-
Notifications
You must be signed in to change notification settings - Fork 66
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
Setup translation infrastructure for A2+ #416
Conversation
Following directions from https://wiki.freecadweb.org/Translating_an_external_workbench - Add translations/ directory - Add import for translation library to *.py files that require it
Whowww !! Thanks. Small Problem: Devel branch is far away from my master branch and cannot be used in public area at moment. Are your changes automated somehow and you can apply them to master branch ? If not, it doesn't matter and i merge things manually. |
@kbwbe sorry about that! yikes, tried to rebase and there was sooo much work to do. Maybe it's worth doing it manually now in to a new rebased branch on master ? |
I will merge the changes manually at weekend to a2+ master branch. Thank's again. |
A new branch "translations" with A2plus has been started. [WIP] |
@kbwbe can you document here how you set that up ? I'd love to add that to the wiki |
@luzpaz |
@kbwbe there is also some good advice from vocx in shaise/FreeCAD_SheetMetal#105 (comment) BTW, I have no idea how to wrap a multi-line variable with a translation function. Example the various tooltips like this one https://github.com/luzpaz/A2plus/blob/ccfb98abefc39dbc293cdc464819d7e47e25b9fc/a2p_recursiveUpdatePlanner.py#L101-L116 |
@luzpaz Some details to my setup...
This file is included everywhere in my .py files
At least your macros for translating the menu entries are included, e.g.
Also i tried to translate a multi-line tooltip...
After doing all this, i created a .ts file within the new translations/ directory.
Then i used the QtLinguist and tried two small translations (only for testing) After that i released the .ts file to a .qm file...
FreeCAD starts up without complaining about anything, but ignores my german translations, even when switching the language settings of FC. I think i am missing something important. Everything can be found in a2+ branch translations. It is up to date. Any help is appreciated. Edit: code has been newly formatted. |
yikes, the formatting of that post is messed up. Can you format it so the indentation is correct? |
@yorikvanhavre can you weigh in when you get a moment ? |
@luzpaz |
is there an error ? |
@luzpaz |
It's hard to know what's wrong, but I would try something like this to test:
|
@luzpaz thanks!! |
@yorikvanhavre , thx ! |
Addresses #44
MenuText
tooltips
print()
statmentsQuestions:
Should we setup similar to how BIM is ?
from BimTranslateUtils import *
https://github.com/yorikvanhavre/BIM_Workbench/blob/1d257b890c66dc7637e94ae1612dc7cb2a842887/BimBox.py#L29
How do we translate
print()
statements likeprint(u"some text")
How do we translate multi-line tooltips?
How do we test translations?