@markuplint/i18n
Advanced tools
@@ -6,4 +6,2 @@ import type { LocaleSet, Primitive, Translator } from './types'; | ||
| */ | ||
| export declare function taggedTemplateTranslator( | ||
| localeSet?: LocaleSet, | ||
| ): (strings: TemplateStringsArray, ...keys: Primitive[]) => string; | ||
| export declare function taggedTemplateTranslator(localeSet?: LocaleSet): (strings: Readonly<TemplateStringsArray>, ...keys: readonly Primitive[]) => string; |
@@ -13,3 +13,3 @@ "use strict"; | ||
| let message = messageTmpl; | ||
| if (Array.isArray(messageTmpl)) { | ||
| if (typeof messageTmpl !== 'string') { | ||
| const format = (localeSet === null || localeSet === void 0 ? void 0 : localeSet.listFormat) || defaultListFormat; | ||
@@ -16,0 +16,0 @@ return `${format.quoteStart}${messageTmpl |
+9
-9
@@ -1,16 +0,16 @@ | ||
| export type Translator = (messageTmpl: string | string[], ...keywords: Primitive[]) => string; | ||
| export type Translator = (messageTmpl: string | readonly string[], ...keywords: readonly Primitive[]) => string; | ||
| export type LocaleSet = { | ||
| locale: string; | ||
| listFormat?: ListFormat; | ||
| keywords?: LocalesKeywords; | ||
| sentences?: LocalesKeywords; | ||
| readonly locale: string; | ||
| readonly listFormat?: ListFormat; | ||
| readonly keywords?: LocalesKeywords; | ||
| readonly sentences?: LocalesKeywords; | ||
| }; | ||
| export type ListFormat = { | ||
| quoteStart: string; | ||
| quoteEnd: string; | ||
| separator: string; | ||
| readonly quoteStart: string; | ||
| readonly quoteEnd: string; | ||
| readonly separator: string; | ||
| }; | ||
| export type Primitive = string | number | boolean; | ||
| export type LocalesKeywords = { | ||
| [messageId: string]: string | void; | ||
| readonly [messageId: string]: string; | ||
| }; |
+2
-2
| { | ||
| "name": "@markuplint/i18n", | ||
| "version": "3.4.0", | ||
| "version": "3.5.0", | ||
| "description": "HTML parser for markuplint", | ||
@@ -21,3 +21,3 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
| }, | ||
| "gitHead": "a83e0f5f214a9bbcc0286b9e269074ddca6189e7" | ||
| "gitHead": "0c47b2c2722f6823a17f36edbab98486275f8ab4" | ||
| } |
34026
0.37%686
-0.29%