More locale things
This commit is contained in:
parent
b7be269980
commit
7e1bf776e5
|
@ -2,7 +2,117 @@
|
||||||
/*eslint no-nested-ternary: "off"*/
|
/*eslint no-nested-ternary: "off"*/
|
||||||
/*eslint quotes: "off"*/
|
/*eslint quotes: "off"*/
|
||||||
|
|
||||||
export default [{
|
export default [
|
||||||
|
{
|
||||||
|
locale: "dog",
|
||||||
|
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 ? 1 == t && 11 != r ? "one" : 2 == t && 12 != r ? "two" : 3 == t && 13 != r ? "few" : "other" : 1 == e && l ? "one" : "other"
|
||||||
|
},
|
||||||
|
fields: {
|
||||||
|
year: {
|
||||||
|
displayName: "year",
|
||||||
|
relative: {
|
||||||
|
0: "this year",
|
||||||
|
1: "next year",
|
||||||
|
"-1": "last year"
|
||||||
|
},
|
||||||
|
relativeTime: {
|
||||||
|
future: {
|
||||||
|
one: "in {0} year",
|
||||||
|
other: "in {0} years"
|
||||||
|
},
|
||||||
|
past: {
|
||||||
|
one: "{0} year ago",
|
||||||
|
other: "{0} years ago"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
month: {
|
||||||
|
displayName: "month",
|
||||||
|
relative: {
|
||||||
|
0: "this month",
|
||||||
|
1: "next month",
|
||||||
|
"-1": "last month"
|
||||||
|
},
|
||||||
|
relativeTime: {
|
||||||
|
future: {
|
||||||
|
one: "in {0} month",
|
||||||
|
other: "in {0} months"
|
||||||
|
},
|
||||||
|
past: {
|
||||||
|
one: "{0} month ago",
|
||||||
|
other: "{0} months ago"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
day: {
|
||||||
|
displayName: "day",
|
||||||
|
relative: {
|
||||||
|
0: "today",
|
||||||
|
1: "tomorrow",
|
||||||
|
"-1": "yesterday"
|
||||||
|
},
|
||||||
|
relativeTime: {
|
||||||
|
future: {
|
||||||
|
one: "in {0} day",
|
||||||
|
other: "in {0} days"
|
||||||
|
},
|
||||||
|
past: {
|
||||||
|
one: "{0} day ago",
|
||||||
|
other: "{0} days ago"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hour: {
|
||||||
|
displayName: "hour",
|
||||||
|
relativeTime: {
|
||||||
|
future: {
|
||||||
|
one: "in {0} hour",
|
||||||
|
other: "in {0} hours"
|
||||||
|
},
|
||||||
|
past: {
|
||||||
|
one: "{0} hour ago",
|
||||||
|
other: "{0} hours ago"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
minute: {
|
||||||
|
displayName: "minute",
|
||||||
|
relativeTime: {
|
||||||
|
future: {
|
||||||
|
one: "in {0} minute",
|
||||||
|
other: "in {0} minutes"
|
||||||
|
},
|
||||||
|
past: {
|
||||||
|
one: "{0} minute ago",
|
||||||
|
other: "{0} minutes ago"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
second: {
|
||||||
|
displayName: "second",
|
||||||
|
relative: {
|
||||||
|
0: "now"
|
||||||
|
},
|
||||||
|
relativeTime: {
|
||||||
|
future: {
|
||||||
|
one: "in {0} second",
|
||||||
|
other: "in {0} seconds"
|
||||||
|
},
|
||||||
|
past: {
|
||||||
|
one: "{0} second ago",
|
||||||
|
other: "{0} seconds ago"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
locale: "oc",
|
locale: "oc",
|
||||||
pluralRuleFunction: function (e, a) {
|
pluralRuleFunction: function (e, a) {
|
||||||
return a ? 1 == e ? "one" : "other" : e >= 0 && e < 2 ? "one" : "other";
|
return a ? 1 == e ? "one" : "other" : e >= 0 && e < 2 ? "one" : "other";
|
||||||
|
@ -105,4 +215,5 @@ export default [{
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
|
|
2
app/javascript/mastodon/locales/whitelist_dog.json
Normal file
2
app/javascript/mastodon/locales/whitelist_dog.json
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[
|
||||||
|
]
|
|
@ -29,6 +29,7 @@ module Mastodon
|
||||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||||
config.i18n.available_locales = [
|
config.i18n.available_locales = [
|
||||||
|
:dog,
|
||||||
:en,
|
:en,
|
||||||
:ar,
|
:ar,
|
||||||
:bg,
|
:bg,
|
||||||
|
@ -63,7 +64,7 @@ module Mastodon
|
||||||
:'zh-TW',
|
:'zh-TW',
|
||||||
]
|
]
|
||||||
|
|
||||||
config.i18n.default_locale = :en
|
config.i18n.default_locale = :dog
|
||||||
|
|
||||||
# config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb')
|
# config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb')
|
||||||
# config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')]
|
# config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')]
|
||||||
|
|
Loading…
Reference in a new issue