@markuplint/i18n
Advanced tools
Comparing version 1.0.0-alpha.7 to 1.0.0-alpha.8
@@ -17,4 +17,5 @@ { | ||
"attribute id value": { "type": "string" }, | ||
"{$} attribute": { "type": "string" }, | ||
"element": { "type": "string" }, | ||
"html elements": { "type": "string" }, | ||
"class name": { "type": "string" }, | ||
"quote": { "type": "string" }, | ||
@@ -27,9 +28,20 @@ "double quotation mark": { "type": "string" }, | ||
"escape in character reference": { "type": "string" }, | ||
"declarate": { "type": "string" }, | ||
"deprecated": { "type": "string" }, | ||
"obsolete": { "type": "string" }, | ||
"indentation": { "type": "string" }, | ||
"tab": { "type": "string" }, | ||
"space": { "type": "string" } | ||
"space": { "type": "string" }, | ||
"break line": { "type": "string" }, | ||
"line break": { "type": "string" }, | ||
"equal sign": { "type": "string" }, | ||
"doctype": { "type": "string" }, | ||
"obsolete doctype": { "type": "string" }, | ||
"top level": { "type": "string" }, | ||
"the html specification": { "type": "string" }, | ||
"settings": { "type": "string" } | ||
} | ||
}, | ||
"{0} is {1}": { "type": "string" }, | ||
"The {0} {1} is {2}": { "type": "string" }, | ||
"Required {0}": { "type": "string" }, | ||
@@ -40,2 +52,4 @@ "Required {0} on {1}": { "type": "string" }, | ||
"Duplicate {0}": { "type": "string" }, | ||
"Missing the {0} {1}": { "type": "string" }, | ||
"Duplicate the {0} {1}": { "type": "string" }, | ||
"{0} is must {1} on {2}": { "type": "string" }, | ||
@@ -48,5 +62,19 @@ "{0} must {1}": { "type": "string" }, | ||
"{0} of {1} should be {2}": { "type": "string" }, | ||
"Never {0}": { "type": "string" }, | ||
"Insert {0}": { "type": "string" }, | ||
"Never {0} {1}": { "type": "string" }, | ||
"Values allowed for {0} attributes are {$}": { "type": "string" }, | ||
"{0} width spaces": { "type": "string" } | ||
"{0} width spaces": { "type": "string" }, | ||
"Always insert {0} before {1} of {2}": { "type": "string" }, | ||
"Never insert {0} before {1} of {2}": { "type": "string" }, | ||
"Always insert {0} after {1} of {2}": { "type": "string" }, | ||
"Never insert {0} after {1} of {2}": { "type": "string" }, | ||
"{0} {1} is unmatched patterns ({2})": { "type": "string" }, | ||
"Should increase indentation": { "type": "string" }, | ||
"Should decrease indentation": { "type": "string" }, | ||
"Start tag and end tag indentation should align": { "type": "string" }, | ||
"Should have a unique label because {0} landmarks were markup more than once on a page": { "type": "string" }, | ||
"The {0} element must be descendant of the {1} element": { "type": "string" }, | ||
"Invalid content of the {0} element in {1}": { "type": "string" } | ||
} | ||
} |
export declare type Primitive = string | number | boolean; | ||
export declare type Message = (messageTmpl: string, ...keywords: Primitive[]) => string; | ||
export declare type Translator = (messageTmpl: string, ...keywords: Primitive[]) => string; | ||
export interface LocaleSet { | ||
@@ -10,8 +10,8 @@ keywords: LocalesKeywords; | ||
} | ||
export declare class Messenger { | ||
export declare class I18n { | ||
private static _singleton; | ||
static create(localeSet: LocaleSet | null): Promise<Messenger>; | ||
static create(localeSet: LocaleSet | null): Promise<I18n>; | ||
localeSet: LocaleSet | null; | ||
private constructor(); | ||
message(): Message; | ||
translator(): Translator; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
class Messenger { | ||
class I18n { | ||
constructor(localeSet) { | ||
@@ -8,11 +8,11 @@ this.localeSet = localeSet; | ||
static async create(localeSet) { | ||
if (!Messenger._singleton) { | ||
Messenger._singleton = new Messenger(localeSet); | ||
if (!I18n._singleton) { | ||
I18n._singleton = new I18n(localeSet); | ||
} | ||
else { | ||
Messenger._singleton.localeSet = localeSet; | ||
I18n._singleton.localeSet = localeSet; | ||
} | ||
return Messenger._singleton; | ||
return I18n._singleton; | ||
} | ||
message() { | ||
translator() { | ||
const localeSet = this.localeSet; | ||
@@ -38,3 +38,3 @@ return (messageTmpl, ...keywords) => { | ||
} | ||
exports.Messenger = Messenger; | ||
Messenger._singleton = null; | ||
exports.I18n = I18n; | ||
I18n._singleton = null; |
@@ -11,4 +11,5 @@ { | ||
"attribute id value": "id属性の値", | ||
"{$} attribute": "{$}属性", | ||
"element": "要素", | ||
"html elements": "HTML要素", | ||
"class name": "クラス名", | ||
"quote": "囲う", | ||
@@ -21,8 +22,19 @@ "double quotation mark": "ダブルクオーテーション", | ||
"escape in character reference": "参照文字でエスケープ", | ||
"declarate": "宣言", | ||
"deprecated": "非推奨", | ||
"obsolete": "廃止ずみ", | ||
"indentation": "インデント", | ||
"tab": "タブ", | ||
"space": "スペース" | ||
"space": "スペース", | ||
"break line": "改行", | ||
"line break": "改行", | ||
"equal sign": "等号", | ||
"doctype": "文書型", | ||
"obsolete doctype": "廃止された文書型", | ||
"top level": "トップレベル", | ||
"the html specification": "HTMLの仕様", | ||
"settings": "設定" | ||
}, | ||
"{0} is {1}": "{0}は{1}です。", | ||
"{0} is {1}": "{0}は{1}です", | ||
"The {0} {1} is {2}": "{0}{1}は{2}です", | ||
"Required {0}": "{0}が必要です", | ||
@@ -32,12 +44,28 @@ "Required {0} on {1}": "{1}には{0}が必要です", | ||
"Not required {0} on {1}": "{1}には{0}は不要です", | ||
"Duplicate {0}": "{0}が重複しています。", | ||
"{0} is must {1} on {2}": "{0}は{2}で{1}べきです。", | ||
"{0} must {1}": "{0}は{1}するべきです。", | ||
"{0} should {1}": "{0}は{1}してください。", | ||
"{0} must be {1}": "{0}は{1}にするべきです。", | ||
"{0} should be {1}": "{0}は{1}にしてください。", | ||
"{0} of {1} must be {2}": "{1}の{0}は{2}にするべきです。", | ||
"{0} of {1} should be {2}": "{1}の{0}は{2}にしてください。", | ||
"Values allowed for {0} attributes are {$}": "{0}属性に許可される値は{$}です。", | ||
"{0} width spaces": "{0}幅スペース" | ||
"Duplicate {0}": "{0}が重複しています", | ||
"Missing the {0} {1}": "{0}{1}が見つかりません", | ||
"Duplicate the {0} {1}": "{0}{1}が重複しています", | ||
"{0} is must {1} on {2}": "{0}は{2}で{1}べきです", | ||
"{0} must {1}": "{0}は{1}するべきです", | ||
"{0} should {1}": "{0}は{1}してください", | ||
"{0} must be {1}": "{0}は{1}にするべきです", | ||
"{0} should be {1}": "{0}は{1}にしてください", | ||
"{0} of {1} must be {2}": "{1}の{0}は{2}にするべきです", | ||
"{0} of {1} should be {2}": "{1}の{0}は{2}にしてください", | ||
"Never {0}": "{0}しないでください", | ||
"Insert {0}": "{0}を入れてください", | ||
"Never {0} {1}": "{1}を{0}しないでください", | ||
"Values allowed for {0} attributes are {$}": "{0}属性に許可される値は{$}です", | ||
"{0} width spaces": "{0}幅スペース", | ||
"Always insert {0} before {1} of {2}": "{2}の{1}の前には{0}を入れてください", | ||
"Never insert {0} before {1} of {2}": "{2}の{1}の前には{0}を入れないでください", | ||
"Always insert {0} after {1} of {2}": "{2}の{1}の後には{0}を入れてください", | ||
"Never insert {0} after {1} of {2}": "{2}の{1}の後には{0}を入れないでください", | ||
"{0} {1} is unmatched patterns ({2})": "{1}{0}は次のパターンにマッチしませんでした {2}", | ||
"Should increase indentation": "インデントを下げてください", | ||
"Should decrease indentation": "インデントを上げてください", | ||
"Start tag and end tag indentation should align": "開始タグと終了タグのインデントを揃えてください", | ||
"Should have a unique label because {0} landmarks were markup more than once on a page": "{0}ランドマークが複数回マークアップされているため一意のラベルが必要です", | ||
"The {0} element must be descendant of the {1} element": "{0}要素は{1}要素の子孫でなければなりません", | ||
"Invalid content of the {0} element in {1}": "{1}において{0}要素の内容が不正です" | ||
} |
{ | ||
"name": "@markuplint/i18n", | ||
"version": "1.0.0-alpha.7", | ||
"version": "1.0.0-alpha.8", | ||
"description": "HTML parser for markuplint", | ||
@@ -18,3 +18,3 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
}, | ||
"gitHead": "c2da0ad45aeda5c0bc9dfdc7a819cc65d8f3a185" | ||
"gitHead": "29707f9a60778eba2343c472316767c522a41ed4" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
139959
9
205