Add Chinese localization

Addresses https://github.com/paperless-ngx/paperless-ngx/issues/134#issuecomment-1062950795
This commit is contained in:
Michael Shamoon 2022-03-10 10:00:20 -08:00
parent 4184988c0c
commit 37c6201a5a
4 changed files with 11 additions and 2 deletions

View File

@ -31,7 +31,8 @@
"ro-RO": "src/locale/messages.ro_RO.xlf",
"ru-RU": "src/locale/messages.ru_RU.xlf",
"sl-SI": "src/locale/messages.sl_SI.xlf",
"sv-SE": "src/locale/messages.sv_SE.xlf"
"sv-SE": "src/locale/messages.sv_SE.xlf",
"zh-CN": "src/locale/messages.zh_CN.xlf"
}
},
"architect": {

View File

@ -1,6 +1,5 @@
import { BrowserModule } from '@angular/platform-browser'
import { NgModule } from '@angular/core'
import { AppRoutingModule } from './app-routing.module'
import { AppComponent } from './app.component'
import {
@ -84,6 +83,7 @@ import localeRo from '@angular/common/locales/ro'
import localeRu from '@angular/common/locales/ru'
import localeSl from '@angular/common/locales/sl'
import localeSv from '@angular/common/locales/sv'
import localeZh from '@angular/common/locales/zh'
registerLocaleData(localeCs)
registerLocaleData(localeDa)
@ -101,6 +101,7 @@ registerLocaleData(localeRo)
registerLocaleData(localeRu)
registerLocaleData(localeSl)
registerLocaleData(localeSv)
registerLocaleData(localeZh)
@NgModule({
declarations: [

View File

@ -264,6 +264,12 @@ export class SettingsService {
englishName: 'Swedish',
dateInputFormat: 'yyyy-mm-dd',
},
{
code: "zh-cn",
name: $localize`Chinese Simplified`,
englishName: "Chinese Simplified",
dateInputFormat: "yyyy-mm-dd"
}
]
// Sort languages by localized name at runtime

View File

@ -315,6 +315,7 @@ LANGUAGES = [
("ru-ru", _("Russian")),
("sl-si", _("Slovenian")),
("sv-se", _("Swedish")),
("zh-cn", _("Chinese Simplified")),
]
LOCALE_PATHS = [os.path.join(BASE_DIR, "locale")]