Skip to content

Commit bf66e0e

Browse files
committed
feat(global): locale naming simplified
1 parent 42f6009 commit bf66e0e

File tree

12 files changed

+24
-20
lines changed

12 files changed

+24
-20
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { codes } from './codes';
22
import { CodeGetter } from './utils';
33
import { ELocal, IFullCode } from './types';
44

5-
const errors = new CodeGetter(codes, ELocal.en_US);
5+
const errors = new CodeGetter(codes, ELocal.en);
66

77
export { errors, ELocal, IFullCode };

src/resources/authentication/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { II18n, IErrorRes, EHttpCode } from '../../types';
2-
import * as fr_FR from './locales/fr_FR.json';
3-
import * as en_US from './locales/en_US.json';
42

5-
const i18n: II18n = { fr_FR, en_US };
3+
// Locales
4+
import * as fr from './locales/fr.json';
5+
import * as en from './locales/en.json';
6+
7+
const i18n: II18n = { fr, en };
68

79
const authentication: IErrorRes = {
810
client: {

src/resources/general/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { II18n, IErrorRes, EHttpCode } from '../../types';
22

3-
// Locals
4-
import * as fr_FR from './locales/fr_FR.json';
5-
import * as en_US from './locales/en_US.json';
3+
// Locales
4+
import * as fr from './locales/fr.json';
5+
import * as en from './locales/en.json';
66

7-
const i18n: II18n = { fr_FR, en_US };
7+
const i18n: II18n = { fr, en };
88

99
const general: IErrorRes = {
1010
client: {},
File renamed without changes.
File renamed without changes.

src/resources/signIn/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { II18n, IErrorRes, EHttpCode } from '../../types';
2-
import * as fr_FR from './locales/fr_FR.json';
3-
import * as en_US from './locales/en_US.json';
42

5-
const i18n: II18n = { fr_FR, en_US };
3+
// Locales
4+
import * as fr from './locales/fr.json';
5+
import * as en from './locales/en.json';
6+
7+
const i18n: II18n = { fr, en };
68

79
const authentication: IErrorRes = {
810
client: {
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)