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

Translating whoismyneta.com #16

Open
3 tasks
thedivtagguy opened this issue Apr 29, 2024 · 3 comments
Open
3 tasks

Translating whoismyneta.com #16

thedivtagguy opened this issue Apr 29, 2024 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@thedivtagguy
Copy link
Owner

We are looking to add Hindi and other regional language translations to the content on whoismyneta.com. I am keen on using ParaglideJS with our Sveltekit set up to make this happen.

Resources:
https://jldec.me/blog/getting-started-i18n-with-paraglide-and-fink
https://github.com/LorisSigrist/paraglide-sveltekit-example

This issue tracks only the addition of such a functionality, not the translation itself. This includes:

  • Adding a language switcher
  • Extracting the page copy to a paraglide schema. An messages/en.json to begin with.
  • Removing instances of hardcoded text and using the data from the language schema instead.

There will be caveats in how the fonts and layout change because of this. For the time being, we will only translate to Hindi.

We are in the process of adding more data for all candidates for the current election so doing it at this stage with smaller amount of text would be nice.

@thedivtagguy thedivtagguy added the help wanted Extra attention is needed label Apr 29, 2024
@sawlachintan
Copy link

I would like to help in this section.

@thedivtagguy
Copy link
Owner Author

thedivtagguy commented May 17, 2024

Hello!! Thanks for checking this out. It would be an awesome addition to have. For the time being, mine and @Vonter's energies are directed towards an election results dashboard we're making for June 4th, but having a start on this in some way would be useful so we might extend it to other facets of the project in the future.

Does the outline I attached above using Paraglide make sense? I'd also be interested to know what thoughts you have on how we can handle candidate and constituency names. There will be some transliteration required I think, but I'm not sure how that would work. This layer of complexity got added last week when we began to include candidates for 2024.

This is new territory for me as well so I am very unopinionated about how we can solve this, and I'd be happy to hear your ideas!

Btw, we're over on the bengawalk discord for this project if you want to drop by for discussing anything.

@sawlachintan
Copy link

sawlachintan commented May 17, 2024

Hey, yes, the outline was really helpful.

I have been able to implement a basic translation switcher. And for the translations, we can do it ourselves or ask other contributors to add languages they know using a frontend tool provided by Inlang.

I will look into the candidate and constituency names for translation. I don't think it will be ideal for a single file to have all the data. In my experience, it is better to have a separate repo for the data and then make a fetch request to that repo if we add more languages.

I am creating a new pull request for you to see the language switcher (I have added a few hardcoded hindi words to show how it works). I'd like to know your thoughts on the feature and ensure that we are on the same page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants