You are here

Custome language variables help request

6 posts / 0 new
Last post
JLim
Offline
Last seen: 6 months 3 weeks ago
Joined: 2013-07-17 01:30
Custome language variables help request

I am just start learnging to write custome language variables.
The following is part of the launcher ini file.

[Language]
Base=%PortableApps.comLocaleName%
CheckIfExists=%PAL:AppDir%\SUMo\SUMo_%PAL:LanguageCustom%.SPK
DefaultIfNotExists=ENGLISH

[LanguageStrings]
ENGLISH=00000409
SIMPCHINESE=00000804
TRADCHINESE=00000404
AFRIKAANS=00000436
BULGARIAN=00000402
CATALAN=00000403
CZECH=00000405
DANISH=00000406
DUTCH=00000413
ESTONIAN=00000425
FINNISH=0000040B
FRENCH=0000040C
GERMAN=00000407
HEBREW=0000040D
HUNGARIAN=0000040E
ITALIAN=00000410
KOREAN=00000412
POLISH=00000415
PORTUGUESE=00000816
PORTUGUESEBR=00000416
ROMANIAN=00000418
RUSSIAN=00000419
SLOVAK=0000041B
SLOVENIAN=00000424
SPANISHINTERNATIONAL=00000C0A
SWEDISH=0000041D
TURKISH=0000041F
UKRAINIAN=00000422
VIETNAMESE=0000042A

[LanguageFile]
Type=ConfigRead
File=%PAL:DataDir%\settings\SUMo.reg
Entry='"lng"=dword:'

[FileWrite1]
Type=ConfigWrite
File=%PAL:DataDir%\settings\SUMo.reg
Entry='"lng"=dword:'
Value=%PAL:LanguageCustom%

When I launch it not from the PortableApps.com Platform and set the language to German (or others) within the program.
The language setting can be retained when relaunch after closing. However when I now launch it from the PortableApps.com Platform it still give me German, not the platform language which I set at SimpChinese.

If I change the FileWrite1 to:

[FileWrite1]
Type=INI
File=%PAL:DataDir%\settings\SUMo.reg
Section='HKEY_CURRENT_USER\Software\KC Softwares\SUMo'
Key='"lng"'
Value=dword:%PAL:LanguageCustom%

The language setting is same as the platform language if launch from the platform. But this time when launch not from the platform, it away change back to the default English.

Could someone help? Thanks.

darksabre76
darksabre76's picture
Offline
Last seen: 1 month 2 weeks ago
Developer
Joined: 2011-04-19 23:28
RegistryValueWrite

I know very little about the language switching, but since it looks like you're dealing with the registry, why not use the built-in tools for writing to it? Namely, with RegistryValueWrite you can set the values you are changing using FileWrite a little bit easier. I'm not sure you're supposed to be able to edit the .reg files using FileWrite, but I'm sure another dev will pitch in if I'm wrong.

(I'm also blindly assuming that further up the launcher.ini file you have registry activated and a RegistryKeys section to back up HKCU\Software\KC Softwares\SUMo to SUMo.)

Simeon
Simeon's picture
Offline
Last seen: 10 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
no

RegistryValueWrite is for writing to the registry, but as far as I know, language switching takes place by modifying *.reg files.

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

darksabre76
darksabre76's picture
Offline
Last seen: 1 month 2 weeks ago
Developer
Joined: 2011-04-19 23:28
Odd

That's an odd way of doing it, but okay. When I see .reg files being manipulated, I assume the change could be done elsewhere.

Simeon
Simeon's picture
Offline
Last seen: 10 years 1 month ago
DeveloperTranslator
Joined: 2006-09-25 15:15
DefaultIfNotExists

The manual states:

If the file in CheckIfExists did not exist, the custom language variable will be set to this value.

So you need to set
DefaultIfNotExists=00000409
instead of
DefaultIfNotExists=ENGLISH

Does that fix it?

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

JLim
Offline
Last seen: 6 months 3 weeks ago
Joined: 2013-07-17 01:30
No. Same.

No. Same.

Log in or register to post comments