Skip to content

Commit 6cfbb93

Browse files
Merge pull request #13 from wintondeshong/master
Localization configuration utilities
2 parents 5d86ab5 + c3d9dad commit 6cfbb93

12 files changed

Lines changed: 862 additions & 23 deletions

package-lock.json

Lines changed: 24 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,25 @@
99
},
1010
"dependencies": {
1111
"axios": "0.19.2",
12+
"i18next": "19.4.5",
1213
"immutable": "4.0.0-rc.12",
13-
"lodash": "4.17.15"
14+
"lodash": "4.17.15",
15+
"query-string": "6.13.1"
1416
},
1517
"description": "Common patterns, functions, etc... used when building react applications",
1618
"devDependencies": {
1719
"@testing-library/jest-dom": "5.5.0",
1820
"@testing-library/react": "10.0.4",
21+
"@types/faker": "^4.1.12",
1922
"@types/jest": "25.1.5",
2023
"@types/lodash": "4.14.108",
2124
"@types/node": "13.11.0",
2225
"@types/rosie": "0.0.37",
2326
"andculturecode-javascript-testing": "0.0.1",
27+
"faker": "4.1.0",
2428
"jest": "25.5.4",
2529
"jest-extended": "0.11.5",
2630
"prettier": "1.19.1",
27-
"query-string": "6.13.1",
2831
"rimraf": "2.6.2",
2932
"rosie": "2.0.1",
3033
"ts-jest": "25.5.1",
@@ -64,6 +67,7 @@
6467
"prepublishOnly": "npm run build",
6568
"test": "jest ./src",
6669
"watch": "npm run build -- --watch",
70+
"watch:coverage": "jest ./src --coverage --watch",
6771
"watch:test": "jest ./src --watch"
6872
},
6973
"types": "dist/index",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Rfc4646LanguageCodes } from "../constants/rfc4646-language-codes";
2+
import { Culture } from "../interfaces/culture";
3+
4+
const BaseEnglishUnitedStates: Culture<any> = {
5+
code: Rfc4646LanguageCodes.EN_US,
6+
resources: null,
7+
};
8+
9+
export { BaseEnglishUnitedStates };

src/cultures/base-spanish-spain.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Rfc4646LanguageCodes } from "../constants/rfc4646-language-codes";
2+
import { Culture } from "../interfaces/culture";
3+
4+
const BaseSpanishSpain: Culture<any> = {
5+
code: Rfc4646LanguageCodes.ES_ES,
6+
resources: null,
7+
};
8+
9+
export { BaseSpanishSpain };

src/index.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@
55
export { Rfc4646LanguageCodes } from "./constants/rfc4646-language-codes";
66
export { VideoResolutions } from "./constants/video-resolutions";
77

8-
//#endregion Constants
8+
// #endregion Constants
9+
10+
// -----------------------------------------------------------------------------------------
11+
// #region Cultures
12+
// -----------------------------------------------------------------------------------------
13+
14+
export { BaseEnglishUnitedStates } from "./cultures/base-english-united-states";
15+
export { BaseSpanishSpain } from "./cultures/base-spanish-spain";
16+
17+
// #endregion Cultures
918

1019
// -----------------------------------------------------------------------------------------
1120
// #region Enumerations
@@ -16,7 +25,7 @@ export { ErrorType } from "./enumerations/error-type";
1625
export { HttpHeader } from "./enumerations/http-header";
1726
export { HttpVerb } from "./enumerations/http-verb";
1827

19-
//#endregion Enumerations
28+
// #endregion Enumerations
2029

2130
// -----------------------------------------------------------------------------------------
2231
// #region Interfaces
@@ -30,15 +39,15 @@ export { Result } from "./interfaces/result";
3039
export { ResultError } from "./interfaces/result-error";
3140
export { ServiceResponse } from "./interfaces/service-response";
3241

33-
//#endregion Interfaces
42+
// #endregion Interfaces
3443

3544
// -----------------------------------------------------------------------------------------
3645
// #region Types
3746
// -----------------------------------------------------------------------------------------
3847

3948
export { CancellablePromise } from "./types/cancellable-promise";
4049

41-
//#endregion Types
50+
// #endregion Types
4251

4352
// -----------------------------------------------------------------------------------------
4453
// #region Utilities
@@ -47,12 +56,13 @@ export { CancellablePromise } from "./types/cancellable-promise";
4756
export { CollectionUtils } from "./utilities/collection-utils";
4857
export { CoreUtils } from "./utilities/core-utils";
4958
export { EnvironmentUtils } from "./utilities/environment-utils";
59+
export { LocalizationUtils } from "./utilities/localization-utils";
5060
export { PromiseFactory } from "./utilities/promise-factory";
5161
export { RouteUtils } from "./utilities/route-utils";
5262
export { ServiceUtils } from "./utilities/service-utils";
5363
export { StringUtils } from "./utilities/string-utils";
5464

55-
//#endregion Utilities
65+
// #endregion Utilities
5666

5767
// -----------------------------------------------------------------------------------------
5868
// #region View Models
@@ -61,4 +71,4 @@ export { StringUtils } from "./utilities/string-utils";
6171
export { ResultRecord } from "./view-models/result-record";
6272
export { ResultErrorRecord } from "./view-models/result-error-record";
6373

64-
//#endregion View Models
74+
// #endregion View Models

0 commit comments

Comments
 (0)