The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

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:
    font-size: 30px;
    color: red;
    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.


    # March 18, 2010 at 2:18 pm

    This reply has been reported for inappropriate content. … e-demo.php
    Courtesy of Eric Watson

    # March 19, 2010 at 8:27 am

    This reply has been reported for inappropriate content.

    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. … ebsite.php

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

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed