NSIS: Refactor translations to use higher level functionality #20501
+1,909
−3,546
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.
Apparently only the low-level APIs are documented well in the official docs.
There is higher level abstraction available to achieve the same thing less painfully.
You need to read the comments in Include\LangFile.nsh and Contrib\Modern UI 2\Localization.nsh.
This new infrastructure allows for not translating all strings for a certain locale and having it fallback to English.
The comments from the linked files were the last pieces of the puzzle so I can understand how to integrate non-builtin languages to the installer. I have such an example commit with the Filipino language (this is a demo. I will first merge #18935 for attribution and then rebase this PR).
Now the question is if it is acceptable for the installer UI to be mostly in English (the various NSIS text strings) only our own strings translated?
NOTICE: This is an intermediately step. The last step is to convert our translations files into gettext
.po
files (similar to Qt's.ts
files). The.po
files can be integrated with Transifex. Then via a python script autogenerate the*Extra.nsh
from the.po
files and autogenerate thetranslations.nsh
file.NOTICE2: The diff is huge because the strings were moved around (via scripting), the actual changes are few.
Any comments?