explain resource url usage for add_i18n_javascript (#8761)

see #8748
This commit is contained in:
wernerkrauss 2019-01-29 08:00:04 +01:00 committed by Robbie Averill
parent d2c8530fec
commit 2d257ae3df

View File

@ -414,6 +414,11 @@ Requirements::javascript('silverstripe/admin:client/dist/js/i18n.js');
Requirements::add_i18n_javascript('<my-module-dir>/javascript/lang');
```
You can also include the language files from the public resources folder with the resource syntax:
```php
Requirements::add_i18n_javascript('vendor/module:path/to/lang');
```
### Translation Tables in JavaScript
Translation tables are automatically included as required, depending on the configured locale in `i18n::get_locale()`.