Fix: conflicting strings issue in translations (#917)

* Fix conflicting strings issue in translations

* Preserve structure of `customTranslations`

* Use `deepmerge` to merge whole of `localized-strings`

* Simplify and make deep property access on an object safe

* Fix deep property accessor and rename it to idx
This commit is contained in:
Laxman 2018-08-28 21:34:02 +05:30 committed by Endilie Yacop Sucipto
parent d18b09954b
commit cfabaedc99
12 changed files with 94 additions and 66 deletions

View file

@ -28,9 +28,14 @@ function getPath(pathStr, cleanUrl = false) {
: removeExtension(pathStr);
}
function idx(target, path) {
return path.reduce((obj, key) => obj && obj[key], target);
}
module.exports = {
blogPostHasTruncateMarker,
extractBlogPostBeforeTruncate,
getPath,
removeExtension,
idx,
};