[Wish][Plugin interface]Parse language as a parameter

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

[Wish][Plugin interface]Parse language as a parameter

Post by *m^2 »

I'd like to be aware of users language.
TC can automatically translate field names in my WDX, but I write execution errors in ContentGetValue to FieldValue - and I have to decide which language to use.
Can you add optional function SetLanguage, to give give plugin writers a possibility of custom language handling?
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

Isn't enough to read LanguageIni value from current wincmd.ini file?
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Nice idea, thanks.
But it's not really good - when 2 copies of TC run at the same time, each has different config, I can make a mistake.
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

For every session TC uses its own %COMMANDER_INI% variable so you should be easily find the right config file but maybe I'm wrong...
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

Yes, it does. But AFAIK only internally - there's one COMMANDER_INI environment variable. Are there any other ways to obtain it?
ADD:
And another problem: what if user changed language after plugin load?
Checking it every ContentGetValue call is quite inefficient.
ADD: Sorry, my mistake, I forgot I read program environmet variables. I will always get the correct COMMANDER_INI. But problem with changing languages still holds.
Post Reply