The main problem inhibiting me from submitting Freecol Portable as a Pre-Release right now, is the problem of language switching.
Here's an explanation:
Freecol, in order to determine language for launch, looks at its main option file, and launches based on that. If it's set to automatic or not set, it determines language based on the Java locale.
The problem with updating the language in the option file is that Freecol, when saving options, does not save options with newlines between each one. This makes [FileWriteN] useless.
My question is, is it possible to add newlines using the Replace function, so that a later [FileWriteN] will work? Otherwise, what's the best way to update the Java locale?
(Another, more minor problem with languages, is that the language strings are sometimes labeled with their country. For example, there is no pt language string file included, only a pt_BR and pt_PT.)
OK, so it was as easy as I thought: I set the Java locale via -Duser.language, and everything worked.
My Dev Tests: ~ KeePass Pro Portable (awaiting .NET directory) ~ FreeCol Portable (needs testers)
"... proving to everyone that we are operating on Valve Time..." - us
For the second you can use a language list to redefine the variables that don't match the normal ones.
Sometimes, the impossible can become possible, if you're awesome!
I forgot about the [LanguageStrings] section! That will make it much easier.
As soon as I finish this, FreeCol Portable should be about ready for Pre-Release.
Thanks, John!
My Dev Tests: ~ KeePass Pro Portable (awaiting .NET directory) ~ FreeCol Portable (needs testers)
"... proving to everyone that we are operating on Valve Time..." - us
I didn't react yet, but was busy on finding a solution for the language setting.
The problem with FreeCol's settings is that it's using XML files for it's settings, and as far as I know there isn't a proper XML plug-in for unicode NSIS (yet).
To solve this, I could make a script what could roughly deal with editing these XML settings, if needed in the future !
Anyway, I'm happy you got it working
Formerly Gringoloco
Windows XP Pro sp3 x32
The docs for the Launcher say it does support config files, but it acts like a modified Replace in that it checks the beginning of each line for the string, then replaces the end of the line with the value you give it.
If you could make that script, I'm sure that some other app will need it in the future, and I might use it as a backup.
My Dev Tests: ~ KeePass Pro Portable (awaiting .NET directory) ~ FreeCol Portable (needs testers)
"... proving to everyone that we are operating on Valve Time..." - us
But it probably will not be out very soon.
I'm not having much time lately.
Formerly Gringoloco
Windows XP Pro sp3 x32
There is a XML Plugin, though not very good. Its use is demonstrated within the screamer portable source
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
The key is Unicode NSIS. I imagine Gringoloco's trying porting one of the existing plug-ins to Unicode.
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
Eh, okay. I keep forgetting your guy's fascination with unicode
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
http://wiz0u.free.fr/prog/nsisXML/
(Although no support for utf-16LE files, if ever needed)
An nsis script appears too slow to deal with an xml file.
Anyway thanx for telling me about Screamer Portable, it gives me another idea what PAL should be able to do. I suspect the plug-in is only needed for lang-switching, but Screamer Portable deals with it in another way again (setting a text vs. an attribute).
To be continued...
Formerly Gringoloco
Windows XP Pro sp3 x32
That's another helpful thing for Java apps that I can add to the manual.
(Note for both of us: the Java documentation says it's the two-letter code, so use
[Language]:Base=%PortableApps.comLocaleCode2%
.)I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
From what I've seen, it also supports the glibc locale, with the two letter country code after it. For some languages my app requires it like that.
I'll report again later once I'm on a PC.
My Dev Tests: ~ KeePass Pro Portable (awaiting .NET directory) ~ FreeCol Portable (needs testers)
"... proving to everyone that we are operating on Valve Time..." - us
From the Java docs on the definition of a locale:
So, you can either use just the language code (the one you mentioned) or the language and country code (as I mentioned).
My Dev Tests: ~ KeePass Pro Portable (awaiting .NET directory) ~ FreeCol Portable (needs testers)
"... proving to everyone that we are operating on Valve Time..." - us
That's about talking about them. To actually use them, you seem to need to separate them.
I am a Christian and a developer and moderator here.
“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1
Apparently, I missed that part, perhaps because I skimmed it while adding the function. I'll test it thoroughly soon (hopefully tomorrow).
Assuming you are right (which you probably are, looking at the docs), isn't that going to be a problem for different dialects (by country) of a language, which usually isn't represented in the two-letter language code? The only working example right now is Portugese (with regular (Portugal) and Brazilian) but that could change as more languages are brought onto the platform.
My Dev Tests: ~ KeePass Pro Portable (awaiting .NET directory) ~ FreeCol Portable (needs testers)
"... proving to everyone that we are operating on Valve Time..." - us
After testing it, it seems to work both ways. However, for the sake of being correct, I will change back to the two-letter locale code.
In the future, I suggest that the country and optionally the variant code be added to the Launcher so that we don't lose the ability to display languages in a situation like this (where Brazilian Portuguese cannot be displayed automatically).
(Also, while I'm making suggestions, there is a mistake in the manual: splash.jpg goes in the Launcher folder, not the AppInfo folder.)
My Dev Tests: ~ KeePass Pro Portable (awaiting .NET directory) ~ FreeCol Portable (needs testers)
"... proving to everyone that we are operating on Valve Time..." - us