Skip to content

Commit

Permalink
chore(i18n-validate): release [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
imranbarbhuiya committed Jul 18, 2023
1 parent 3673637 commit a1e1db4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ You can ignore a specific function by adding `// i18n-validate-disable-next-line
For dynamic keys, we check the typescript type of the key. If the type is a `const` type, the type is used as the key. Otherwise, the key is ignored. Type can be an union type or a literal type.
For ts files
```ts
const a = 'namespace:key1';

Expand All @@ -73,15 +75,19 @@ t(`namespace:${b}` as const);
declare const c: 'namespace:key3' | 'namespace:key4';

t(c);
```
For js files
```js
/**
* @type {'a:key5' | 'a:key6'}
*/
const d = `a:${b}`;

t(d);

const e = /** @type {'a:key7' | 'a:key8'} */ `a:${b}`;
const e = /** @type {'a:key7' | 'a:key8'} */ (`a:${b}`);

t(e);
```
Expand Down
12 changes: 12 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

All notable changes to this project will be documented in this file.

## [[email protected]](https://github.com/imranbarbhuiya/i18n-validate/compare/[email protected]) - (2023-07-18)

### 🐛 Bug Fixes

- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5))
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8))

### 🚀 Features

- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7))
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16))

## [[email protected]](https://github.com/imranbarbhuiya/i18n-validate/compare/[email protected]) - (2023-07-18)

### 🐛 Bug Fixes
Expand Down
8 changes: 7 additions & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ You can ignore a specific function by adding `// i18n-validate-disable-next-line
For dynamic keys, we check the typescript type of the key. If the type is a `const` type, the type is used as the key. Otherwise, the key is ignored. Type can be an union type or a literal type.
For ts files
```ts
const a = 'namespace:key1';

Expand All @@ -72,15 +74,19 @@ t(`namespace:${b}` as const);
declare const c: 'namespace:key3' | 'namespace:key4';

t(c);
```
For js files
```js
/**
* @type {'a:key5' | 'a:key6'}
*/
const d = `a:${b}`;

t(d);

const e = /** @type {'a:key7' | 'a:key8'} */ `a:${b}`;
const e = /** @type {'a:key7' | 'a:key8'} */ (`a:${b}`);

t(e);
```
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "i18n-validate",
"version": "1.3.0",
"version": "1.4.0",
"description": "A cli tool to find invalid i18n keys, missing variables and many more",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down

0 comments on commit a1e1db4

Please sign in to comment.