Fixing incorrect/missing translations due to legalities

We are trying to hold a Turkish event, and the universities have some strict legal restrictions on the terms. Unfortunately, the Turkish translation has significant number of “incorrect” (i.e. not legally acceptable) translations and missing translations.

I tried to fix this by editing “indico/translations/tr_TR/LC_MESSAGES/messages.po” in the venv, followed by a restart of services “systemctl restart nginx.service indico-celery.service indico-uwsgi.service”

However, my changes are ignored, and the generated PDF documents (pages) still insist on “incorrect” translations or direct English.

Is there a solution to this problem?

Indico 3.2.1 installed directly using the standard instructions

Hi, try running indico i18n compile-catalog. Note that such manual changes will be lost during an upgrade.
Afterwards you only need to restart uwsgi and celery; no need to restart nginx.

PS: If there are mistakes feel free to contribute fixes to our translations on Transifex; those will end up in an upcoming release and thus be available for everyone! See this page in the docs for details.

1 Like

That did the trick! Thank you very much. I didn’t think that section of the manual was relevant to my case, I’ll push my translations to there as well.

Btw, the command failed at first with

error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:996: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:1138: unknown named placeholder 'n'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:1855: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:2879: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:2885: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:3823: unknown named placeholder 'tpls_count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:5588: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:6727: unknown named placeholder 'missing_groups'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:6733: unknown named placeholder 'missing_groups'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:6931: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:9506: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:10968: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:12165: unknown named placeholder 'num'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:12624: unknown named placeholder 'total'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:13472: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:14090: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:14378: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:14634: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:15374: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:15693: unknown named placeholder 'count'
error: indico/translations/zh_Hans_CN/LC_MESSAGES/messages.po:17003: unknown named placeholder 'count'

I just deleted the translation, since I don’t need it.

Also, my react translation compilation failed. First, because I didn’t have npm installed, second for some reason I don’t clearly understand. This is not super important to me at the moment, but FYI the error message is attached.

[..................] \ idealTree:bb26327961e0b32d: sill idealTree buildDeps
[..................] / idealTree:prop-types: sill fetch manifest loose-envify@^1.1.0
Traceback (most recent call last):
  File "/opt/indico/.venv/bin/indico", line 8, in <module>
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/indico/.venv/lib/python3.9/site-packages/flask/", line 567, in main
    return super().main(*args, **kwargs)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/indico/.venv/lib/python3.9/site-packages/indico/cli/", line 108, in invoke
    return self._impl.invoke(ctx)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/indico/.venv/lib/python3.9/site-packages/click/", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/indico/.venv/lib/python3.9/site-packages/indico/cli/", line 158, in compile_catalog_react
    json.loads(output)  # just to be sure the JSON is valid
  File "/usr/lib/python3.9/json/", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The chinese errors are safe to ignore, no need to delete anything.

Compiling react translations does NOT work in a production setup (since it requires the JS build env which is not present in production). Generally the way to go is to make a dev setup on another machine, compile the translations there, and then build a new Python wheel to install on production.
See Building — Indico 3.2.2 documentation on how to build an Indico Python wheel.

1 Like