-
Notifications
You must be signed in to change notification settings - Fork 117
Some fixes and enhancements for the make file #678
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
Conversation
make.py
Outdated
print(f"No language file for {lang} in po/ ?") | ||
continue | ||
system( | ||
f'msgcat --use-first po/{lang}.po {GRAMPSPATH}/po/{lang}.po -o "po/{lang}_g.po"' |
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.
Why do you need to do this?
The get_addon_translator method returns a translator that looks in both the gramps
and addon
domains for translations. It uses the add_fallback method.
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.
I have a script that reports the percentage of strings done for each addon/lang. It was consistently showing less than 100%, which led me to investigate what was missing. The Gramps strings. I studied the make "update" code and realized that the new process was not including the Gramps strings, where the old process was.
I confess that I did not test to see if the addon was actually using the Gramps strings when an individual string was missing. So I assumed that we needed to emulate the old process. I'll run some more tests to make sure I understand all this, and then rework this PR. When I have some more time (life still happens!).
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.
I've added a few unit tests in PR #2023 just to check that the translator was working as expected.
It actually looks in gramps.mo
first and then uses addon.mo
as the fallback. Any strings from Gramps core that end up in an addon.mo
file will be ignored.
This is intentional. The addon translators should look in both the |
I thought that might be the case, but I saw that it was used elsewhere. My original implementation of |
Are all of the questions resolved such that this is ready to merge? The list of changes seem to mostly be about replacing 'touch' and some lint changes. The specific question from Nick seems to be resolved. |
Rebased. |
Yes. I'll merge this now. |
Been looking at the translation automation in make.
Big one, it looks like the extracted po files don't contain .pot msgid strings that should be satisfied from the Gramps main translations. You stripped those out of the overall pot, to reduce translation work, good.
But when you did the extraction of main po files to individual addons, the Gramps strings were not included.
A smaller issue, Windows system (mine at least) doesn't include a "touch" command.
Also on Windows, you have to specify utf8 when opening a file or you get errors due to default code page.
I also added the ability to do a single file "as-needed", but may still want to enhance further with updated po etc. when the Weblate changes settle down.
I suspect that some of the other commands will fail for the 'all' when they hit the new po directory, but have not yet tested and fixed these.