diff --git a/lang/de-DE.json b/lang/de-DE.json index 0128943e..df6adaa1 100644 --- a/lang/de-DE.json +++ b/lang/de-DE.json @@ -12,12 +12,14 @@ "button.more": "Mehr", "button.save": "Speichern", "button.view-details": "Details anzeigen", + "button.websites": "Webseiten", "footer.powered-by": "Powered by", "header.nav.dashboard": "Übersicht", "header.nav.settings": "Einstellungen", "label.administrator": "Administrator", "label.confirm-password": "Passwort wiederholen", "label.current-password": "Derzeitiges Passwort", + "label.custom-range": "Custom range", "label.domain": "Domain", "label.enable-share-url": "Freigabe-URL aktivieren", "label.invalid": "Ungültig", diff --git a/lang/en-US.json b/lang/en-US.json index e9ebdf6b..e24b9347 100644 --- a/lang/en-US.json +++ b/lang/en-US.json @@ -12,12 +12,14 @@ "button.more": "More", "button.save": "Save", "button.view-details": "View details", + "button.websites": "Websites", "footer.powered-by": "Powered by", "header.nav.dashboard": "Dashboard", "header.nav.settings": "Settings", "label.administrator": "Administrator", "label.confirm-password": "Confirm password", "label.current-password": "Current password", + "label.custom-range": "Custom range", "label.domain": "Domain", "label.enable-share-url": "Enable share URL", "label.invalid": "Invalid", diff --git a/lang/es-MX.json b/lang/es-MX.json index 783992d8..e089ef7f 100644 --- a/lang/es-MX.json +++ b/lang/es-MX.json @@ -12,12 +12,14 @@ "button.more": "Más", "button.save": "Guardar", "button.view-details": "Ver detalles", + "button.websites": "Sitios", "footer.powered-by": "Desarrollado con", "header.nav.dashboard": "Panel de control", "header.nav.settings": "Configuraciones", "label.administrator": "Administrador", "label.confirm-password": "Confirmar contraseña", "label.current-password": "Contraseña actual", + "label.custom-range": "Custom range", "label.domain": "Dominio", "label.enable-share-url": "Habilitar compartir URL", "label.invalid": "Inválido", @@ -42,6 +44,7 @@ "message.failure": "Algo falló.", "message.incorrect-username-password": "Nombre de usuario o contraseña incorrectos.", "message.no-data-available": "Sin información disponible.", + "message.page-not-found": "Page not found", "message.save-success": "Guardado exitosamente.", "message.share-url": "Esta es la URL compartida públicamente para {target}.", "message.track-stats": "Para registrar estadísticas para {target}, copia el siguiente código dentro de la etiqueta {head} de tu sitio.", diff --git a/lang/ja-JP.json b/lang/ja-JP.json index 7d286428..cdeec4c8 100644 --- a/lang/ja-JP.json +++ b/lang/ja-JP.json @@ -12,12 +12,14 @@ "button.more": "さらに表示", "button.save": "保存", "button.view-details": "詳細表示", + "button.websites": "Webサイト", "footer.powered-by": "Powered by", "header.nav.dashboard": "ダッシュボード", "header.nav.settings": "設定", "label.administrator": "管理者", "label.confirm-password": "パスワード(確認)", "label.current-password": "現在のパスワード", + "label.custom-range": "Custom range", "label.domain": "ドメイン", "label.enable-share-url": "共有リンクを有効にする", "label.invalid": "無効", diff --git a/lang/nl-NL.json b/lang/nl-NL.json index 5e02d493..8d97ca43 100644 --- a/lang/nl-NL.json +++ b/lang/nl-NL.json @@ -12,12 +12,14 @@ "button.more": "Toon meer", "button.save": "Opslaan", "button.view-details": "Meer details", + "button.websites": "Websites", "footer.powered-by": "mogelijk gemaakt door", "header.nav.dashboard": "Dashboard", "header.nav.settings": "Instellingen", "label.administrator": "Administrator", "label.confirm-password": "Wachtwoord bevestigen", "label.current-password": "Huidig wachtwoord", + "label.custom-range": "Custom range", "label.domain": "Domein", "label.enable-share-url": "Sta delen via openbare URL toe", "label.invalid": "Ongeldig", diff --git a/lang/ru-RU.json b/lang/ru-RU.json index a173c970..5c6e9df7 100644 --- a/lang/ru-RU.json +++ b/lang/ru-RU.json @@ -12,12 +12,14 @@ "button.more": "Больше", "button.save": "Сохранить", "button.view-details": "Посмотреть детали", + "button.websites": "Сайты", "footer.powered-by": "на движке", "header.nav.dashboard": "Информационная панель", "header.nav.settings": "Настройки", "label.administrator": "Администратор", "label.confirm-password": "Подтвердить пароль", "label.current-password": "Текущий пароль", + "label.custom-range": "Custom range", "label.domain": "Домен", "label.enable-share-url": "Разрешить делиться ссылкой", "label.invalid": "Некорректный", diff --git a/lang/tr-TR.json b/lang/tr-TR.json index 20a1c441..8e9f100c 100644 --- a/lang/tr-TR.json +++ b/lang/tr-TR.json @@ -12,12 +12,14 @@ "button.more": "Detaylı göster", "button.save": "Kaydet", "button.view-details": "Detayı incele", + "button.websites": "Web siteleri", "footer.powered-by": "Sağlayıcı:", "header.nav.dashboard": "Kontrol Paneli", "header.nav.settings": "Ayarlar", "label.administrator": "Yönetici", "label.confirm-password": "Parolayı onayla", "label.current-password": "Mevcut parola", + "label.custom-range": "Custom range", "label.domain": "Alan adı", "label.enable-share-url": "Anonim paylaşım URL'i aktif", "label.invalid": "Geçeriz", diff --git a/lang/zh-CN.json b/lang/zh-CN.json index c050e6a6..1f21eb0f 100644 --- a/lang/zh-CN.json +++ b/lang/zh-CN.json @@ -12,12 +12,14 @@ "button.more": "更多", "button.save": "保存", "button.view-details": "查看更多", + "button.websites": "网站", "footer.powered-by": "运行", "header.nav.dashboard": "仪表板", "header.nav.settings": "设置", "label.administrator": "管理员", "label.confirm-password": "确认密码", "label.current-password": "目前密码", + "label.custom-range": "Custom range", "label.domain": "域名", "label.enable-share-url": "激活共享链接", "label.invalid": "输入无效", diff --git a/lib/lang.js b/lib/lang.js index f66aa0ac..3f097a2e 100644 --- a/lib/lang.js +++ b/lib/lang.js @@ -33,12 +33,12 @@ export const dateLocales = { export const menuOptions = [ { label: 'English', value: 'en', display: 'EN' }, - { label: '中文 (Chinese Simplified)', value: 'zh-CN', display: '中文' }, - { label: 'Nederlands (Dutch)', value: 'nl-NL', display: 'NL' }, - { label: 'Deutsch (German)', value: 'de-DE', display: 'DE' }, - { label: '日本語 (Japanese)', value: 'ja-JP', display: '日本語' }, - { label: 'Español (Mexicano)', value: 'es-MX', display: 'ES' }, - { label: 'Русский (Russian)', value: 'ru-RU', display: 'РУ' }, + { label: '中文', value: 'zh-CN', display: 'CN' }, + { label: 'Deutsch', value: 'de-DE', display: 'DE' }, + { label: 'Español', value: 'es-MX', display: 'ES' }, + { label: '日本語', value: 'ja-JP', display: 'JP' }, + { label: 'Nederlands', value: 'nl-NL', display: 'NL' }, + { label: 'Русский', value: 'ru-RU', display: 'RU' }, { label: 'Turkish', value: 'tr-TR', display: 'TR' }, ]; diff --git a/package.json b/package.json index f9541179..25c50c7d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "umami", - "version": "0.31.0", + "version": "0.32.0", "description": "A simple, fast, website analytics alternative to Google Analytics. ", "author": "Mike Cao ", "license": "MIT", @@ -23,10 +23,10 @@ "build-postgresql-schema": "dotenv prisma introspect -- --schema=./prisma/schema.postgresql.prisma", "build-postgresql-client": "dotenv prisma generate -- --schema=./prisma/schema.postgresql.prisma", "build-lang": "npm-run-all format-lang compile-lang", - "extract-lang": "formatjs extract {pages,components}/**/*.js --out-file lang/en-US.json", + "extract-lang": "formatjs extract {pages,components}/**/*.js --out-file build/messages.json", "merge-lang": "node scripts/merge-lang.js", "format-lang": "node scripts/format-lang.js", - "compile-lang": "formatjs compile-folder --ast lang-formatted lang-compiled" + "compile-lang": "formatjs compile-folder --ast build lang-compiled" }, "lint-staged": { "**/*.js": [ diff --git a/scripts/format-lang.js b/scripts/format-lang.js index f26c0249..5b03239e 100644 --- a/scripts/format-lang.js +++ b/scripts/format-lang.js @@ -3,7 +3,7 @@ const path = require('path'); const prettier = require('prettier'); const src = path.resolve(__dirname, '../lang'); -const dest = path.resolve(__dirname, '../lang-formatted'); +const dest = path.resolve(__dirname, '../build'); const files = fs.readdirSync(src); if (!fs.existsSync(dest)) { diff --git a/scripts/merge-lang.js b/scripts/merge-lang.js index 885bf759..f1b86df9 100644 --- a/scripts/merge-lang.js +++ b/scripts/merge-lang.js @@ -1,11 +1,11 @@ const fs = require('fs'); const path = require('path'); const prettier = require('prettier'); -const root = require('../lang/en-US.json'); +const messages = require('../build/messages.json'); -const dir = path.resolve(__dirname, '../lang'); -const files = fs.readdirSync(dir); -const keys = Object.keys(root).sort(); +const dest = path.resolve(__dirname, '../lang'); +const files = fs.readdirSync(dest); +const keys = Object.keys(messages).sort(); files.forEach(file => { const lang = require(`../lang/${file}`); @@ -15,7 +15,7 @@ files.forEach(file => { const merged = keys.reduce((obj, key) => { const message = lang[key]; - obj[key] = message || root[key]; + obj[key] = message || messages[key].defaultMessage; if (!message) { console.log(`* Added key ${key}`); @@ -26,5 +26,5 @@ files.forEach(file => { const json = prettier.format(JSON.stringify(merged), { parser: 'json' }); - fs.writeFileSync(path.resolve(dir, file), json); + fs.writeFileSync(path.resolve(dest, file), json); });