Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Apress.Pro.Drupal.7.Development.3rd.Edition.Dec.2010.pdf
Скачиваний:
63
Добавлен:
14.03.2016
Размер:
12.64 Mб
Скачать

CHAPTER 19 LOCALIZATION AND TRANSLATION

Download from Wow! eBook <www.wowebook.com>

Figure 19-22. Determination of language using the path prefix for French

Path Prefix with Language Fallback

When language negotiation is set to this setting, Drupal will first look at the path prefix. If a match is not made, the user’s preferred language is checked by examining $user->language. If the user has not selected a preferred language, Drupal next tries to determine the user’s preferred language by looking at the Accept-language HTTP header in the browser’s HTTP request. If the browser does not specify a preferred language, the default language for the site is used. Assuming that English is the default language for the site, and both French and Hebrew are enabled, the process of language determination is shown in Figure 19-23.

440

CHAPTER 19 LOCALIZATION AND TRANSLATION

Figure 19-23. Determination of language using “Path prefix with language fallback”

URL Only

When language negotiation is set to this setting, Drupal will determine the current language by attempting to match the current URL with the language domain specified in the “Language domain” field of the “Edit language” page of a language (see Figure 19-21). For example, with English as the default language, specifying http://fr.example.com as the language domain for the French language would set the current language to French for users visiting http://fr.example.com/?q=node/2 and English for users visiting http://example.com/ ?q=node/2.

Note A user’s preferred language setting from the “My account” page and the client browser settings are ignored when “Language negotiation” is set to Domain Name Only.

441

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]