@markuplint/i18n 4.0.0-dev.20 → 4.0.0-dev.23

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 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
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2023 Yusuke Hirao
3
+ Copyright (c) 2017-2024 Yusuke Hirao
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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 sentence = localeSet?.sentences?.[key];
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;
@@ -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 sentence = localeSet?.sentences?.[key];
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.20+6b35da16",
3
+ "version": "4.0.0-dev.23+d6f2aa9bc",
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": "6b35da161d94f784953d0adecc2d28502052d92a"
40
+ "gitHead": "d6f2aa9bc287768466f23b5340e4e0eecfa30d59"
41
41
  }