SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Must I insert langusge tags?

    I have 2 landing pages in Russian and Hebrew in the blog that is totally in English.
    Should I insert some language tags in to the HTML page?
    If yes, what tags and where?
    Thanks,
    Vadim

  2. #2
    SitePoint Guru
    Join Date
    Nov 2005
    Location
    Norway
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I usually use the html lang attribute.
    Code:
    <html lang="en">

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My page starts like this:

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>שירות, תיקונים ותחזוקת מחשבים בתל אביב, ישראל</title>

    Should I insert it into the first line like that:
    <html lang="he" xmlns="http://www.w3.org/1999/xhtml">

    The page is here:
    http://repairpcguide.com/pc-repair-service/he/

    Thanks,
    Vadim

  4. #4
    SitePoint Guru
    Join Date
    Nov 2005
    Location
    Norway
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep correct. If the whole page is in Hebrew, otherwise you can use the lang attribute on other elements as well.

    More info: http://www.w3.org/TR/REC-html40/struct/dirlang.html

  5. #5
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In your case, you should use both the lang and xmllang attributes in your HTML opening tag along with the META content language tag.

    HTML Code:
    <html xmlns="http://www.w3.org/1999/xhtml" lang="iw" xml:lang="iw">
    HTML Code:
    <meta http-equiv="content-language" content="iw" />
    For the sections of the page that have English (like your search form), add the lang="en" attribute. I also recommend you remove the Wordpress generator tag from your header.php file as well - you don't want scripts sniffing to see what version of WordPress you're using and then hacking into it.

  6. #6
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Schulz View Post
    In your case, you should use both the lang and xmllang attributes in your HTML opening tag along with the META content language tag.

    HTML Code:
    <html xmlns="http://www.w3.org/1999/xhtml" lang="iw" xml:lang="iw">
    HTML Code:
    <meta http-equiv="content-language" content="iw" />
    Dan thanks a lot, it was of great help!
    But isn't "IW" obsolete?
    Nowadays Hebrew language use "HE" attribute, isn't it?

    For the sections of the page that have English (like your search form), add the lang="en" attribute. I also recommend you remove the Wordpress generator tag from your header.php file as well - you don't want scripts sniffing to see what version of WordPress you're using and then hacking into it.
    Regarding contact form where exactly should I insert it? Should it be like this:
    <a lang="en" href="/contact-us/" target="_blank">או שלח אי-מייל </a>

    Thanks again
    Vadim

  7. #7
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The SitePoint Reference has IW as the current listing. If HE is now being used, then by all means go ahead and use it.

    The attribute would be put in the the tag that has the English content on it.

  8. #8
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    According to ISO 639-2 the language code for Hebrew is 'heb' (or 'he' in ISO 639-1).
    Birnam wood is come to Dunsinane

  9. #9
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That settles it then. Time to update the SitePoint Reference...

  10. #10
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys!
    Can you check the source code and see whether or not I should remove or change something?
    Thank you very much
    Vadim


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
  •