Update docs for i18n

This commit is contained in:
Damian Mooyman 2017-09-26 10:11:36 +13:00
parent 5f8eb0806e
commit a478939ea9
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A

View File

@ -398,9 +398,12 @@ the browser: The current locale, and the default locale as a fallback.
The `Requirements` class has a special method to determine these includes: The `Requirements` class has a special method to determine these includes:
Just point it to a directory instead of a file, and the class will figure out the includes. Just point it to a directory instead of a file, and the class will figure out the includes.
If using this on the frontend, it's also necessary to include the stand-alone i18n
js file.
```php ```php
Requirements::add_i18n_javascript('<my-module-dir>/javascript/lang'); Requirements::javascript('silverstripe/admin:client/dist/js/i18n.js');
Requirements::add_i18n_javascript('<my-module-dir>/javascript/lang');
``` ```
### Translation Tables in JavaScript ### Translation Tables in JavaScript