Enhance Breadcrumbs (#39)

* chore(localization): remove duplicated locale files

* feat(localization): add localization for breadcrumbs

* feat(localization): add beadcrumb enhancements

* feat(debugging): add npm run debug command

* chore(localization): add unit tests

* chore(breadcrumbs): fix tests and typos

* chore(localization): add docs for translationAvailable

* chore(localization): refactor translationAvailable
This commit is contained in:
David Litvak Bruno
2017-11-08 15:39:24 +01:00
committed by GitHub
parent a48fd1b63d
commit 81577c82fd
10 changed files with 67 additions and 158 deletions

View File

@@ -44,3 +44,14 @@ module.exports.translate = (symbol, locale = 'en-US') => {
return translatedValue
}
/**
* Checks if string is translatable
* @param symbol string Identifier for static text
* @param locale string Locale code
*
* @returns boolean
*/
module.exports.translationAvaliable = (symbol, locale = 'en-US') => {
return !!(translations[locale] || {})[symbol]
}

View File

@@ -15,6 +15,7 @@
"logoAlt": "Contentful Example App",
"homeLabel": "Home",
"coursesLabel": "Courses",
"lessonsLabel": "Lessons",
"footerDisclaimer": "Powered by Contentful. This website and the materials found on it are for demo purposes. You can use this to preview the content created on your Contentful account.",
"imprintLabel": "Imprint",
"contactUsLabel": "Contact us",