Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nextcloud/l10n

Package Overview
Dependencies
Maintainers
13
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nextcloud/l10n - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

26

CHANGELOG.md
# 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](https://github.com/nextcloud-libraries/nextcloud-l10n/pull/756)
```js
// 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

@@ -5,0 +31,0 @@

16

dist/index.d.ts

@@ -103,5 +103,8 @@ /// <reference types="@nextcloud/typings" />

* @param {object} [options] options object
* @param {boolean} options.escape enable/disable auto escape of placeholders (by default enabled)
* @param {boolean} options.sanitize enable/disable sanitization (by default enabled)
*
* @return {string}
*/
declare function translate(app: string, text: string, vars?: Record<string, string | number>, number?: number, options?: TranslationOptions): string;
declare function translate(app: string, text: string, vars?: TranslationVariables, number?: number, options?: TranslationOptions): string;
export { translate as t }

@@ -148,2 +151,13 @@ export { translate }

/** @notExported */
declare interface TranslationVariableReplacementObject<T> {
/** The value to use for the replacement */
value: T;
/** Overwrite the `escape` option just for this replacement */
escape: boolean;
}
/** @notExported */
declare type TranslationVariables = Record<string, string | number | TranslationVariableReplacementObject<string | number>>;
/**

@@ -150,0 +164,0 @@ * Unregister all translations of an app

2

package.json
{
"name": "@nextcloud/l10n",
"version": "3.0.1",
"version": "3.1.0",
"description": "Nextcloud L10n helpers for apps and libraries",

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc