According to Translations, “Add the translated strings in another file in the same order”.
However, when I tried it, I got:
(env) frappe@b33f2bd70900:/workspace/development/frappe-bench/sites$ bench update-translations id untranslated.csv id.csv
WARN: bench is installed in editable mode!
This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/workspace/development/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 99, in <module>
main()
File "/workspace/development/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
click.Group(commands=commands)(prog_name='bench')
File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/workspace/development/frappe-bench/env/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/workspace/development/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 26, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File "/workspace/development/frappe-bench/apps/frappe/frappe/commands/translate.py", line 68, in update_translations
frappe.translate.update_translations(lang, untranslated_file, translated_file)
File "/workspace/development/frappe-bench/apps/frappe/frappe/translate.py", line 668, in update_translations
write_translations_file(app, lang, full_dict)
File "/workspace/development/frappe-bench/apps/frappe/frappe/translate.py", line 703, in write_translations_file
app_messages, full_dict or get_full_dict(lang))
File "/workspace/development/frappe-bench/apps/frappe/frappe/translate.py", line 592, in write_csv_file
for p, m in app_messages:
When I tried to debug write_csv_file()
, app_messages
structure is like:
...
('apps/frappe/frappe/templates/emails/download_data.html', ' to your browser', None, 9)
('DocType: About Us Settings', '"Company History"')
('apps/frappe/frappe/core/doctype/data_export/exporter.py', '"Parent" signifies the parent table in which this row must be added', None, 134)
...
so each row is inconsistent, usually it is a tuple with 4 elements instead of 2, and sometimes it is 2 elements.
Reported bug to: bench update-translations throws error: ValueError: not enough values to unpack (expected 4, got 2) · Issue #11429 · frappe/frappe · GitHub