Skip to content

Instantly share code, notes, and snippets.

@ramakay
Created December 8, 2016 16:24
Show Gist options
  • Save ramakay/583232eccd68abbcef6973c38c40eef1 to your computer and use it in GitHub Desktop.
Save ramakay/583232eccd68abbcef6973c38c40eef1 to your computer and use it in GitHub Desktop.
/**
* Translation in the current system uses both "Translate" vs "No-Translate" configuration.
* Important that markup emitted is also in sync if you are declaring some portions of the state here.
/*
provide Path to the higher level object.
Smartling documentation:
`/#` : Wildcard to match everything
`notranslate object`: Items that need to be stripped.
/**
* [ comma separated xPath consumed by `server.jsx` ]
* @type {Array}
*/
const TRANSLATION_CONFIG = [
'labels/#',
'home/contentList/#',
'plp/#',
'pdp/#',
'dlp/#',
'shop/#',
'giftCardBalance/#',
'signupComp/#',
'searchBox/#',
'promoBanner/#',
'headerMobileNav/#',
'header/#',
'footer/#',
'mobileMenu/#',
'sizeGuide/#',
'cart/#',
'login/error/#',
'giftcarddetail/#'
];
/**
* [Provide the paths of the configuration object that should not be translated]
* @type {Array}
*/
const TRANSLATION_EXCEPTIONS = [
'home/name/#',
'home/contentPaths/#',
'home/contentList/#',
'routing/#',
'cart/minicart/miniCartStatus',
'preloader/#',
'locales/#', // Unsure
'plp/productTileViewClass',
'plp/selectedValue',
'plp/dataNextPage/#',
'plp/plpMetaData',
'plp/sortOptions/#',
'plp/breadCrumbs/name',
'plp/initialFilters/#',
'plp/plpLeftNavigation/'
]
module.exports = {
TRANSLATION_CONFIG,
TRANSLATION_EXCEPTIONS
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment