diff --git a/gatsby-node.js b/gatsby-node.js index 228007e279e..6484c3334ee 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -1,5 +1,6 @@ /* eslint-disable import/order */ const language_config = require(`./i18n-config.js`) +const language_config_en = require(`./i18n-config-en.js`) const path = require('path') const translations_cache = {} @@ -44,18 +45,6 @@ exports.onCreatePage = ({ page, actions }) => { redirectInBrowser: true, isPermanent: true, }) - createRedirect({ - fromPath: `/careers/locations/minsk`, - toPath: `/careers/`, - redirectInBrowser: true, - isPermanent: true, - }) - createRedirect({ - fromPath: `/careers/locations/minsk/`, - toPath: `/careers/`, - redirectInBrowser: true, - isPermanent: true, - }) } if (is_responsible_trading) { @@ -197,8 +186,9 @@ exports.onCreatePage = ({ page, actions }) => { isPermanent: true, }) } + const is_english = process.env.GATSBY_LANGUAGE === 'en' - Object.keys(language_config).map((lang) => { + Object.keys(is_english ? language_config_en : language_config).map((lang) => { // Use the values defined in "locales" to construct the path const { path, is_default } = language_config[lang] const localized_path = is_default ? page.path : `${path}${page.path}` diff --git a/i18n-config-en.js b/i18n-config-en.js new file mode 100644 index 00000000000..a0d1f2de349 --- /dev/null +++ b/i18n-config-en.js @@ -0,0 +1,9 @@ +module.exports = { + en: { + is_default: true, + path: 'en', + display_name: 'English', + short_name: 'EN', + affiliate_lang: 0, + }, +}