Announcement

Collapse
No announcement yet.

using language message as variable !!!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • using language message as variable !!!

    Hello,

    Is there any possibility to change language message value dynamically ??
    I use some language messages to change x,y and width positions off fields in invoice pdfprint layout, so user can customize is own layout

    I know that all messages are in "lang" sub-directory in PHP files but, maybe there is an existing function to change that dynamically

    If not, maybe it will be interesting to add it.

    Thanks in advance
    Nac

  • #2
    Hi,
    I did something similar on login .
    Read about sc_get_language(); and then you must have a global variable to use within your code

    IF [glo_var_language] = 'it_IT' { echo "Ciao" ;}
    IF [glo_var_language] = 'en_US' { echo "Hello" ;}
    ...


    // CG language selection from login form
    $my_language = sc_get_language();
    if ($my_language == 'it')
    {$my_language_CG = 'it_IT';
    [my_language_CG]= $my_language_CG;
    [my_language] = $my_language_CG;
    }
    else
    {[my_language_CG] = $my_language ;
    [my_language] = $my_language;
    }

    Comment


    • #3
      Hi Giovannino

      Thanks for answering !!!

      But , here I would like to use language file as parameters : for example,
      in layoutpdf Interface, I changed values xpos, xpos, width by lang_date_x, lang_date_y, lang_date_w

      it works fine !!!

      Now, I just want to make a form application to modify and save new values for lang_date_x, lang_date_y, lang_date_w .

      Otherwise, I have to create same parameters for a second time in my own database, but it's not the best way ...

      Best regards
      Nac

      Comment


      • #4
        Hi,
        in my case the Language is choosen at the login form and them I got the Language glo var for all application.
        If each form entry can have a different Language connected to each singular record you have to create a column where to store the Language ID like it_IT, en_US.... and with select field to choose the correct one .

        Comment


        • #5
          Good idea to use language as variable. But you need to work hard it to make complete.

          Comment

          Working...
          X