@markuplint/i18n 4.0.0-dev.0 → 4.0.0-dev.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/$schema.json +2 -0
- package/LICENSE +1 -1
- package/cjs/translator.js +2 -1
- package/esm/translator.mjs +2 -1
- package/locales/ja.json +2 -0
- package/package.json +2 -2
package/$schema.json
CHANGED
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"c:obsolete": { "type": "string" },
|
|
51
51
|
"character": { "type": "string" },
|
|
52
52
|
"characters": { "type": "string" },
|
|
53
|
+
"child element": { "type": "string" },
|
|
53
54
|
"class name": { "type": "string" },
|
|
54
55
|
"code block": { "type": "string" },
|
|
55
56
|
"colon": { "type": "string" },
|
|
@@ -212,6 +213,7 @@
|
|
|
212
213
|
"{0} or more chars": { "type": "string" },
|
|
213
214
|
"{0} or more digits": { "type": "string" },
|
|
214
215
|
"{0} part of {1}": { "type": "string" },
|
|
216
|
+
"{0} requires {1}": { "type": "string" },
|
|
215
217
|
"{0} should {1}": { "type": "string" },
|
|
216
218
|
"{0} should associate with {1}": { "type": "string" },
|
|
217
219
|
"{0} should be {1}": { "type": "string" },
|
package/LICENSE
CHANGED
package/cjs/translator.js
CHANGED
|
@@ -25,7 +25,8 @@ function translator(localeSet) {
|
|
|
25
25
|
/(?<={)\d+(?=\*})/g),
|
|
26
26
|
].map(m => m[0]));
|
|
27
27
|
const key = removeNoTranslateMark(messageTmpl).toLowerCase();
|
|
28
|
-
const
|
|
28
|
+
const sentences = Object.entries(localeSet?.sentences ?? {});
|
|
29
|
+
const sentence = sentences.find(([sentenceKey]) => sentenceKey.toLowerCase() === key)?.[1];
|
|
29
30
|
messageTmpl = sentence ?? key;
|
|
30
31
|
messageTmpl =
|
|
31
32
|
removeNoTranslateMark(input.toLowerCase()) === messageTmpl ? removeNoTranslateMark(input) : messageTmpl;
|
package/esm/translator.mjs
CHANGED
|
@@ -22,7 +22,8 @@ export function translator(localeSet) {
|
|
|
22
22
|
/(?<={)\d+(?=\*})/g),
|
|
23
23
|
].map(m => m[0]));
|
|
24
24
|
const key = removeNoTranslateMark(messageTmpl).toLowerCase();
|
|
25
|
-
const
|
|
25
|
+
const sentences = Object.entries(localeSet?.sentences ?? {});
|
|
26
|
+
const sentence = sentences.find(([sentenceKey]) => sentenceKey.toLowerCase() === key)?.[1];
|
|
26
27
|
messageTmpl = sentence ?? key;
|
|
27
28
|
messageTmpl =
|
|
28
29
|
removeNoTranslateMark(input.toLowerCase()) === messageTmpl ? removeNoTranslateMark(input) : messageTmpl;
|
package/locales/ja.json
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"c:obsolete": "は廃止されています",
|
|
39
39
|
"character": "文字",
|
|
40
40
|
"characters": "文字",
|
|
41
|
+
"child element": "子要素",
|
|
41
42
|
"class name": "クラス名",
|
|
42
43
|
"code block": "コードブロック",
|
|
43
44
|
"colon": "コロン",
|
|
@@ -196,6 +197,7 @@
|
|
|
196
197
|
"{0} or more chars": "{0}文字以上",
|
|
197
198
|
"{0} or more digits": "{0}桁以上",
|
|
198
199
|
"{0} part of {1}": "{1}の{0}の部分",
|
|
200
|
+
"{0} requires {1}": "{0}に{1}が必要です",
|
|
199
201
|
"{0} should {1}": "{0}は{1}したほうがよいです",
|
|
200
202
|
"{0} should associate with {1}": "{0}は{1}と関連付けたほうがよいです",
|
|
201
203
|
"{0} should be {1}": "{0}は{1}にしたほうがよいです",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/i18n",
|
|
3
|
-
"version": "4.0.0-dev.
|
|
3
|
+
"version": "4.0.0-dev.12+2275fbeb0",
|
|
4
4
|
"description": "Internationalization for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"build:cjs": "tsc --module commonjs --outDir cjs",
|
|
38
38
|
"clean": "tsc --build --clean"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "2275fbeb053605b636f080f4fafd7cd4fc57a9a3"
|
|
41
41
|
}
|