No announcement yet.

how to pull out field from database according to language?

  • Filter
  • Time
  • Show
Clear All
new posts

  • how to pull out field from database according to language?

    I have two fields in my database "title_english" and "title_spanish". By SC-Macro i can detect selected language. so i want to pull out or i should say make field visible by language. if language macro detects english language i want to make field spanish visible and field english as unvisible. I do not know if i described it in an understandable way?!?! is this possibe? and if yes how to do it?

  • #2
    First of all this is not the recommended way of making multilangual applications. The general way is to create a data dictionary and use the language options of scriptcase itself. That works perfectly.

    To hide and show fields there are scriptcase macro's. Look into the helpfile for those. The best place is after the database is read, for a form generally the envents onscriptinit or onrecord.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development /


    • #3
      yeeaaahh i got what you mean. but maybe i did not describe it well. i mean can i check what languange had been chosen. and read out table of the database according to the language?


      • #4
        If it's for a grid.

        In onScriptInit:
        [var_lang] = sc_get_language();

        Change your SQL statement for the grid

        SELECT IF('[var_lang]' = 'en_us',title_english,title_spanish) AS title, ...

        On a form application you have to hide and show the respective fields.