@team-monolith/cds 1.117.13 → 1.117.14

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.
@@ -8,7 +8,7 @@ interface CdsContext {
8
8
  uploadByFile: (file: File) => Promise<string>;
9
9
  showFileError: (type: "upload" | "download", message: string) => void;
10
10
  };
11
- i18nextConfig?: i18nextOption;
11
+ i18nextOption?: i18nextOption;
12
12
  }
13
13
  export declare const CdsContext: import("react").Context<CdsContext>;
14
14
  export declare function CdsProvider(props: {
@@ -318,7 +318,7 @@ export function CdsProvider(props) {
318
318
  // useEffect가 실행이 되지 않는 문제가 있습니다.
319
319
  // 따라서 useEffect를 사용하지 않고, 동기적으로 i18n 초기화를 수행합니다.
320
320
  if (!i18n.isInitialized && !i18n.isInitializing) {
321
- initI18nInstance(props.i18nextConfig);
321
+ initI18nInstance(props.i18nextOption);
322
322
  }
323
323
  const muiTheme = createTheme({
324
324
  typography: {
@@ -5,4 +5,4 @@ export type i18nextOption = {
5
5
  apiKey?: string;
6
6
  };
7
7
  export declare const i18n: import("i18next").i18n;
8
- export declare function initI18nInstance(config: i18nextOption | undefined): Promise<import("i18next").TFunction<"translation", undefined>>;
8
+ export declare function initI18nInstance(option: i18nextOption | undefined): Promise<import("i18next").TFunction<"translation", undefined>>;
package/dist/i18n/i18n.js CHANGED
@@ -31,10 +31,10 @@ export const i18n = i18next
31
31
  .createInstance()
32
32
  .use(languageDetector)
33
33
  .use(initReactI18next);
34
- export function initI18nInstance(config) {
34
+ export function initI18nInstance(option) {
35
35
  return __awaiter(this, void 0, void 0, function* () {
36
- if (!config) {
37
- // config가 없는 경우, backend 플러그인 없이 기본 i18next 설정을 사용하여,
36
+ if (!option) {
37
+ // option이 없는 경우, backend 플러그인 없이 기본 i18next 설정을 사용하여,
38
38
  // fallbackValue(=key)를 항상 사용하게 됩니다.
39
39
  return i18n.init(Object.assign(Object.assign({}, I18N_COMMON_CONFIGS), { fallbackLng: false }));
40
40
  }
@@ -44,19 +44,19 @@ export function initI18nInstance(config) {
44
44
  * 1. 프로덕션 환경이 아닐 때 (개발 or 로컬 환경) 또는,
45
45
  * 2. 언어 설정이 한국어가 아닐 때
46
46
  */
47
- const LOCIZE_ENABLED = config.environment !== "production" || !CONTAINS_KOREAN;
48
- return (LOCIZE_ENABLED ? i18n.use(Backend).use(locizePlugin) : i18n).init(Object.assign(Object.assign({}, I18N_COMMON_CONFIGS), { debug: config.environment !== "production",
47
+ const LOCIZE_ENABLED = option.environment !== "production" || !CONTAINS_KOREAN;
48
+ return (LOCIZE_ENABLED ? i18n.use(Backend).use(locizePlugin) : i18n).init(Object.assign(Object.assign({}, I18N_COMMON_CONFIGS), { debug: option.environment !== "production",
49
49
  // AIDEV-NOTE:
50
50
  // - 유저의 언어가 Korean인 경우:
51
51
  // fallbackLng를 false로 설정하여, 번역이 없는 경우 key 자체를 반환하도록 합니다.
52
52
  // 이 값을 설정하지 않는다면 i18next가 'dev'(=i18next 기본값)라는 언어를 찾으려고 시도할 것이므로,
53
53
  // 이 동작을 방지합니다.
54
54
  // - 유저의 언어가 Korean이 아닌 경우:
55
- // fallbackLng를 env.REACT_APP_MAIN_LANGUAGE로 설정하여,
55
+ // fallbackLng를 option.mainLanguage로 설정하여,
56
56
  // 유저 언어의 번역이 없을 경우, 메인 언어로 fallback합니다.
57
- fallbackLng: CONTAINS_KOREAN ? false : config.mainLanguage, saveMissing: LOCIZE_ENABLED, backend: {
58
- projectId: config.projectId,
59
- apiKey: config.apiKey,
57
+ fallbackLng: CONTAINS_KOREAN ? false : option.mainLanguage, saveMissing: LOCIZE_ENABLED, backend: {
58
+ projectId: option.projectId,
59
+ apiKey: option.apiKey,
60
60
  referenceLng: "ko",
61
61
  } }));
62
62
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.117.13",
3
+ "version": "1.117.14",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,