@prezly/theme-kit-nextjs 2.0.0-0 → 2.0.0-2
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/README.md +8 -13
- package/build/@types/global.d.js +1 -0
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js +26 -18
- package/build/adapter-nextjs/api-handlers/fetchStories.js +36 -20
- package/build/adapter-nextjs/api-handlers/index.js +2 -3
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +15 -10
- package/build/adapter-nextjs/getNewsroomStaticProps.js +14 -10
- package/build/adapter-nextjs/index.js +6 -7
- package/build/adapter-nextjs/page-props/category.js +115 -91
- package/build/adapter-nextjs/page-props/gallery.js +85 -61
- package/build/adapter-nextjs/page-props/galleryAlbum.js +61 -44
- package/build/adapter-nextjs/page-props/home.js +81 -62
- package/build/adapter-nextjs/page-props/index.js +8 -9
- package/build/adapter-nextjs/page-props/lib/types.js +1 -2
- package/build/adapter-nextjs/page-props/search.js +23 -24
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +28 -45
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js +12 -14
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +32 -30
- package/build/adapter-nextjs/page-props/sitemap/index.js +4 -5
- package/build/adapter-nextjs/page-props/sitemap/types.js +1 -2
- package/build/adapter-nextjs/page-props/story.js +74 -55
- package/build/adapter-nextjs/page-props/storyPreview.js +26 -21
- package/build/adapter-nextjs/processRequest.js +33 -20
- package/build/adapter-nextjs/processStaticRequest.js +18 -11
- package/build/components-nextjs/PageSeo/PageSeo.js +81 -71
- package/build/components-nextjs/PageSeo/index.js +2 -3
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +4 -5
- package/build/components-nextjs/PageSeo/lib/types.js +1 -2
- package/build/components-nextjs/StorySeo/StorySeo.js +67 -41
- package/build/components-nextjs/StorySeo/index.js +1 -2
- package/build/components-nextjs/document.js +29 -19
- package/build/components-nextjs/index.js +3 -4
- package/build/data-fetching/api/PrezlyApi.js +205 -185
- package/build/data-fetching/api/getPrezlyApi.js +20 -16
- package/build/data-fetching/api/index.js +1 -2
- package/build/data-fetching/api/queries.js +71 -34
- package/build/data-fetching/index.js +3 -4
- package/build/data-fetching/lib/getAlgoliaSettings.js +21 -17
- package/build/data-fetching/lib/getEnvVariables.js +33 -29
- package/build/data-fetching/lib/index.js +4 -5
- package/build/data-fetching/lib/isSdkError.js +2 -3
- package/build/data-fetching/lib/isUuid.js +2 -3
- package/build/data-fetching/types.js +1 -2
- package/build/index.js +9 -10
- package/build/infinite-loading/index.js +4 -5
- package/build/infinite-loading/types.js +1 -2
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +41 -32
- package/build/infinite-loading/useInfiniteLoading.js +48 -37
- package/build/infinite-loading/useInfiniteStoriesLoading.js +54 -44
- package/build/intl/index.d.ts +1 -1
- package/build/intl/index.js +4 -5
- package/build/intl/index.js.map +1 -1
- package/build/intl/languages.js +135 -97
- package/build/intl/languages.js.map +1 -1
- package/build/intl/locale.d.ts +0 -1
- package/build/intl/locale.js +47 -97
- package/build/intl/locale.js.map +1 -1
- package/build/intl/localeConfig.d.ts +3 -1
- package/build/intl/localeConfig.js +20 -13
- package/build/intl/localeConfig.js.map +1 -1
- package/build/intl/localeList.js +1 -108
- package/build/intl/localeObject.js +79 -74
- package/build/intl/localeObject.js.map +1 -1
- package/build/newsroom-context/context.js +34 -20
- package/build/newsroom-context/hooks/index.js +11 -12
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +4 -5
- package/build/newsroom-context/hooks/useCategories.js +4 -5
- package/build/newsroom-context/hooks/useCompanyInformation.js +4 -5
- package/build/newsroom-context/hooks/useCurrentCategory.js +4 -5
- package/build/newsroom-context/hooks/useCurrentLocale.js +4 -5
- package/build/newsroom-context/hooks/useCurrentStory.js +4 -5
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +15 -15
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +48 -44
- package/build/newsroom-context/hooks/useLanguages.js +4 -5
- package/build/newsroom-context/hooks/useNewsroom.js +4 -5
- package/build/newsroom-context/hooks/useNewsroomContext.js +9 -10
- package/build/newsroom-context/index.js +2 -3
- package/build/sentry/client.js +3 -4
- package/build/sentry/common.js +25 -24
- package/build/sentry/index.js +2 -3
- package/build/sentry/server.js +3 -4
- package/build/types.js +1 -2
- package/build/utils/boilerplate.js +4 -13
- package/build/utils/constants.js +1 -2
- package/build/utils/getAssetsUrl.js +3 -4
- package/build/utils/getDataRequestLink.js +5 -7
- package/build/utils/getLocalizedCategoryData.js +30 -24
- package/build/utils/getNewsroomLogoUrl.js +12 -13
- package/build/utils/getPrivacyPortalUrl.js +10 -8
- package/build/utils/getStoryPublicationDate.js +8 -9
- package/build/utils/getUploadcareGroupUrl.js +4 -5
- package/build/utils/index.js +10 -11
- package/build/utils/isEmbargoStory.js +2 -3
- package/package.json +17 -2
- package/build/tsconfig.tsbuildinfo +0 -1
package/build/intl/languages.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { DUMMY_DEFAULT_LOCALE } from
|
|
2
|
-
import { LocaleObject } from
|
|
1
|
+
import { DUMMY_DEFAULT_LOCALE } from "./localeConfig.js";
|
|
2
|
+
import { LocaleObject } from "./localeObject.js";
|
|
3
3
|
function isOnlyCulture(culture, languages) {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const numberOfLanguages = languages.filter(({
|
|
5
|
+
locale: {
|
|
6
|
+
language_code
|
|
7
|
+
}
|
|
8
|
+
}) => language_code === culture.language_code).length;
|
|
9
|
+
return numberOfLanguages === 1;
|
|
6
10
|
}
|
|
11
|
+
|
|
7
12
|
/**
|
|
8
13
|
* @returns the display name of the locale in its native language
|
|
9
14
|
*
|
|
@@ -17,107 +22,135 @@ function isOnlyCulture(culture, languages) {
|
|
|
17
22
|
* - -> English (Global), English (UK), Spanish
|
|
18
23
|
*/
|
|
19
24
|
export function getLanguageDisplayName(language, languages) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
const {
|
|
26
|
+
locale
|
|
27
|
+
} = language;
|
|
28
|
+
if (isOnlyCulture(locale, languages)) {
|
|
29
|
+
const cultureNameIndex = locale.native_name.indexOf('(');
|
|
30
|
+
if (cultureNameIndex !== -1) {
|
|
31
|
+
return locale.native_name.slice(0, cultureNameIndex - 1);
|
|
26
32
|
}
|
|
27
|
-
|
|
33
|
+
}
|
|
34
|
+
return locale.native_name;
|
|
28
35
|
}
|
|
36
|
+
|
|
29
37
|
/**
|
|
30
38
|
* @returns Language set as default in the Newsroom Settings.
|
|
31
39
|
*/
|
|
32
40
|
export function getDefaultLanguage(languages) {
|
|
33
|
-
|
|
41
|
+
return languages.find(({
|
|
42
|
+
is_default
|
|
43
|
+
}) => is_default) || languages[0];
|
|
34
44
|
}
|
|
45
|
+
|
|
35
46
|
/**
|
|
36
47
|
* @returns Only languages having at least one published story
|
|
37
48
|
*/
|
|
38
49
|
export function getUsedLanguages(languages) {
|
|
39
|
-
|
|
50
|
+
return languages.filter(language => language.public_stories_count > 0);
|
|
40
51
|
}
|
|
41
52
|
export function getLanguageByExactLocaleCode(languages, locale) {
|
|
42
|
-
|
|
43
|
-
|
|
53
|
+
const localeCode = locale.toUnderscoreCode();
|
|
54
|
+
return languages.find(({
|
|
55
|
+
code
|
|
56
|
+
}) => code === localeCode);
|
|
44
57
|
}
|
|
58
|
+
|
|
45
59
|
// See https://github.com/prezly/prezly/blob/master/lib/model/CulturePeer.php#L123
|
|
46
60
|
export function getLanguageByNeutralLocaleCode(languages, locale) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
const neutralLanguageCode = locale.toNeutralLanguageCode();
|
|
62
|
+
|
|
63
|
+
// Prefer default language
|
|
64
|
+
const defaultLanguage = getDefaultLanguage(languages);
|
|
65
|
+
// TODO: This doesn't align with other methods logic
|
|
66
|
+
if (defaultLanguage.code === locale.toUnderscoreCode()) {
|
|
67
|
+
return defaultLanguage;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Try to look in used cultures first (giving priority to used ones)
|
|
71
|
+
const usedLanguages = getUsedLanguages(languages);
|
|
72
|
+
const usedLanguage = usedLanguages.find(({
|
|
73
|
+
code
|
|
74
|
+
}) => LocaleObject.fromAnyCode(code).toNeutralLanguageCode() === neutralLanguageCode);
|
|
75
|
+
if (usedLanguage) {
|
|
76
|
+
return usedLanguage;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Search in all languages
|
|
80
|
+
return languages.find(({
|
|
81
|
+
code
|
|
82
|
+
}) => LocaleObject.fromAnyCode(code).toNeutralLanguageCode() === neutralLanguageCode);
|
|
62
83
|
}
|
|
84
|
+
|
|
63
85
|
// See https://github.com/prezly/prezly/blob/master/lib/model/CulturePeer.php#L159
|
|
64
86
|
export function getLanguageByShortRegionCode(languages, locale) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
87
|
+
const shortRegionCode = locale.toRegionCode();
|
|
88
|
+
|
|
89
|
+
// Prefer default language
|
|
90
|
+
const defaultLanguage = getDefaultLanguage(languages);
|
|
91
|
+
if (LocaleObject.fromAnyCode(defaultLanguage.code).toRegionCode() === shortRegionCode) {
|
|
92
|
+
return defaultLanguage;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Try to look in used cultures first (giving priority to used ones)
|
|
96
|
+
const usedLanguages = getUsedLanguages(languages);
|
|
97
|
+
const usedLanguage = usedLanguages.find(({
|
|
98
|
+
code
|
|
99
|
+
}) => LocaleObject.fromAnyCode(code).toRegionCode() === shortRegionCode);
|
|
100
|
+
if (usedLanguage) {
|
|
101
|
+
return usedLanguage;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Search in all languages
|
|
105
|
+
return languages.find(({
|
|
106
|
+
code
|
|
107
|
+
}) => LocaleObject.fromAnyCode(code).toRegionCode() === shortRegionCode);
|
|
79
108
|
}
|
|
109
|
+
|
|
80
110
|
/**
|
|
81
111
|
* Retrieve a culture with fallback to legacy codes support.
|
|
82
112
|
* Pulled from https://github.com/prezly/prezly/blob/de9900d9890a33502780494aa3fb85c9a732b3c3/lib/model/CulturePeer.php#L91-L114
|
|
83
113
|
*/
|
|
84
114
|
export function getLanguageFromNextLocaleIsoCode(languages, nextLocaleIsoCode) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
else {
|
|
99
|
-
targetLanguage = getLanguageByExactLocaleCode(languages, locale);
|
|
100
|
-
}
|
|
101
|
-
return targetLanguage;
|
|
115
|
+
const defaultLanguage = getDefaultLanguage(languages);
|
|
116
|
+
if (!nextLocaleIsoCode || nextLocaleIsoCode === DUMMY_DEFAULT_LOCALE) {
|
|
117
|
+
return defaultLanguage;
|
|
118
|
+
}
|
|
119
|
+
const locale = LocaleObject.fromAnyCode(nextLocaleIsoCode);
|
|
120
|
+
let targetLanguage;
|
|
121
|
+
if (nextLocaleIsoCode.length >= 2 && nextLocaleIsoCode.length <= 4) {
|
|
122
|
+
// The order of methods here is reversed from `getShortestLocaleCode`, so that the logic "unwraps" the possible variants with no collisions
|
|
123
|
+
targetLanguage = getLanguageByExactLocaleCode(languages, locale) || getLanguageByShortRegionCode(languages, locale) || getLanguageByNeutralLocaleCode(languages, locale);
|
|
124
|
+
} else {
|
|
125
|
+
targetLanguage = getLanguageByExactLocaleCode(languages, locale);
|
|
126
|
+
}
|
|
127
|
+
return targetLanguage;
|
|
102
128
|
}
|
|
103
129
|
export function getLanguageFromStory(languages, story) {
|
|
104
|
-
|
|
105
|
-
|
|
130
|
+
const {
|
|
131
|
+
code: storyLocaleCode
|
|
132
|
+
} = story.culture;
|
|
133
|
+
return languages.find(({
|
|
134
|
+
code
|
|
135
|
+
}) => code === storyLocaleCode);
|
|
106
136
|
}
|
|
137
|
+
|
|
107
138
|
/**
|
|
108
139
|
* Extracts company information for the selected locale
|
|
109
140
|
*/
|
|
110
141
|
export function getCompanyInformation(languages, locale) {
|
|
111
|
-
|
|
112
|
-
|
|
142
|
+
const currentLanguage = getLanguageByExactLocaleCode(languages, locale) || getDefaultLanguage(languages);
|
|
143
|
+
return currentLanguage.company_information;
|
|
113
144
|
}
|
|
145
|
+
|
|
114
146
|
/**
|
|
115
147
|
* Get newsroom notifications for the selected locale
|
|
116
148
|
*/
|
|
117
149
|
export function getNotifications(languages, locale) {
|
|
118
|
-
|
|
119
|
-
|
|
150
|
+
const currentLanguage = getLanguageByExactLocaleCode(languages, locale) || getDefaultLanguage(languages);
|
|
151
|
+
return currentLanguage.notifications;
|
|
120
152
|
}
|
|
153
|
+
|
|
121
154
|
/**
|
|
122
155
|
* Get the shortest locale code possible from full locale code
|
|
123
156
|
* First: try shorting to neutral language code (there should be no locales with the same language code)
|
|
@@ -127,33 +160,38 @@ export function getNotifications(languages, locale) {
|
|
|
127
160
|
* @param locale A LocaleObject constructed from FULL locale code (taken straight from the selected language)
|
|
128
161
|
*/
|
|
129
162
|
export function getShortestLocaleCode(languages, locale) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
const localeCode = locale.toUnderscoreCode();
|
|
164
|
+
const defaultLanguage = getDefaultLanguage(languages);
|
|
165
|
+
// If it's a default locale, return false (no locale needed in URL)
|
|
166
|
+
if (localeCode === defaultLanguage.code) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Try shorting to neutral language code
|
|
171
|
+
const neutralLanguageCode = locale.toNeutralLanguageCode();
|
|
172
|
+
const matchingLanguagesByNeutralCode = languages.filter(({
|
|
173
|
+
code
|
|
174
|
+
}) => LocaleObject.fromAnyCode(code).toNeutralLanguageCode() === neutralLanguageCode || code === neutralLanguageCode);
|
|
175
|
+
if (matchingLanguagesByNeutralCode.length === 1) {
|
|
176
|
+
return neutralLanguageCode;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Try shorting to region code
|
|
180
|
+
const shortRegionCode = locale.toRegionCode();
|
|
181
|
+
const matchingLanguagesByRegionCode = languages.filter(({
|
|
182
|
+
code
|
|
183
|
+
}) => LocaleObject.fromAnyCode(code).toRegionCode() === shortRegionCode);
|
|
184
|
+
// Prevent collision with neutral language codes
|
|
185
|
+
const lowerCasedShortRegionCode = shortRegionCode.toLowerCase();
|
|
186
|
+
const mathchingNeutralLanguagesByRegionCode = languages.filter(({
|
|
187
|
+
code
|
|
188
|
+
}) => LocaleObject.fromAnyCode(code).toNeutralLanguageCode() === lowerCasedShortRegionCode || code === lowerCasedShortRegionCode);
|
|
189
|
+
if (matchingLanguagesByRegionCode.length === 1 &&
|
|
190
|
+
// If there are 2 or more matching neutral languages, it means that there are no languages that can be shortened to neutral code
|
|
191
|
+
mathchingNeutralLanguagesByRegionCode.length !== 1 &&
|
|
192
|
+
// We don't want just numbers in our region code
|
|
193
|
+
Number.isNaN(Number(shortRegionCode))) {
|
|
194
|
+
return shortRegionCode;
|
|
195
|
+
}
|
|
196
|
+
return localeCode;
|
|
197
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../../src/intl/languages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../../src/intl/languages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,SAAS,aAAa,CAAC,OAAmB,EAAE,SAAqC;IAC7E,MAAM,iBAAiB,GAAG,SAAS,CAAC,MAAM,CACtC,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE,CAAC,aAAa,KAAK,OAAO,CAAC,aAAa,CAC7E,CAAC,MAAM,CAAC;IAET,OAAO,iBAAiB,KAAK,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,sBAAsB,CAClC,QAAkC,EAClC,SAAqC;IAErC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;IAE5B,IAAI,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE;QAClC,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAEzD,IAAI,gBAAgB,KAAK,CAAC,CAAC,EAAE;YACzB,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,GAAG,CAAC,CAAC,CAAC;SAC5D;KACJ;IAED,OAAO,MAAM,CAAC,WAAW,CAAC;AAC9B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAqC;IACpE,OAAO,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 @@ import type { Redirect } from 'next';
|
|
|
3
3
|
import type { ParsedUrlQuery } from 'querystring';
|
|
4
4
|
import { LocaleObject } from './localeObject';
|
|
5
5
|
export declare const DEFAULT_LOCALE = "en";
|
|
6
|
-
export declare const DUMMY_DEFAULT_LOCALE = "qps-ploc";
|
|
7
6
|
/**
|
|
8
7
|
* Use this function to determine which translations file you should load from `@prezly/themes-intl-mesages` package.
|
|
9
8
|
* See https://github.com/prezly/theme-nextjs-bea/blob/main/utils/lang.ts for a usage example.
|
package/build/intl/locale.js
CHANGED
|
@@ -1,113 +1,63 @@
|
|
|
1
1
|
import { stringify } from 'querystring';
|
|
2
|
-
import {
|
|
2
|
+
import { DUMMY_DEFAULT_LOCALE } from "./localeConfig.js";
|
|
3
|
+
import { LocaleObject } from "./localeObject.js";
|
|
3
4
|
export const DEFAULT_LOCALE = 'en';
|
|
4
|
-
|
|
5
|
-
export const DUMMY_DEFAULT_LOCALE = 'qps-ploc';
|
|
5
|
+
|
|
6
6
|
/**
|
|
7
7
|
* This a list of locales that Prezly has translations for. Each code represents a language file in the `@prezly/themes-intl-messages` package.
|
|
8
8
|
* See https://github.com/prezly/themes-intl-messages for more info.
|
|
9
9
|
*/
|
|
10
|
-
const SUPPORTED_LOCALES = [
|
|
11
|
-
|
|
12
|
-
'ar',
|
|
13
|
-
'az',
|
|
14
|
-
'be',
|
|
15
|
-
'bg',
|
|
16
|
-
'cs',
|
|
17
|
-
'da',
|
|
18
|
-
'de',
|
|
19
|
-
'el',
|
|
20
|
-
'en',
|
|
21
|
-
'es',
|
|
22
|
-
'et',
|
|
23
|
-
'fi',
|
|
24
|
-
'fil',
|
|
25
|
-
'fr',
|
|
26
|
-
'ga',
|
|
27
|
-
'he',
|
|
28
|
-
'hi',
|
|
29
|
-
'hr',
|
|
30
|
-
'hu',
|
|
31
|
-
'id',
|
|
32
|
-
'it',
|
|
33
|
-
'ja',
|
|
34
|
-
'kk',
|
|
35
|
-
'ko',
|
|
36
|
-
'lt',
|
|
37
|
-
'lv',
|
|
38
|
-
'mt',
|
|
39
|
-
'nl',
|
|
40
|
-
'no',
|
|
41
|
-
'pl',
|
|
42
|
-
'pt-BR',
|
|
43
|
-
'pt',
|
|
44
|
-
'ro',
|
|
45
|
-
'ru',
|
|
46
|
-
'sk',
|
|
47
|
-
'sl',
|
|
48
|
-
'sv',
|
|
49
|
-
'sw',
|
|
50
|
-
'th',
|
|
51
|
-
'tr',
|
|
52
|
-
'uk',
|
|
53
|
-
'ur',
|
|
54
|
-
'uz',
|
|
55
|
-
'vi',
|
|
56
|
-
'zh-CN',
|
|
57
|
-
'zh-TW',
|
|
58
|
-
];
|
|
10
|
+
const SUPPORTED_LOCALES = ['af', 'ar', 'az', 'be', 'bg', 'cs', 'da', 'de', 'el', 'en', 'es', 'et', 'fi', 'fil', 'fr', 'ga', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kk', 'ko', 'lt', 'lv', 'mt', 'nl', 'no', 'pl', 'pt-BR', 'pt', 'ro', 'ru', 'sk', 'sl', 'sv', 'sw', 'th', 'tr', 'uk', 'ur', 'uz', 'vi', 'zh-CN', 'zh-TW'];
|
|
11
|
+
|
|
59
12
|
/**
|
|
60
13
|
* Use this function to determine which translations file you should load from `@prezly/themes-intl-mesages` package.
|
|
61
14
|
* See https://github.com/prezly/theme-nextjs-bea/blob/main/utils/lang.ts for a usage example.
|
|
62
15
|
*/
|
|
63
16
|
export function getSupportedLocaleIsoCode(locale) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
17
|
+
const localeIsoCode = locale.toHyphenCode();
|
|
18
|
+
const isSupportedLocale = localeIsoCode.length >= 2 && SUPPORTED_LOCALES.includes(localeIsoCode);
|
|
19
|
+
if (isSupportedLocale) {
|
|
20
|
+
return localeIsoCode;
|
|
21
|
+
}
|
|
22
|
+
const language = locale.toNeutralLanguageCode();
|
|
23
|
+
const isSupportedLanguage = SUPPORTED_LOCALES.includes(language);
|
|
24
|
+
if (isSupportedLanguage) {
|
|
25
|
+
return language;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Custom mapping for Chinese locales
|
|
29
|
+
if (localeIsoCode.toLowerCase() === 'zh-hant') {
|
|
30
|
+
return 'zh-TW';
|
|
31
|
+
}
|
|
32
|
+
if (localeIsoCode.toLowerCase() === 'zh-hk') {
|
|
33
|
+
return 'zh-CN';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// This code should never be reached, because locale code check is happening in `LocaleObject.fromAnyCode`
|
|
37
|
+
// eslint-disable-next-line no-console
|
|
38
|
+
console.warn('Unsupported locale provided. Please use `LocaleObject.fromAnyCode` to ensure you are using a correct language code');
|
|
39
|
+
return DEFAULT_LOCALE;
|
|
85
40
|
}
|
|
86
41
|
export function getRedirectToCanonicalLocale(shortestLocaleCode, nextLocaleIsoCode, redirectPath, query) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return undefined;
|
|
90
|
-
}
|
|
91
|
-
const shortestLocaleSlug = shortestLocaleCode
|
|
92
|
-
? LocaleObject.fromAnyCode(shortestLocaleCode).toUrlSlug()
|
|
93
|
-
: shortestLocaleCode;
|
|
94
|
-
if (shortestLocaleSlug !== nextLocaleIsoCode) {
|
|
95
|
-
const prefixedPath = redirectPath && !redirectPath.startsWith('/') ? `/${redirectPath}` : redirectPath;
|
|
96
|
-
const urlQuery = query ? `?${stringify(query)}` : '';
|
|
97
|
-
return {
|
|
98
|
-
destination: shortestLocaleSlug
|
|
99
|
-
? `/${shortestLocaleSlug}${prefixedPath}${urlQuery}`
|
|
100
|
-
: `${prefixedPath}${urlQuery}`,
|
|
101
|
-
permanent: false,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
42
|
+
// No need to redirect if no particular locale was requested by the application
|
|
43
|
+
if (!nextLocaleIsoCode || nextLocaleIsoCode === DUMMY_DEFAULT_LOCALE) {
|
|
104
44
|
return undefined;
|
|
45
|
+
}
|
|
46
|
+
const shortestLocaleSlug = shortestLocaleCode ? LocaleObject.fromAnyCode(shortestLocaleCode).toUrlSlug() : shortestLocaleCode;
|
|
47
|
+
if (shortestLocaleSlug !== nextLocaleIsoCode) {
|
|
48
|
+
const prefixedPath = redirectPath && !redirectPath.startsWith('/') ? `/${redirectPath}` : redirectPath;
|
|
49
|
+
const urlQuery = query ? `?${stringify(query)}` : '';
|
|
50
|
+
return {
|
|
51
|
+
destination: shortestLocaleSlug ? `/${shortestLocaleSlug}${prefixedPath}${urlQuery}` : `${prefixedPath}${urlQuery}`,
|
|
52
|
+
permanent: false
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return undefined;
|
|
105
56
|
}
|
|
106
57
|
export function getLocaleDirection(locale) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=locale.js.map
|
|
58
|
+
const neutralLanguageCode = locale.toNeutralLanguageCode();
|
|
59
|
+
if (['ar', 'he', 'ur'].includes(neutralLanguageCode)) {
|
|
60
|
+
return 'rtl';
|
|
61
|
+
}
|
|
62
|
+
return 'ltr';
|
|
63
|
+
}
|
package/build/intl/locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/intl/locale.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/intl/locale.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAA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,EAAE,CAAC;IAE3D,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;QAClD,OAAO,KAAK,CAAC;KAChB;IAED,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -3,17 +3,24 @@
|
|
|
3
3
|
* Together with permutation performed lower in the code,
|
|
4
4
|
* the exported list represents all of the possible locale codes that Next.js theme application might accept.
|
|
5
5
|
*/
|
|
6
|
-
import { localeList } from
|
|
7
|
-
const lowercaseLocales = localeList.map(
|
|
6
|
+
import { localeList } from "./localeList.js";
|
|
7
|
+
const lowercaseLocales = localeList.map(l => l.toLowerCase());
|
|
8
|
+
|
|
9
|
+
// We use pseudo locale used for localization testing, to reliably determine if we need to fallback to the default newsroom language
|
|
10
|
+
export const DUMMY_DEFAULT_LOCALE = 'qps-ploc';
|
|
11
|
+
|
|
8
12
|
// Get all permutations for the shorter locale codes supported by Prezly (e.g. short region codes and neutral language codes)
|
|
9
|
-
const lowercaseLocalPermutations = Array.from(new Set([
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const lowercaseLocalPermutations = Array.from(new Set([...lowercaseLocales, ...lowercaseLocales.map(code => code.split('-')[0]), ...lowercaseLocales.map(code => code.split('-')[1]).filter(Boolean)
|
|
14
|
+
// Remove number-only codes from possible permutations (like `419` for `es-419`)
|
|
15
|
+
.filter(code => Number.isNaN(Number(code)))])).sort();
|
|
16
|
+
export const localeConfig = {
|
|
17
|
+
// These are all the locales you want to support in
|
|
18
|
+
// your application
|
|
19
|
+
locales: [DUMMY_DEFAULT_LOCALE, ...lowercaseLocalPermutations],
|
|
20
|
+
// This is the default locale you want to be used when visiting
|
|
21
|
+
// a non-locale prefixed path e.g. `/media`
|
|
22
|
+
// We use Pseudo locale used for localization testing, to reliably determine if we need to fallback to the default newsroom language
|
|
23
|
+
defaultLocale: DUMMY_DEFAULT_LOCALE,
|
|
24
|
+
// Default locale detection is disabled, since the locales would be determined by Prezly API
|
|
25
|
+
localeDetection: false
|
|
26
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeConfig.js","sourceRoot":"","sources":["../../src/intl/localeConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"localeConfig.js","sourceRoot":"","sources":["../../src/intl/localeConfig.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,gBAAgB,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAEhE,oIAAoI;AACpI,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAE/C,6HAA6H;AAC7H,MAAM,0BAA0B,GAAG,KAAK,CAAC,IAAI,CACzC,IAAI,GAAG,CAAC;IACJ,GAAG,gBAAgB;IACnB,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,GAAG,gBAAgB;SACd,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACjC,MAAM,CAAC,OAAO,CAAC;QAChB,gFAAgF;SAC/E,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;CACpD,CAAC,CACL,CAAC,IAAI,EAAE,CAAC;AAET,MAAM,CAAC,MAAM,YAAY,GAAe;IACpC,mDAAmD;IACnD,mBAAmB;IACnB,OAAO,EAAE,CAAC,oBAAoB,EAAE,GAAG,0BAA0B,CAAC;IAC9D,+DAA+D;IAC/D,2CAA2C;IAC3C,oIAAoI;IACpI,aAAa,EAAE,oBAAoB;IACnC,4FAA4F;IAC5F,eAAe,EAAE,KAAK;CACzB,CAAC"}
|