Skip to content

Latest commit

 

History

History
195 lines (155 loc) · 6.36 KB

CHANGELOG.md

File metadata and controls

195 lines (155 loc) · 6.36 KB

Changelog

All notable changes to this project will be documented in this file.

3.1.0 - 2024-05-07

Added

  • Allow setting escape option 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,
    		}
    	},
    )

3.0.1 - 2024-05-04

Fixed

  • Ensure that built type definitions are bundled with the release and located in the correct directory

3.0.0 - 2024-05-02

Full Changelog

Breaking changes

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,
	}
)

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 to 1.8.0
  • chore(deps): Bump dompurify to 3.1.1
  • chore(deps): Bump @nextcloud/router to 3.0.1

2.2.0 - 2023-06-26

Full Changelog

Added

  • isRTL was added to check whether a given, or the current, language is read right-to-left #639 (susnux)

Fixed

  • Add typings to the package exports to fix build for Typescript projects using node16 or nodenext module resolution #633 (susnux)
  • Update exported NextcloudWindowWithRegistry type for Nextcloud 27 #640 (susnux)
  • Harden loadTranslations by handling edge cases where invalid data is retrieved #644 (susnux)

Changed

  • Update node engines to next LTS (Node 20 + NPM 9)
  • Dependency updates

2.1.0 - 2023-02-25

Full Changelog

Added

  • unregister is now part of the public API #579 (susnux)

Fixed

  • Export the Translations type 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)

Changed

  • Added tests and increased code coverage
  • Dependency updates

2.0.1 - 2023-01-19

Full Changelog

Fixed

Changed

  • Dependency updates

2.0.0 - 2023-01-12

Full Changelog

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 (susnux)
  • Fix building and deploying documentation #546 (susnux)

1.6.0 - 2022-05-10

Changed

  • Dependency updates
  • Remove dependency on OC for getLocale and getLanguage

1.5.0 - 2022-05-10

Superseeded by v1.6.0 as the release was empty.

1.4.1 - 2020-09-07

Changed

  • Dependency updates

Fixed

  • Language detection of languages that have a _ in their code (#172)

1.4.0 - 2020-08-31

Added

  • Nextcloud 20 support

Changed

  • Dependency updates

1.3.0 - 2020-06-04

Added

  • getCanonicalLocale

Changed

  • Dependency updates

1.2.3 - 2020-04-08

Changed

  • Dependency updates

Fixed

  • Source locale of translations is now set to 'en', so fewer warnings are printed

1.2.2 - 2020-04-06

Fixed

  • Update vulnerable packages

1.2.1 - 2020-04-06

Changed

  • Dependency updates

Fixed

  • Update vulnerable packages

1.2.0 - 2020-03-19

Added

  • Optional debug mode with logging, no console.warn for production builds

Changed

  • Dependency updates

1.1.1 - 2020-03-19

Changed

  • Dependency updates

Fixed

  • Update vulnerable packages

1.1.0 - 2020-02-21

Added

  • Gettext-based translation helpers for Nextcloud-independent translations (mostly for libraries)

Changed

  • Updated documentation
  • Updated dependencies

1.0.1 - 2020-01-08

Fixed

  • Translate escape option typo

Changed

  • Updated documentation