Skip to content

Commit

Permalink
Finish the rest of the translations
Browse files Browse the repository at this point in the history
  • Loading branch information
cloneofghosts committed Dec 22, 2024
1 parent b477a4f commit 6cf8323
Show file tree
Hide file tree
Showing 45 changed files with 9,285 additions and 27 deletions.
27 changes: 7 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributing Translations

The API (and therefore this module as well) is written in [Python][1]. Knowledge of that environment is
required in order to contribute to this software, but this document will do its
best to provide a crash-course for developers that are not familiar with Node.
best to provide a crash-course for developers that are not familiar with Python.

[1]: https://www.python.org/

Expand Down Expand Up @@ -35,23 +35,10 @@ working by running the tests:
platform linux -- Python 3.10.12, pytest-8.3.4, pluggy-1.5.0
plugins: anyio-4.6.0, cov-6.0.0, subtests-0.14.1
collected 18 items

test.py .................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.

---------- coverage: platform linux, python 3.10.12-final-0 ----------
Name Stmts Miss Cover
----------------------------------------
lib/lang/en.py 46 0 100%
lib/lang/fr.py 53 5 91%
lib/translation.py 56 7 88%
test.py 76 1 99%
test_cases/en.py 1 0 100%
test_cases/fr.py 1 0 100%
----------------------------------------
TOTAL 233 13 94%
test.py .................,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,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,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,. [100%]


============================================================================== 18 passed, 154 subtests passed in 0.35s ==============================================================================
============================================================================= 18 passed, 3634 subtests passed in 7.33s ==============================================================================


[2]: https://docs.pytest.org/en/stable/
Expand Down Expand Up @@ -143,7 +130,7 @@ The following algorithm will be applied:
are substituted into the function and a final expression is returned:
`"drizzle starting in 15 minutes"`.

Any arbitrary JavaScript code may be used in a function, but in many templating
Any arbitrary Python code may be used in a function, but in many templating
scenarios, only simple string concatenation is necessary. In these cases, a
shortcut syntax is also allowed:

Expand Down Expand Up @@ -172,7 +159,7 @@ Please see `/lib/lang/en.js` for an example of this in action.
Once a new translation module has been created, it is advisable to write tests
for it to ensure its correctness. (In fact, it may be advisable to write the
tests beforehand!) Much of the work of this has been done for you; simply
create the file `/test-cases/<language>.json`. This file should contain an
create the file `/test-cases/<language>.py`. This file should contain an
associative array of translated sentences to the expression used to generate
them:

Expand All @@ -181,9 +168,9 @@ them:
["starting-in", "very-light-rain", ["minutes", 15]]
}

The English test cases (`/test-cases/en.json`) may be used as an example
The English test cases (`/test-cases/en.py`) may be used as an example
and starting place. As noted above, you can verify your tests by running
`npm test`. Pull requests without a full suite of passing tests will not
`pytest test.py`. Pull requests without a full suite of passing tests will not
be accepted. Please make every effort to ensure that your tests provide
as full code coverage as possible.

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Pirate Weather API Translation Module
Introduction
------------

