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

@markuplint/i18n

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@markuplint/i18n - npm Package Compare versions

Comparing version 3.5.0 to 3.6.0

4

lib/translator.d.ts

@@ -6,2 +6,4 @@ import type { LocaleSet, Primitive, Translator } from './types';

*/
export declare function taggedTemplateTranslator(localeSet?: LocaleSet): (strings: Readonly<TemplateStringsArray>, ...keys: readonly Primitive[]) => string;
export declare function taggedTemplateTranslator(
localeSet?: LocaleSet,
): (strings: Readonly<TemplateStringsArray>, ...keys: readonly Primitive[]) => string;

@@ -11,6 +11,6 @@ "use strict";

return (messageTmpl, ...keywords) => {
var _a;
var _a, _b;
let message = messageTmpl;
if (typeof messageTmpl !== 'string') {
const format = (localeSet === null || localeSet === void 0 ? void 0 : localeSet.listFormat) || defaultListFormat;
const format = (_a = localeSet === null || localeSet === void 0 ? void 0 : localeSet.listFormat) !== null && _a !== void 0 ? _a : defaultListFormat;
return `${format.quoteStart}${messageTmpl

@@ -26,3 +26,3 @@ .map(keyword => translateKeyword(keyword, '', localeSet))

const key = removeNoTranslateMark(messageTmpl).toLowerCase();
const sentence = (_a = localeSet === null || localeSet === void 0 ? void 0 : localeSet.sentences) === null || _a === void 0 ? void 0 : _a[key];
const sentence = (_b = localeSet === null || localeSet === void 0 ? void 0 : localeSet.sentences) === null || _b === void 0 ? void 0 : _b[key];
messageTmpl = sentence !== null && sentence !== void 0 ? sentence : key;

@@ -29,0 +29,0 @@ messageTmpl =

export type Translator = (messageTmpl: string | readonly string[], ...keywords: readonly Primitive[]) => string;
export type LocaleSet = {
readonly locale: string;
readonly listFormat?: ListFormat;
readonly keywords?: LocalesKeywords;
readonly sentences?: LocalesKeywords;
readonly locale: string;
readonly listFormat?: ListFormat;
readonly keywords?: LocalesKeywords;
readonly sentences?: LocalesKeywords;
};
export type ListFormat = {
readonly quoteStart: string;
readonly quoteEnd: string;
readonly separator: string;
readonly quoteStart: string;
readonly quoteEnd: string;
readonly separator: string;
};
export type Primitive = string | number | boolean;
export type LocalesKeywords = {
readonly [messageId: string]: string;
readonly [messageId: string]: string;
};
{
"name": "@markuplint/i18n",
"version": "3.5.0",
"version": "3.6.0",
"description": "HTML parser for markuplint",

@@ -21,3 +21,3 @@ "repository": "git@github.com:markuplint/markuplint.git",

},
"gitHead": "0c47b2c2722f6823a17f36edbab98486275f8ab4"
"gitHead": "715dd53d3b1064a9bcf616c1533921cad9e3b187"
}
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