nextcloud-libraries/nextcloud-l10n (@nextcloud/l10n)
### [`v3.1.0`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#310---2024-05-07)
[Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v3.0.1...v3.1.0)
##### Added
- Allow setting `escape` option per parameter replacing.\
For more security this should be used instead of disabling paramter escaping,
see [pull request #756](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/756)
```js
// Example
t(
'my-app',
'{a}{userInput}{a_end}',
{
a: {
value: '',
escape: false,
},
userInput: somePossiblyInsecureValue, // This will be escaped
a_end: {
value: '',
escape: false,
}
},
)
```
### [`v3.0.1`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#301---2024-05-04)
[Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v3.0.0...v3.0.1)
##### Fixed
- Ensure that built type definitions are bundled with the release and located in the correct directory
### [`v3.0.0`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#300---2024-05-02)
[Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.2.0...v3.0.0)
[Full Changelog](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.2.0...v3.0.0)
##### Breaking changes
Instead of also sanitizing the replacing variables, now only the result is sanitized, see [pull request #648](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/648).
This will improve the performance if multiple placeholders are used and it allows this,
while the string is still sanitized:
```js
t(
'See {linkstart}documentation{linkend}',
{
linkstart: '',
linkend: '',
},
// No number
undefined,
{
// Do not escape the result as we want the HTML anchor element
escape: false,
}
)
```
##### Added
- feat: export aliases `t` and `n` for `translate` and `translatePlural`
##### Fixed
- fix!: Only sanitize the result string when replacing variables
##### Changed
- Update NPM to latest LTS v10
- Migrate to vite for transpiling and vitest for testing
- chore: Added more tests for special cases on plural forms
- chore(deps): Bump tough-cookie to 4.1.3
- chore(deps): Bump postcss to 8.4.31
- chore(deps): Bump [@nextcloud/typings](https://togithub.com/nextcloud/typings) to 1.8.0
- chore(deps): Bump dompurify to 3.1.1
- chore(deps): Bump [@nextcloud/router](https://togithub.com/nextcloud/router) to 3.0.1
### [`v2.2.0`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#220---2023-06-26)
[Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.1.0...v2.2.0)
[Full Changelog](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.1.0...v2.2.0)
##### Added
- `isRTL` was added to check whether a given, or the current, language is read right-to-left [#639](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/639) ([susnux](https://togithub.com/susnux))
##### Fixed
- Add typings to the package exports to fix build for Typescript projects using `node16` or `nodenext` module resolution [#633](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/633) ([susnux](https://togithub.com/susnux))
- Update exported `NextcloudWindowWithRegistry` type for Nextcloud 27 [#640](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/640) ([susnux](https://togithub.com/susnux))
- Harden `loadTranslations` by handling edge cases where invalid data is retrieved [#644](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/644) ([susnux](https://togithub.com/susnux))
##### Changed
- Update node engines to next LTS (Node 20 + NPM 9)
- Dependency updates
### [`v2.1.0`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#210---2023-02-25)
[Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.0.1...v2.1.0)
[Full Changelog](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.0.1...v2.1.0)
##### Added
- `unregister` is now part of the public API [#579](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/579) ([susnux](https://togithub.com/susnux))
##### Fixed
- Export the `Translations` type and add missing documentation [#566](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/566) ([susnux](https://togithub.com/susnux))
- Fix singular translation in edge cases where plural strings are provided [#570](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/570) ([susnux](https://togithub.com/susnux))
- Make loading translations use async XMLHttpRequest [#571](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/571) ([susnux](https://togithub.com/susnux))
- Removed warning "no app translation was registered" [#572](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/572) ([ShGKme](https://togithub.com/ShGKme))
##### Changed
- Added tests and increased code coverage
- Dependency updates
### [`v2.0.1`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#201---2023-01-19)
[Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.0.0...v2.0.1)
[Full Changelog](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.0.0...v2.0.1)
##### Fixed
- fix(config): fix npmignore config [#563](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/563) ([skjnldsv](https://togithub.com/skjnldsv))
- fix(config): fix tsconfig out dir typings [#562](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/562) ([skjnldsv](https://togithub.com/skjnldsv))
- Fix standalone registration [#556](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/556) ([ShGKme](https://togithub.com/ShGKme))
##### Changed
- Dependency updates
### [`v2.0.0`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#200---2023-01-12)
[Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v1.6.0...v2.0.0)
[Full Changelog](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v1.6.0...v2.0.0)
##### Changed
From 2.0.0, this package is standalone and do not rely on window OC variables to function.
##### Fixed
- Provide all translation related functions [#542](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/542) ([susnux](https://togithub.com/susnux))
- Fix building and deploying documentation [#546](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/546) ([susnux](https://togithub.com/susnux))
Configuration
📅 Schedule: Branch creation - "before 3am on saturday" in timezone Europe/Berlin, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
[ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
^1.4 \|\| ^2.0
->^1.4 \|\| ^2.0 \|\| ^3.0.0
Release Notes
nextcloud-libraries/nextcloud-l10n (@nextcloud/l10n)
### [`v3.1.0`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#310---2024-05-07) [Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v3.0.1...v3.1.0) ##### Added - Allow setting `escape` option per parameter replacing.\ For more security this should be used instead of disabling paramter escaping, see [pull request #756](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/756) ```js // Example t( 'my-app', '{a}{userInput}{a_end}', { a: { value: '', escape: false, }, userInput: somePossiblyInsecureValue, // This will be escaped a_end: { value: '', escape: false, } }, ) ``` ### [`v3.0.1`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#301---2024-05-04) [Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v3.0.0...v3.0.1) ##### Fixed - Ensure that built type definitions are bundled with the release and located in the correct directory ### [`v3.0.0`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#300---2024-05-02) [Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.2.0...v3.0.0) [Full Changelog](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.2.0...v3.0.0) ##### Breaking changes Instead of also sanitizing the replacing variables, now only the result is sanitized, see [pull request #648](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/648). This will improve the performance if multiple placeholders are used and it allows this, while the string is still sanitized: ```js t( 'See {linkstart}documentation{linkend}', { linkstart: '', linkend: '', }, // No number undefined, { // Do not escape the result as we want the HTML anchor element escape: false, } ) ``` ##### Added - feat: export aliases `t` and `n` for `translate` and `translatePlural` ##### Fixed - fix!: Only sanitize the result string when replacing variables ##### Changed - Update NPM to latest LTS v10 - Migrate to vite for transpiling and vitest for testing - chore: Added more tests for special cases on plural forms - chore(deps): Bump tough-cookie to 4.1.3 - chore(deps): Bump postcss to 8.4.31 - chore(deps): Bump [@nextcloud/typings](https://togithub.com/nextcloud/typings) to 1.8.0 - chore(deps): Bump dompurify to 3.1.1 - chore(deps): Bump [@nextcloud/router](https://togithub.com/nextcloud/router) to 3.0.1 ### [`v2.2.0`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#220---2023-06-26) [Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.1.0...v2.2.0) [Full Changelog](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.1.0...v2.2.0) ##### Added - `isRTL` was added to check whether a given, or the current, language is read right-to-left [#639](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/639) ([susnux](https://togithub.com/susnux)) ##### Fixed - Add typings to the package exports to fix build for Typescript projects using `node16` or `nodenext` module resolution [#633](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/633) ([susnux](https://togithub.com/susnux)) - Update exported `NextcloudWindowWithRegistry` type for Nextcloud 27 [#640](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/640) ([susnux](https://togithub.com/susnux)) - Harden `loadTranslations` by handling edge cases where invalid data is retrieved [#644](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/644) ([susnux](https://togithub.com/susnux)) ##### Changed - Update node engines to next LTS (Node 20 + NPM 9) - Dependency updates ### [`v2.1.0`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#210---2023-02-25) [Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.0.1...v2.1.0) [Full Changelog](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.0.1...v2.1.0) ##### Added - `unregister` is now part of the public API [#579](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/579) ([susnux](https://togithub.com/susnux)) ##### Fixed - Export the `Translations` type and add missing documentation [#566](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/566) ([susnux](https://togithub.com/susnux)) - Fix singular translation in edge cases where plural strings are provided [#570](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/570) ([susnux](https://togithub.com/susnux)) - Make loading translations use async XMLHttpRequest [#571](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/571) ([susnux](https://togithub.com/susnux)) - Removed warning "no app translation was registered" [#572](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/572) ([ShGKme](https://togithub.com/ShGKme)) ##### Changed - Added tests and increased code coverage - Dependency updates ### [`v2.0.1`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#201---2023-01-19) [Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.0.0...v2.0.1) [Full Changelog](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v2.0.0...v2.0.1) ##### Fixed - fix(config): fix npmignore config [#563](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/563) ([skjnldsv](https://togithub.com/skjnldsv)) - fix(config): fix tsconfig out dir typings [#562](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/562) ([skjnldsv](https://togithub.com/skjnldsv)) - Fix standalone registration [#556](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/556) ([ShGKme](https://togithub.com/ShGKme)) ##### Changed - Dependency updates ### [`v2.0.0`](https://togithub.com/nextcloud-libraries/nextcloud-l10n/blob/HEAD/CHANGELOG.md#200---2023-01-12) [Compare Source](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v1.6.0...v2.0.0) [Full Changelog](https://togithub.com/nextcloud-libraries/nextcloud-l10n/compare/v1.6.0...v2.0.0) ##### Changed From 2.0.0, this package is standalone and do not rely on window OC variables to function. ##### Fixed - Provide all translation related functions [#542](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/542) ([susnux](https://togithub.com/susnux)) - Fix building and deploying documentation [#546](https://togithub.com/nextcloud-libraries/nextcloud-l10n/pull/546) ([susnux](https://togithub.com/susnux))Configuration
📅 Schedule: Branch creation - "before 3am on saturday" in timezone Europe/Berlin, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate. View repository job log here.