The [Pirate Weather API][1] has, since version 2.5, included a [module for
producing textual weather summaries][2] from its weather data. These summaries
The [Pirate Weather API][1] has, since version 2.5, included a module for
producing textual weather summaries from its weather data. These summaries
have always been in English (since that's the only language we know) and have
always been procedurally generated (since there are so many possible weather
conditions). Procedural generation makes translating these summaries into other
Expand All @@ -14,7 +14,6 @@ lookup to replace an English sentence with one of a different language—becomes
impractical, requiring a *very* large table to support!

[1]: https://pirateweather.net/en/latest/
[2]: http://www.kickstarter.com/projects/jackadam/dark-sky-hyperlocal-weather-prediction-and-visuali/posts/141049

This software module was developed in order to work around these issues. We are
modifying the Pirate Weather API text summary code to generate a machine-readable
Expand Down Expand Up @@ -351,8 +350,8 @@ in English, respectively.
* `"light-wind"`: Represents light wind at a location. (15 mph (~24.14 km/h) or greater)
* `"medium-wind"`: Represents moderate wind at a location. (~22.37 mph (36 km/h) or greater)
* `"heavy-wind"`: Represents strong wind at a location. (40 mph (~64.37 km/h) or greater)
* `"low-humidity"`: Represents when the air is unusually dry.
* `"high-humidity"`: Represents when the air is unusually humid.
* `"low-humidity"`: Represents when the humidity is below 15%
* `"high-humidity"`: Represents when the humidity is above 95% and the air temperature is above 20C (68F).
* `"fog"`: Represents when there is less than approximately 0.62 miles (1 kilometers) of
visibility.
* `"very-light-clouds"`: Represents when clouds cover more less than 37.5% of the sky.
Expand Down
127 changes: 127 additions & 0 deletions lib/lang/mr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
template = {
"clear": "स्वच्छ",
"no-precipitation": "पाऊस नाही",
"mixed-precipitation": "मिश्र पर्जन्य",
"possible-very-light-precipitation": "पावसाच्या हलक्या सरींची शक्यता",
"very-light-precipitation": "अत्यल्प पाऊस",
"possible-light-precipitation": "अत्यल्प पावसाची शक्यता",
"light-precipitation": "थोडासा पाऊस",
"medium-precipitation": "मध्यम पाऊस",
"heavy-precipitation": "मुसळधार पाऊस",
"possible-very-light-rain": "पावसाच्या हलक्या सरी",
"very-light-rain": "थोड्या प्रमाणात पाऊस",
"possible-light-rain": "रिमझिम पावसाची शक्यता",
"light-rain": "रिमझिम पाऊस",
"medium-rain": "मध्यम स्वरूपाच्या पावसाची शक्यता",
"heavy-rain": "मुसळधार पाऊस",
"possible-very-light-sleet": "थोड्या प्रमाणात गारा पडण्याची शक्यता",
"very-light-sleet": "अत्यल्प प्रमाणात गारा पडण्याची शक्यता",
"possible-light-sleet": "थोड्या प्रमाणात गारा पडण्याची शक्यता",
"light-sleet": "अल्प स्वरूपाच्या गारपिटीची शक्यता",
"medium-sleet": "मध्यम प्रमाणात गारा पडण्याची शक्यता",
"heavy-sleet": "गारपीट",
"possible-very-light-snow": "अत्यल्प हिमवर्षावाची शक्यता",
"very-light-snow": "अल्प हिमवर्षावाची शक्यता",
"possible-light-snow": "थोड्याफार प्रमाणात हिमवर्षावाची शक्यता",
"light-snow": "हलक्याशा हिमवर्षावाची शक्यता",
"medium-snow": "मध्यम प्रमाणात हिमवर्षाव",
"heavy-snow": "मोठ्या प्रमाणात हिमवर्षावाची शक्यता",
"possible-thunderstorm": "गडगडाटी वादळाची शक्यता",
"thunderstorm": "गडगडाटी वादळ",
"possible-medium-precipitation": "possible precipitation",
"possible-heavy-precipitation": "possible heavy precipitation",
"possible-medium-rain": "possible rain",
"possible-heavy-rain": "possible heavy rain",
"possible-medium-sleet": "possible sleet",
"possible-heavy-sleet": "possible heavy sleet",
"possible-medium-snow": "possible snow",
"possible-heavy-snow": "possible heavy snow",
"possible-freezing-drizzle": "possible freezing drizzle",
"freezing-drizzle": "freezing drizzle",
"possible-light-freezing-rain": "possible light freezing rain",
"light-freezing-rain": "light freezing rain",
"possible-freezing-rain": "possible freezing rain",
"freezing-rain": "freezing rain",
"possible-heavy-freezing-rain": "possible heavy freezing rain",
"heavy-freezing-rain": "heavy freezing rain",
"possible-hail": "possible hail",
"hail": "hail",
"light-wind": "वादळ",
"medium-wind": "मध्यम प्रमाणात वारा",
"heavy-wind": "सोसाट्याचा वारा",
"low-humidity": "कमी आर्द्रता",
"high-humidity": "उच्च आर्द्रता",
"fog": "धुके",
"very-light-clouds": "बहुतांशी स्पष्ट",
"light-clouds": "अंशतः ढगाळ",
"medium-clouds": "मुख्यतः ढगाळ",
"heavy-clouds": "ढगाळ",
"today-morning": "आज सकाळी",
"later-today-morning": "आज सकाळ नंतर",
"today-afternoon": "आज दुपारी",
"later-today-afternoon": "आज दुपार नंतर",
"today-evening": "आज संध्याकाळी",
"later-today-evening": "आज संध्याकाळ नंतर",
"today-night": "आज रात्री",
"later-today-night": "आज रात्री नंतर",
"tomorrow-morning": "उद्या सकाळी",
"tomorrow-afternoon": "उद्या दुपारी",
"tomorrow-evening": "उद्या संध्याकाळी",
"tomorrow-night": "उद्या रात्री",
"morning": "सकाळी",
"afternoon": "दुपारी",
"evening": "संध्याकाळी",
"night": "रात्री",
"today": "आज",
"tomorrow": "उद्या",
"sunday": "रविवारी",
"monday": "सोमवारी",
"tuesday": "मंगळवारी",
"wednesday": "बुधवारी",
"thursday": "गुरुवारी",
"friday": "शुक्रवारी",
"saturday": "शनिवारी",
"next-sunday": "पुढच्या रविवारी",
"next-monday": "पुढच्या सोमवारी",
"next-tuesday": "पुढच्या मंगळवारी",
"next-wednesday": "पुढच्या बुधवारी",
"next-thursday": "पुढच्या गुरुवारी",
"next-friday": "पुढच्या शुक्रवारी",
"next-saturday": "पुढच्या शनिवारी",
"minutes": "$1 मिनट",
"fahrenheit": "$1\u00b0F",
"celsius": "$1\u00b0C",
"inches": "$1 इंच",
"centimeters": "$1 सेंटीमीटर",
"less-than": "$1 पेक्षा कमी",
"for-hour": "$1 तासासाठी",
"starting-in": "$1 $2 चालू होत आहे",
"stopping-in": "$1 $2 बंद होत आहे",
"starting-then-stopping-later": "$1 $2 सुरु होईल त्यानंतर बंद $3 नंतर",
"stopping-then-starting-later": "$1 $2 बंद होईल त्यानंतर चालू $3 नंतर",
"for-day": "$1 दिवसासाठी",
"starting": "$1 सुरु $2",
"until": "$1 पर्यंत $2",
"until-starting-again": "$1 $2 पुन्हा चालू होई पर्यंत $3",
"starting-continuing-until": "$1 $2 पर्यंत सुरू पुढे होईपर्यंत $3",
"during": "दरम्यान $1 $2",
"for-week": "$1 आठवड्यासाठी",
"over-weekend": "$1 आठवड्याचा शेवटी",
"temperatures-peaking": "तापमान मोठ्या प्रमाणात वाढत आहे $1 $2",
"temperatures-rising": "तापमान $1 $2 प्रमाणात वाढत आहे",
"temperatures-valleying": "तापमान $1 $2 मोठ्या प्रमाणात कमी होत आहे",
"temperatures-falling": "तापमान $1 $2 कमी होत आहे",
"and": "$1 आणि $2",
"through": "$1, माध्यमातून $2",
"with": "$1 च्या बरोबर $2",
"range": "$1\u2013$2",
"title": "$1",
"sentence": "$1",
"parenthetical": "$1 ($2)",
"next-hour-forecast-status": "next hour forecasts are $1 due to $2",
"unavailable": "unavailable",
"temporarily-unavailable": "temporarily unavailable",
"partially-unavailable": "partially unavailable",
"station-offline": "all nearby radar stations being offline",
"station-incomplete": "gaps in coverage from nearby radar stations",
}
Loading

0 comments on commit 6cf8323

Please sign in to comment.