fix: sync WebA labels and forward fixes
This commit is contained in:
parent
7bb7e11603
commit
4d3bbeabd8
11 changed files with 422 additions and 10 deletions
|
|
@ -72,7 +72,7 @@ func (r *Router) langpackLanguage(ctx context.Context, langPack, langCode string
|
|||
langCode = "en"
|
||||
}
|
||||
}
|
||||
langCode = strings.ToLower(langCode)
|
||||
langCode = normalizeLangpackCode(langCode)
|
||||
languages := r.langpackLanguages(ctx, langPack)
|
||||
for _, lang := range languages {
|
||||
if strings.ToLower(lang.LangCode) == langCode {
|
||||
|
|
@ -150,3 +150,11 @@ func langPackFromClient(ctx context.Context) string {
|
|||
}
|
||||
return "tdesktop"
|
||||
}
|
||||
|
||||
func normalizeLangpackCode(langCode string) string {
|
||||
code := strings.ToLower(strings.TrimSpace(langCode))
|
||||
if code == "" {
|
||||
return "en"
|
||||
}
|
||||
return strings.TrimSuffix(code, "-raw")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue