mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Partially revert docs commit 7710cf59
i18n.js doesn't support named parameters (yet)
This commit is contained in:
parent
2b6d735182
commit
64888c07b7
@ -299,13 +299,14 @@ Example Translation Table (mymodule/javascript/lang/de_DE.js)
|
||||
alert(ss.i18n._t('MYMODULE.MYENTITY'));
|
||||
|
||||
|
||||
### Advanced Usage with injection
|
||||
### Advanced Usage with sprintf()
|
||||
|
||||
:::js
|
||||
// MYMODULE.MYENTITY contains "Really delete {answer} articles by {author} authors?"
|
||||
alert(ss.i18n._t('MYMODULE.MYENTITY'),
|
||||
array('answer' => 42, 'author' => 'Douglas Adams')
|
||||
));
|
||||
// MYMODULE.MYENTITY contains "Really delete %s articles by %s authors?"
|
||||
alert(ss.i18n.sprintf(
|
||||
ss.i18n._t('MYMODULE.MYENTITY'),
|
||||
42,
|
||||
'Douglas Adams'
|
||||
// Displays: "Really delete 42 articles by Douglas Adams?"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user