In the section "Support" of the PhotoFiltre Portable website are mentioned the following sentences:
Languages: PhotoFiltre Portable will automatically adjust language to match the PortableApps.com Platform. If running without the platform, you can adjust the language after running and closing the application at least once by editing the file PhotoFiltrePortableSettings.ini within the PhotoFiltrePortable\Data\settings directory. Set Language= to your preferred language (example, de for German, fr for French, etc).
But the above advices are not valid. The reason for this problem is the fact, that the appropriate language file (eg the file "StudioDE.PLG" for German) don't exists in the folder PhotoFiltre. Therefore it's necessary to paste manually the appropriate language file in the folder PhotoFiltre.
I haven't tried running it, but it looks correct to me; however part of it is that it deals with "TranslationDE.plg" rather than "StudioDE.plg". Observe the contents of App\AppInfo\Launcher\Custom.nsh to see how it deals with it. (That code needs refactoring! The fr branch is useless, can't imagine why it's there. And then when changing it we could rename it from custom.nsh to Custom.nsh, a sort of thing which I care about disproportionately much.)
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 both the current file "StudioDE.plg" as well as the older file "TranslationDE.plg" tested. But only the file "StudioDE.plg" works fine.
Thank you for your tip to look in the file "custum.nsh". Unfortunately I am not yet familiar with the scripting language NSIS. Could you offer me some solid tutorials to learn NSIS?
I looked straight into the file "custom.nsh". How about if I replace in this file the string "Translation" through "Studio"?
In row 10 of the file "custom.nsh" I can read, that the code use a folder called "Languages". This folder should reside in the folder PhotoFiltre. In fact during the installing such a folder "Languages" is not generated.
Languages are manually added with version 7 and all separate downloads on the site. The launcher was not updated for this. Version 6 only had french and nothing else so those were added in a fr directory. If you download and place them manually do they work?
Sometimes, the impossible can become possible, if you're awesome!
I have downloaded the language file StudioDE.plg from here and it works fine.
However, if there are multiple language files in the folder PhotoFiltre, then PhotoFiltre will use the first PLG (language file) it finds in alphabetical order. That seems to be a problem. Therefore it's necessary to put all language files in a seperate folder called "Languages". By the file custom.nsh it should be possible to choose the appropriate language file (I hope to interpret this correctly).
Could you offer me some solid tutorials to learn NSIS?
My starting point is the following:
I have created a folder named "Languages" within the folder "PhotoFiltre". In the folder "Languages" I have pasted all the necessary language files (e.g. StudioDE.plg, StudioNL.plg, StudioES.plg, StudioIT.plg ...). Within the folder "PhotoFiltre" resides only the language file "StudioEN.plg". By parsing the environment variable %PAL:LanguageCustom% it will become for example DE. My aim is now, that I want to substitute the language file "StudioEN.plg" in the folder "PhotoFiltre" through the language file "StudioDE.plg" in the folder "Languages".
In a first step I wrote the following code in the file "PhotoFiltrePortable.ini":
In a second step I create a file custom.nsh with the following content:
Unfortunately this did not work. Or is it necessary, that I must compile a new Launcher with the above file custom.nsh and the altered file "PhotoFiltrePortable.ini"? Or is the code of the file custom.nsh probably false?
How I read in the Language documentation in the section "Other ways", I need to compile this new code with the PortableApps.com Launcher Generator. Now all works fine. I forgot this last step.
Now are the invalid sentences, which I have mentioned in my original post, again correctly.
For everyone, who are interested at my version, is here the Downloadlink for the installer: PhotoFiltre Portable 7.0 Development Test 1
If I want to rename a file called "PhotoFiltre.htm" to "PhotoFiltre7.htm" with NSIS, can I do that with the following code?
.
Previously known as kAlug.
In some language files I detected 2 files called "PhotoFiltre.htm" and PhotoMasque.htm". The file "PhotoFiltre.htm" I renamed as "PhotoFiltre7.htm".
I created for every language a folder inside of the folder Languages. For example for german I named this folder "help-de". In this folder I pasted the 2 files "PhotoFiltre7.htm" and "PhotoMasque.htm".
My aim is now, that I want to substitute the language file "StudioEN.plg" in the folder "PhotoFiltre" through the appropriate language file (e.g. "StudioDE.plg" for german) in the folder "Languages". In addition should be replaced the two files "PhotoFiltre7.htm" and "PhotoMasque.htm" in the folder "PhotoFiltre" through the appropriate files in the folder "help-%PAL:LanguageCustom%" (e.g. "help-de" for german). To this end I have created a file "custom.nsh" with the following code:
Unfortunately, it does not work. Can someone give me a tip to solve this problem?
Unfortunately, I overlooked one small thing. The code of the file "custom.nsh" is correct. Also I have solved the problem with the registry keys (please look for more information in the post of the member SYSTEM).
For everyone, who are interested at my version, is here the Downloadlink for the installer: PhotoFiltre Portable 7.0 Development Test 2
To fix the language issue, I have created a folder named "Languages" inside of the folder "PhotoFiltre". To preserve the folder "Languages" during an upgrade of the app, I have written the following code in the section [DirectoriesToPreserve] of the file "installer.ini":
For a revised version is here the link for downloading: PhotoFiltre Portable 7.0 Development Test 3
Once again I have modified the code of the file "custom.nsh". Furthermore I have eliminated the folder "Languages" from the folder "PhotoFiltre". Instead I have pasted the folder "Languages" in the folder DefaultData. Accordingly the folder "Languages" will be preserved during an upgrade of the app.
Through these measures now automatic language switching works in the PortableApps.com Platform. If running without the platform, you can adjust the language after running and closing the application at least once by editing the file PhotoFiltrePortableSettings.ini within the PhotoFiltrePortable\Data\settings directory.
For a revised version is here the link for downloading: PhotoFiltre Portable 7.0 Development Test 4
DefaultData is only for default user data. As I said previously, things like language files are part of the app and must remain in the App directory. There is no reason to have language files within Data.
Sometimes, the impossible can become possible, if you're awesome!
It may be, that the language files are a fundamental part of the app. But the folder "Languages" with all the language files, which I created, is not a part of the original app. Also, I was able to reach through this solution (Development Test 4) that the automatic language switching works fine in the PortableApps.com Platform. And in the end this solution preserves the folder "Languages" during an upgrade of the app. So I can not quite understand your objection.
Finally I would like to mention, that I've pasted with the variant Development Test 3 the folder "Languages" in the folder "PhotoFiltre". In this case also works fine the automatic language switching.
The result ought to be decisive and not the way there.
In this case, I think Dev Test 3 is the better solution. The language files are not included in the original app but belong to it. It is no user generated content nor is it part of the launchers working files. You preserved it with the installer.ini, so that upgrading is no problem (contrary to placing them in the DefaultData which breaks your language switching mechanism when Data is already present). But as every new version should contain the set of language files (possibly updated as well) there even is no need to preserve them. They should simply be replaced.
Unfortunately I can not understand your argument, why should breaks the automatic language switching, if the folder Data is already present. Please explain it in more detail. Also your assumption is false, that every new version should contain the set of language files. The program PhotoFiltre 7.0 contains only 1 language file named StudioEN.plg. For all these reasons I've created a folder "Languages" with all language files inside of the folder DefaultData. And through the file custom.nsh in conjunction with the section [Language] in the file "PhotoFiltrePortable.ini" it's now possible, that the language file StudioEN.plg in the folder PhotoFiltre will be substituted by the appropriate language file in the folder Languages.
Try installing your Dev Test over an older Photofiltre portable installation that contains a Data folder ans see what happens to your language switching.
I shurly understood your concept, no need to explain it over and over again. It is good, but not in DefaultData!
-edit-
to further explain again: You do not need to preserve the languages as you should better contain them in every updated paf as well. They would therefore be installed new.
First I would like to mention at this point, that I greatly appreciate your contributions That's why I'm still very interested in your comments.
In fact you have right, that after an upgrade from an older version of PhotoFiltre the automatic language switching in the PortableApps.com Platform don't work. Although the folder Languages is located in the folder DefaultData, afterwards the folder Languages is not transferred to the Data folder. Very strange but sadly true
I also have the same idea like you to insert the complete folder Languages in the folder PhotoFiltre on every update. In fact works then an update from an older version. Therefore is it recommended to use my version Development Test 3.
At the moment I test your launcher.ini regarding Tomahawk PDF+ Portable. More soon
That's by design.
DefaultData is the "blueprint" for a newly installed app where the Data folder does not exist already. It's the place for any preset settings files that need to be existend for the app to be portable.
(from the PA.c Format Specification 2.0)
The purpose of this is to ensure that user settings won't get overwritten.
In the case of your Photofiltre package, the language files are no user data or settings to portablize and belong to the app's folder - so your first idea for a subfolder in photofiltre was right. It's a pitty that they are not included in the base app already - makes maintanance more complicated than needed. Maybe one should leave the developer a message...
Not including the language files is a relatively common practice among many apps. When I package apps like KeePass Portable and WinSCP Portable, I go out and grab the then-current translations and incorporate them into the portable app.
Sometimes, the impossible can become possible, if you're awesome!
I have now again revised the 3 files PhotoFiltrePortable.ini, installer.ini and custom.nsh. In particular I've inserted into the file PhotoFiltrePortable.ini a new section [LanguageStrings].
I've also added the folder Languages again into the program folder PhotoFiltre (as in my version PhotoFiltre Portable 7.0 Development Test 3 ). For future updates the folder Languages should always be a part of the program folder PhotoFiltre.
Here the link for downloading: PhotoFiltre Portable 7.0 Development Test 5
issue been resolved now through custom code?
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” Dr. Seuss
This is fixed in 7.0 Rev 2. Thank you tapsklaps for your assistance! I did have to add back in the specialized French handling due to it being internal. Check it out to see what was added.
Sometimes, the impossible can become possible, if you're awesome!