diff options
-rw-r--r-- | docs/content/en/content-management/multilingual.md | 5 | ||||
-rw-r--r-- | langs/config.go | 2 | ||||
-rw-r--r-- | langs/language.go | 9 |
3 files changed, 12 insertions, 4 deletions
diff --git a/docs/content/en/content-management/multilingual.md b/docs/content/en/content-management/multilingual.md index d3f71676a..575393d47 100644 --- a/docs/content/en/content-management/multilingual.md +++ b/docs/content/en/content-management/multilingual.md @@ -47,6 +47,11 @@ weight = 2 linkedin = "https://linkedin.com/fr/whoever" [languages.fr.params.navigation] help = "Aide" + +[languages.ar] +title = "مدونتي" +weight = 2 +languagedirection = "rtl" {{< /code-toggle >}} Anything not defined in a `languages` block will fall back to the global value for that key (e.g., `copyright` for the English `en` language). This also works for `params`, as demonstrated with `help` above: You will get the value `Aide` in French and `Help` in all the languages without this parameter set. diff --git a/langs/config.go b/langs/config.go index 184223650..08cd15009 100644 --- a/langs/config.go +++ b/langs/config.go @@ -185,6 +185,8 @@ func toSortedLanguages(cfg config.Provider, l map[string]interface{}) (Languages language.Title = cast.ToString(v) case "languagename": language.LanguageName = cast.ToString(v) + case "languagedirection": + language.LanguageDirection = cast.ToString(v) case "weight": language.Weight = cast.ToInt(v) case "contentdir": diff --git a/langs/language.go b/langs/language.go index 036f5413a..874bd3020 100644 --- a/langs/language.go +++ b/langs/language.go @@ -41,10 +41,11 @@ var globalOnlySettings = map[string]bool{ // Language manages specific-language configuration. type Language struct { - Lang string - LanguageName string - Title string - Weight int + Lang string + LanguageName string + LanguageDirection string + Title string + Weight int Disabled bool |