Adding Locales should be done through YAML

Configuring locales via PHP now returns an error as common_locales is a static property. Documentation shoudl reflect this.
This commit is contained in:
Richard Rudy 2016-06-03 16:21:15 -04:00
parent 64788bd42e
commit 143b0d1790

View File

@ -508,10 +508,14 @@ the same as your current page locale.
### Adding a new locale
The `i18n` logic has lookup tables for common locales in i18n::$common_locales, which is a subset of i18n::$all_locales.
If your locale is not present here, you can simply add it through `mysite/_config.php`:
If your locale is not present here, you can simply add it through `mysite/_config/config.yml`:
:::php
i18n::$common_locales['de_AT'] = array('German (Austria)', 'Deutsch (Österreich)');
:::yml
i18n:
common_locales:
de_AT:
name: 'German (Austria)'
native: 'Deutsch (Österreich)'
This should e.g. enable you to use `$Locale.Nice` in template code.