Phase 7: languages
- Complete Spanish (neutral Latin American, Paraguay friendly, no inverted marks) and Dutch catalogs, including the Mini App and owner texts - Command menus per language in three scopes (private, group members, group admins); per-chat menus follow a user's /language and a group's /grouplang, from chat and from the Mini App - Bot name, description and short description per language, sent only when the catalog text changes (TELEGRAM_SET_PROFILE) - Dates from the catalog, numbers, sizes and durations per locale - Pseudo-locale en-XA generated from English (I18N_PSEUDO), owners only - Catalog checks: completeness, placeholders, tags, commands, plurals, Telegram length limits, untranslated text, unused and missing IDs - CI workflow; make i18n-check; docs/TRANSLATING.md - Test fix: the queued-download helper could match another chat's status Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
4f11f939a0
commit
f1f9c6156c
@@ -222,7 +222,7 @@ func (m *MiniApp) me(w http.ResponseWriter, r *http.Request, s *session) {
|
||||
refs, _ := m.Store.CountReferrals(ctx, s.user.ID)
|
||||
var langs []map[string]string
|
||||
for _, l := range m.I18n.Langs() {
|
||||
if !m.I18n.Hidden(l) {
|
||||
if !m.I18n.Hidden(l) || m.Cfg.IsOwner(s.user.ID) {
|
||||
langs = append(langs, map[string]string{"code": l, "name": m.I18n.T(l, "language.name", nil)})
|
||||
}
|
||||
}
|
||||
@@ -284,7 +284,7 @@ func (m *MiniApp) updateMe(w http.ResponseWriter, r *http.Request, s *session) {
|
||||
lang := ""
|
||||
if *in.Lang != "" && *in.Lang != "auto" {
|
||||
for _, l := range m.I18n.Langs() {
|
||||
if l == *in.Lang {
|
||||
if l == *in.Lang && (!m.I18n.Hidden(l) || m.Cfg.IsOwner(s.user.ID)) {
|
||||
lang = l
|
||||
}
|
||||
}
|
||||
@@ -297,6 +297,9 @@ func (m *MiniApp) updateMe(w http.ResponseWriter, r *http.Request, s *session) {
|
||||
m.explain(w, s, err)
|
||||
return
|
||||
}
|
||||
if lang != s.user.LangOverride {
|
||||
m.Bot.SyncUserMenu(ctx, s.user.ID, lang)
|
||||
}
|
||||
}
|
||||
m.ok(w, map[string]bool{"ok": true})
|
||||
}
|
||||
@@ -736,10 +739,14 @@ func (m *MiniApp) groupSettings(w http.ResponseWriter, r *http.Request, s *sessi
|
||||
MaxSizeMB: in.MaxSizeMB, MaxDuration: in.MaxDuration, Quality: in.Quality, Lang: in.Lang,
|
||||
Allowed: allowed, Blocked: blocked,
|
||||
}
|
||||
old, _ := m.Store.GetGroupSettings(r.Context(), g.ChatID)
|
||||
if err := m.Store.SaveGroupSettings(r.Context(), st); err != nil {
|
||||
m.explain(w, s, err)
|
||||
return
|
||||
}
|
||||
if old != nil && old.Lang != st.Lang {
|
||||
m.Bot.SyncGroupMenu(r.Context(), g.ChatID, st.Lang)
|
||||
}
|
||||
m.Log.Info("group settings changed in the mini app", "chat_id", g.ChatID, "by", s.user.ID)
|
||||
m.ok(w, map[string]any{"settings": toSettingsJSON(st)})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user