mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 complete language configs and fix Arabic translations (#13605)
This commit is contained in:
parent
59a90bb0fa
commit
2d8152381c
2 changed files with 78 additions and 63 deletions
|
|
@ -42,6 +42,7 @@ import (
|
|||
|
||||
type DisplayName struct {
|
||||
Default string `json:"default"`
|
||||
ArSA string `json:"ar_SA"`
|
||||
DeDE string `json:"de_DE"`
|
||||
EnUS string `json:"en_US"`
|
||||
EsES string `json:"es_ES"`
|
||||
|
|
@ -57,6 +58,7 @@ type DisplayName struct {
|
|||
|
||||
type Description struct {
|
||||
Default string `json:"default"`
|
||||
ArSA string `json:"ar_SA"`
|
||||
DeDE string `json:"de_DE"`
|
||||
EnUS string `json:"en_US"`
|
||||
EsES string `json:"es_ES"`
|
||||
|
|
@ -72,6 +74,7 @@ type Description struct {
|
|||
|
||||
type Readme struct {
|
||||
Default string `json:"default"`
|
||||
ArSA string `json:"ar_SA"`
|
||||
DeDE string `json:"de_DE"`
|
||||
EnUS string `json:"en_US"`
|
||||
EsES string `json:"es_ES"`
|
||||
|
|
@ -166,6 +169,10 @@ func getPreferredReadme(readme *Readme) string {
|
|||
|
||||
ret := readme.Default
|
||||
switch util.Lang {
|
||||
case "ar_SA":
|
||||
if "" != readme.ArSA {
|
||||
ret = readme.ArSA
|
||||
}
|
||||
case "de_DE":
|
||||
if "" != readme.DeDE {
|
||||
ret = readme.DeDE
|
||||
|
|
@ -228,6 +235,10 @@ func GetPreferredName(pkg *Package) string {
|
|||
|
||||
ret := pkg.DisplayName.Default
|
||||
switch util.Lang {
|
||||
case "ar_SA":
|
||||
if "" != pkg.DisplayName.ArSA {
|
||||
ret = pkg.DisplayName.ArSA
|
||||
}
|
||||
case "de_DE":
|
||||
if "" != pkg.DisplayName.DeDE {
|
||||
ret = pkg.DisplayName.DeDE
|
||||
|
|
@ -290,6 +301,10 @@ func getPreferredDesc(desc *Description) string {
|
|||
|
||||
ret := desc.Default
|
||||
switch util.Lang {
|
||||
case "ar_SA":
|
||||
if "" != desc.ArSA {
|
||||
ret = desc.ArSA
|
||||
}
|
||||
case "de_DE":
|
||||
if "" != desc.DeDE {
|
||||
ret = desc.DeDE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue