Grow your CSS skills. Land your dream job.

Language Support

  • # March 18, 2010 at 1:39 pm

    I have an application which displays the data in a field in 2 languages like this:
    ENG: This is the english text
    FR: Ici est le …..

    I want to make this dynamic based on the user’s language selection in the Browser or the user’s locale setting on his system.

    First I changed the data to be like this:
    <span id="EN">This is the english text</span>
    <span id="FR">Ici est le …..</span>

    and define a CSS file like this:
    #EN
    {
    font-size: 30px;
    color: red;
    }
    #FR
    {
    font-size: 10px;
    color: blue;
    }

    All Ok so far :D

    But what I really want is to detect the language and display either the French or the English text but not both.

    So I can presumbly hide the French or English by setting it to 0px but how do I do this dynamically and will it work on all Browsers consistently.

    I have played around with :lang(en) but not too sure this is the way to do it.

    Thanks

    # March 18, 2010 at 2:18 pm

    http://www.visibilityinherit.com/projec … e-demo.php
    Courtesy of Eric Watson

    # March 19, 2010 at 8:27 am

    I think that link is dead now. I build them in the projects folder, and publish them in the code folder. Here is the finished page. http://www.visibilityinherit.com/code/m … ebsite.php

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".