3. Multilingual types
• Localized
Single language site
• Multilingual site
Site with different content for different languages
• Multilingual site with translation
Site with translated content
•
13. Language types
• Interface language
– t()
– format_plural()
• Content language *
– Used for Field API
– Used for content translation
• URL language *
– l()
•
Not configurable by core
15. t(): variations
• t()
if your code will never run during the Drupal installation phase
• st()
if your code will only run during installation and never any other
time
• get_t()
if your code could run in either circumstance
16. t(): calling
Parameters
• $string
• $args
– @argument – processed via check_plain()
– %argument – processed via drupal_placeholder()
– !argument – inserted as is.
• $options
– context – context for string
– langcode – language code, default current
language
21. Context
• The way to describe string
• Works for
– t()
– format_plural()
– Drupal.t()
– Drupal.formatPlural()
Drupal 6 Drupal 7
Представления
Представления Views
Views ? Просмотры
Просмотры
25. Translation types
Node translation Field translation
Base ru
node Title en
(ru)
Entity uk
Node (default language)
(en) ru
Body en
Node Price Photo
uk
(uk) (und) (und)