All notable changes to this project will be documented in this file.
- Fix array order inconsistencies for weekdays when using timezone with negative offset #958 (Sector6759)
- Updated development dependencies
- chore: update Node and NPM dev versions to align with apps #960 (susnux)
- feat: add support for universal environment #933 (susnux)
- feat(gettext): allow to add translations to the wrapper #953 (susnux)
- chore: update ESLint to v9 and adjust code style #955 (susnux)
- chore: update support Node versions and use
devEngines#954 (susnux) - Updated development dependencies
- The Node version was increased to current LTS version 22.
- The
callbackparameter of theloadTranslationsmethod is deprecated. Instead just use the returned promise likeloadTranslations('app').then(callback).
- fix: export types used in gettext exports #905 (susnux)
- fix(translations): use language instead of locale + refactor the
loadTranslationsmethod #927 (susnux) - fix(locale): fallback to device preferences instead of 'en' #864 (ShGKme)
- refactor: simplify
loadTranslations#928 (susnux) - chore(deps): drop unnecessary @types/dompurify #903 (max-nextcloud)
- docs(readme): update badges #904 (st3iny)
- chore(deps): Bump dompurify to 3.2.6
- Bump development dependencies
The GettextBuilder.detectLocale method is deprecated and will be removed in the next major version.
It is replaced with the detectLanguage method to make the method naming more consistent.
- feat(date): fallback to Intl #831 (ShGKme)
- feat(gettext): Add
detectLanguagemethod and deprecatedetectLocale#850 (susnux) - feat: Overload translate function to either allow number or placeholder as third arg #854 (susnux)
- fix(types): type translation variable keys #807 (ShGKme)
- fix(isRTL): Correctly handle Urdu and Uzbek Afghan #855 (susnux)
- fix(registry): Prevent prototype polluting #860 (susnux)
- refactor(gettext): Drop
node-gettextdependency and use our translation logic #851 (susnux) - license: Add SPDX header #781 (AndyScherzinger)
- chore: Add missing trailing comma in vite config #852 (susnux)
- docs: Clarify readme about Nextcloud provided and custom translations #853 (susnux)
- docs: improve return type of getFirstDay() #784 (st3iny)
- docs: replace missing exports plugin to also document internal types #846 (susnux)
- ci: Update from org #795 (AndyScherzinger)
- ci: Update workflows from organization #847 (susnux)
- chore(deps): Bump
dompurifyand@types/dompurify - chore(dev-deps): Update development dependencies
- Allow setting
escapeoption per parameter replacing.
For more security this should be used instead of disabling paramter escaping, see pull request #756// 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, } }, )
- Ensure that built type definitions are bundled with the release and located in the correct directory
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,
}
)- feat: export aliases
tandnfortranslateandtranslatePlural
- fix!: Only sanitize the result string when replacing variables
- 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 to 1.8.0
- chore(deps): Bump dompurify to 3.1.1
- chore(deps): Bump @nextcloud/router to 3.0.1
isRTLwas added to check whether a given, or the current, language is read right-to-left #639 (susnux)
- Add typings to the package exports to fix build for Typescript projects using
node16ornodenextmodule resolution #633 (susnux) - Update exported
NextcloudWindowWithRegistrytype for Nextcloud 27 #640 (susnux) - Harden
loadTranslationsby handling edge cases where invalid data is retrieved #644 (susnux)
- Update node engines to next LTS (Node 20 + NPM 9)
- Dependency updates
- Export the
Translationstype and add missing documentation #566 (susnux) - Fix singular translation in edge cases where plural strings are provided #570 (susnux)
- Make loading translations use async XMLHttpRequest #571 (susnux)
- Removed warning "no app translation was registered" #572 (ShGKme)
- Added tests and increased code coverage
- Dependency updates
- fix(config): fix npmignore config #563 (skjnldsv)
- fix(config): fix tsconfig out dir typings #562 (skjnldsv)
- Fix standalone registration #556 (ShGKme)
- Dependency updates
From 2.0.0, this package is standalone and do not rely on window OC variables to function.
- Provide all translation related functions #542 (susnux)
- Fix building and deploying documentation #546 (susnux)
- Dependency updates
- Remove dependency on OC for
getLocaleandgetLanguage
Superseeded by v1.6.0 as the release was empty.
- Dependency updates
- Language detection of languages that have a
_in their code (#172)
- Nextcloud 20 support
- Dependency updates
- getCanonicalLocale
- Dependency updates
- Dependency updates
- Source locale of translations is now set to 'en', so fewer warnings are printed
- Update vulnerable packages
- Dependency updates
- Update vulnerable packages
- Optional debug mode with logging, no console.warn for production builds
- Dependency updates
- Dependency updates
- Update vulnerable packages
- Gettext-based translation helpers for Nextcloud-independent translations (mostly for libraries)
- Updated documentation
- Updated dependencies
- Translate
escapeoption typo
- Updated documentation