-
-
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
Merged
+495
−80
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f9d1e2d
Initialize Internationalization
sumit-158 edd666f
Remove .pot from gitignore
sumit-158 31031f1
feat: Crowdin translations
teolemon 2434000
ci: github action for crowdin
teolemon c4debea
Merge branch 'main' into Setup-internationalization
teolemon 2213f71
update
sumit-158 34afe3f
Refractor code
sumit-158 4f57393
refractor
sumit-158 9ee6567
minor update
sumit-158 55ea4cd
update
sumit-158 e6ac33a
Refractored
sumit-158 d871e58
Fixes tests
sumit-158 fe90596
Update requirements.txt
sumit-158 5c371c3
Update i18n.py
sumit-158 4a62601
Update i18n.py
sumit-158 82a4439
Update off.py
sumit-158 ec392e1
fix: working i18n implementation
alexgarel f1ad257
build: add make target to build translation mo files
alexgarel 78c32e4
refactor: fix black, isort and flake8 issues
alexgarel 427af6a
refactor: removed some unnecessary comments
sumit-158 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refractor
commit 4f573936d476c8e9247d872deabd827dd91aa986
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import gettext | ||
|
||
|
||
class TranslationStore: | ||
def lang(text=str): | ||
text = "fr" | ||
return text | ||
|
||
def load(): | ||
lang_translations = gettext.translation( | ||
"knowledge-panel", localedir="i18n", languages=[TranslationStore.lang()] | ||
) | ||
lang_translations.install() | ||
_ = lang_translations.gettext | ||
return _ | ||
sumit-158 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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 :-)