Skip to content

Commit

Permalink
Merge branch 'eragnms-adding-swedish-language'
Browse files Browse the repository at this point in the history
  • Loading branch information
waqasshabbir committed May 21, 2017
2 parents 29ba09b + fba5e1d commit 157317d
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ docs/_build

# Vim temp files
*.swp

.idea
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ Supported languages
* Romanian
* Russian
* Spanish
* Swedish
* Thai
* Turkish
* Ukrainian
Expand Down
113 changes: 113 additions & 0 deletions data/languagefiles/sv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Swedish

dateorder: YMD

skip: ["på", "den"]

monday:
- Mån
- Månd
- Måndag
tuesday:
- Tis
- Tisdag
- Tisd
wednesday:
- Ons
- Onsdag
- Onsd
thursday:
- Tors
- Torsdag
- Torsd
friday:
- Fre
- Fredag
- Fred
saturday:
- Lör
- Lördag
- Lörd
sunday:
- Sön
- Söndag
- Sönd

january:
- Jan
- Januari
february:
- Feb
- Februari
march:
- Mar
- Mars
april:
- Apr
- April
may:
- Maj
june:
- Jun
- Juni
july:
- Jul
- Juli
august:
- Aug
- Augusti
september:
- Sep
- Sept
- September
october:
- Okt
- Oktober
november:
- Nov
- November
december:
- Dec
- December

year:
- år
month:
- månad
- månader
- månaden
week:
- vecka
- veckor
day:
- dag
- dagar
hour:
- h
- timme
- timmar
- t
minute:
- m
- minut
- minuter
second:
- s
- sekund
- sekunder

ago:
- sedan
in:
- om
- från nu

simplifications:
- förrgår: 2 dagar
- igår: 1 dag
- imorgon: om 1 dag
- idag: 0 dagar
- förra (veckan|månaden|året): 1 \1
- nästa (vecka|månad|år): om 1 \1
- en: 1
- två: 2
4 changes: 3 additions & 1 deletion data/languages.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
base:
skip: [" ", ".", ",", ";", "-", "/", "'", "|", "@", "[", "]", ","]

languageorder: ['en', 'ar', 'be', 'bg', 'bn', 'cs', 'da', 'de', 'es', 'fa', 'fi', 'fr', 'he', 'hi', 'hu', 'id', 'it', 'ja', 'ka', 'nl', 'pl', 'pt', 'ro', 'ru', 'th', 'tl', 'tr', 'uk', 'vi', 'zh']

languageorder: ['en', 'ar', 'be', 'bg', 'bn', 'cs', 'da', 'de', 'es', 'fa', 'fi', 'fr', 'he', 'hi', 'hu', 'id', 'it', 'ja', 'ka', 'nl', 'pl', 'pt', 'ro', 'ru', 'sv', 'th', 'tl', 'tr', 'uk', 'vi', 'zh']

ar: !include languagefiles/ar.yaml
be: !include languagefiles/be.yaml
Expand All @@ -27,6 +28,7 @@ pl: !include languagefiles/pl.yaml
pt: !include languagefiles/pt.yaml
ro: !include languagefiles/ro.yaml
ru: !include languagefiles/ru.yaml
sv: !include languagefiles/sv.yaml
th: !include languagefiles/th.yaml
tl: !include languagefiles/tl.yaml
tr: !include languagefiles/tr.yaml
Expand Down
10 changes: 10 additions & 0 deletions tests/test_languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ def setUp(self):
param('hi', 'सोमवार 13 जून 1998','monday 13 june 1998'),
param('hi', 'मंगल 16 1786 12:18','tuesday 16 1786 12:18'),
param('hi','शनि 11 अप्रैल 2002 03:09','saturday 11 april 2002 03:09'),
# Swedish
param('sv', "Sept 03 2014", "september 03 2014"),
param('sv', "fredag, 03 september 2014", "friday 03 september 2014"),
])
def test_translation(self, shortname, datetime_string, expected_translation):
self.given_bundled_language(shortname)
Expand Down Expand Up @@ -407,6 +411,12 @@ def test_translation(self, shortname, datetime_string, expected_translation):
param('hi', "सन् १९२०"," 1920"),
param('hi',"आठ पूर्वाह्न","8 am"),
param('hi',"बारह सेकंड पूर्व","12 second ago"),
# Swedish
param('sv', "igår", "1 day"),
param('sv', "idag", "0 day"),
param('sv', "förrgår", "2 day"),
param('sv', "förra månaden", "1 month"),
param('sv', "nästa månad", "in 1 month"),
# Georgian
param('ka', 'გუშინ', '1 day'),
param('ka', 'დღეს', '0 day'),
Expand Down

0 comments on commit 157317d

Please sign in to comment.