Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial setup for adding Hindi to the editor. #1703

Merged
merged 15 commits into from Jan 29, 2021
10 changes: 10 additions & 0 deletions client/components/Nav.jsx
Expand Up @@ -679,6 +679,16 @@ class Nav extends React.PureComponent {
日本語
</button>
</li>
<li className="nav__dropdown-item">
<button
onFocus={this.handleFocusForLang}
onBlur={this.handleBlur}
value="hi"
onClick={(e) => this.handleLangSelection(e)}
>
हिन्दी
</button>
</li>
</ul>
</li>
</React.Fragment>
Expand Down
10 changes: 6 additions & 4 deletions client/i18n.js
@@ -1,16 +1,17 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import Backend from 'i18next-http-backend';
import { enUS, es, ja } from 'date-fns/locale';
import { enUS, es, ja, hi } from 'date-fns/locale';

const fallbackLng = ['en-US'];
const availableLanguages = ['en-US', 'es-419', 'ja'];
const availableLanguages = ['en-US', 'es-419', 'ja', 'hi'];

export function languageKeyToLabel(lang) {
const languageMap = {
'en-US': 'English',
'es-419': 'Español',
ja: '日本語'
ja: '日本語',
hi: 'हिन्दी'
};
return languageMap[lang];
}
Expand All @@ -19,7 +20,8 @@ export function languageKeyToDateLocale(lang) {
const languageMap = {
'en-US': enUS,
'es-419': es,
ja
ja,
hi
};
return languageMap[lang];
}
Expand Down