fix(i18n): ensure language redirects for Chinese traditional (#42020)
This commit is contained in:
committed by
GitHub
parent
0b5553002a
commit
5cb3465a1d
@@ -3,10 +3,13 @@ import envData from '../../../config/env.json';
|
||||
const { forumLocation } = envData;
|
||||
|
||||
const createExternalRedirect = (page, { clientLocale }) => {
|
||||
const isNotEnglish = clientLocale !== 'english';
|
||||
if (clientLocale === 'chinese') {
|
||||
// Handle Chinese
|
||||
if (clientLocale === 'chinese' || clientLocale === 'chinese-traditional') {
|
||||
return `https://chinese.freecodecamp.org/${page}`;
|
||||
}
|
||||
|
||||
// Handle Others
|
||||
const isNotEnglish = clientLocale !== 'english';
|
||||
if (page === 'forum') {
|
||||
return `${forumLocation}/${isNotEnglish ? 'c/' + clientLocale + '/' : ''}`;
|
||||
}
|
||||
|
Reference in New Issue
Block a user