PortableApps.com Platform and Suite 1.6 have been released.
More Useful Code: Language Reading/SettingSubmitted by OliverK on November 21, 2008 - 3:32pm
Here's the code I used for PNotes/ATPad. They set the language through a file name, not using the environmental variables or using international language codes. GetAppLanguage:
ReadEnvStr $APPLANGUAGE "PortableApps.comLanguageCode"
StrCmp $APPLANGUAGE de Deutsch
StrCmp $APPLANGUAGE en_us English
StrCmp $APPLANGUAGE es_la Spanish
StrCmp $APPLANGUAGE it Italian
StrCmp $APPLANGUAGE jp Japanese
StrCmp $APPLANGUAGE pl Polski
StrCmp $APPLANGUAGE pt Portugese
StrCmp $APPLANGUAGE ru Russian English
Deutsch:
StrCpy $APPLANGUAGE deutsch
Goto GetCurrentLanguage
English:
StrCpy $APPLANGUAGE english
Goto GetCurrentLanguage
Spanish:
StrCpy $APPLANGUAGE spanish
Goto GetCurrentLanguage
Italian:
StrCpy $APPLANGUAGE italian
Goto GetCurrentLanguage
Japanese:
StrCpy $APPLANGUAGE japanese
Goto GetCurrentLanguage
Polski:
StrCpy $APPLANGUAGE polski
Goto GetCurrentLanguage
Portugese:
StrCpy $APPLANGUAGE portugese
Goto GetCurrentLanguage
Russian:
StrCpy $APPLANGUAGE russian
Goto GetCurrentLanguage
GetCurrentLanguage:
ReadINIStr $0 "$EXEDIR\Data\settings\Settings.ini" "lang" "Language"
StrCmp "$APPLANGUAGE.lng" $0 LaunchNow ;if the same, move on
IfFileExists "$EXEDIR\PNotes\lang\$APPLANGUAGE.lng" SetAppLanguage LaunchNow
SetAppLanguage:
WriteINIStr "$EXEDIR\Data\settings\Settings.ini" "lang" "Language""$APPLANGUAGE.lng"Anywho, thought you might like another coding tidbit. »
|


you spelt language wrong on
you spelt language wrong on these lines:
was there some meaning to this, or was it a typo by lamer when writing the INI reading part of PNotes?
but anyway, enough of the criticism. thanks for this, its going into HM NIS Edit Portable as i write.
Dogbottler says: Don't count your dogs until they're bottled.
Criticism good, someone might
Criticism good, someone might not have caught it, like me
.
Actually, I kinda generalized it from the instances in PNotes/ATPad. Anywho, thanks and I 'll fix it.
Too many lonely hearts in the real world
Too many bridges you can burn
Too many tables you can't turn
Don't wanna live my life in the real world