From cfa97405892d862ccd24e71c83d60805c1cde88f Mon Sep 17 00:00:00 2001 From: Riley Trautman Date: Thu, 16 Nov 2017 16:51:28 -0600 Subject: [PATCH] Finish fixing locales, themes --- app/helpers/settings_helper.rb | 1 + .../mastodon/locales/locale-data/dog.js | 115 +++++++ .../mastodon/locales/locale-data/oc.js | 311 ++++++------------ app/javascript/styles/custom.scss | 5 + app/javascript/styles/dog.scss | 2 +- config/themes.yml | 2 +- 6 files changed, 223 insertions(+), 213 deletions(-) create mode 100644 app/javascript/mastodon/locales/locale-data/dog.js create mode 100644 app/javascript/styles/custom.scss diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index abce85812..7895fe764 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -2,6 +2,7 @@ module SettingsHelper HUMAN_LOCALES = { + dog: 'Dog', en: 'English', ar: 'العربية', bg: 'Български', diff --git a/app/javascript/mastodon/locales/locale-data/dog.js b/app/javascript/mastodon/locales/locale-data/dog.js new file mode 100644 index 000000000..614d3efad --- /dev/null +++ b/app/javascript/mastodon/locales/locale-data/dog.js @@ -0,0 +1,115 @@ +/*eslint eqeqeq: "off"*/ +/*eslint no-nested-ternary: "off"*/ +/*eslint quotes: "off"*/ + +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" + } + } + } + } + } +]; diff --git a/app/javascript/mastodon/locales/locale-data/oc.js b/app/javascript/mastodon/locales/locale-data/oc.js index 15f264632..c4b56350b 100644 --- a/app/javascript/mastodon/locales/locale-data/oc.js +++ b/app/javascript/mastodon/locales/locale-data/oc.js @@ -2,218 +2,107 @@ /*eslint no-nested-ternary: "off"*/ /*eslint quotes: "off"*/ -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" +export default [{ + locale: "oc", + pluralRuleFunction: function (e, a) { + return a ? 1 == e ? "one" : "other" : e >= 0 && e < 2 ? "one" : "other"; + }, + fields: { + year: { + displayName: "an", + relative: { + 0: "ongan", + 1: "l'an que ven", + "-1": "l'an passat", + }, + relativeTime: { + future: { + one: "dins {0} an", + other: "dins {0} ans", }, - 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" - } - } - } - } + past: { + one: "fa {0} an", + other: "fa {0} ans", + }, + }, }, - { - locale: "oc", - pluralRuleFunction: function (e, a) { - return a ? 1 == e ? "one" : "other" : e >= 0 && e < 2 ? "one" : "other"; + month: { + displayName: "mes", + relative: { + 0: "aqueste mes", + 1: "lo mes que ven", + "-1": "lo mes passat", + }, + relativeTime: { + future: { + one: "dins {0} mes", + other: "dins {0} meses", }, - fields: { - year: { - displayName: "an", - relative: { - 0: "ongan", - 1: "l'an que ven", - "-1": "l'an passat", - }, - relativeTime: { - future: { - one: "dins {0} an", - other: "dins {0} ans", - }, - past: { - one: "fa {0} an", - other: "fa {0} ans", - }, - }, - }, - month: { - displayName: "mes", - relative: { - 0: "aqueste mes", - 1: "lo mes que ven", - "-1": "lo mes passat", - }, - relativeTime: { - future: { - one: "dins {0} mes", - other: "dins {0} meses", - }, - past: { - one: "fa {0} mes", - other: "fa {0} meses", - }, - }, - }, - day: { - displayName: "jorn", - relative: { - 0: "uèi", - 1: "deman", - "-1": "ièr", - }, - relativeTime: { - future: { - one: "dins {0} jorn", - other: "dins {0} jorns", - }, - past: { - one: "fa {0} jorn", - other: "fa {0} jorns", - }, - }, - }, - hour: { - displayName: "ora", - relativeTime: { - future: { - one: "dins {0} ora", - other: "dins {0} oras", - }, - past: { - one: "fa {0} ora", - other: "fa {0} oras", - }, - }, - }, - minute: { - displayName: "minuta", - relativeTime: { - future: { - one: "dins {0} minuta", - other: "dins {0} minutas", - }, - past: { - one: "fa {0} minuta", - other: "fa {0} minutas", - }, - }, - }, - second: { - displayName: "segonda", - relative: { - 0: "ara", - }, - relativeTime: { - future: { - one: "dins {0} segonda", - other: "dins {0} segondas", - }, - past: { - one: "fa {0} segonda", - other: "fa {0} segondas", - }, - }, - }, + past: { + one: "fa {0} mes", + other: "fa {0} meses", }, - } -]; + }, + }, + day: { + displayName: "jorn", + relative: { + 0: "uèi", + 1: "deman", + "-1": "ièr", + }, + relativeTime: { + future: { + one: "dins {0} jorn", + other: "dins {0} jorns", + }, + past: { + one: "fa {0} jorn", + other: "fa {0} jorns", + }, + }, + }, + hour: { + displayName: "ora", + relativeTime: { + future: { + one: "dins {0} ora", + other: "dins {0} oras", + }, + past: { + one: "fa {0} ora", + other: "fa {0} oras", + }, + }, + }, + minute: { + displayName: "minuta", + relativeTime: { + future: { + one: "dins {0} minuta", + other: "dins {0} minutas", + }, + past: { + one: "fa {0} minuta", + other: "fa {0} minutas", + }, + }, + }, + second: { + displayName: "segonda", + relative: { + 0: "ara", + }, + relativeTime: { + future: { + one: "dins {0} segonda", + other: "dins {0} segondas", + }, + past: { + one: "fa {0} segonda", + other: "fa {0} segondas", + }, + }, + }, + }, +}]; diff --git a/app/javascript/styles/custom.scss b/app/javascript/styles/custom.scss new file mode 100644 index 000000000..7b9e92dce --- /dev/null +++ b/app/javascript/styles/custom.scss @@ -0,0 +1,5 @@ +@import 'application'; + +.column { + flex-grow: 1 !important; +} diff --git a/app/javascript/styles/dog.scss b/app/javascript/styles/dog.scss index 86e6c5294..c07d33051 100644 --- a/app/javascript/styles/dog.scss +++ b/app/javascript/styles/dog.scss @@ -25,4 +25,4 @@ $ui-primary-color: #c9c7c5; // Echo Blue $ui-secondary-color: #ebe9e8; // Pattens Blue $ui-highlight-color: #48b9c7; // Summer Sky -@import 'application'; +@import 'custom'; diff --git a/config/themes.yml b/config/themes.yml index 8a455ce66..f464fab14 100644 --- a/config/themes.yml +++ b/config/themes.yml @@ -1,2 +1,2 @@ default: styles/dog.scss -mastodon: styles/application.scss +mastodon: styles/custom.scss