@ya-accelerators/nextjs-framework 0.0.52 → 0.0.53
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/dist/i18n/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { getRequestConfig } from 'next-intl/server';
|
|
2
2
|
import { getCookieValue } from '../lib/cookie';
|
|
3
3
|
import { getMessageFallback } from './get-message-fallback';
|
|
4
|
-
/** Framework strings: `en-
|
|
4
|
+
/** Framework strings: `en-GB.json` is canonical; other locale files supply overrides only. */
|
|
5
5
|
const loadFrameworkMessagesFlat = async (locale) => {
|
|
6
|
-
const { default: base } = (await import('./strings/en-
|
|
7
|
-
if (locale === 'en-
|
|
6
|
+
const { default: base } = (await import('./strings/en-GB.json'));
|
|
7
|
+
if (locale === 'en-GB') {
|
|
8
8
|
return base;
|
|
9
9
|
}
|
|
10
|
-
if (locale === 'en-
|
|
10
|
+
if (locale === 'en-US' || locale === 'ja-JP') {
|
|
11
11
|
const { default: override } = (await import(`./strings/${locale}.json`));
|
|
12
12
|
return { ...base, ...override };
|
|
13
13
|
}
|
|
@@ -39,7 +39,7 @@ const normalizeMessages = (flat) => {
|
|
|
39
39
|
};
|
|
40
40
|
export const createRequestConfig = (getConsumerMessages) => getRequestConfig(async () => {
|
|
41
41
|
const rawLocale = await getCookieValue('locale');
|
|
42
|
-
const locale = rawLocale && /^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$/.test(rawLocale) ? rawLocale : 'en-
|
|
42
|
+
const locale = rawLocale && /^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$/.test(rawLocale) ? rawLocale : 'en-GB';
|
|
43
43
|
const rawTimeZone = await getCookieValue('timezone');
|
|
44
44
|
let timeZone = 'UTC';
|
|
45
45
|
if (rawTimeZone && rawTimeZone.length <= 64) {
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"locale": "en-GB",
|
|
3
|
-
"dateFormat": "dd/MM/yyyy"
|
|
3
|
+
"dateFormat": "dd/MM/yyyy",
|
|
4
|
+
"monShort": "Mon",
|
|
5
|
+
"monLong": "Monday",
|
|
6
|
+
"tueShort": "Tue",
|
|
7
|
+
"tueLong": "Tuesday",
|
|
8
|
+
"wedShort": "Wed",
|
|
9
|
+
"wedLong": "Wednesday",
|
|
10
|
+
"thuShort": "Thu",
|
|
11
|
+
"thuLong": "Thursday",
|
|
12
|
+
"friShort": "Fri",
|
|
13
|
+
"friLong": "Friday",
|
|
14
|
+
"satShort": "Sat",
|
|
15
|
+
"satLong": "Saturday",
|
|
16
|
+
"sunShort": "Sun",
|
|
17
|
+
"sunLong": "Sunday"
|
|
4
18
|
}
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
{
|
|
2
2
|
"locale": "en-US",
|
|
3
|
-
"dateFormat": "MM/dd/yyyy"
|
|
4
|
-
"monShort": "Mon",
|
|
5
|
-
"monLong": "Monday",
|
|
6
|
-
"tueShort": "Tue",
|
|
7
|
-
"tueLong": "Tuesday",
|
|
8
|
-
"wedShort": "Wed",
|
|
9
|
-
"wedLong": "Wednesday",
|
|
10
|
-
"thuShort": "Thu",
|
|
11
|
-
"thuLong": "Thursday",
|
|
12
|
-
"friShort": "Fri",
|
|
13
|
-
"friLong": "Friday",
|
|
14
|
-
"satShort": "Sat",
|
|
15
|
-
"satLong": "Saturday",
|
|
16
|
-
"sunShort": "Sun",
|
|
17
|
-
"sunLong": "Sunday"
|
|
3
|
+
"dateFormat": "MM/dd/yyyy"
|
|
18
4
|
}
|