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

Adds translation for miles/kilometers #524

Merged
merged 5 commits into from
Nov 24, 2018

Conversation

shadowmaru
Copy link
Contributor

@shadowmaru shadowmaru commented Oct 30, 2018

Context

  • In the search results page the terms 'miles' and 'kilometers' weren't translated

Summary of Changes

  • adds the keys restroom.distance.miles and restroom.distance.kilometers
  • adds the translation for all languages (via Google Translator, please review)

Checklist

  • Tested Mobile Responsiveness
  • Added Unit Tests
  • CI Passes
  • Deploys to Heroku on test Correctly (Maintainers will handle)
  • Added Documentation (Service and Code when required)

Screenshots

Before

After

@@ -20,6 +20,9 @@ pl:
guess_location: 'Obecna lokalizacja urządzenia'
directions: 'Wskazówki'
directions_hint: '(np.: na trzecim piętrze, obok baru, koło przebieralni...)'
distance:
miles: mile
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
miles: mile
miles: mil

I think? (From some online dictionaries.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I honestly have no idea. Polish is the one language here that I have no clue.

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Oct 31, 2018

Thanks for this. I am taking a look now.

I am surprised there is no obvious gem for official Rails translations for these.

(I'm also not sure whether it makes sense to ping everyone who has submitted or reviewed these languages, but we could do that to get it 100% right.)

@DeeDeeG DeeDeeG added enhancement Ready for Review Hacktoberfest These are issues or pull requests related to Hacktoberfest (https://hacktoberfest.digitalocean.com/) translations labels Nov 2, 2018
@DeeDeeG
Copy link
Contributor

DeeDeeG commented Nov 5, 2018

Rather than guess, I am planning to reach out to our previous contributors to Polish and French.

with French, google translate hints to me that some French speakers are using "mile" as a loan word from English, where others are using "milles". (Which in conversation would just sound like "thousands"?? Maybe confusing, hence the loan word?)

And with Polish, the online translation doesn't give me a ton of confidence, like it's guessing from too little data.

My inferences/guesses aside, it would be nice to get someone who actually knows these languages!

I am reasonably confident in the other translations, but might still reach out to contributors for those languages in case they want to give the thumbs up or suggest corrections.

@@ -20,6 +20,9 @@ fr:
guess_location: 'Trouver ma position actuelle'
directions: 'Indications'
directions_hint: "(ex: troisième étage au fond, à coté des cabines d'essayage...)"
distance:
miles: milles
kilometers: kilomètres
Copy link
Contributor

Choose a reason for hiding this comment

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

Hello, @BertrandClosset, @TiteiKo.

Sorry to bother you... It has been a while since you contributed the French translation for Refuge Restrooms (#450).

We are trying to add proper translation of "miles" and "kilometers" to the website, and so I wonder if you could help by checking if this new translation is correct, or suggest a better translation?

Thank you very much.

Sincerely,

- DeeDeeG

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @DeeDeeG,

No problem, it's always a pleasure to help. In my opinion, there is nothing to change to this translation ;)

Bertrand

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you!

@@ -20,6 +20,9 @@ pl:
guess_location: 'Obecna lokalizacja urządzenia'
directions: 'Wskazówki'
directions_hint: '(np.: na trzecim piętrze, obok baru, koło przebieralni...)'
distance:
miles: mile
kilometers: kilometrów
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, @tusindfryd, @katafrakt.

It has been a while since you contributed the Polish translation for Refuge Restrooms (#475), so I'm sorry to bother you if you are busy.

In any case, we are now trying to add translations for the words "mile" and "kilometer", but we only have a machine translation from Google Translate so far. I am wondering if you could confirm that this translation looks good, or suggest the correct translation?

Thank you very much.

Sincerely,

- DeeDeeG

Copy link
Contributor

@nonnullish nonnullish Nov 5, 2018

Choose a reason for hiding this comment

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

Hi,

In Polish numerals differ slightly: 1 kilometr, 2 - 4 kilometry, 5 - 21 kilometrów, 22 - 24 kilometry, 25 - 31 kilometrów, and so on. I think I would personally go with just writing km tbh.

With miles it would be: 1 mila, 2 - 4 mile, 5 - 21 mil, 22 - 24 mile, 25 - 31 mil, and so on. There is no abbreviation for miles in Polish, but no one uses them, so ¯\_(ツ)_/¯

So yeah. That's fun.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm.

Thank you for the information. I suppose we'll have to think of how we want to do this.

There are ways in Rails to use different pluralizations for different numbers. But it would be a bit trickier to set up. And I'm a little nervous at adding math and branching if - then logic in the results page for performance and complexity reasons. But it is possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wow, it's really interesting the way Polish handles numbers and plurals. Maybe we should go with the abbreviations ('km' and 'mi') anyway in this case.

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Nov 5, 2018

In other news, today I learned that the word "mile" literally comes from "a thousand", as in "a thousand paces."

https://en.wiktionary.org/wiki/mile#Etymology

@micahcochran
Copy link

It looks like Wikidata has a few translations "mile", under its unit symbol. Those may be abbreviations.
https://www.wikidata.org/wiki/Q253276

Wikidata also has unit symbols for kilometer. Those may or may not be abbreviations.
https://www.wikidata.org/wiki/Q828224

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Nov 7, 2018

@micahcochran thanks for that resource.

I looked at the "in more languages" tables on Wikidata, and the translations we have here (from Google Translate) match with those translations (on Wikidata). So that does bring my confidence up just a bit more.

With regard to Polish: I am leaning toward using the suggestion from @tusindfryd, to use "km" instead of all the different pluralizations for 1, 2-4, 5-21, etc. And we can use "mi" for "miles" alongside "km" for "kilometers".

@shadowmaru would you want to update the Polish translation to use "km" and "mi"? Would you rather I do that?

After we update Polish as just mentioned, I think we can merge this. Thanks again, everybody!

@shadowmaru
Copy link
Contributor Author

With regard to Polish: I am leaning toward using the suggestion from @tusindfryd, to use "km" instead of all the different pluralizations for 1, 2-4, 5-21, etc. And we can use "mi" for "miles" alongside "km" for "kilometers".

@shadowmaru would you want to update the Polish translation to use "km" and "mi"? Would you rather I do that?

@DeeDeeG Sure, I can do that!

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Nov 14, 2018

Also, now that we have Hindi (#503), we should add a Hindi translation as well.

https://translate.google.com says:

miles: मील की दूरी पर

kilometers: किलोमीटर की दूरी पर

("miles away" and "kilometers away", respectively)

But I'm not clear if just this would work:

miles: मील

kilometers: किलोमीटर

("mile" and "kilometer", respectively)

Or if Google Translate is wrong.

@ashishwadekar, @sankalpchauhan-me, We are trying to translate "kilometers" and "miles" in this pull request (#524). If either of you could comment what the correct translation is, it would be appreciated much, and would help us add the correct translation to Refuge Restrooms. Thank you very much once again.

Sincerely,

- DeeDeeG

@ashishwadekar
Copy link
Contributor

Also, now that we have Hindi (#503), we should add a Hindi translation as well.

https://translate.google.com says:

miles: मील की दूरी पर

kilometers: किलोमीटर की दूरी पर

("miles away" and "kilometers away", respectively)

But I'm not clear if just this would work:

miles: मील

kilometers: किलोमीटर

Or if Google Translate is wrong.

@ashishwadekar, @sankalpchauhan-me, We are trying to translate "kilometers" and "miles" in this pull request (#524). If either of you could comment what the correct translation is, it would be appreciated much, and would help us add the correct translation to Refuge Restrooms. Thank you very much once again.

Sincerely,

  • DeeDeeG

@DeeDeeG Thanks for putting that in context.

What we are talking here is about units of distance measurement. So the below mentioned translation is correct.

28 miles: २८  मील 
28 kilometers: २८  किलोमीटर
 

Google translation is being done as a part of grammar consideration. To clarify more:

28 miles away: २८ मील की दूरी पर
28 kilometers away: २८ किलोमीटर की दूरी पर

Hope this clears the confusion. Let me know if you need more help on this.

Cheers,
Ashish

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Nov 14, 2018

@ashishwadekar, thanks for your response.

Based on your explanation, I think we can go with the shorter version:

miles: मील

kilometers: किलोमीटर

@ashishwadekar
Copy link
Contributor

Sure @DeeDeeG

Cheers

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Nov 14, 2018

Sorry to add things on, and create a bit of a moving target for finishing this pull request, @shadowmaru; If we can add the translation for Hindi as follows:

distance:
  miles: मील
  kilometers: किलोमीटर

that should be enough to finish up this pull request. Once again, whichever is most convenient/preferred, I am happy to add this or let you do it whenever you get the chance.

In any case, we are close to the finish line on this.

Best regards,

- DeeDeeG

P.S. If you need to overwrite the merge I just did, feel free to force push to your develop branch. Sorry if that merge commit gets in the way at all.

P.P.S: I made a backup branch, in case any commits in this branch get deleted by accident. https://github.com/DeeDeeG/refugerestrooms/tree/shadowmaru-develop-2

mi-wood
mi-wood previously approved these changes Nov 24, 2018
Copy link
Member

@mi-wood mi-wood left a comment

Choose a reason for hiding this comment

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

I'm going to move forward with this and make a note to add to the recent Hindi translation once merged.

@mi-wood
Copy link
Member

mi-wood commented Nov 24, 2018

Thank you @shadowmaru and other folks who chimed in!

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Nov 24, 2018

Would like to add Co-authored-by: <name.> <email> for a few people to this merge, in the commit message:

potentially:

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Nov 24, 2018

Also, I could add the Hindi translation in here real quick before we merge.

@mi-wood
Copy link
Member

mi-wood commented Nov 24, 2018

Not going to stop you. I'll leave it up

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Nov 24, 2018

Thanks!

Thanks for verifying this translation, @ashishwadekar

Co-authored-by: Ashish Wadekar <ashishwadekar@users.noreply.github.com>
@DeeDeeG DeeDeeG merged commit 6ac24ac into RefugeRestrooms:develop Nov 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Hacktoberfest These are issues or pull requests related to Hacktoberfest (https://hacktoberfest.digitalocean.com/) translations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants