-
Notifications
You must be signed in to change notification settings - Fork 119
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
VPN-5175 - Get languages, currencies and server name translations from the l10n repository strings #9448
Conversation
20fede4
to
f0b7f6b
Compare
exit("No source argument.") | ||
|
||
# If no output directory was provided, use the current directory. | ||
if args.output is None: | ||
args.output = os.getcwd() | ||
|
||
# Parse the inputs for their sweet juicy strings. |
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.
🙄
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.
Heh, I was hoping I could just quietly remove this.
Looks like GitHub ate one of my comment. Don't know much about C++, but is there a switch/case structure to use instead of so many "if else"? |
Can´t do a switch statement with strings unfortunately, only integers :/ |
b1a0b94
to
d60967a
Compare
Regarding the Linux build failures. The package sources for RPM-based distributions maintain their dependency information in However! Unless we need to use |
Also: The last time we made use of |
Plot twist: the Windows C++ compiler spits out a fatal error when there are more than 128 nesting blocks |
9f3299e
to
917e33b
Compare
No worries, I just removed that dependency. |
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.
Python scripts look good to me 👍🏼
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.
👍
36fc2a6
to
319d45e
Compare
Co-authored-by: Francesco Lodolo <[email protected]>
bc2b3d4
to
6a88e62
Compare
Test failure was unrelated and being worked on in #9499. Therefore I force merged. |
Ok, this is a large one.
I considered separating each commit into a separate PR, but 🤷♀️ Let me know if you'd prefer I do that.
Regardless, I recomend reviewing this per commit. Each commit handles a different part of the task.
We had the
languages.json
andservers.json
files that included translations for: language name, currency symbols and server names. This PR moves away from that to actually use translations from Pontoon for these.On previous PRs (#9411, mozilla-l10n/mozilla-vpn-client-l10n#435) I have added the
extras.xliff
file with language and server name strings to take place of the JSON files.1. Currency symbols (221aa63)
After discussions with @flodolo and Santiago, we decided not to have translations for these anymore. It seems pointless, because all translations are the same.
On the first commit of this pull request, I have update localizer.cpp to either grap currency symbol translations from Qt translations or from a hardcoded list of currencies that we support.
2. Using extras.xliff (3afc2ed)
On this commit I updated the build to include strings from extas.xliff into i18nstrings_p.cpp and friends.
3. Laguage names (721effb)
On this commit I remove code that generates and consumes languages.json and add code to get language names from I18nStrings. I also had to include some new code generation in order to have a list of language names in all supported locales, the alternative to that would be to load a QTranslator just to grab a string than unload it -- not good. That means there is also some build changes to generate the new string and well as to update the I18nStrings class to be able to get strings by id.
4. Server names (d6830e1)
Finally, this commit adds logic to get city and country names. All of the infrastrcuture that makes this possible was done already in the previous commits so this is mechanical work.
I also removed the code that would get the server names form servers.json.