Skip to content

Commit

Permalink
Merge pull request #11 from pi-apps/hausa-translation
Browse files Browse the repository at this point in the history
add Hausa translation
  • Loading branch information
dev-king21 authored Dec 1, 2021
2 parents c8626c9 + 8848c85 commit 41dd48c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker/nginx-defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ server {
location = /50x.html {
root /usr/share/nginx/html;
}
}
}
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"short_name": "steexp",
"short_name": "Blockexplorer",
"name": "Blockexplorer",
"start_url": ".",
"display": "standalone",
Expand Down
9 changes: 8 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import ru from 'react-intl/locale-data/ru'
import ur from 'react-intl/locale-data/ur'
import vi from 'react-intl/locale-data/vi'
import zh from 'react-intl/locale-data/zh'
import ha from 'react-intl/locale-data/ha'

import enMessages from './languages/en'
import frMessages from './languages/fr'
import hiMessages from './languages/hi'
Expand All @@ -28,6 +30,8 @@ import urMessages from './languages/ur'
import viMessages from './languages/vi'
import zhHansMessages from './languages/zh-Hans.json'
import zhHantMessages from './languages/zh-Hant.json'
import haMessages from './languages/hau.json'


import Header from './components/layout/Header'
import Footer from './components/layout/Footer'
Expand Down Expand Up @@ -64,8 +68,9 @@ addLocaleData([
...ur,
...vi,
...zh,
...ha,
])
const locales = ['en', 'fr', 'hi', 'id', 'ja', 'ru', 'ur', 'vi', 'zh-Hans', 'zh-Hant']
const locales = ['en', 'fr', 'hi', 'id', 'ja', 'ru', 'ur', 'vi', 'zh-Hans', 'zh-Hant', 'ha']
let initialLanguage =
storage.getItem('language') || navigator.language || 'en'
if(!locales.includes(initialLanguage) ){
Expand Down Expand Up @@ -98,6 +103,8 @@ const getMessages = locale => {
return zhHansMessages
case 'zh-Hant':
return zhHantMessages
case 'ha':
return haMessages
default:
return enMessages
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/layout/LanguageSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ const LanguageSelector = ({
<MenuItem lang="id" onClick={switcher}>
Bahasa Indonesia
</MenuItem>
<MenuItem lang="ha" onClick={switcher}>
Hausa
</MenuItem>
<MenuItem
onClick={onClickTranslateHelp}
style={{borderTop: '1px solid black'}}
Expand Down

0 comments on commit 41dd48c

Please sign in to comment.