SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    Brazil
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to block bar suggestion of Google Chrome

    I'm brazilian and Google Chrome always show that bar saying that my pages are in English, but are not...

    My DOCTYPE:
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="pt-BR">
    and a screenshot:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="pt-BR">
    
    <head>
            <title>Teste pt-BR</title>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    
    <body>
            
            <h1>teste de conteúdo em pt-BR</h1>
            <p>Este texto é o único conteúdo do site e está em pt-BR</p>
            
    </body>
    
    </html>
    Is there anything else to make the browser identify which language the page?
    Thanks.

  2. #2
    Chive On FFCus's Avatar
    Join Date
    Feb 2006
    Location
    Connecticut
    Posts
    542
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know you can disallow Google Translate on a page by adding a meta tag in:

    Code:
    <meta name="google" value="notranslate">
    I don't know if Chrome hooks into that as well though. Give it a test and see what happens. I think that will work in Chrome 11+

  3. #3
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    I wouldn't suggest disableing Google Translate altogether. Rather, try sending the language in the HTTP header as well:

    Code php:
    header('Content-Language: pt-BR');

    Also, Google might not recognize language subcategories. Have you tried just using pt, just to check if it works?
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    Brazil
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It works!
    But.. now does not suggest any translation. What if... Tomorrow I make a page that needs translation suggestion, but in the case of pt_BR to en_US?

    Do you have any tag to make the suggestion?
    Thanks.

  5. #5
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    That is exactly why I recommended against disableing translation. It's a bit like curing a cold with 240 grains of lead

    Might also be a version problem: Auto translate detect the wrong language. Why is it so? - Toolbar Help
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  6. #6
    Chive On FFCus's Avatar
    Join Date
    Feb 2006
    Location
    Connecticut
    Posts
    542
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure about the 2nd part of the question. I just only remembered how to block the bar completely.

    Did you find this issue to also happen in other browsers with the Google toolbar or just in Chrome?

  7. #7
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    Brazil
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just in Chrome, but works for my application.
    Thanks FFCus and C. Ankerstjerne.


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
  •