From ceb13a6405a452f6e8ac3ddd22448240490ce156 Mon Sep 17 00:00:00 2001
From: eal <eal@waifu.club>
Date: Wed, 8 Nov 2017 22:18:42 +0200
Subject: [PATCH] Add timeago locales.

---
 src/main.js                              | 15 +++++++++++----
 static/timeago-de.json                   | 10 ++++++++++
 static/{timeago.json => timeago-en.json} |  0
 static/timeago-et.json                   | 10 ++++++++++
 static/timeago-fi.json                   | 10 ++++++++++
 static/timeago-fr.json                   | 10 ++++++++++
 static/timeago-hu.json                   | 10 ++++++++++
 static/timeago-it.json                   | 10 ++++++++++
 static/timeago-ja.json                   | 10 ++++++++++
 9 files changed, 81 insertions(+), 4 deletions(-)
 create mode 100644 static/timeago-de.json
 rename static/{timeago.json => timeago-en.json} (100%)
 create mode 100644 static/timeago-et.json
 create mode 100644 static/timeago-fi.json
 create mode 100644 static/timeago-fr.json
 create mode 100644 static/timeago-hu.json
 create mode 100644 static/timeago-it.json
 create mode 100644 static/timeago-ja.json

diff --git a/src/main.js b/src/main.js
index 9d2930b6..a387b444 100644
--- a/src/main.js
+++ b/src/main.js
@@ -25,12 +25,21 @@ import createPersistedState from './lib/persisted_state.js'
 
 import messages from './i18n/messages.js'
 
+const currentLocale = (window.navigator.language || 'en').split('-')[0]
+
 Vue.use(Vuex)
 Vue.use(VueRouter)
 Vue.use(VueTimeago, {
-  locale: 'en-US',
+  locale: currentLocale,
   locales: {
-    'en-US': require('../static/timeago.json')
+    'en': require('../static/timeago-en.json'),
+    'fi': require('../static/timeago-fi.json'),
+    'de': require('../static/timeago-de.json'),
+    'et': require('../static/timeago-et.json'),
+    'hu': require('../static/timeago-hu.json'),
+    'it': require('../static/timeago-it.json'),
+    'fr': require('../static/timeago-fr.json'),
+    'ja': require('../static/timeago-ja.json')
   }
 })
 Vue.use(VueI18n)
@@ -83,8 +92,6 @@ const router = new VueRouter({
   }
 })
 
-const currentLocale = (window.navigator.language || 'en').split('-')[0]
-
 const i18n = new VueI18n({
   locale: currentLocale,
   fallbackLocale: 'en',
diff --git a/static/timeago-de.json b/static/timeago-de.json
new file mode 100644
index 00000000..da5766a0
--- /dev/null
+++ b/static/timeago-de.json
@@ -0,0 +1,10 @@
+[
+  "jetzt gerade",
+  ["vor %s Sekunde", "vor %s Sekunden"],
+  ["vor %s Minute", "vor %s Minuten"],
+  ["vor %s Stunde", "vor %s Stunden"],
+  ["vor %s Tag", "vor %s Tagen"],
+  ["vor %s Woche", "vor %s Wochen"],
+  ["vor %s Monat", "vor %s Monaten"],
+  ["vor %s Jahr", "vor %s Jahren"]
+]
diff --git a/static/timeago.json b/static/timeago-en.json
similarity index 100%
rename from static/timeago.json
rename to static/timeago-en.json
diff --git a/static/timeago-et.json b/static/timeago-et.json
new file mode 100644
index 00000000..68b405ed
--- /dev/null
+++ b/static/timeago-et.json
@@ -0,0 +1,10 @@
+[
+  "praegu",
+  ["%s sekund tagasi", "%s sekundit tagasi"],
+  ["%s minut tagasi", "%s minutit tagasi"],
+  ["%s tund tagasi", "%s tundi tagasi"],
+  ["%s päev tagasi", "%s päeva tagasi"],
+  ["%s nädal tagasi", "%s nädalat tagasi"],
+  ["%s kuu tagasi", "%s kuud tagasi"],
+  ["%s aasta tagasi", "%s aastat tagasi"]
+]
diff --git a/static/timeago-fi.json b/static/timeago-fi.json
new file mode 100644
index 00000000..066588c0
--- /dev/null
+++ b/static/timeago-fi.json
@@ -0,0 +1,10 @@
+[
+  "juuri nyt",
+  ["%s sekunti sitten", "%s sekuntia sitten"],
+  ["%s minuutti sitten", "%s minuuttia sitten"],
+  ["%s tunti sitten", "%s tuntia sitten"],
+  ["%s päivä sitten", "%s päivää sitten"],
+  ["%s viikko sitten", "%s viikkoa sitten"],
+  ["%s kuukausi sitten", "%s kuukautta sitten"],
+  ["%s vuosi sitten", "%s vuotta sitten"]
+]
diff --git a/static/timeago-fr.json b/static/timeago-fr.json
new file mode 100644
index 00000000..95c4a409
--- /dev/null
+++ b/static/timeago-fr.json
@@ -0,0 +1,10 @@
+[
+  "à l'instant",
+  ["il y a %s seconde", "il y a %s secondes"],
+  ["il y a %s minute",  "il y a %s minutes"],
+  ["il y a %s heure",   "il y a %s heures"],
+  ["il y a %s jour",    "il y a %s jours"],
+  ["il y a %s semaine", "il y a %s semaines"],
+  ["il y a %s mois",    "il y a %s mois"],
+  ["il y a %s an",      "il y a %s ans"]
+]
diff --git a/static/timeago-hu.json b/static/timeago-hu.json
new file mode 100644
index 00000000..2e6e405d
--- /dev/null
+++ b/static/timeago-hu.json
@@ -0,0 +1,10 @@
+[
+  "pont most",
+  "%s másodperce",
+  "%s perce",
+  "%s órája",
+  "%s napja",
+  "%s hete",
+  "%s hónapja",
+  "%s éve"
+]
diff --git a/static/timeago-it.json b/static/timeago-it.json
new file mode 100644
index 00000000..39b4cd11
--- /dev/null
+++ b/static/timeago-it.json
@@ -0,0 +1,10 @@
+[
+  "adesso",
+  ["%s secondo fa", "%s secondi fa"],
+  ["%s minuto fa", "%s minuti fa"],
+  ["%s ora fa", "%s ore fa"],
+  ["%s giorno fa", "%s giorni fa"],
+  ["%s settimana fa", "%s settimane fa"],
+  ["%s mese fa", "%s mesi fa"],
+  ["%s anno fa", "%s anni fa"]
+]
diff --git a/static/timeago-ja.json b/static/timeago-ja.json
new file mode 100644
index 00000000..a0f975be
--- /dev/null
+++ b/static/timeago-ja.json
@@ -0,0 +1,10 @@
+[
+  "たった今",
+  "%s 秒前",
+  "%s 分前",
+  "%s 時間前",
+  "%s 日前",
+  "%s 週間前",
+  "%s ヶ月前",
+  "%s 年前"
+]