Categories
EXT:rlmp_language_detection HTTP ACCEPT LANGUAGE

Testing your Browsers HTTP ACCEPT LANGUAGE with google

Set your browser language to chinese

  1. Use the firefox browser
  2. Set HTTP ACCEPT LANG to chinese (“zh”)
  3. Go to www.google.com
  4. The Google Website should be displayed in chinese language (See screenshot below)

Screenshot: Google Website in chinese language

Click to enlarge

Categories
EXT:rlmp_language_detection HTTP ACCEPT LANGUAGE

Setting language preferences in a browser

Internet Explorer. When you install a copy of Internet Explorer version 7+, your preferences are automatically set according to the Windows user locale, although you are given the opportunity to modify this when you first install.

Note that, if you haven’t customized your browser’s language preferences, when you change the Windows user locale the browser preferences get changed too. If you customize the browser settings, they no longer follow the changes in the Windows user locale. (The Windows user locale settings allow you to switch formats, such as which character is used as the decimal separator, the order of date information, etc. by selecting different locales.)

By default, the values sent in the Accept-Language request-header from IE7 onwards are typically of the form language-region. Typically no language-only form is included. For example, if you are French your Accept-Language header will present fr-FR to the server. This has implications for some servers, particularly if you add other language tags.

To change your language preferences go to Tools > Internet Options > General (tab) > Languages > Language preference. In IE you can also specify your own customized language tags: click on the ‘Add’ button in the language preferences dialog, and type your language tag into the ‘User defined’ field.

Firefox. To change your language preferences go to Tools > Options (Windows) or Firefox > Preferences (Mac OS X), and select Content (tab) > Languages > Choose (button).

You can add languages to this from a (long) pre-defined set, and Firefox will send all the languages you choose with the Accept-Language header in the order in which you arrange them.

You can’t create custom language tags using the standard interface. (You can, however, via about:config, using intl.accept_languages if you are geeky enough.)

Safari. On Mac OS X the language sent is that specified in the OS X system language preferences. To change those preferences go to System Preferences > Language & text > Language. You can have a long list of languages in this dialog box, but Safari will only send the top item with the Accept-Language header. You can’t create custom language tags.

On Windows, you can’t change the language sent by Safari. The language sent with the Accept-Language header is derived from your system settings.

Google Chrome. To change your language preferences go to Options (Windows) or Chrome > Preferences (Mac OS X), and select Under the Bonnet > Web Content > Languages & Spellchecker settings.

You can add languages to this from a pre-defined set, and Chrome will send all the languages you choose with the Accept-Language header in the order in which you arrange them. You can’t create custom language tags.

Opera. On Windows you can change your language preferences at Menu > Settings > Preferences > General > Language > Details (button).

You can add languages from a pre-defined set, or create a custom (User-defined) language tag. Opera will send all the languages you choose with the Accept-Language header, in the order in which you list them in the dialog box.

On Mac OS X, Opera takes the list of languages to send with the Accept-Language header from the OS X system language preferences. To change those preferences go to System Preferences > Language & text > Language. You can have a long list of languages in this dialog box, and, unlike Safari, Opera sends all of them with the Accept-Language header.

You can’t create custom language tags using the standard interface. (Again, you can if you are sufficiently technically aware to use opera:config and the Network > HTTP Accept Language setting.)

Links

Categories
EXT:rlmp_language_detection Firefox HTTP ACCEPT LANGUAGE

Sprache im Firefox Browser einstellen (HTTP ACCEPT LANGUAGE)

Um die bevorzugten Sprachen im Firefox einzustellen, gehen Sie zu

Extras > Einstellungen (Windows)
Firefox > Einstellungen (Mac OS X)

und wählen Sie

Inhalt (Tab) > Sprachen > Wählen (Button).

Links

Categories
EXT:rlmp_language_detection HTTP ACCEPT LANGUAGE

EXT:rlmp_language_detection – Ablauf der automatischen Weiterleitung zur “richtigen” Sprache

Ablauf

  1. Spracheinstellung des Browsers wird gelesen
    • Technisch: “HTTP ACCEPT LANGUAGE” wird gelesen
    • Beispiele:
      • Ein Schweizer hat entweder DE-CH oder FR-CH, wenn er in der französischen Schweiz lebt.
      • Ein Österreicher hat DE-AT
      • Ein Deutscher hat DE-DE oder nur DE
  2. Prüfen, ob überhaupt weitergeleitet werden soll
    • Prüfung #1: Was war die zuletzt besuchten Seite?
      • Ja, leite weiter, wenn der Surfer von einer externen Seite kommt
      • Nein, leite NICHT weiter, wenn der Surfer von der eigenen Seite kommt
  3. Weiterleitung
    • Wenn HTTP ACCEPT LANGUAGE…
      • DE (und Varianten) auf die deutsche Seite weiter
        • Varianten sind DE-CH, DE-AT, …
      • EN (und Varianten) auf die englische Seite weiter
        • Varianten sind EN-GB, EN-US, EN-AU, …
      • FR (und Varianten) auf die französische Seite weiter
        • Varianten sind FR-CH, FR-BE, …
      • NL (und Variante)
        • Variante ist NL-BE
    • Wenn andere HTTP ACCEPT LANGUAGE…
      • dann leite auf die englische Seite weiter
    • Beispiel:
      • Ein Chinese hat “ZH-CN” als HTTP ACCEPT LANGUAGE
      • Er wird auf die englische Seite weitergeleitet.

Sonderfall “Mehrere HTTP ACCEPT LANGUAGES im Browser eingestellt”

Beispiel: “Ein Chinese, der auch deutsch spricht”

  • 1. Sprache “ZH-CN” (Chinesisch)
    • Unsere Webseiten liegen nicht in chinesischer Sprache vor.
    • Deshalb sollte der Surfer auf die englischen Seiten weitergeleitet werden.
    • Das wird er aber nicht, weil er noch eine zweite Sprache (DE) eingestellt hat, die wir bedienen können:
  • 2. Sprache “DE” (Deutsch)
    • Also wird zur deutschen Seite weitergeleitet.
  • Grund:
    • Wenn mehrere Sprachen im Browser eingestellt sind, dann wird die erste passende Sprache ausgewählt.

Links

Categories
EXT:rlmp_language_detection HTTP ACCEPT LANGUAGE

EXT:rlmp_language_detection – Ablauf der automatischen Weiterleitung zur “richtigen” Sprache (Kurzfassung)

Ablauf

  1. Spracheinstellung des Browsers wird gelesen
  2. Prüfen, ob überhaupt weitergeleitet werden soll
  3. Weiterleitung

Sonderfall “Mehrere HTTP ACCEPT LANGUAGES im Browser eingestellt”

  • Wenn mehrere Sprachen im Browser eingestellt sind, dann wird die erste passende Sprache ausgewählt.

Links