mirror of
https://github.com/drakkan/sftpgo.git
synced 2026-03-14 14:25:52 +01:00
locales: add zh-CN
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
0be7545d9b
commit
a73f8998a2
6 changed files with 1233 additions and 5 deletions
68
static/assets/plugins/custom/flatpickr/l10n/zh.js
Normal file
68
static/assets/plugins/custom/flatpickr/l10n/zh.js
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.zh = {}));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
var fp = typeof window !== "undefined" && window.flatpickr !== undefined
|
||||
? window.flatpickr
|
||||
: {
|
||||
l10ns: {},
|
||||
};
|
||||
var Mandarin = {
|
||||
weekdays: {
|
||||
shorthand: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
|
||||
longhand: [
|
||||
"星期日",
|
||||
"星期一",
|
||||
"星期二",
|
||||
"星期三",
|
||||
"星期四",
|
||||
"星期五",
|
||||
"星期六",
|
||||
],
|
||||
},
|
||||
months: {
|
||||
shorthand: [
|
||||
"一月",
|
||||
"二月",
|
||||
"三月",
|
||||
"四月",
|
||||
"五月",
|
||||
"六月",
|
||||
"七月",
|
||||
"八月",
|
||||
"九月",
|
||||
"十月",
|
||||
"十一月",
|
||||
"十二月",
|
||||
],
|
||||
longhand: [
|
||||
"一月",
|
||||
"二月",
|
||||
"三月",
|
||||
"四月",
|
||||
"五月",
|
||||
"六月",
|
||||
"七月",
|
||||
"八月",
|
||||
"九月",
|
||||
"十月",
|
||||
"十一月",
|
||||
"十二月",
|
||||
],
|
||||
},
|
||||
rangeSeparator: " 至 ",
|
||||
weekAbbreviation: "周",
|
||||
scrollTitle: "滚动切换",
|
||||
toggleTitle: "点击切换 12/24 小时时制",
|
||||
};
|
||||
fp.l10ns.zh = Mandarin;
|
||||
var zh = fp.l10ns;
|
||||
|
||||
exports.Mandarin = Mandarin;
|
||||
exports.default = zh;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
1140
static/locales/zh-CN/translation.json
Normal file
1140
static/locales/zh-CN/translation.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -190,6 +190,8 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||
lngs.de = { nativeName: 'Deutsch' };
|
||||
//{{- else if eq . "fr" }}
|
||||
lngs.fr = { nativeName: 'Français' };
|
||||
//{{- else if eq . "zh-CN" }}
|
||||
lngs["zh-CN"] = { nativeName: '简体中文' };
|
||||
//{{- end}}
|
||||
//{{- end}}
|
||||
if (Object.keys(lngs).length == 0){
|
||||
|
|
@ -214,7 +216,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||
debug: false,
|
||||
supportedLngs: Object.keys(lngs),
|
||||
fallbackLng: Object.keys(lngs)[0],
|
||||
load: 'languageOnly',
|
||||
backend: {
|
||||
backends: [
|
||||
i18nextLocalStorageBackend,
|
||||
|
|
@ -275,6 +276,22 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||
el.localize(options);
|
||||
}
|
||||
|
||||
function flatpickrLocale() {
|
||||
const currentLang = i18next.resolvedLanguage;
|
||||
if (currentLang === 'zh-CN') {
|
||||
return 'zh';
|
||||
}
|
||||
return currentLang;
|
||||
}
|
||||
|
||||
function humanizeDurationLocale() {
|
||||
const currentLang = i18next.resolvedLanguage;
|
||||
if (currentLang === 'zh-CN') {
|
||||
return 'zh_CN';
|
||||
}
|
||||
return currentLang;
|
||||
}
|
||||
|
||||
function handlePasswordInputVisibility(el) {
|
||||
let pwdVisibility = $(el.querySelector('[data-password-control="visibility"]'));
|
||||
let passwordInput = el.querySelector('[data-password-control="input"]');
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/it.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/de.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/fr.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/zh.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/humanize-duration/humanize-duration.min.js"></script>
|
||||
<script type="text/javascript" {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}}>
|
||||
const pageSize = 20;
|
||||
|
|
@ -231,7 +232,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||
decimalPoints = 0;
|
||||
}
|
||||
return humanizeDuration(val, {
|
||||
language: i18next.resolvedLanguage,
|
||||
language: humanizeDurationLocale(),
|
||||
fallbacks: ["en"],
|
||||
maxDecimalPoints: decimalPoints,
|
||||
units: units
|
||||
|
|
@ -1010,7 +1011,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||
mode: "range",
|
||||
defaultDate: [moment().add(-1,'hour').format('YYYY-MM-DD HH:mm')],
|
||||
minuteIncrement: 1,
|
||||
locale: i18next.resolvedLanguage
|
||||
locale: flatpickrLocale()
|
||||
});
|
||||
onEventChanged('1');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -832,6 +832,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/it.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/de.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/fr.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/zh.js"></script>
|
||||
<script type="text/javascript" {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}}>
|
||||
|
||||
$(document).on("i18nload", function(){
|
||||
|
|
@ -874,7 +875,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||
},
|
||||
defaultHour: 23,
|
||||
defaultMinute: 59,
|
||||
locale: i18next.resolvedLanguage,
|
||||
locale: flatpickrLocale(),
|
||||
onChange: function(selectedDates, dateStr, instance) {
|
||||
if (selectedDates.length > 0){
|
||||
$('#id_expiration_clear').removeClass("d-none");
|
||||
|
|
|
|||
|
|
@ -184,6 +184,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/it.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/de.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/fr.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/flatpickr/l10n/zh.js"></script>
|
||||
<script type="text/javascript" {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}}>
|
||||
$(document).on("i18nshow", function(){
|
||||
initRepeater('#paths');
|
||||
|
|
@ -202,7 +203,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||
},
|
||||
defaultHour: 23,
|
||||
defaultMinute: 59,
|
||||
locale: i18next.resolvedLanguage,
|
||||
locale: flatpickrLocale(),
|
||||
onChange: function(selectedDates, dateStr, instance) {
|
||||
if (selectedDates.length > 0){
|
||||
$('#id_expiration_clear').removeClass("d-none");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue