@nextcloud/l10n
Advanced tools
Changelog
3.1.0 - 2024-05-07
escape
option per parameter replacing.// Example
t(
'my-app',
'{a}{userInput}{a_end}',
{
a: {
value: '<a>',
escape: false,
},
userInput: somePossiblyInsecureValue, // This will be escaped
a_end: {
value: '</a>',
escape: false,
}
},
)
Changelog
3.0.1 - 2024-05-04
Changelog
3.0.0 - 2024-05-02
Instead of also sanitizing the replacing variables, now only the result is sanitized, see pull request #648.
This will improve the performance if multiple placeholders are used and it allows this, while the string is still sanitized:
t(
'See {linkstart}documentation{linkend}',
{
linkstart: '<a ...>',
linkend: '</a>',
},
// No number
undefined,
{
// Do not escape the result as we want the HTML anchor element
escape: false,
}
)
t
and n
for translate
and translatePlural
Changelog
2.2.0 - 2023-06-26
isRTL
was added to check whether a given, or the current, language is read right-to-left #639 (susnux)node16
or nodenext
module resolution #633 (susnux)NextcloudWindowWithRegistry
type for Nextcloud 27 #640 (susnux)loadTranslations
by handling edge cases where invalid data is retrieved #644 (susnux)Changelog
2.1.0 - 2023-02-25
Translations
type and add missing documentation #566 (susnux)Changelog
1.6.0 - 2022-05-10
getLocale
and getLanguage