Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Feature: Localization support #432

Closed
wants to merge 1 commit into from
Closed

Conversation

jeremyphilemon
Copy link
Collaborator

@jeremyphilemon jeremyphilemon commented Mar 31, 2020

  • Localization support
  • Telegram translation fix
  • District wise translations
  • Hover over district issue
  • Translations cleanup

Feature added by: @harshzalavadiya

Co-authored-by: Jeremy jeremyphilemon@outlook.com

@vercel
Copy link

vercel bot commented Mar 31, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/covid19india/covid19india-react/5zy1f8php
✅ Preview: https://covid19india-react-git-feature-localization.covid19india.now.sh

@jeremyphilemon
Copy link
Collaborator Author

jeremyphilemon commented Apr 1, 2020

@harshzalavadiya Hey, so this feature is still in staging and we're looking forward to merge soon!
There seems to be a few bugs like when you click on Arunachal Pradesh it seems to be crashing, similarly with Meghalaya too.

I'm not familiar with with i18n library so I was stumped to figure out how to fix it myself, would appreciate it if you could fix that!

Also we need to support these languages on the first push:

  • English
  • Hindi
  • Telugu
  • Kannada
  • Gujarati
  • Marathi
  • Tamil
  • Bangla
  • Odiya
  • Punjabi
  • Malayalam

I think there are json files for languages not mentioned above, feel free to keep them also! More the languages, the better!

You don't have to work on all the translations, it's under stable how much an arduous task that is!
It'd be great if you could just add those locale templates and we can crowdsource for fixes and translations after that!

Let me know what you think :) Really awesome work btw!

Heads up: This is a separate branch now, so your PRs will have to build upon this!

@harshzalavadiya
Copy link
Contributor

sure @jeremyphilemon I'll be happy to fix

src/App.js Outdated
const history = require('history').createBrowserHistory;

function App() {
const {t} = useTranslation();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { translate } = useTransaltion();

translate would be more meaningful than just t

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@puru0019

Hook is from react-i18next and we can't change it directly https://react.i18next.com/latest/usetranslation-hook

Copy link
Contributor

@KrishnaPravin KrishnaPravin Apr 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if translate is a must, then this might help

const { t: translate } = useTransaltion();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, @KrishnaPravin, I know aliasing is possible but doing it everywhere, or wrapping it in another hook isn't a clean approach.

they are naming function as 't' because it's less distractive provides better DX, ctrl clicking on t goes to useTranslate that anyway says that this is a translate function plus most react translation libraries do it same way.

https://www.npmjs.com/package/react-translate
https://react.i18next.com/latest/usetranslation-hook

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

understood👍

@harshzalavadiya
Copy link
Contributor

@jeremyphilemon I guess this branch is far outdated to be merged with master,

Humble advise: next time if localisation happens it should be merged with master in day or two since it affects almost all files, don't wait for all translations to be perfect Just merge it once and then keep on improving it. Otherwise merge conflicts will keep on happening and it will end up in similar situation

Anyways it was a nice learning experience for me keep up the good work

@JunaidBabu JunaidBabu mentioned this pull request Apr 19, 2020
@tannakartikey tannakartikey added Status: In Progress and removed Status: Completed Nothing further to be done with this issue labels Apr 23, 2020
@jeremyphilemon jeremyphilemon changed the title Feature: Localization support (#357) Feature: Localization support Apr 24, 2020
@jeremyphilemon
Copy link
Collaborator Author

Closing in favor of #1862 :)

@shuklaayush shuklaayush deleted the feature/localization branch February 2, 2021 12:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants