SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist
    Join Date
    Nov 2004
    Location
    Netherlands
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    different languages - one page

    Hi,

    what for coding I have to include in the <head> of my page when I do want different languages on my page?

    - english
    - russian

    hope you can help me out.

    thanks
    mathilde

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If the content is mainly in one language (e.g., English) then use <html lang="en"> and mark up the Russian bits with lang="ru".

    If it's a 50/50 split between the languages, omit the lang attribute for the <html> tag and set it on each bit of content instead.

    You'll probably want to use UTF-8 as the character encoding, so that you can easily mix Latin and Cyrillic letters on the same page. There are legacy encodings that allows this, too, but UTF-8 is usually the best choice.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Evangelist
    Join Date
    Nov 2004
    Location
    Netherlands
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How to set the lang="ru" on the bit of text used on the page?

    example:

    <p>eng</p>
    <p> here some text in ru, and next some eng again</p>

    thanks
    mathilde

    edit: forgot a thank you for the first reply :-)

  4. #4
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    Code HTML4Strict:
    <p lang="ru">Cyrillic letters</p>
    Code HTML4Strict:
    <p lang="en">Latin  letters</p>

    That'd be quite some work there for websites with tons of multi-lingual content on a per document basis.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  5. #5
    SitePoint Evangelist
    Join Date
    Nov 2004
    Location
    Netherlands
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for showing.

    by that I also can put it in some <div style="lang="ru"; "> ?

  6. #6
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    lang is an attribute so the correct syntax for it is:

    Code HTML4Strict:
    <div lang="en"></div>
    Maleika E. A. | Rockatee | Twitter | Dribbble



  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dancing-mathilde View Post
    by that I also can put it in some <div style="lang="ru"; "> ?
    No, but you can use <div lang="ru">...</div>. (The language isn't a styling option.)
    The lang attribute is valid for most HTML element types.
    Birnam wood is come to Dunsinane


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
  •