John and I have been discussing how to encorporate language switching into Stickies. Unfortunately the app handles language switching in a rather odd manor. When it's launched it checks it's running directory for a file called "language70.dll". If that file is found it will pickup whatever language is contained; if there is no file it defaults to English.
On IRC John said that
Basically, you check to see if it's set, then delete the lang that is there (if there is one). Then, if the lang is English, do nothing. If it is something else, copy it in. Then write out the current lang to the StickiesPortableSettings.ini file for next time, so you can check if it changed or not.
That way, if it hasn't changed, you can avoid copying something else in. Becuase PAL will always try to switch it to English otherwise.
He said that he believed an existing app used that method, does anyone know which that is or have existing code that can be just cloned over?
PNotes Portable? It uses *.lang files, but its pretty close . . .
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
I have this same predicament for Dimio's apps (DShutdown, DTaskManager, etc.). Honestly, I think it might need some custom code regarding FilesMove since it's relative to the data directory.
Here's my answer for scriptdaemon, for DShutdown (as he emailed me asking about it). It'll be very similar for other apps, just with some different paths. (Scriptdaemon: note I've also changed your App\DShutdown\DShutdown English Pack\DShutdown.lng to just App\Languages\English.lng; seems neater to me and you can more easily filter it for the optional section in the installer too. Your choice on how you do it.)
Store the language name in %PAL:DataDir%\settings\DShutdownPortableSettings.ini, section DShutdownPortableSettings, key Language. Then you'll be able to switch over to [Language]:SaveLanguage=true which I'll be putting in PAL 2.2 for cases like this (and ones which use an environment variable).
Then here's some code.
launcher.ini:
Custom.nsh:
(Incidental note: this is safe in case of power failure, crash, etc. as well.)
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
Small question though, what's the benefit of having App\Languages instead of App\DShutdown\Languages? Is that due to the fact the languages don't come with the app by default?
EDIT: Tried it out and the custom code doesn't seem to be working. Is the PAL:LanguageCustom variable built before PrePrimary?
EDIT 2: I don't think that matters as it still doesn't work even when I hardcode a language into the custom code.
App\Languages vs. App\DShutdown\Languages? There's no real difference between them... App\Languages is just shorter.
Make sure you've got the file in the right place: App\AppInfo\Launcher\Custom.nsh for 2.1. You can also put in MessageBox lines to check that it's happening.
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
The manual still says that file goes in Other\Source. It's working now.
What exactly is the purpose of adding [Language]:SaveLanguage=true?
2.0 had it in Other\Source\PortableApps.comLauncherCustom.nsh. 2.1 has it in App\AppInfo\Launcher\Custom.nsh.
[Language]:SaveLanguage=true (might change that key to Save) will be equivalent to the FileWrite1+LanguageFile; it's just for simplicity in the launcher configuration as it's not related to the actual app, only to internal stuff with the launcher.
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
Do you mind taking a look at this. It's what I've got done so far, and it's not really doing anything...
Release Team Member
1. Your custom code should be in App\Appinfo\Launcher\Custom.nsh
2. Also, it should instead be
3. Rename App\languages to App\Languages
4. In launcher.ini, the [Language] section should be changed to
5. And you'll need a [LanguageStrings] section that contains all available languages, because currently %PortableApps.comLocaleName% returns strings in all capital letters, and files are case sensitive.
On Windows all paths are case insensitive. For this, you don't need to worry about case. Granted, it will turn e.g. English.dll to ENGLISH.dll after it's been used, but that doesn't matter.
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
I have a question, and I have three ways to ask the same think, since English is no my main language (and today I'm "English mentally blocked"), I'm going to ask twice the same think to make me more understandable...
This means that App\Languages will reduce the total size of files stored in the portable drive, but only if every app is going to use it, so those apps which already comes with different lang files should be edited to remove those lang files... so PortableApps.com will not be "the same app" anymore. Otherwise we are going to have a lot of redundant files (almost as we already have)...
But this means that applications like GIMP, OpenOffice, Filezilla which have their own lang files (already comes in the old fashioned App\DShutdown\Languages way) will have to be edited to remove those redunded lang files?
Do you mean that the current lang file of an app will be moved to App\Languages folder? because this makes it easier to me to locate them and delete it all (except English and Spanish) but is dangerous since two apps can have the same file name but not the same content/format and one can replace the other one and mess the entire think.
If a packet hits a pocket on a socket on a port,
and the bus is interrupted as a very last resort,
and the address of the memory makes your floppy disk abort,
then the socket packet pocket has an error to report
I think you misunderstood something here. This is only for one app which needs special language file handling and not for all others. All other apps will remain the way they are.
"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate
Sprry, I understood that "the platform" was going to have this feature to use it to the whole pack of portableapps.
If a packet hits a pocket on a socket on a port,
and the bus is interrupted as a very last resort,
and the address of the memory makes your floppy disk abort,
then the socket packet pocket has an error to report