Browse Source

Added Czech language.

dev
Mike Cao 11 months ago
parent
commit
5b84378731
4 changed files with 25 additions and 14 deletions
  1. +1
    -0
      lang-ignore.json
  2. +18
    -13
      lib/lang.js
  3. +1
    -1
      package.json
  4. +5
    -0
      scripts/check-lang.js

+ 1
- 0
lang-ignore.json View File

@ -1,4 +1,5 @@
{
"cs-CZ": ["label.reset", "metrics.device.tablet"],
"de-DE": [
"label.administrator",
"label.name",


+ 18
- 13
lib/lang.js View File

@ -1,24 +1,25 @@
import { format } from 'date-fns';
import {
enUS,
nl,
zhCN,
zhTW,
tr,
ru,
cs,
da,
de,
ja,
el,
enUS,
es,
fi,
fr,
da,
sv,
el,
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' },


+ 1
- 1
package.json View File

@ -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 <mike@mikecao.com>",
"license": "MIT",


+ 5
- 0
scripts/check-lang.js View File

@ -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 => {


Loading…
Cancel
Save