@markuplint/i18n 3.0.0-alpha.6 → 3.0.0-rc.0
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/README.md +9 -3
- package/lib/translator.d.ts +1 -3
- package/lib/types.d.ts +8 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
# @markuplint/i18n
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@markuplint/i18n)
|
|
4
|
-
[](https://travis-ci.org/markuplint/markuplint)
|
|
5
|
-
[](https://coveralls.io/github/markuplint/markuplint?branch=main)
|
|
6
4
|
|
|
7
5
|
## Install
|
|
8
6
|
|
|
7
|
+
[`markuplint`](https://www.npmjs.com/package/markuplint) package includes this package.
|
|
8
|
+
|
|
9
|
+
<details>
|
|
10
|
+
<summary>If you are installing purposely, how below:</summary>
|
|
11
|
+
|
|
9
12
|
```sh
|
|
10
13
|
$ npm install @markuplint/i18n
|
|
11
14
|
|
|
12
15
|
$ yarn add @markuplint/i18n
|
|
16
|
+
|
|
13
17
|
```
|
|
14
18
|
|
|
19
|
+
</details>
|
|
20
|
+
|
|
15
21
|
## API
|
|
16
22
|
|
|
17
23
|
```ts
|
|
@@ -71,7 +77,7 @@ There is a placeholder that the number is surrounded by `{}` on template strings
|
|
|
71
77
|
|
|
72
78
|
#### Tagged templates syntax
|
|
73
79
|
|
|
74
|
-
|
|
80
|
+
:warning: It is experimental.
|
|
75
81
|
|
|
76
82
|
```ts
|
|
77
83
|
import { taggedTemplateTranslator } from '@markuplint/i18n';
|
package/lib/translator.d.ts
CHANGED
|
@@ -3,6 +3,4 @@ export declare function translator(localeSet?: LocaleSet): Translator;
|
|
|
3
3
|
/**
|
|
4
4
|
* @experimental
|
|
5
5
|
*/
|
|
6
|
-
export declare function taggedTemplateTranslator(
|
|
7
|
-
localeSet?: LocaleSet,
|
|
8
|
-
): (strings: TemplateStringsArray, ...keys: Primitive[]) => string;
|
|
6
|
+
export declare function taggedTemplateTranslator(localeSet?: LocaleSet): (strings: TemplateStringsArray, ...keys: Primitive[]) => string;
|
package/lib/types.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export type Translator = (messageTmpl: string | string[], ...keywords: Primitive[]) => string;
|
|
2
2
|
export type LocaleSet = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
locale: string;
|
|
4
|
+
listFormat?: ListFormat;
|
|
5
|
+
keywords?: LocalesKeywords;
|
|
6
|
+
sentences?: LocalesKeywords;
|
|
7
7
|
};
|
|
8
8
|
export type ListFormat = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
quoteStart: string;
|
|
10
|
+
quoteEnd: string;
|
|
11
|
+
separator: string;
|
|
12
12
|
};
|
|
13
13
|
export type Primitive = string | number | boolean;
|
|
14
14
|
export type LocalesKeywords = {
|
|
15
|
-
|
|
15
|
+
[messageId: string]: string | void;
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/i18n",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-rc.0",
|
|
4
4
|
"description": "HTML parser for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"build": "tsc",
|
|
16
16
|
"clean": "tsc --build --clean"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "f2cf8f0da3900539568e2e8345bf201d41196c1f"
|
|
19
19
|
}
|