|
|
|
# How to use Drupal translation?
|
|
|
|
|
|
|
|
We use `Drupal.t` for all strings in this project, so any static string should be by default accessible for translation.
|
|
|
|
|
|
|
|
However, some strings are coming from the config object and we use them like `Drupal.t(config.placeholder)`. Drupal can't scan these strings, so you need to add them somewhere in your JS files for Drupal to scan them.
|
|
|
|
Something like:
|
|
|
|
```
|
|
|
|
Drupal.t('My placeholder');
|
|
|
|
Drupal.t('The custom title');
|
|
|
|
Drupal.t('Another title');
|
|
|
|
Drupal.t('Another string!');
|
|
|
|
...
|
|
|
|
``` |
|
|
|
\ No newline at end of file |