Page 1 of 1

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

Posted: 2006-12-12, 12:08 UTC
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?

Posted: 2006-12-12, 12:14 UTC
by djk
Isn't enough to read LanguageIni value from current wincmd.ini file?

Posted: 2006-12-12, 12:22 UTC
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.

Posted: 2006-12-12, 12:34 UTC
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...

Posted: 2006-12-12, 12:39 UTC
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.