You are here

Scope of the environment variable %PAL:LanguageCustom%

19 posts / 0 new
Last post
tapsklaps
Offline
Last seen: 5 years 5 months ago
Developer
Joined: 2010-10-17 08:11
Scope of the environment variable %PAL:LanguageCustom%

I've read through several times the complete documentation of Languages​​. Based on the explanations in the "Setting a custom language environment variable" I've come to the conclusion, that the environment variable %PAL:LanguageCustom% exclusively will be applied in the PortableApps.com Platform. This environment variable is generated by the sections [Language] and [LanguageStrings].

On the other hand the section [LanguageFile] will only applied, if the portable program is started outside of PortableApps.com Platform. From this I deduced, that the section [LanguageFile] not uses the environment variable %PAL:LanguageCustom%. Instead the section [LanguageFile] uses a particular file.

Are these statements so far correct?

John T. Haller
John T. Haller's picture
Online
Last seen: 3 min 5 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Not Quite

The whole point of language switching is for use with the platform (what other reason is there? We certainly don't want it always changing to match the host OS.) Keep in mind that users can disable automatic language switching within the Platform as well, so it may use the fallback with the Platform in that case. LanguageCustom is set appropriately based on both the platform environment variables and then what is read in from the language file setting in the app if the environment variables don't exist.

Sometimes, the impossible can become possible, if you're awesome!

tapsklaps
Offline
Last seen: 5 years 5 months ago
Developer
Joined: 2010-10-17 08:11
more detailed information
  1. Disabling of the autamatic language switching in the PortableApps.com Platform

    To reach that goal, the user must click on "Options" in the PortableApps.com Menu.
    In the dialog window named "Options" the user chooses the tab "General". In the section "Language" he now disables the checkbox next to "Use this language for all portable apps". Is this procedure so far correct?

  2. Non existing environment variables

    You have mentioned in your last sentence the possibility, that an environment variable don't exist. Does that mean, that some languages exists, which are not integrated in the PortableApps.com Platform?

  3. Usage of the section [LanguageFile]

    Is my assumption so far correct, that the section [LanguageFile] only uses a particular file. If such a file does not exist, then the section [LanguageFile] is not applied. In no case this section uses the environment variable %PAL:LanguageCustom%.

Aluísio A. S. G.
Offline
Last seen: 7 years 8 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
2 = No Platform; 3. Always

These environment variables only exist when launched from the Platform.

PAL:LanguageCustom always point to the correct language; it gets it from [Language] and [LanguageStrings] when launched from the Platform, and from [LanguageFile] otherwise.

Tip: Use the Source, Luke Wink

Previously known as kAlug.

tapsklaps
Offline
Last seen: 5 years 5 months ago
Developer
Joined: 2010-10-17 08:11
?

your information are as always a little bit unclear Wink

Aluísio A. S. G.
Offline
Last seen: 7 years 8 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
Sorry; answers

Sorry about that. It's not exactly easy to answer from my cell phone.

So let's answer your questions:
1. Yes (at least my memory says so).
2. The environment variables John mentioned are provided by the Platform, what means that they are only present when launched by it.
3. PAL:LanguageCustom contains the final value of the language. It's not used anywhere; it's set by PAL's Language segment and then you just do what do you need do to with it (write to/copy a file, set an environment variable, etc.).
The [LanguageFile] section is used to read the language from a file so the launcher knows the proper language to set when not launched from the Platform. You'll need to write the value of PAL:LanguageCustom to the same file too.

I don't think I can more clearer than all my answers together. If you have doubts and no one here manages to answer them, read the source.

Previously known as kAlug.

tapsklaps
Offline
Last seen: 5 years 5 months ago
Developer
Joined: 2010-10-17 08:11
creation of the variable %PAL:LanguageCustom%

kAlug wrote...

The [LanguageFile] section is used to read the language from a file so the launcher knows the proper language to set when not launched from the Platform. You'll need to write the value of PAL:LanguageCustom to the same file too.

I'm with you totally agree, that the section [LanguageFile] is used to read the language from a file. But when the program is not launched from the PortableApps.com Platform, then I think, that the launcher not interpreted the two sections [Language] and [LanguageStrings] (because these two sections are evaluated only when the program is started within the PortableApps.com Platform). Since, however, the environment variable %PAL:LanguageCustom% only is created in the sections [Language] and [LanguageStrings], this variable does not exist when the program is started outside of PortableApps.com Platform. Thus the section [LanguageFile] can't use this non-existent environment variable %PAL:LanguageCustom%.

depp.jones
Offline
Last seen: 1 day 4 hours ago
DeveloperTranslator
Joined: 2010-06-05 17:19
follow kAlug's advice to read

follow kAlug's advice to read the source, it is well documented and should answer all your question (or scrap your suppositions...)

I know, you don't trust until you find out by yourself, but sometimes you should try. Wink

depp.jones
Offline
Last seen: 1 day 4 hours ago
DeveloperTranslator
Joined: 2010-06-05 17:19
Hi tapsklaps!I see, this

Hi tapsklaps!
I see, this still bothers you. Have you noticed my advice to run a launcher in debug mode? I could build my experimental version of tomahawk for you as debug version so you could test it under different conditions. (Tomahawk because I think you have investigated this app's stuctures thoroughly the last days. Wink )
In debug mode, you see every action the launcher takes step by step and you have a debug.log in Data you could study afterwards.

To your questions:

  1. yes
  2. %PortableApps.com...% = PA.c menu generated variables / %PAL:..." = PA.c Launcher generated variables => no menu = no menu generated variables = launcher sets them to english
  3. Just partly right again. If the file in LanguageFile is not present, the launcher can not read the settings and therefore sets %PAL:LanguageCustom% to english by design - but that would be a bug in the package setup. Blum
    %PAL:LanguageCustom% is not "used" but set by the launcher depending various conditions that you have to define in the launcher.ini and LanguageFile is the part to get the desired value from a file in case the platform variables are not present - either cause of launching standalone or by disabling automatic language setting... You have to define what the launcher should do with that variable, according to way the app should work.

Remember: 3 is only applicable if run standalone.

-edit-
Oh, I think, I forgot to scroll down. I see kAlug already answered your questions exhaustively. Smile

tapsklaps
Offline
Last seen: 5 years 5 months ago
Developer
Joined: 2010-10-17 08:11
partial approval

I'm agree with you regarding your answers No. 1 and 2.

Regarding your answer No. 3 following:

Please explain me exactly, what you want to say with your very unclear statement:

%PAL:LanguageCustom% is not "used" but set by the launcher depending various conditions that you have to define in the launcher.ini ...

As I have already tried several times to explain this variable is generated exclusively by the two sections [Language] and [LanguageStrings]. If the program is not launched in the PortableApps.com Platform, then this variable not exists. Then the section [LanguageFile] can't use this non-existent variable.

depp.jones
Offline
Last seen: 1 day 4 hours ago
DeveloperTranslator
Joined: 2010-06-05 17:19
You are wrong. As I tried to

You are wrong.

As I tried to explain several times, the variable is generated by the launcher from Language and LanguageStrings in case it is launched from the platform and read from LanguageFile if not. It is as simple as that.

Only in case the section LanguageFile is not present when the launcher is launched standalone it reads the Language section as fallback and would set the language to english according to the format specified in Base.

From now on I will put my assistance on hold until you either have read the source or tried a launcher in debug mode. Your theoretical assumptions seem not to help you to understand how the launcher works. You just guess from what you think is right according to your findings by simply reading parts of the manual and analysing some outcome from some launcher setup.
It is all layed out, we pointed you to the different information sources, but I get the feeling that you don't use them thoroughly enough. For instance: This whole thread is kind of redundant. May I remind you that I pointed you to the launcher manual for this exact issue?

[LanguageFile]

For reading the custom language variable from a file for when the portable application is not launched from the PortableApps.com Platform. The values which must be set depend on the Type specified below.

(PA.c Launcher documentation => Reference => launcher.ini => [Language])

No offence meant, but I'm getting weary.

tapsklaps
Offline
Last seen: 5 years 5 months ago
Developer
Joined: 2010-10-17 08:11
Contradiction in your sentence

depp.jones wrote ...

As I tried to explain several times, the variable is generated by the launcher from Language and LanguageStrings in case it is launched from the platform and read from LanguageFile if not.

In the first half of your sentence you mentioned, that the launcher generated the variable by the two sections [Language] and [LanguageStrings], when the program will launched in the PortableApps.com Platform. That's ok and I'm agree with you.

In the second half of your sentence you mentioned, that the section [LanguageFile] uses this variable, when the program will not launched in the PortableApps.com Platform. But please explain me, how this variable will be generated in this last case?

I would now like to end this dispute, because you can not persuade me with your arguments. Sorry

depp.jones
Offline
Last seen: 1 day 4 hours ago
DeveloperTranslator
Joined: 2010-06-05 17:19
Source or debug mode! No

Source or debug mode! Wink

No need to persuade you if you don't want to learn...

tapsklaps
Offline
Last seen: 5 years 5 months ago
Developer
Joined: 2010-10-17 08:11
Sorry

Unfortunately I have not exactly read the following sentence:

[LanguageFile]

For reading the custom language variable from a file for when the portable application is not launched from the PortableApps.com Platform. The values ...

(PA.c Launcher documentation)

Probably you seem to have right. Sorry Wink But what value is then assigned to this variable? When the program is not launched from the PortableApps.com Platform, then only the system language of the host PC can assigned to this variable. Or what would you think?

depp.jones
Offline
Last seen: 1 day 4 hours ago
DeveloperTranslator
Joined: 2010-06-05 17:19
The value is specified in

The value is specified in [LanguageFile]. Now PLEASE do some practical learning instead of analyzing answers. When build in debug mode, all relevant actions of a launcher are displayed.
Like this: http://screenshooter.net/5313111/omcmira
and this: http://screenshooter.net/5313111/vowdcon

Aluísio A. S. G.
Offline
Last seen: 7 years 8 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
[FileWrite] + [LanguageFile]

First, you need a [FileWrite] section to write the value of %PAL:LanguageCustom% to some file. You also need a [LanguageFile] section with approximately the same parameters as that [FileWrite] section.

Now, when the app is launched from the Platform, the launcher will detect its language environment variables and set %PAL:LanguageCustom% based on them. Right after that it will execute the [FileWrite] section.

So, we have the value of %PAL:LanguageCustom% written somewhere, right?

Then, the app is launched directly by the user (i.e. not through the Platform). The launcher will not detect the Platform's language environment variables, and will then try to read the language as specified in the [LanguageFile] section.

Do you agree that now %PAL:LanguageCustom% has the same value as of when we wrote it with [FileWrite]?

After that, the launcher will execute the [FileWrite] section as when it has been launched from the Platform.

Previously known as kAlug.

depp.jones
Offline
Last seen: 1 day 4 hours ago
DeveloperTranslator
Joined: 2010-06-05 17:19
And in addition it can make a

And in addition it can make a language selected manually in the app itself persistent when launched standalone which otherwise will be reset to english. I already explained that here and earlier in that thread - but not as plausible as you.

tapsklaps
Offline
Last seen: 5 years 5 months ago
Developer
Joined: 2010-10-17 08:11
Requirements for the sections [FileWrite] and [LanguageFile]

Your first 4 paragraphs are absolutely clear.

Before you can use the section [FileWrite], you need a value, which is assigned to the environment variable %PAL:LanguageCustom%. Afterwards you can read this value via the section [LanguageFile]. That's all logical so far.

But from where get the environment variable %PAL:LanguageCustom% a value, when the program will launched outside of the PortableApps.com Platform. This is my question? Because only after this variable has been assigned a value, can work the two sections [FileWrite] and [LanguageFile].

Aluísio A. S. G.
Offline
Last seen: 7 years 8 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
3rd; English

Please read my answer again, specially the third paragraph.
Now add this: if the app's first run is not through the Platform, the launcher will automatically fall back to English.

Previously known as kAlug.

Log in or register to post comments