@opengeoweb/form-fields 9.32.1 → 9.33.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/index.esm.js +2 -23
- package/package.json +1 -1
- package/src/lib/utils/i18n.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -3,8 +3,8 @@ import { FormControl, FormHelperText, InputLabel, Select, RadioGroup, TextField,
|
|
|
3
3
|
import { useFormContext, useController, useForm, FormProvider } from 'react-hook-form';
|
|
4
4
|
import { isEqual } from 'lodash';
|
|
5
5
|
import { dateUtils } from '@opengeoweb/shared';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
6
|
+
import 'i18next';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { DateTimePicker } from '@mui/x-date-pickers';
|
|
10
10
|
import { CalendarToday } from '@opengeoweb/theme';
|
|
@@ -2335,27 +2335,6 @@ const isNonOrBothCoordinates = (coordinate, otherCoordinate) => {
|
|
|
2335
2335
|
};
|
|
2336
2336
|
|
|
2337
2337
|
const FORM_FIELDS_NAMESPACE = 'form-fields';
|
|
2338
|
-
void i18n.use(initReactI18next).init({
|
|
2339
|
-
lng: 'en',
|
|
2340
|
-
ns: FORM_FIELDS_NAMESPACE,
|
|
2341
|
-
interpolation: {
|
|
2342
|
-
escapeValue: false
|
|
2343
|
-
},
|
|
2344
|
-
resources: {
|
|
2345
|
-
en: {
|
|
2346
|
-
[FORM_FIELDS_NAMESPACE]: formFieldsTranslations.en
|
|
2347
|
-
},
|
|
2348
|
-
fi: {
|
|
2349
|
-
[FORM_FIELDS_NAMESPACE]: formFieldsTranslations.fi
|
|
2350
|
-
},
|
|
2351
|
-
no: {
|
|
2352
|
-
[FORM_FIELDS_NAMESPACE]: formFieldsTranslations.no
|
|
2353
|
-
},
|
|
2354
|
-
nl: {
|
|
2355
|
-
[FORM_FIELDS_NAMESPACE]: formFieldsTranslations.nl
|
|
2356
|
-
}
|
|
2357
|
-
}
|
|
2358
|
-
});
|
|
2359
2338
|
const ns = [FORM_FIELDS_NAMESPACE];
|
|
2360
2339
|
const useFormFieldsTranslation = () => useTranslation(ns);
|
|
2361
2340
|
|
package/package.json
CHANGED
package/src/lib/utils/i18n.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import i18n from 'i18next';
|
|
2
2
|
import { UseTranslationResponse } from 'react-i18next';
|
|
3
3
|
export declare const FORM_FIELDS_NAMESPACE = "form-fields";
|
|
4
|
+
export declare const initFormFieldsI18n: () => void;
|
|
4
5
|
export declare const translateKeyOutsideComponents: (key: string, params?: Record<string, string | number> | undefined) => string;
|
|
5
6
|
export declare const useFormFieldsTranslation: () => UseTranslationResponse<typeof FORM_FIELDS_NAMESPACE, typeof i18n>;
|
|
6
7
|
export { i18n };
|