How make images show according to the language ID

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cybershaolin
    Member
    • Nov 2006
    • 38
    • 3.8.x

    How make images show according to the language ID

    I have a bilingual forum. (two languages ID)

    Language 1 = English
    Language 2 = French

    I'm trying to make something working but without success. My goal is to make an image appear in the header template, according to the language ID setup by the user. Of course, my image is different for each language. I've tried this code but with that, no image at all is displayed.

    Note: All images are copied under /images/misc

    Code:
    <if condition="$vboptions['languageid'] == '2'">
    
    <a href='myform.php?do=myform_action $session[sessionurl]'><img src="$stylevar[imgdir_misc]/french_image.png" onmouseover="this.src='$stylevar[imgdir_misc]/french_image_MouseOver.png' ;" onmouseout="this.src='$stylevar[imgdir_misc]/french_image.png' ;" border="0" /></a>&nbsp;&nbsp;
    
    <else />
    
    <a href='myform.php?do=myform_action $session[sessionurl]'><img src="$stylevar[imgdir_misc]/english_image.png" onmouseover="this.src='$stylevar[imgdir_misc]/english_image_MouseOver.png' ;" onmouseout="this.src='$stylevar[imgdir_misc]/english_image.png' ;" border="0" /></a>&nbsp;&nbsp;
    
    </if>
    Any suggestions?
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 74123

    #2
    You can specify an image override under Language & Templates -> Language Manager -> Edit Settings.

    So you can name your buttons like newthread1.gif and newthread2.gif where the first would be used for English and the second would be used for French based on the Language ID being used.

    In your conditional above you should be checking "$vbulletin->userinfo['languageid']"
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    • Reeve of Shinra
      Senior Member
      • Sep 2001
      • 4325
      • 4.0.0

      #3
      So you can name your buttons like newthread1.gif and newthread2.gif where the first would be used for English and the second would be used for French based on the Language ID being used.
      Make it even easier for yourself and use folders with a unique name like:

      yoursite.com/forums/images/site-english/ blah.jpg
      yoursite.com/forums/images/site-french/ blah.jpg

      Then you only need ONE replacement variable to change "site-english" to "site-french"
      Plan, Do, Check, Act!

      Comment

      • Cybershaolin
        Member
        • Nov 2006
        • 38
        • 3.8.x

        #4
        Originally posted by Wayne Luke
        In your conditional above you should be checking "$vbulletin->userinfo['languageid']"
        Thanks, that worked. I was just not checking the right thing!

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...