darryllrohr
20th September 2013 16:32 UTC
Need help with Localization - modifying and adding strings
hey guys,
i am using the modern ui for my installer:
!include "MUI2.nsh"
i am including the various languages. for example:
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
on init, i am including:
!insertmacro MUI_RESERVEFILE_LANGDLL
!insertmacro MUI_LANGDLL_DISPLAY
from what i can gather, the modern ui loads the Localization.nsh file:
C:\Program Files (x86)\NSIS\Contrib\Modern UI 2\Localization.nsh
and the Localization.nsh file loads the various translations files. for example:
C:\Program Files (x86)\NSIS\Contrib\Language files\English.nsh
so, i would expect that if i modify one of the strings in the English.nsh file and rebuild my installer, i should see the changes. however, this behavior is not the case. the string is not modified.
also, i am trying to add a new string in the English.nsh file. for example:
${LangFileString} MY_TEST_STRING "test string"
and i try to use it within the installer with the following syntax:
$(MY_TEST_STRING)
however, that does nto work either.
so my questions are: how do i add new strings and modify the existing strings using the modern ui 2?
also, looking at the russian language files, all the strings are garbage. how can i get the propper translations?
thanks,
bnicer
21st September 2013 02:25 UTC
LangString MY_TEST_STRING ${LANG_ENGLISH} "test string"
LangString MY_TEST_STRING ${LANG_FRENCH} "chaîne de test"
Why the string in English.nsh does not change, although modified by you, is rather odd. Are you sure that you modified the right string?
Originally posted by darryllrohr
also, looking at the russian language files, all the strings are garbage
Do you mean the Russian is a poor translation? You could redo the translated strings, for instance, hiring a translator? If the Russian translation really is garbage, which only a Russian-speaker could judge, you might be able to submit an alternate Russian.nsh
http://forums.winamp.com/showthread.php?t=302144Hopefully not at the risk of starting a blood feud.
darryllrohr
24th September 2013 18:44 UTC
Originally posted by bnicer
LangString MY_TEST_STRING ${LANG_ENGLISH} "test string"
LangString MY_TEST_STRING ${LANG_FRENCH} "chaîne de test"
Why the string in English.nsh does not change, although modified by you, is rather odd. Are you sure that you modified the right string?
Do you mean the Russian is a poor translation? You could redo the translated strings, for instance, hiring a translator? If the Russian translation really is garbage, which only a Russian-speaker could judge, you might be able to submit an alternate Russian.nsh
http://forums.winamp.com/showthread.php?t=302144
Hopefully not at the risk of starting a blood feud.
no, the russian strings are literally garbage:
!ifdef MUI_WELCOMEPAGE
${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "Âàñ ïðèâåòñòâóåò ìàñòåð óñòàíîâêè $(^NameDA)"
${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "Ýòà ïðîãðàììà óñòàíîâèò $(^NameDA) íà âàø êîìïüþòåð.$\r$\n$\r$\nÏåðåä íà÷àëîì óñòàíîâêè ðåêîìåíäóåòñÿ çàêðûòü âñå ðàáîòàþùèå ïðèëîæåíèÿ. Ýòî ïîçâîëèò ïðîãðàììå óñòàíîâêè îáíîâèòü ñèñòåìíûå ôàéëû áåç ïåðåçàãðóçêè êîìïüþòåðà.$\r$\n$\r$\n$_CLICK"
!endif
i did try this as well:
LangString MY_TEST_STRING ${LANG_ENGLISH} "test string"
but ${LANG_ENGLISH} never evaluted to anything. it was essentially null.
the only language files that i could find are here:
C:\Program Files (x86)\NSIS\Contrib\Language files
i modified a few english strings and they didnt change in my installer.
is there any other place that the languages are defined?
i tried modifying MUI_TEXT_WELCOME_INFO_TITLE and MUI_TEXT_WELCOME_INFO_TEXT. i even tried adding a new string and tried to referrence it, but it did not work either.
any suggestions?
thanks,
bnicer
25th September 2013 20:26 UTC
:( All I can say is that it seems like something basic.
Originally posted by darryllrohr
no, the russian strings are literally garbage:
If the Russian strings appear as "garbage", the problem is most likely that you are opening/viewing the Russian.nsh file in ansi mode. Nsis 3.0a1 nsh files are encoded as UTF-8. Windows Notepad should automatically display UTF-8. Are you using NSIS 3.0a1?
Have you tried opening other languages, such as Macedonian? The characters there are Cyrillic. If the problem is consistent, you'd see Macedonian as "garbage" too.
Originally posted by darryllrohr
but ${LANG_ENGLISH} never evaluted to anything. it was essentially null.
Could you try:
MessageBox MB_USERICON|MB_OK "${MY_TEST_STRING}" /SD IDOK
I can't see anything wrong with your code:
!insertmacro MUI_LANGUAGE "English"
Do you include mui2 in your installer?
!include "MUI2.nsh"
bnicer
25th September 2013 22:21 UTC
You are creating an ansi installer. Âàñ ïðèâåòñòâóåò ìàñòåð óñòàíîâêè is from the 2.46 (ansi) Russian.nsh. The characters will be converted according to the user's codepage. On a Russian system they ought to render in Cyrillic letters. It's my fault for not noticing before. I'm very sorry. :tinfoil:
Note: With multilingual installers, unicode has some advantages, notably, the user could install the Russian version on any system. The characters would always be recognizable: Вас приветствует мастер установки. The Russian.nsh strings in utf-8 would not be garbage.