Menu

One more question?

i18n
2003-02-06
2003-08-07
  • Alison Wainwright

    Rather than using the drop-down to change the language i want to use the standard 'little flag' images. Do you have any suggestions how to go about this?

     
    • flaimo

      flaimo - 2003-02-06

      You can get an array with all available languages with the LanguagesFilesList( ) function from the translator class. Loop through this array to get the iso codes. you can use them for choosing the right picture or whatever you like. Be sure to use the same names for the form elements as the original dropdown menu, then it should work.

       
    • flaimo

      flaimo - 2003-02-06

      using flags isn't the best way to do it. take a look at this: http://liga1.com/articles/usability.php

       
    • Alison Wainwright

      Thanks!
      The article was very interesting. My boss has the final say for what he wants to do :)

       
    • Nobody/Anonymous

      From : root@decologia.com

      Hi Flaimo, anyway I want to use form images to switch to one language to another. But it doesn't work, the cookie isn't reset with the correct value.

      <FORM METHOD="post" ACTION="<?php echo $_SERVER['PHP_SELF'] ?>">
                  <INPUT TYPE="hidden" NAME="<?php echo session_name(); ?>" VALUE="<?php echo session_id(); ?>" />

      <INPUT type='IMAGE' id="locale" name="locale" VALUE="fr" SRC='g/topnav/topnav-lang-fr.gif' WIDTH='27' HEIGHT='24' border='0'>

      </form>

      It looks like the value of the submit button of the dropdown menu is missing (value="Change language").

      But since the image form must transmit the locale value, how can I transmit the "Change language" command ?

       
    • flaimo

      flaimo - 2003-08-07

      the problem isnt my script, but your html. it is not valid. you can't pass a value with a image-input element. you can only use an image as a replacement for a submit button. you have to pass the locale information in a hidden input field with the same form

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.