diff --git a/i18n/generate.go b/i18n/generate.go new file mode 100644 index 0000000..9b93e4f --- /dev/null +++ b/i18n/generate.go @@ -0,0 +1,97 @@ +// Copyright 2021 The Casdoor Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package i18n + +import ( + "fmt" + "os" + "path/filepath" + "regexp" + "strings" + + "github.com/casbin/caswaf/util" +) + +type I18nData map[string]map[string]string + +var reI18n *regexp.Regexp + +func init() { + reI18n, _ = regexp.Compile("i18next.t\\(\"(.*?)\"\\)") +} + +func getAllI18nStrings(fileContent string) []string { + res := []string{} + + matches := reI18n.FindAllStringSubmatch(fileContent, -1) + if matches == nil { + return res + } + + for _, match := range matches { + res = append(res, match[1]) + } + return res +} + +func getAllJsFilePaths() []string { + path := "../web/src" + + res := []string{} + err := filepath.Walk(path, + func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + if !strings.HasSuffix(info.Name(), ".js") { + return nil + } + + res = append(res, path) + fmt.Println(path, info.Name()) + return nil + }) + if err != nil { + panic(err) + } + + return res +} + +func parseToData() *I18nData { + allWords := []string{} + paths := getAllJsFilePaths() + for _, path := range paths { + fileContent := util.ReadStringFromPath(path) + words := getAllI18nStrings(fileContent) + allWords = append(allWords, words...) + } + fmt.Printf("%v\n", allWords) + + data := I18nData{} + for _, word := range allWords { + tokens := strings.Split(word, ":") + namespace := tokens[0] + key := tokens[1] + + if _, ok := data[namespace]; !ok { + data[namespace] = map[string]string{} + } + data[namespace][key] = key + } + + return &data +} diff --git a/i18n/generate_test.go b/i18n/generate_test.go new file mode 100644 index 0000000..1d352e3 --- /dev/null +++ b/i18n/generate_test.go @@ -0,0 +1,42 @@ +// Copyright 2021 The Casdoor Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build !skipCi +// +build !skipCi + +package i18n + +import "testing" + +func applyToOtherLanguage(dataEn *I18nData, lang string) { + dataOther := readI18nFile(lang) + println(dataOther) + + applyData(dataEn, dataOther) + writeI18nFile(lang, dataEn) +} + +func TestGenerateI18nStrings(t *testing.T) { + dataEn := parseToData() + writeI18nFile("en", dataEn) + + applyToOtherLanguage(dataEn, "zh") + applyToOtherLanguage(dataEn, "fr") + applyToOtherLanguage(dataEn, "de") + applyToOtherLanguage(dataEn, "id") + applyToOtherLanguage(dataEn, "ja") + applyToOtherLanguage(dataEn, "ko") + applyToOtherLanguage(dataEn, "ru") + applyToOtherLanguage(dataEn, "es") +} diff --git a/i18n/util.go b/i18n/util.go new file mode 100644 index 0000000..2751fed --- /dev/null +++ b/i18n/util.go @@ -0,0 +1,63 @@ +// Copyright 2021 The Casdoor Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package i18n + +import ( + "fmt" + "strings" + + "github.com/casbin/caswaf/util" +) + +func getI18nFilePath(language string) string { + return fmt.Sprintf("../web/src/locales/%s/data.json", language) +} + +func readI18nFile(language string) *I18nData { + s := util.ReadStringFromPath(getI18nFilePath(language)) + + data := &I18nData{} + err := util.JsonToStruct(s, data) + if err != nil { + panic(err) + } + return data +} + +func writeI18nFile(language string, data *I18nData) { + s := util.StructToJson(data) + s = strings.ReplaceAll(s, "\\\\\"", "\"") + println(s) + + util.WriteStringToPath(s, getI18nFilePath(language)) +} + +func applyData(data1 *I18nData, data2 *I18nData) { + for namespace, pairs2 := range *data2 { + if _, ok := (*data1)[namespace]; !ok { + continue + } + + pairs1 := (*data1)[namespace] + + for key, value := range pairs2 { + if _, ok := pairs1[key]; !ok { + continue + } + + pairs1[key] = value + } + } +} diff --git a/web/src/Setting.js b/web/src/Setting.js index 014f450..5aa8a3e 100644 --- a/web/src/Setting.js +++ b/web/src/Setting.js @@ -27,28 +27,14 @@ export let CasdoorSdk; export const Countries = [ {label: "English", key: "en", country: "US", alt: "English"}, + {label: "中文", key: "zh", country: "CN", alt: "中文"}, {label: "Español", key: "es", country: "ES", alt: "Español"}, {label: "Français", key: "fr", country: "FR", alt: "Français"}, {label: "Deutsch", key: "de", country: "DE", alt: "Deutsch"}, - {label: "中文", key: "zh", country: "CN", alt: "中文"}, {label: "Indonesia", key: "id", country: "ID", alt: "Indonesia"}, {label: "日本語", key: "ja", country: "JP", alt: "日本語"}, {label: "한국어", key: "ko", country: "KR", alt: "한국어"}, {label: "Русский", key: "ru", country: "RU", alt: "Русский"}, - {label: "TiếngViệt", key: "vi", country: "VN", alt: "TiếngViệt"}, - {label: "Português", key: "pt", country: "PT", alt: "Português"}, - {label: "Italiano", key: "it", country: "IT", alt: "Italiano"}, - {label: "Malay", key: "ms", country: "MY", alt: "Malay"}, - {label: "Türkçe", key: "tr", country: "TR", alt: "Türkçe"}, - {label: "لغة عربية", key: "ar", country: "SA", alt: "لغة عربية"}, - {label: "עִבְרִית", key: "he", country: "IL", alt: "עִבְרִית"}, - {label: "Nederlands", key: "nl", country: "NL", alt: "Nederlands"}, - {label: "Polski", key: "pl", country: "PL", alt: "Polski"}, - {label: "Suomi", key: "fi", country: "FI", alt: "Suomi"}, - {label: "Svenska", key: "sv", country: "SE", alt: "Svenska"}, - {label: "Українська", key: "uk", country: "UA", alt: "Українська"}, - {label: "Қазақ", key: "kk", country: "KZ", alt: "Қазақ"}, - {label: "فارسی", key: "fa", country: "IR", alt: "فارسی"}, ]; export function initServerUrl() { diff --git a/web/src/SiteListPage.js b/web/src/SiteListPage.js index 84a7ce9..fa8f8a0 100644 --- a/web/src/SiteListPage.js +++ b/web/src/SiteListPage.js @@ -197,7 +197,7 @@ class SiteListPage extends BaseListPage { }, }, { - title: i18next.t("site: Enable WAF"), + title: i18next.t("site:Enable WAF"), dataIndex: "enableWaf", key: "enableWaf", width: "120px", diff --git a/web/src/i18n.js b/web/src/i18n.js index 73907b3..a0839c6 100644 --- a/web/src/i18n.js +++ b/web/src/i18n.js @@ -15,6 +15,14 @@ import i18n from "i18next"; import zh from "./locales/zh/data.json"; import en from "./locales/en/data.json"; +import de from "./locales/de/data.json"; +import es from "./locales/es/data.json"; +import fr from "./locales/fr/data.json"; +import id from "./locales/id/data.json"; +import ja from "./locales/ja/data.json"; +import ko from "./locales/ko/data.json"; +import ru from "./locales/ru/data.json"; + import * as Conf from "./Conf"; import * as Setting from "./Setting"; import {initReactI18next} from "react-i18next"; @@ -22,6 +30,13 @@ import {initReactI18next} from "react-i18next"; const resources = { en: en, zh: zh, + de: de, + es: es, + fr: fr, + id: id, + ja: ja, + ko: ko, + ru: ru, }; function initLanguage() { @@ -44,6 +59,27 @@ function initLanguage() { case "en-US": language = "en"; break; + case "de": + language = "de"; + break; + case "es": + language = "es"; + break; + case "fr": + language = "fr"; + break; + case "id": + language = "id"; + break; + case "ja": + language = "ja"; + break; + case "ko": + language = "ko"; + break; + case "ru": + language = "ru"; + break; default: language = Conf.DefaultLanguage; } diff --git a/web/src/locales/de/data.json b/web/src/locales/de/data.json new file mode 100644 index 0000000..696aabd --- /dev/null +++ b/web/src/locales/de/data.json @@ -0,0 +1,92 @@ +{ + "account": { + "My Account": "My Account", + "Sign In": "Sign In", + "Sign Out": "Sign Out", + "Sign Up": "Sign Up" + }, + "cert": { + "Access key": "Access key", + "Access secret": "Access secret", + "Account": "Account", + "Certificate": "Certificate", + "Certificate copied to clipboard successfully": "Certificate copied to clipboard successfully", + "Copy certificate": "Copy certificate", + "Copy private key": "Copy private key", + "Crypto algorithm": "Crypto algorithm", + "Domain expire": "Domain expire", + "Download certificate": "Download certificate", + "Download private key": "Download private key", + "Edit Cert": "Edit Cert", + "Expire time": "Expire time", + "Private key": "Private key", + "Private key copied to clipboard successfully": "Private key copied to clipboard successfully", + "Provider": "Provider", + "Type": "Type" + }, + "general": { + "Action": "Action", + "Add": "Add", + "Back Home": "Back Home", + "Cancel": "Cancel", + "Certs": "Certs", + "Client ip": "Client ip", + "Count": "Count", + "Create time": "Create time", + "Created time": "Created time", + "CreatedTime": "CreatedTime", + "Dashboard": "Dashboard", + "Delete": "Delete", + "Display name": "Display name", + "Edit": "Edit", + "Edit Record": "Edit Record", + "Go to writable demo site?": "Go to writable demo site?", + "Home": "Home", + "Host": "Host", + "ID": "ID", + "IP Address": "IP Address", + "Method": "Method", + "Name": "Name", + "OK": "OK", + "Owner": "Owner", + "Path": "Path", + "Records": "Records", + "Save": "Save", + "Self": "Self", + "Sites": "Sites", + "Sorry, you do not have permission to access this page or logged in status invalid.": "Sorry, you do not have permission to access this page or logged in status invalid.", + "Tag": "Tag", + "This is a read-only demo site!": "This is a read-only demo site!", + "Top 10 IP Addresses": "Top 10 IP Addresses", + "Top 10 User-Agents": "Top 10 User-Agents", + "Total Request Count": "Total Request Count", + "Unique IP Count": "Unique IP Count", + "User agent": "User agent", + "User-Agent": "User-Agent", + "UserAgent": "UserAgent" + }, + "site": { + "Casdoor app": "Casdoor app", + "Challenges": "Challenges", + "Domain": "Domain", + "Edit Site": "Edit Site", + "Enable WAF": "Enable WAF", + "Host": "Host", + "Mode": "Mode", + "Need redirect": "Need redirect", + "Node": "Node", + "Nodes": "Nodes", + "Other domains": "Other domains", + "Port": "Port", + "Public IP": "Public IP", + "SSL cert": "SSL cert", + "Status": "Status" + }, + "usage": { + "All": "All", + "Day": "Day", + "Hour": "Hour", + "Month": "Month", + "Week": "Week" + } +} \ No newline at end of file diff --git a/web/src/locales/en/data.json b/web/src/locales/en/data.json index 9e26dfe..696aabd 100644 --- a/web/src/locales/en/data.json +++ b/web/src/locales/en/data.json @@ -1 +1,92 @@ -{} \ No newline at end of file +{ + "account": { + "My Account": "My Account", + "Sign In": "Sign In", + "Sign Out": "Sign Out", + "Sign Up": "Sign Up" + }, + "cert": { + "Access key": "Access key", + "Access secret": "Access secret", + "Account": "Account", + "Certificate": "Certificate", + "Certificate copied to clipboard successfully": "Certificate copied to clipboard successfully", + "Copy certificate": "Copy certificate", + "Copy private key": "Copy private key", + "Crypto algorithm": "Crypto algorithm", + "Domain expire": "Domain expire", + "Download certificate": "Download certificate", + "Download private key": "Download private key", + "Edit Cert": "Edit Cert", + "Expire time": "Expire time", + "Private key": "Private key", + "Private key copied to clipboard successfully": "Private key copied to clipboard successfully", + "Provider": "Provider", + "Type": "Type" + }, + "general": { + "Action": "Action", + "Add": "Add", + "Back Home": "Back Home", + "Cancel": "Cancel", + "Certs": "Certs", + "Client ip": "Client ip", + "Count": "Count", + "Create time": "Create time", + "Created time": "Created time", + "CreatedTime": "CreatedTime", + "Dashboard": "Dashboard", + "Delete": "Delete", + "Display name": "Display name", + "Edit": "Edit", + "Edit Record": "Edit Record", + "Go to writable demo site?": "Go to writable demo site?", + "Home": "Home", + "Host": "Host", + "ID": "ID", + "IP Address": "IP Address", + "Method": "Method", + "Name": "Name", + "OK": "OK", + "Owner": "Owner", + "Path": "Path", + "Records": "Records", + "Save": "Save", + "Self": "Self", + "Sites": "Sites", + "Sorry, you do not have permission to access this page or logged in status invalid.": "Sorry, you do not have permission to access this page or logged in status invalid.", + "Tag": "Tag", + "This is a read-only demo site!": "This is a read-only demo site!", + "Top 10 IP Addresses": "Top 10 IP Addresses", + "Top 10 User-Agents": "Top 10 User-Agents", + "Total Request Count": "Total Request Count", + "Unique IP Count": "Unique IP Count", + "User agent": "User agent", + "User-Agent": "User-Agent", + "UserAgent": "UserAgent" + }, + "site": { + "Casdoor app": "Casdoor app", + "Challenges": "Challenges", + "Domain": "Domain", + "Edit Site": "Edit Site", + "Enable WAF": "Enable WAF", + "Host": "Host", + "Mode": "Mode", + "Need redirect": "Need redirect", + "Node": "Node", + "Nodes": "Nodes", + "Other domains": "Other domains", + "Port": "Port", + "Public IP": "Public IP", + "SSL cert": "SSL cert", + "Status": "Status" + }, + "usage": { + "All": "All", + "Day": "Day", + "Hour": "Hour", + "Month": "Month", + "Week": "Week" + } +} \ No newline at end of file diff --git a/web/src/locales/es/data.json b/web/src/locales/es/data.json new file mode 100644 index 0000000..696aabd --- /dev/null +++ b/web/src/locales/es/data.json @@ -0,0 +1,92 @@ +{ + "account": { + "My Account": "My Account", + "Sign In": "Sign In", + "Sign Out": "Sign Out", + "Sign Up": "Sign Up" + }, + "cert": { + "Access key": "Access key", + "Access secret": "Access secret", + "Account": "Account", + "Certificate": "Certificate", + "Certificate copied to clipboard successfully": "Certificate copied to clipboard successfully", + "Copy certificate": "Copy certificate", + "Copy private key": "Copy private key", + "Crypto algorithm": "Crypto algorithm", + "Domain expire": "Domain expire", + "Download certificate": "Download certificate", + "Download private key": "Download private key", + "Edit Cert": "Edit Cert", + "Expire time": "Expire time", + "Private key": "Private key", + "Private key copied to clipboard successfully": "Private key copied to clipboard successfully", + "Provider": "Provider", + "Type": "Type" + }, + "general": { + "Action": "Action", + "Add": "Add", + "Back Home": "Back Home", + "Cancel": "Cancel", + "Certs": "Certs", + "Client ip": "Client ip", + "Count": "Count", + "Create time": "Create time", + "Created time": "Created time", + "CreatedTime": "CreatedTime", + "Dashboard": "Dashboard", + "Delete": "Delete", + "Display name": "Display name", + "Edit": "Edit", + "Edit Record": "Edit Record", + "Go to writable demo site?": "Go to writable demo site?", + "Home": "Home", + "Host": "Host", + "ID": "ID", + "IP Address": "IP Address", + "Method": "Method", + "Name": "Name", + "OK": "OK", + "Owner": "Owner", + "Path": "Path", + "Records": "Records", + "Save": "Save", + "Self": "Self", + "Sites": "Sites", + "Sorry, you do not have permission to access this page or logged in status invalid.": "Sorry, you do not have permission to access this page or logged in status invalid.", + "Tag": "Tag", + "This is a read-only demo site!": "This is a read-only demo site!", + "Top 10 IP Addresses": "Top 10 IP Addresses", + "Top 10 User-Agents": "Top 10 User-Agents", + "Total Request Count": "Total Request Count", + "Unique IP Count": "Unique IP Count", + "User agent": "User agent", + "User-Agent": "User-Agent", + "UserAgent": "UserAgent" + }, + "site": { + "Casdoor app": "Casdoor app", + "Challenges": "Challenges", + "Domain": "Domain", + "Edit Site": "Edit Site", + "Enable WAF": "Enable WAF", + "Host": "Host", + "Mode": "Mode", + "Need redirect": "Need redirect", + "Node": "Node", + "Nodes": "Nodes", + "Other domains": "Other domains", + "Port": "Port", + "Public IP": "Public IP", + "SSL cert": "SSL cert", + "Status": "Status" + }, + "usage": { + "All": "All", + "Day": "Day", + "Hour": "Hour", + "Month": "Month", + "Week": "Week" + } +} \ No newline at end of file diff --git a/web/src/locales/fr/data.json b/web/src/locales/fr/data.json new file mode 100644 index 0000000..696aabd --- /dev/null +++ b/web/src/locales/fr/data.json @@ -0,0 +1,92 @@ +{ + "account": { + "My Account": "My Account", + "Sign In": "Sign In", + "Sign Out": "Sign Out", + "Sign Up": "Sign Up" + }, + "cert": { + "Access key": "Access key", + "Access secret": "Access secret", + "Account": "Account", + "Certificate": "Certificate", + "Certificate copied to clipboard successfully": "Certificate copied to clipboard successfully", + "Copy certificate": "Copy certificate", + "Copy private key": "Copy private key", + "Crypto algorithm": "Crypto algorithm", + "Domain expire": "Domain expire", + "Download certificate": "Download certificate", + "Download private key": "Download private key", + "Edit Cert": "Edit Cert", + "Expire time": "Expire time", + "Private key": "Private key", + "Private key copied to clipboard successfully": "Private key copied to clipboard successfully", + "Provider": "Provider", + "Type": "Type" + }, + "general": { + "Action": "Action", + "Add": "Add", + "Back Home": "Back Home", + "Cancel": "Cancel", + "Certs": "Certs", + "Client ip": "Client ip", + "Count": "Count", + "Create time": "Create time", + "Created time": "Created time", + "CreatedTime": "CreatedTime", + "Dashboard": "Dashboard", + "Delete": "Delete", + "Display name": "Display name", + "Edit": "Edit", + "Edit Record": "Edit Record", + "Go to writable demo site?": "Go to writable demo site?", + "Home": "Home", + "Host": "Host", + "ID": "ID", + "IP Address": "IP Address", + "Method": "Method", + "Name": "Name", + "OK": "OK", + "Owner": "Owner", + "Path": "Path", + "Records": "Records", + "Save": "Save", + "Self": "Self", + "Sites": "Sites", + "Sorry, you do not have permission to access this page or logged in status invalid.": "Sorry, you do not have permission to access this page or logged in status invalid.", + "Tag": "Tag", + "This is a read-only demo site!": "This is a read-only demo site!", + "Top 10 IP Addresses": "Top 10 IP Addresses", + "Top 10 User-Agents": "Top 10 User-Agents", + "Total Request Count": "Total Request Count", + "Unique IP Count": "Unique IP Count", + "User agent": "User agent", + "User-Agent": "User-Agent", + "UserAgent": "UserAgent" + }, + "site": { + "Casdoor app": "Casdoor app", + "Challenges": "Challenges", + "Domain": "Domain", + "Edit Site": "Edit Site", + "Enable WAF": "Enable WAF", + "Host": "Host", + "Mode": "Mode", + "Need redirect": "Need redirect", + "Node": "Node", + "Nodes": "Nodes", + "Other domains": "Other domains", + "Port": "Port", + "Public IP": "Public IP", + "SSL cert": "SSL cert", + "Status": "Status" + }, + "usage": { + "All": "All", + "Day": "Day", + "Hour": "Hour", + "Month": "Month", + "Week": "Week" + } +} \ No newline at end of file diff --git a/web/src/locales/id/data.json b/web/src/locales/id/data.json new file mode 100644 index 0000000..696aabd --- /dev/null +++ b/web/src/locales/id/data.json @@ -0,0 +1,92 @@ +{ + "account": { + "My Account": "My Account", + "Sign In": "Sign In", + "Sign Out": "Sign Out", + "Sign Up": "Sign Up" + }, + "cert": { + "Access key": "Access key", + "Access secret": "Access secret", + "Account": "Account", + "Certificate": "Certificate", + "Certificate copied to clipboard successfully": "Certificate copied to clipboard successfully", + "Copy certificate": "Copy certificate", + "Copy private key": "Copy private key", + "Crypto algorithm": "Crypto algorithm", + "Domain expire": "Domain expire", + "Download certificate": "Download certificate", + "Download private key": "Download private key", + "Edit Cert": "Edit Cert", + "Expire time": "Expire time", + "Private key": "Private key", + "Private key copied to clipboard successfully": "Private key copied to clipboard successfully", + "Provider": "Provider", + "Type": "Type" + }, + "general": { + "Action": "Action", + "Add": "Add", + "Back Home": "Back Home", + "Cancel": "Cancel", + "Certs": "Certs", + "Client ip": "Client ip", + "Count": "Count", + "Create time": "Create time", + "Created time": "Created time", + "CreatedTime": "CreatedTime", + "Dashboard": "Dashboard", + "Delete": "Delete", + "Display name": "Display name", + "Edit": "Edit", + "Edit Record": "Edit Record", + "Go to writable demo site?": "Go to writable demo site?", + "Home": "Home", + "Host": "Host", + "ID": "ID", + "IP Address": "IP Address", + "Method": "Method", + "Name": "Name", + "OK": "OK", + "Owner": "Owner", + "Path": "Path", + "Records": "Records", + "Save": "Save", + "Self": "Self", + "Sites": "Sites", + "Sorry, you do not have permission to access this page or logged in status invalid.": "Sorry, you do not have permission to access this page or logged in status invalid.", + "Tag": "Tag", + "This is a read-only demo site!": "This is a read-only demo site!", + "Top 10 IP Addresses": "Top 10 IP Addresses", + "Top 10 User-Agents": "Top 10 User-Agents", + "Total Request Count": "Total Request Count", + "Unique IP Count": "Unique IP Count", + "User agent": "User agent", + "User-Agent": "User-Agent", + "UserAgent": "UserAgent" + }, + "site": { + "Casdoor app": "Casdoor app", + "Challenges": "Challenges", + "Domain": "Domain", + "Edit Site": "Edit Site", + "Enable WAF": "Enable WAF", + "Host": "Host", + "Mode": "Mode", + "Need redirect": "Need redirect", + "Node": "Node", + "Nodes": "Nodes", + "Other domains": "Other domains", + "Port": "Port", + "Public IP": "Public IP", + "SSL cert": "SSL cert", + "Status": "Status" + }, + "usage": { + "All": "All", + "Day": "Day", + "Hour": "Hour", + "Month": "Month", + "Week": "Week" + } +} \ No newline at end of file diff --git a/web/src/locales/ja/data.json b/web/src/locales/ja/data.json new file mode 100644 index 0000000..696aabd --- /dev/null +++ b/web/src/locales/ja/data.json @@ -0,0 +1,92 @@ +{ + "account": { + "My Account": "My Account", + "Sign In": "Sign In", + "Sign Out": "Sign Out", + "Sign Up": "Sign Up" + }, + "cert": { + "Access key": "Access key", + "Access secret": "Access secret", + "Account": "Account", + "Certificate": "Certificate", + "Certificate copied to clipboard successfully": "Certificate copied to clipboard successfully", + "Copy certificate": "Copy certificate", + "Copy private key": "Copy private key", + "Crypto algorithm": "Crypto algorithm", + "Domain expire": "Domain expire", + "Download certificate": "Download certificate", + "Download private key": "Download private key", + "Edit Cert": "Edit Cert", + "Expire time": "Expire time", + "Private key": "Private key", + "Private key copied to clipboard successfully": "Private key copied to clipboard successfully", + "Provider": "Provider", + "Type": "Type" + }, + "general": { + "Action": "Action", + "Add": "Add", + "Back Home": "Back Home", + "Cancel": "Cancel", + "Certs": "Certs", + "Client ip": "Client ip", + "Count": "Count", + "Create time": "Create time", + "Created time": "Created time", + "CreatedTime": "CreatedTime", + "Dashboard": "Dashboard", + "Delete": "Delete", + "Display name": "Display name", + "Edit": "Edit", + "Edit Record": "Edit Record", + "Go to writable demo site?": "Go to writable demo site?", + "Home": "Home", + "Host": "Host", + "ID": "ID", + "IP Address": "IP Address", + "Method": "Method", + "Name": "Name", + "OK": "OK", + "Owner": "Owner", + "Path": "Path", + "Records": "Records", + "Save": "Save", + "Self": "Self", + "Sites": "Sites", + "Sorry, you do not have permission to access this page or logged in status invalid.": "Sorry, you do not have permission to access this page or logged in status invalid.", + "Tag": "Tag", + "This is a read-only demo site!": "This is a read-only demo site!", + "Top 10 IP Addresses": "Top 10 IP Addresses", + "Top 10 User-Agents": "Top 10 User-Agents", + "Total Request Count": "Total Request Count", + "Unique IP Count": "Unique IP Count", + "User agent": "User agent", + "User-Agent": "User-Agent", + "UserAgent": "UserAgent" + }, + "site": { + "Casdoor app": "Casdoor app", + "Challenges": "Challenges", + "Domain": "Domain", + "Edit Site": "Edit Site", + "Enable WAF": "Enable WAF", + "Host": "Host", + "Mode": "Mode", + "Need redirect": "Need redirect", + "Node": "Node", + "Nodes": "Nodes", + "Other domains": "Other domains", + "Port": "Port", + "Public IP": "Public IP", + "SSL cert": "SSL cert", + "Status": "Status" + }, + "usage": { + "All": "All", + "Day": "Day", + "Hour": "Hour", + "Month": "Month", + "Week": "Week" + } +} \ No newline at end of file diff --git a/web/src/locales/ko/data.json b/web/src/locales/ko/data.json new file mode 100644 index 0000000..696aabd --- /dev/null +++ b/web/src/locales/ko/data.json @@ -0,0 +1,92 @@ +{ + "account": { + "My Account": "My Account", + "Sign In": "Sign In", + "Sign Out": "Sign Out", + "Sign Up": "Sign Up" + }, + "cert": { + "Access key": "Access key", + "Access secret": "Access secret", + "Account": "Account", + "Certificate": "Certificate", + "Certificate copied to clipboard successfully": "Certificate copied to clipboard successfully", + "Copy certificate": "Copy certificate", + "Copy private key": "Copy private key", + "Crypto algorithm": "Crypto algorithm", + "Domain expire": "Domain expire", + "Download certificate": "Download certificate", + "Download private key": "Download private key", + "Edit Cert": "Edit Cert", + "Expire time": "Expire time", + "Private key": "Private key", + "Private key copied to clipboard successfully": "Private key copied to clipboard successfully", + "Provider": "Provider", + "Type": "Type" + }, + "general": { + "Action": "Action", + "Add": "Add", + "Back Home": "Back Home", + "Cancel": "Cancel", + "Certs": "Certs", + "Client ip": "Client ip", + "Count": "Count", + "Create time": "Create time", + "Created time": "Created time", + "CreatedTime": "CreatedTime", + "Dashboard": "Dashboard", + "Delete": "Delete", + "Display name": "Display name", + "Edit": "Edit", + "Edit Record": "Edit Record", + "Go to writable demo site?": "Go to writable demo site?", + "Home": "Home", + "Host": "Host", + "ID": "ID", + "IP Address": "IP Address", + "Method": "Method", + "Name": "Name", + "OK": "OK", + "Owner": "Owner", + "Path": "Path", + "Records": "Records", + "Save": "Save", + "Self": "Self", + "Sites": "Sites", + "Sorry, you do not have permission to access this page or logged in status invalid.": "Sorry, you do not have permission to access this page or logged in status invalid.", + "Tag": "Tag", + "This is a read-only demo site!": "This is a read-only demo site!", + "Top 10 IP Addresses": "Top 10 IP Addresses", + "Top 10 User-Agents": "Top 10 User-Agents", + "Total Request Count": "Total Request Count", + "Unique IP Count": "Unique IP Count", + "User agent": "User agent", + "User-Agent": "User-Agent", + "UserAgent": "UserAgent" + }, + "site": { + "Casdoor app": "Casdoor app", + "Challenges": "Challenges", + "Domain": "Domain", + "Edit Site": "Edit Site", + "Enable WAF": "Enable WAF", + "Host": "Host", + "Mode": "Mode", + "Need redirect": "Need redirect", + "Node": "Node", + "Nodes": "Nodes", + "Other domains": "Other domains", + "Port": "Port", + "Public IP": "Public IP", + "SSL cert": "SSL cert", + "Status": "Status" + }, + "usage": { + "All": "All", + "Day": "Day", + "Hour": "Hour", + "Month": "Month", + "Week": "Week" + } +} \ No newline at end of file diff --git a/web/src/locales/ru/data.json b/web/src/locales/ru/data.json new file mode 100644 index 0000000..696aabd --- /dev/null +++ b/web/src/locales/ru/data.json @@ -0,0 +1,92 @@ +{ + "account": { + "My Account": "My Account", + "Sign In": "Sign In", + "Sign Out": "Sign Out", + "Sign Up": "Sign Up" + }, + "cert": { + "Access key": "Access key", + "Access secret": "Access secret", + "Account": "Account", + "Certificate": "Certificate", + "Certificate copied to clipboard successfully": "Certificate copied to clipboard successfully", + "Copy certificate": "Copy certificate", + "Copy private key": "Copy private key", + "Crypto algorithm": "Crypto algorithm", + "Domain expire": "Domain expire", + "Download certificate": "Download certificate", + "Download private key": "Download private key", + "Edit Cert": "Edit Cert", + "Expire time": "Expire time", + "Private key": "Private key", + "Private key copied to clipboard successfully": "Private key copied to clipboard successfully", + "Provider": "Provider", + "Type": "Type" + }, + "general": { + "Action": "Action", + "Add": "Add", + "Back Home": "Back Home", + "Cancel": "Cancel", + "Certs": "Certs", + "Client ip": "Client ip", + "Count": "Count", + "Create time": "Create time", + "Created time": "Created time", + "CreatedTime": "CreatedTime", + "Dashboard": "Dashboard", + "Delete": "Delete", + "Display name": "Display name", + "Edit": "Edit", + "Edit Record": "Edit Record", + "Go to writable demo site?": "Go to writable demo site?", + "Home": "Home", + "Host": "Host", + "ID": "ID", + "IP Address": "IP Address", + "Method": "Method", + "Name": "Name", + "OK": "OK", + "Owner": "Owner", + "Path": "Path", + "Records": "Records", + "Save": "Save", + "Self": "Self", + "Sites": "Sites", + "Sorry, you do not have permission to access this page or logged in status invalid.": "Sorry, you do not have permission to access this page or logged in status invalid.", + "Tag": "Tag", + "This is a read-only demo site!": "This is a read-only demo site!", + "Top 10 IP Addresses": "Top 10 IP Addresses", + "Top 10 User-Agents": "Top 10 User-Agents", + "Total Request Count": "Total Request Count", + "Unique IP Count": "Unique IP Count", + "User agent": "User agent", + "User-Agent": "User-Agent", + "UserAgent": "UserAgent" + }, + "site": { + "Casdoor app": "Casdoor app", + "Challenges": "Challenges", + "Domain": "Domain", + "Edit Site": "Edit Site", + "Enable WAF": "Enable WAF", + "Host": "Host", + "Mode": "Mode", + "Need redirect": "Need redirect", + "Node": "Node", + "Nodes": "Nodes", + "Other domains": "Other domains", + "Port": "Port", + "Public IP": "Public IP", + "SSL cert": "SSL cert", + "Status": "Status" + }, + "usage": { + "All": "All", + "Day": "Day", + "Hour": "Hour", + "Month": "Month", + "Week": "Week" + } +} \ No newline at end of file diff --git a/web/src/locales/zh/data.json b/web/src/locales/zh/data.json index e09a778..82c9310 100644 --- a/web/src/locales/zh/data.json +++ b/web/src/locales/zh/data.json @@ -1,239 +1,92 @@ { - "general": { - "Access key": "访问密钥", - "Access secret": "访问密钥密文", - "Action": "操作", - "Account": "账号", - "Add": "添加", - "Application": "应用", - "Apps": "应用列表", - "Avatar": "头像", - "Back": "返回", - "Cancel": "取消", - "Captcha": "人机验证码", - "Casdoor app": "Casdoor应用", - "Cert": "证书", - "Certs": "证书", - "Certificate": "证书", - "Click to Upload": "点击上传", - "Client ip": "客户端IP", - "Close": "关闭", - "Confirm": "确认", - "Copied to clipboard successfully": "已成功复制到剪贴板", - "Created time": "创建时间", - "Crypto algorithm": "加密算法", - "Custom": "自定义", - "Dashboard": "数据看板", - "Default": "默认", - "Default application": "默认应用", - "Default application - Tooltip": "直接从组织页面注册的用户默认所属的应用", - "Default avatar": "默认头像", - "Default avatar - Tooltip": "新注册用户没有设置头像时所采用的默认头像", - "Default password": "默认密码", - "Default password - Tooltip": "添加新用户时,如果没有指定密码,默认采用的密码", - "Delete": "删除", - "Description": "描述信息", - "Description - Tooltip": "供人参考的详细描述信息,Casdoor平台本身不会使用", - "Disable": "关闭", - "Display name": "显示名称", - "Display name - Tooltip": "在界面里公开显示的、易读的名称", - "Domain": "域名", - "Domain expire": "域名过期", - "Down": "下移", - "Edit": "编辑", - "Edit Cert": "编辑证书", - "Edit Record": "编辑日志", - "Edit Site": "编辑站点", - "Email": "电子邮箱", - "Email - Tooltip": "合法的电子邮件地址", - "Email only": "仅支持邮件", - "Email or Phone": "电子邮件或手机", - "Enable": "启用", - "Enable dark logo": "开启暗黑Logo", - "Enable dark logo - Tooltip": "开启暗黑Logo", - "Enable WAF": "开启WAF", - "Enabled": "已开启", - "Enabled successfully": "启用成功", - "Enforcers": "Casbin执行器", - "Expire time": "过期时间", - "FaceIdData": "人脸数据", - "Failed to add": "添加失败", - "Failed to connect to server": "连接服务器失败", - "Failed to delete": "删除失败", - "Failed to enable": "启用失败", - "Failed to get TermsOfUse URL": "获取TermsOfUse链接失败", - "Failed to remove": "移除失败", - "Failed to save": "保存失败", - "Failed to sync": "同步失败", - "Failed to verify": "验证失败", - "Favicon": "组织Favicon", - "First name": "名字", - "Forget URL": "忘记密码URL", - "Forget URL - Tooltip": "自定义忘记密码页面的URL,不设置时采用Casdoor默认的忘记密码页面,设置后Casdoor各类页面的忘记密码链接会跳转到该URL", - "Found some texts still not translated? Please help us translate at": "发现有些文字尚未翻译?请移步这里帮我们翻译:", - "Go to enable": "前往启用", - "Go to writable demo site?": "跳转至可写演示站点?", - "Groups": "群组", - "Groups - Tooltip": "组", - "Home": "首页", - "Host": "主机", - "Home - Tooltip": "应用的首页", - "ID": "ID", - "ID - Tooltip": "唯一的随机字符串", - "Identity": "身份认证", - "Invitations": "邀请码", - "Is enabled": "已启用", - "Is enabled - Tooltip": "是否启用", - "LDAPs": "LDAP", - "LDAPs - Tooltip": "LDAPs", - "Languages": "语言", - "Languages - Tooltip": "可选语言", - "Last name": "姓氏", - "Later": "稍后", - "Logging & Auditing": "日志 & 审计", - "Logo": "Logo", - "Logo - Tooltip": "应用程序向外展示的图标", - "Logo dark": "暗黑logo", - "Logo dark - Tooltip": "暗黑主题下使用的logo", - "MFA items": "MFA 项", - "MFA items - Tooltip": "MFA 项 - Tooltip", - "Master password": "万能密码", - "Master password - Tooltip": "可用来登录该组织下的所有用户,方便管理员以该用户身份登录,以解决技术问题", - "Master verification code": "万能验证码", - "Master verification code - Tooltip": "当万能验证码被设置后,所有该组织下的发出的邮箱、短信验证码都会使用这个固定的验证码,主要用于自动化测试CI用途,正常环境下一般不使用", - "Menu": "目录", - "Method": "方法", - "Mode": "模式", - "Model": "模型", - "Model - Tooltip": "Casbin的访问控制模型", - "Models": "Casbin模型", - "Name": "名称", - "Name - Tooltip": "唯一的、字符串式的ID", - "Name format": "名称格式", - "Need redirect": "需要重定向", - "Node": "节点", - "Nodes": "节点", - "Non-LDAP": "禁用LDAP", - "None": "无", - "OAuth providers": "OAuth提供方", - "OK": "确定", - "Owner": "所有者", - "Organization": "组织", - "Organization - Tooltip": "类似于租户、用户池等概念,每个用户和应用都从属于一个组织", - "Organizations": "组织", - "Other domains": "其他域名", - "Path": "路径", - "Password": "密码", - "Password - Tooltip": "请确认密码正确", - "Password complexity options": "密码复杂度选项", - "Password complexity options - Tooltip": "密码复杂度组合,登录密码复杂度必须符合该规范", - "Password salt": "密码Salt值", - "Password salt - Tooltip": "用于密码加密的随机参数", - "Password type": "密码类型", - "Password type - Tooltip": "密码在数据库中的存储格式", - "Payment": "付款", - "Payment - Tooltip": "对应的付款", - "Payments": "付款", - "Permissions": "权限", - "Permissions - Tooltip": "该用户所拥有的权限", - "Phone": "手机号", - "Phone - Tooltip": "手机号", - "Phone only": "仅支持手机号", - "Phone or Email": "手机或电子邮件", - "Plan": "计划", - "Plan - Tooltip": "订阅里的计划", - "Plans": "计划", - "Plans - Tooltip": "订阅里的计划", - "Port": "端口", - "Preview": "预览", - "Preview - Tooltip": "可预览所配置的效果", - "Pricing": "定价", - "Pricing - Tooltip": "对应的定价", - "Pricings": "定价", - "Private key": "私钥", - "Products": "商品", - "Provider": "提供商", - "Provider - Tooltip": "需要配置的支付提供商,包括PayPal、支付宝、微信支付等", - "Providers": "提供商", - "Providers - Tooltip": "需要配置的提供商,包括第三方登录、对象存储、验证码等", - "Public IP": "公网IP", - "Real name": "姓名", - "Records": "日志", - "Request URI": "请求URI", - "Resources": "资源", - "Role": "角色", - "Role - Tooltip": "所对应的角色", - "Roles": "角色", - "Roles - Tooltip": "用户所属的角色", - "Root cert": "根证书", - "Root cert - Tooltip": "根证书", - "SAML attributes": "SAML属性", - "SAML attributes - Tooltip": "Casdoor作为SAML IdP时所返回的SAML响应的属性", - "SSH cert": "SSH证书", - "SSH type": "SSH类型", - "SSH type - Tooltip": "SSH连接的认证类型", - "Save": "保存", - "Save & Exit": "保存 & 退出", - "Session ID": "会话ID", - "Sessions": "会话", - "Shortcuts": "快捷操作", - "Signin URL": "登录URL", - "Signin URL - Tooltip": "自定义登录页面的URL,不设置时采用Casdoor默认的登录页面,设置后Casdoor各类页面的登录链接会跳转到该URL", - "Signup URL": "注册URL", - "Signup URL - Tooltip": "自定义注册页面的URL,不设置时采用Casdoor默认的注册页面,设置后Casdoor各类页面的注册链接会跳转到该URL", - "Signup application": "注册应用", - "Signup application - Tooltip": "用户注册时通过哪个应用注册的", - "Signup link": "注册链接", - "Sites": "站点", - "Sorry, the page you visited does not exist.": "抱歉,您访问的页面不存在", - "Sorry, the user you visited does not exist or you are not authorized to access this user.": "抱歉,您访问的用户不存在或您无权访问该用户", - "Sorry, you do not have permission to access this page or logged in status invalid.": "抱歉,您无权访问该页面或登录状态失效", - "SSL cert": "SSL证书", - "State": "状态", - "State - Tooltip": "状态", - "Status": "状态", - "Subscriptions": "订阅", - "Successfully added": "添加成功", - "Successfully deleted": "删除成功", - "Successfully removed": "移除成功", - "Successfully saved": "保存成功", - "Successfully sent": "发送成功", - "Successfully synced": "同步成功", - "Supported country codes": "支持的国家代码", - "Supported country codes - Tooltip": "该组织所支持的国家代码,发送短信验证码时可以选择这些国家的代码前缀", - "Sure to delete": "确定删除", - "Sure to disable": "确认关闭", - "Sure to remove": "确定移除", - "Swagger": "API文档", - "Sync": "同步", - "Syncers": "同步器", - "System Info": "系统信息", - "Tag": "标签", - "There was a problem signing you in..": "登录时遇到问题..", - "This is a read-only demo site!": "这是一个只读演示站点!", - "Timestamp": "时间", - "Tokens": "令牌", - "Transactions": "交易", - "Type": "类型", - "Type - Tooltip": "类型", - "URL": "链接", - "URL - Tooltip": "URL链接", - "Up": "上移", - "Updated time": "更新时间", - "User": "用户", - "User - Tooltip": "请确保用户名正确", - "User agent": "用户代理", - "User Management": "用户管理", - "User containers": "用户池", - "User type": "用户类型", - "User type - Tooltip": "用户所属的标签,默认为\"normal-user\"", - "Users": "用户", - "Users under all organizations": "所有组织里的用户", - "Verifications": "验证", - "Webhooks": "Webhooks", - "You can only select one physical group": "只能选择一个实体组", - "empty": "无", - "remove": "移除" - } + "account": { + "My Account": "我的账户", + "Sign In": "登录", + "Sign Out": "退出", + "Sign Up": "注册" + }, + "cert": { + "Access key": "访问密钥", + "Access secret": "访问密钥", + "Account": "账户", + "Certificate": "证书", + "Certificate copied to clipboard successfully": "证书成功复制到剪贴板", + "Copy certificate": "复制证书", + "Copy private key": "复制私钥", + "Crypto algorithm": "加密算法", + "Domain expire": "域名到期", + "Download certificate": "下载证书", + "Download private key": "下载私钥", + "Edit Cert": "编辑证书", + "Expire time": "到期时间", + "Private key": "私钥", + "Private key copied to clipboard successfully": "私钥成功复制到剪贴板", + "Provider": "提供者", + "Type": "类型" + }, + "general": { + "Action": "操作", + "Add": "添加", + "Back Home": "返回首页", + "Cancel": "取消", + "Certs": "证书", + "Client ip": "客户端IP", + "Count": "计数", + "Create time": "创建时间", + "Created time": "创建时间", + "CreatedTime": "创建时间", + "Dashboard": "数据看板", + "Delete": "删除", + "Display name": "显示名称", + "Edit": "编辑", + "Edit Record": "编辑日志", + "Go to writable demo site?": "跳转至可写演示站点?", + "Home": "首页", + "Host": "主机", + "ID": "ID", + "IP Address": "IP地址", + "Method": "方法", + "Name": "名称", + "OK": "确定", + "Owner": "所有者", + "Path": "路径", + "Records": "日志", + "Save": "保存", + "Self": "自己", + "Sites": "站点", + "Sorry, you do not have permission to access this page or logged in status invalid.": "抱歉,您无权访问该页面或登录状态无效。", + "Tag": "标签", + "This is a read-only demo site!": "这是一个只读演示站点!", + "Top 10 IP Addresses": "前10名IP地址", + "Top 10 User-Agents": "前10名用户代理", + "Total Request Count": "总请求数", + "Unique IP Count": "唯一IP计数", + "User agent": "用户代理", + "User-Agent": "用户代理", + "UserAgent": "用户代理" + }, + "site": { + "Casdoor app": "Casdoor应用", + "Challenges": "挑战", + "Domain": "域名", + "Edit Site": "编辑站点", + "Enable WAF": "启用WAF", + "Host": "主机", + "Mode": "模式", + "Need redirect": "需要重定向", + "Node": "节点", + "Nodes": "节点", + "Other domains": "其他域名", + "Port": "端口", + "Public IP": "公网IP", + "SSL cert": "SSL证书", + "Status": "状态" + }, + "usage": { + "All": "全部", + "Day": "天", + "Hour": "小时", + "Month": "月", + "Week": "周" } - \ No newline at end of file +} \ No newline at end of file