-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Initialize Internationalization #18
Conversation
@sumit-158 I've added tooling for Crowdin |
"Looking up a translation while language was not set. " | ||
"Use active_translation context manager", | ||
stack_info=True, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexgarel Just a question what does stack_info=True
do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it prints the stack trace along with the log message (like for exceptions).
Here I added it, because if I just log the developer won't see where the translation function was called, whereas here he sees the lines.
Eg:
knowledge-panel | Looking up a translation while language was not set. Use active_translation context manager
knowledge-panel | Stack (most recent call last):
knowledge-panel | File "/usr/local/lib/python3.9/threading.py", line 937, in _bootstrap
knowledge-panel | self._bootstrap_inner()
knowledge-panel | File "/usr/local/lib/python3.9/threading.py", line 980, in _bootstrap_inner
knowledge-panel | self.run()
knowledge-panel | File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 867, in run
knowledge-panel | result = context.run(func, *args)
knowledge-panel | File "/code/./app/main.py", line 45, in knowledge_panel
knowledge-panel | panels.append(last_edits_kp(facet=facet_tag, value=value_tag, country=country))
knowledge-panel | File "/code/./app/knowledge_panels.py", line 121, in last_edits_kp
knowledge-panel | expected_html, t_description, t_title = last_edit(url=url, query=query)
knowledge-panel | File "/code/./app/off.py", line 80, in last_edit
knowledge-panel | description = _("last-edits issues related to")
knowledge-panel | File "/code/./app/i18n.py", line 66, in translate
knowledge-panel | return get_current_translation().gettext(message)
knowledge-panel | File "/code/./app/i18n.py", line 55, in get_current_translation
knowledge-panel | log.warning(
So you see the problem is in off.py line 80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool! sorry but can I know how to get that log message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the activate_translation line in main.py :-)
Another question , Do I have to make |
I don't know but @teolemon may now
|
It because gettext takes .mo file to read the translation , if we don't remove it from gitignore during deployment how it goona fetch the translation ? |
crowdin will do that for you, |
@alexgarel should we merge it now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge !
What