TIP for using DUAL LANGUAGES (or MULTIPLE)

  • This may seem trivial to some of our more seasoned programmers here, which I don't really claim to be one at all, but I came up with a fairly simple and effective method for changing languages globally using the textfield and thought I would share.

    1) ADD language attributes to all of the textfield plugins which require dual or multilanguage text. Be sure to ADD 1 attribute per language and give it a name to reference the language data set you create with reference to the current plugin. You can leave the html field blank at this point.
    Example:

    Code
    <plugin name="thisPlugin" 
    engData="data:thisPlugin_eng"
    thaiData="data:thisPlugin_thai"
    html=""
    />

    2) Create the text data sets to contain all of the language data (note: each plugin will have a SET based on the # of language attributes added to the plugin.
    Example:

    Code
    <!-- for the Plugin : "thisPlugin" -->
    <data name="thisPlugin_eng"> Some English Text </data>
    <data name="thisPlugin_thai"> Some Thai Text </data>

    3) Add a variable for the current language and call an action to change the language on startup (and on the language buttons too!)
    Example:

    Code
    set(curlang, eng); changlang();

    4) Use an FOR action to check ALL plugins, and find any that have had a language attribute added to them.
    Example:

    The above example is for dual language. Multi-language you can simply change the if statements to include the other languages...
    if(curlang == eng...
    if(curlang == thai...
    if(curlang == ger
    etc....

    Hope this helps. Just wanted to give back to the community.

    If you know a simpler way... I'm all eyes.

    Tony

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!