I´ve tried to realize the automatic language switching in my portable app Tomahawk PDF+ Portable. To that extent I've created a folder named "Languages" with all language files inside of the folder DafaultData\settings. I also have created a file "custom.nsh" with the following code:
${SegmentFile} ${SegmentPrePrimary} ReadEnvStr $0 PAL:LanguageCustom CopyFiles /SILENT $EXEDIR\Data\Languages\TPdfPlus$0.lng $EXEDIR\App\TomahawkPDF+ Delete $EXEDIR\App\TomahawkPDF+\TPdfPlus.lng Rename $EXEDIR\App\TomahawkPDF+\TPdfPlus$0.lng $EXEDIR\App\TomahawkPDF+\TPdfPlus.lng !macroend
In the file "TomahawkPDF+Portable.ini" I pasted the following code:
[Language] Base=%PAL:LanguageCustom%
But the automatic language switching don't work in the PortableApps.com Platform.
Has anyone an idea?
Use
PAL:LanguageCustom
on the custom code, andPortableApps.comLocale*
on the launcher.ini.Previously known as kAlug.
On the last night I have thought a whole lot about the automatic language switching and other matters concerning TomahawkPDF+ Portable. I have also detected the little but important failure in my file TomahawkPDF+Portable.ini. Accordingly I altered the code as follows:
And now comes the good news: Now the automatic language switching works fine in the PortableApps.com Platform
First off, I think your missing a space in the fourth line, but that's not important.
Secondly, all you have to do is:
And that will automatically set the language via PAM.
Also consider moving TPdfPlus into the Data directory and including a copy in DefaultData with English as the default language.
And I don't recommend including a + sign in App\TomahawkPDF, as it's kinda weird.
It's more complicated as TomahawkPDF acts kinda weird.
The TPdfPlus.lng is only created when a user changes the language. If it is not present, english is used. So, it is not needed in DefaultData.
The biggest problem is that TomahawkPDF produces an error message if the TPdfPlus.lng contains an entry that it cannot handle. Therefore the language switching has to be restricted to the set of languages supported by TaomahawkPDF.
The only solution I had in mind was to substitute every unsupported language with English (US) in the LanguageStrings section.
Your code don't work.
I found the solution - or better, I had it already but thought too complicated (once more )... I'll post it in the Tomahawk thread.