From 591a96d2e5fad954406bb037f17a182a7d48df88 Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Wed, 21 Aug 2024 10:58:58 -0700 Subject: [PATCH] Fix translation assistance message --- pkg/server/server_command.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pkg/server/server_command.go b/pkg/server/server_command.go index 4cd40a4..f537298 100644 --- a/pkg/server/server_command.go +++ b/pkg/server/server_command.go @@ -202,16 +202,21 @@ func (s *server) handleFirstCommand(cmd serverCommand, keyword string, params [] s.sendMOTD(cmd.client) // Request translation assistance from international users. - var found bool - for _, language := range translatedLanguages { - if language == cmd.client.language { - found = true - break + if strings.HasPrefix(cmd.client.language, "bgammon-") { + clientLanguage := cmd.client.language[8:] + if clientLanguage != "" { + var found bool + for _, language := range translatedLanguages { + if language == clientLanguage { + found = true + break + } + } + if !found { + cmd.client.sendNotice("Help translate this application into your preferred language at bgammon.org/translate") + } } } - if !found { - cmd.client.sendNotice("Help translate this application into your preferred language at bgammon.org/translate") - } c := cmd.client if c.accountID != 0 {