Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with ERPNext Translation #23

Open
engahmed1190 opened this issue Nov 2, 2023 · 0 comments
Open

Bug with ERPNext Translation #23

engahmed1190 opened this issue Nov 2, 2023 · 0 comments

Comments

@engahmed1190
Copy link

Hello @ahmadpak

Thanks for your custom application it works fine but when I use the translation methods it throws errors , I am using version 14 of ERPNext : https://frappeframework.com/docs/user/en/translations

Here's is the Error

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/azureuser/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module>
    main()
  File "/home/azureuser/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/azureuser/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/azureuser/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/azureuser/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/azureuser/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/azureuser/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/azureuser/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/azureuser/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/azureuser/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/azureuser/frappe-bench/apps/frappe/frappe/commands/translate.py", line 64, in get_untranslated
    frappe.translate.get_untranslated(lang, untranslated_file, get_all=all, app=app)
  File "/home/azureuser/frappe-bench/apps/frappe/frappe/translate.py", line 1049, in get_untranslated
    messages.extend(get_messages_for_app(app_name))
  File "/home/azureuser/frappe-bench/apps/frappe/frappe/translate.py", line 429, in get_messages_for_app
    messages.extend(get_server_messages(app))
  File "/home/azureuser/frappe-bench/apps/frappe/frappe/translate.py", line 659, in get_server_messages
    messages.extend(get_messages_from_file(os.path.join(basepath, f)))
  File "/home/azureuser/frappe-bench/apps/frappe/frappe/translate.py", line 725, in get_messages_from_file
    messages += extract_messages_from_python_code(file_contents)
  File "/home/azureuser/frappe-bench/apps/frappe/frappe/translate.py", line 765, in extract_messages_from_python_code
    raise e  # Re-raise the exception after printing the code
  File "/home/azureuser/frappe-bench/apps/frappe/frappe/translate.py", line 746, in extract_messages_from_python_code
    for message in extract_python(
  File "/home/azureuser/frappe-bench/env/lib/python3.10/site-packages/babel/messages/extract.py", line 487, in extract_python
    value = eval(code, {'__builtins__': {}}, {})
  File "<string>", line 2, in <module>
NameError: name 'doc' is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant