mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-04 11:52:39 +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
|
@ -14,15 +14,16 @@ const Head = require('./Head.js');
|
|||
const Footer = require(`${process.cwd()}/core/Footer.js`);
|
||||
const translation = require('../server/translation.js');
|
||||
const constants = require('./constants');
|
||||
const {idx} = require('./utils.js');
|
||||
|
||||
const CWD = process.cwd();
|
||||
|
||||
// Component used to provide same head, header, footer, other scripts to all pages
|
||||
class Site extends React.Component {
|
||||
render() {
|
||||
const tagline = translation[this.props.language]
|
||||
? translation[this.props.language]['localized-strings'].tagline
|
||||
: this.props.config.tagline;
|
||||
const tagline =
|
||||
idx(translation, [this.props.language, 'localized-strings', 'tagline']) ||
|
||||
this.props.config.tagline;
|
||||
const title = this.props.title
|
||||
? `${this.props.title} · ${this.props.config.title}`
|
||||
: (!this.props.config.disableTitleTagline &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue