Skip to content

Commit 1f15104

Browse files
rudraswamy.crudraswamy.c
rudraswamy.c
authored and
rudraswamy.c
committed
PWA-3294 :PLP should displayed on all store view
1 parent 767d99e commit 1f15104

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

packages/venia-ui/lib/components/App/localeProvider.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,17 @@ const LocaleProvider = props => {
1919
fetchPolicy: 'cache-and-network',
2020
nextFetchPolicy: 'cache-first'
2121
});
22+
let locale = data !== undefined ? data.storeConfig.locale : DEFAULT_LOCALE;
23+
if (locale === 'zh_Hant_TW') {
24+
locale = 'zh_TW';
25+
}
26+
if (locale === 'zh_Hant_TW') {
27+
locale = 'zh_TW';
28+
}
2229

2330
const language = useMemo(() => {
2431
return data && data.storeConfig.locale
25-
? toReactIntl(data.storeConfig.locale)
32+
? toReactIntl(locale)
2633
: DEFAULT_LOCALE;
2734
}, [data]);
2835

packages/venia-ui/lib/util/formatLocale.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @returns {string} A locale string (e.g. `fr_FR`).
66
*/
77
export const fromReactIntl = string => {
8-
return string.replace('-', '_');
8+
return string.replace(/-/g, '_');
99
};
1010

1111
/**
@@ -15,5 +15,5 @@ export const fromReactIntl = string => {
1515
* @returns {string} A string (e.g. `fr-FR`).
1616
*/
1717
export const toReactIntl = string => {
18-
return string.replace('_', '-');
18+
return string.replace(/_/g, '-');
1919
};

0 commit comments

Comments
 (0)