diff --git a/lang-ignore.json b/lang-ignore.json index 56042b8d..8a01beb9 100644 --- a/lang-ignore.json +++ b/lang-ignore.json @@ -1,4 +1,5 @@ { + "cs-CZ": ["label.reset", "metrics.device.tablet"], "de-DE": [ "label.administrator", "label.name", diff --git a/lib/lang.js b/lib/lang.js index 25fcb5d7..07df1837 100644 --- a/lib/lang.js +++ b/lib/lang.js @@ -1,24 +1,25 @@ import { format } from 'date-fns'; import { - enUS, - nl, - zhCN, - zhTW, - tr, - ru, - de, - ja, - es, - fr, + cs, da, - sv, + de, el, + enUS, + es, + fi, + fr, + id, + ja, + nb, + nl, pt, ro, - nb, - id, + ru, + sv, + tr, uk, - fi, + zhCN, + zhTW, } from 'date-fns/locale'; import enMessages from 'lang-compiled/en-US.json'; import nlMessages from 'lang-compiled/nl-NL.json'; @@ -41,6 +42,7 @@ import nbNOMessages from 'lang-compiled/nb-NO.json'; import idMessages from 'lang-compiled/id-ID.json'; import ukMessages from 'lang-compiled/uk-UA.json'; import fiMessages from 'lang-compiled/fi-FI.json'; +import csMessages from 'lang-compiled/cs-CZ.json'; export const messages = { 'en-US': enMessages, @@ -64,6 +66,7 @@ export const messages = { 'id-ID': idMessages, 'uk-UA': ukMessages, 'fi-FI': fiMessages, + 'cs-CZ': csMessages, }; export const dateLocales = { @@ -88,11 +91,13 @@ export const dateLocales = { 'id-ID': id, 'uk-UA': uk, 'fi-FI': fi, + 'cs-CZ': cs, }; export const menuOptions = [ { label: '中文', value: 'zh-CN', display: 'cn' }, { label: '中文(繁體)', value: 'zh-TW', display: 'tw' }, + { label: 'Čeština', value: 'cs-CZ', display: 'cs' }, { label: 'Dansk', value: 'da-DK', display: 'da' }, { label: 'Deutsch', value: 'de-DE', display: 'de' }, { label: 'English', value: 'en-US', display: 'en' }, diff --git a/package.json b/package.json index b6dea4b1..889afc1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "umami", - "version": "1.0.0", + "version": "1.1.0", "description": "A simple, fast, website analytics alternative to Google Analytics. ", "author": "Mike Cao ", "license": "MIT", diff --git a/scripts/check-lang.js b/scripts/check-lang.js index b843efeb..823d7115 100644 --- a/scripts/check-lang.js +++ b/scripts/check-lang.js @@ -7,12 +7,17 @@ const ignore = require('../lang-ignore.json'); const dir = path.resolve(__dirname, '../lang'); const files = fs.readdirSync(dir); const keys = Object.keys(messages).sort(); +const filter = process.argv?.[2]; files.forEach(file => { if (file !== 'en-US.json') { const lang = require(`../lang/${file}`); const id = file.replace('.json', ''); + if (filter && filter !== id) { + return; + } + console.log(chalk.yellowBright(`\n## ${file.replace('.json', '')}`)); let count = 0; keys.forEach(key => {