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

Add Czech language option and locale data #8594

Merged
merged 4 commits into from Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions app/helpers/settings_helper.rb
Expand Up @@ -8,6 +8,7 @@ module SettingsHelper
bg: 'Български',
ca: 'Català',
co: 'Corsu',
cs: 'Čeština',
cy: 'Cymraeg',
da: 'Dansk',
de: 'Deutsch',
Expand Down
138 changes: 138 additions & 0 deletions app/javascript/mastodon/locales/locale-data/Mastodon-cs-data.txt
@@ -0,0 +1,138 @@
/*eslint eqeqeq: "off"*/
Copy link
Sponsor Member

@ykzts ykzts Sep 3, 2018

Choose a reason for hiding this comment

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

locale-data/cs.js already exists.

Copy link
Member

Choose a reason for hiding this comment

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

Also the file is named Mastodon-cs-data.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, was uploading that and forgot to rename it.

/*eslint no-nested-ternary: "off"*/

export default [
{
locale: "cs",
pluralRuleFunction: function(e, a) {
var n = String(e).split("."),
l = !n[1],
o = Number(n[0]) == e,
t = o && n[0].slice(-1),
r = o && n[0].slice(-2);
return a ? "other" : 1 == e && l ? "one" : e >= 2 && e < 5 && l ? "few" : !l ? "many" : "other"
},
fields: {
year: {
displayName: "rok",
relative: {
0: "tento rok",
1: "příští rok",
"-1": "minulý rok"
},
relativeTime: {
future: {
one: "za {0} rok",
few: "za {0} roky",
many: "za {0} roku",
other: "za {0} let"
},
past: {
one: "před {0} rokem",
few: "před {0} roky",
many: "před {0} roku",
other: "před {0} lety"
}
}
},
month: {
displayName: "měsíc",
relative: {
0: "tento měsíc",
1: "příští měsíc",
"-1": "minulý měsíc"
},
relativeTime: {
future: {
one: "za {0} měsíc",
few: "za {0} měsíce",
many: "za {0} měsíce",
other: "za {0} měsíců"
},
past: {
one: "před {0} měsícem",
few: "před {0} měsíci",
many: "před {0} měsíce",
other: "před {0} měsíci"
}
}
},
day: {
displayName: "den",
relative: {
0: "dnes",
1: "zítra",
"-1": "včera"
},
relativeTime: {
future: {
one: "za {0} den",
few: "za {0} dny",
many: "za {0} dne",
other: "za {0} dní"
},
past: {
one: "před {0} dnem",
few: "před {0} dny",
many: "před {0} dne",
other: "před {0} dny"
}
}
},
hour: {
displayName: "hodina",
relativeTime: {
future: {
one: "za {0} hodinu",
few: "za {0} hodiny",
many: "za {0} hodiny",
other: "za {0} hodin"
},
past: {
one: "před {0} hodinou",
few: "před {0} hodinami",
many: "před {0} hodiny",
other: "před {0} hodinami"
}
}
},
minute: {
displayName: "minuta",
relativeTime: {
future: {
one: "za {0} minutu",
few: "za {0} minuty",
many: "za {0} minuty",
other: "za {0} minut"
},
past: {
one: "před {0} minutou",
few: "před {0} minutami",
many: "před {0} minuty",
other: "před {0} minutami"
}
}
},
second: {
displayName: "sekunda",
relative: {
0: "teď"
},
relativeTime: {
future: {
one: "za {0} sekundu",
few: "za {0} sekundy",
many: "za {0} sekundy",
other: "za {0} sekund"
},
past: {
one: "před {0} sekundou",
few: "před {0} sekundami",
many: "před {0} sekundy",
other: "před {0} sekundami"
}
}
}
}
}
]
1 change: 1 addition & 0 deletions config/application.rb
Expand Up @@ -42,6 +42,7 @@ class Application < Rails::Application
:bg,
:ca,
:co,
:cs,
:cy,
:da,
:de,
Expand Down