Results 1 to 8 of 8

Thread: Language switching in css

  1. #1
    Join Date
    Jul 2005
    Location
    Montreal, Quebec, Canada
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Language switching in css

    Hi, i want to make a bilingual site (english & french) with css only if possible.

    I've see somthing like that somewere but it had a 2 pages in a page structure
    like:
    <div id="En">
    ..
    </div>
    <div id="Fr">
    ..
    </div>

    but i want a struture like this:
    <div class="En">
    ..
    </div>
    <div class="Fr">
    ..
    </div>
    <div class="En">
    ..
    </div>
    <div class="Fr">
    ..
    </div>

    but they use ID and it can't be use more than once in a page
    i've try to find something using CLASS element to be able to use it more than once...

    can someone help?

    Thanks !

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Sounds like javascript would be required in either case. Care to post a link to the one that does it using only css and id?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2005
    Location
    Montreal, Quebec, Canada
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok, i don't find the pure css one anymore, lost in my favorites..

    I have find some with a small javascript in it. http://simon.incutio.com/code/js/eas.../example2.html

    http://www.saila.com/attic/sandbox/h...ow_blocks.html

    http://www.sitepoint.com/article/str...p-javascript/2

    but i had one with no java...

    i'll search again but my favorites it's a jungle... lol

    thanks if you can help..

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Don't feel bad, you probably imagined it. I envision that with id it could be done with a very small onclick event to a button or link. With class it could also be done that way except the onclick event would have to be a bit more complex, best passed off to a function. Still, if you are going to all the trouble of writing all your content in two languages, make up alternate pages. That way no javascript will be required, kinder to the browsing public, many of whom may not have javascript enabled.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2005
    Location
    Montreal, Quebec, Canada
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I wanna manage only one set of page for the bilingual site (1 set it's ok, but 2 set it's hard, for me anyway).

    I just had i idea !

    If i put the french text on a z-index and the english text on an other one
    and i use 2 set of css (1 will hide french, the other english).

    than i'll use a button to activate..

    no java, for this anyway, ok i have already javascript on the site but.. this is not the question..lol

    what do you think of that?

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I still don't see how a button can activate a stylesheet without using javascript or some kind of scripting. It would be nice if it could and I certainly may be missing something.

    The z-index is not as reliable as display for hiding and revealing content. If you can switch stylesheets, switch ones utilizing the display property.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Zipotron
    Hi, i want to make a bilingual site (english & french) with css only if possible.
    There are a couple of ways to manage multilingual sites, but CSS is not one of them.

    This isn't an issue I've ever had to deal with personally, but I've seen bits of material around on the subject. The most extensible solution is to pull localised data from a database. You should be able to find decent results on Usenet (a good place to discuss the topic) and the Web, but I've lost threads that I've found interesting in the past. A thread from last year, though very brief, has some ideas.

    You should also consider delivery of the site. It is preferable that the user gets served their preferred language, a default (probably English) if it's not available, and links to other language versions (for cases where their browser is misconfigured). This is best achieved with language negotiation, but it has a few issues to consider. Alan J. Flavell's Language Negotiation Notes is a frequently cited source, as is Jukka Korpela's Techniques for multilingual Web sites and On multilingual Web sites and CSS.

    What you're considering may certainly be easier from an author's perspective, but it really isn't the way to go.

    There is software that can help you with this. Can't think of any name off the top of my head, though.

    Mike

  8. #8
    Join Date
    Jul 2005
    Location
    Montreal, Quebec, Canada
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the answers guys !

    I'll try to use dhtml with cookies to keep the user choice.
    I don't wanna use the language tags cause', i think user may want to use an other language than the one config in there browser.

    but i'm not sure how to begin.

    bye, thanks again

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •