CreateLanguage() Example

BlitzMax Forums/MaxGUI Module/CreateLanguage() Example

SebHoll(Posted 2009) [#1]
I've just finished this basic example to add to the MaxGUI.Localization docs for the next release. Thought I'd post it if anyone is interested in the mean time:




degac(Posted 2009) [#2]
Thank you, very clear example!


Grisu(Posted 2009) [#3]
Thanks!

Why don't we use "SuperStrict" examples these days!?


xlsior(Posted 2009) [#4]
Nice, Very easy to use!


plash(Posted 2009) [#5]
Why don't we use "SuperStrict" examples these days!?
Because the world is a cruel, cruel place :(


degac(Posted 2009) [#6]
Ok, new help request!

This time is about 'Gadget with items' (like ListBox, ComboBox, toolbar...)
What I'm doing wrong?!




SebHoll(Posted 2009) [#7]
Ok, new help request!

This time is about 'Gadget with items' (like ListBox, ComboBox, toolbar...)
What I'm doing wrong?!

No need to tweak MaxGUI.Drivers - the code is there for a reason. Although admittedly, I should have put some docs in there about it. The question is, where... I'm thinking alongside the docs for LocalizeGadget()?

Anyhoo, to specify which of the items within your localized listbox/toolbar gadget should be also be localized, you should specify the GADGETITEM_LOCALIZED flag when creating the item in your AddGadgetItem()/InsertGadgetItem()/ModifyGadgetItem() calls.
AddGadgetItem list,"Item 1 {{window_title}}", GADGETITEM_LOCALIZED|GADGETITEM_DEFAULT,,LocalizeString("{{window_title}}")
AddGadgetItem list,"Item 2  {{btn_english}}", GADGETITEM_LOCALIZED,,LocalizeString("{{btn_english}}")
AddGadgetItem list,"Item 3  {{btn_french}}", GADGETITEM_LOCALIZED,,LocalizeString("{{btn_french}}")
This tells the localization engine to localize both the item text and item tooltip strings everytime an update is required. This was coded like this, to provide greater control for the MaxGUI coder. For example, there may be a case where there are a mixture of items (some of which should be localized, some of which shouldn't) or it may be desirable to localize the text/tooltip of, for example, an editable ComboBox gadget, but not the items.


degac(Posted 2009) [#8]

you should specify the GADGETITEM_LOCALIZED flag when creating the item in your AddGadgetItem()/InsertGadgetItem()/ModifyGadgetItem() calls.



Ah! Ok, this make sense!
Thank you!
(ps: please put everything you think the user should know in the docs so I dont' disturb you anymore for these questions!!! :) )


SebHoll(Posted 2009) [#9]
please put everything you think the user should know in the docs so I dont' disturb you anymore for these questions!!!

That is my aim, although I've obviously missed a few (rather important) things. :P

This information has been added to the docs for MaxGUI v1.34c which should now be available for all platforms on the Product Updates page.


degac(Posted 2009) [#10]
Thnak you very much!