Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Fix some minor issues in the English translations #293

Merged
4 commits merged into from
Jan 14, 2020
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jan 14, 2020

This PR accomplishes the following:

  1. Javascript has come a long way in the last five years, and String#startsWith and String#endsWith and String#includes exist now. It's a lot cleaner to use them, so we do so.
  2. It is possible (albeit unlikely!) for parentheticals to be generated with a generic or rain or sleet type. We are working to reduce the number of cases that this can possibly occur for, but in the meantime we should fix the translation to not be confusing. So: we add a test for this, and clarify that the parenthetical refers to a chance of snow accumulation in those cases. I also updated the README to note this.
  3. It was possible for words like "a"/"of"/"with"/etc. to get capitalized. This shouldn't happen in English.
  4. Did a bunch of cleanup and added comments.

@ghost ghost self-assigned this Jan 14, 2020
Copy link

@hhansson hhansson left a comment

Choose a reason for hiding this comment

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

very satisfying.

Copy link
Contributor

@nonrenewable-zz nonrenewable-zz left a comment

Choose a reason for hiding this comment

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

it's def pretty! thank you for atoning for my sins...

@@ -260,9 +263,11 @@
["starting-in", "very-light-rain", ["less-than", ["minutes", 1]]]],

"Next hour forecasts are temporarily unavailable due to all nearby radar stations being offline.":
["sentence",["next-hour-forecast-status", "temporarily-unavailable", "station-offline"]],
["sentence", ["next-hour-forecast-status", "temporarily-unavailable", "station-offline"]],
Copy link
Contributor

Choose a reason for hiding this comment

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

we should make the linter yell about these since otherwise i'll keep doing it 😞

Copy link
Author

Choose a reason for hiding this comment

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

The linter doesn't check JSON :(

midori:translations jay$ ./node_modules/.bin/eslint test_cases/en.json 

/Users/jay/Projects/Dark Sky/translations/test_cases/en.json
  2:10  error  Parsing error: Unexpected token :

✖ 1 problem (1 error, 0 warnings)

Copy link
Contributor

Choose a reason for hiding this comment

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

😭

@ghost ghost merged commit 254db17 into master Jan 14, 2020
@ghost ghost deleted the ironwallaby/english_bugs branch January 14, 2020 18:59
This pull request was closed.
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.

2 participants