mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-25 00:46:54 +02:00
Fix language auto-detection
Starting lazygit with an environment containing LANG=ko_KO or LANG=nl_NL would result in an error at startup.
This commit is contained in:
@ -24,7 +24,7 @@ func NewTranslationSetFromConfig(log *logrus.Entry, configLanguage string) (*Tra
|
||||
language := detectLanguage(jibber_jabber.DetectIETF)
|
||||
for _, languageCode := range languageCodes {
|
||||
if strings.HasPrefix(language, languageCode) {
|
||||
return newTranslationSet(log, language)
|
||||
return newTranslationSet(log, languageCode)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ func TestNewTranslationSetFromConfig(t *testing.T) {
|
||||
configLanguage: "auto",
|
||||
envLanguage: "nl_NL",
|
||||
expected: "nl",
|
||||
expectedErr: true, // Demonstrates the bug, this should be false
|
||||
expectedErr: false,
|
||||
},
|
||||
{
|
||||
name: "auto-detection with LANG set to zh-CN",
|
||||
|
Reference in New Issue
Block a user