mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 04:45:47 +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:
parent
da86096e19
commit
ae4a579153
2 changed files with 2 additions and 2 deletions
|
@ -24,7 +24,7 @@ func NewTranslationSetFromConfig(log *logrus.Entry, configLanguage string) (*Tra
|
||||||
language := detectLanguage(jibber_jabber.DetectIETF)
|
language := detectLanguage(jibber_jabber.DetectIETF)
|
||||||
for _, languageCode := range languageCodes {
|
for _, languageCode := range languageCodes {
|
||||||
if strings.HasPrefix(language, languageCode) {
|
if strings.HasPrefix(language, languageCode) {
|
||||||
return newTranslationSet(log, language)
|
return newTranslationSet(log, languageCode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ func TestNewTranslationSetFromConfig(t *testing.T) {
|
||||||
configLanguage: "auto",
|
configLanguage: "auto",
|
||||||
envLanguage: "nl_NL",
|
envLanguage: "nl_NL",
|
||||||
expected: "nl",
|
expected: "nl",
|
||||||
expectedErr: true, // Demonstrates the bug, this should be false
|
expectedErr: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "auto-detection with LANG set to zh-CN",
|
name: "auto-detection with LANG set to zh-CN",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue