mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 04:57:05 +02:00
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:
parent
d18b09954b
commit
cfabaedc99
12 changed files with 94 additions and 66 deletions
|
@ -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,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue