Skip to content

Commit

Permalink
Merge pull request #1703 from abhieshekumar/i18n-hindi
Browse files Browse the repository at this point in the history
Initial setup for adding Hindi to the editor.
  • Loading branch information
catarak committed Jan 29, 2021
2 parents 319c90f + 02d77df commit d7224b8
Show file tree
Hide file tree
Showing 3 changed files with 624 additions and 4 deletions.
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

0 comments on commit d7224b8

Please sign in to comment.