mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-13 01:30:53 +02:00
added some commands
This commit is contained in:
@ -5,7 +5,10 @@ import (
|
|||||||
"golang.org/x/text/language"
|
"golang.org/x/text/language"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// addDutch will add all the translations
|
||||||
func addDutch(i18nObject *i18n.Bundle) *i18n.Bundle {
|
func addDutch(i18nObject *i18n.Bundle) *i18n.Bundle {
|
||||||
|
|
||||||
|
// add the translations
|
||||||
i18nObject.AddMessages(language.Dutch,
|
i18nObject.AddMessages(language.Dutch,
|
||||||
&i18n.Message{
|
&i18n.Message{
|
||||||
ID: "NotEnoughSpace",
|
ID: "NotEnoughSpace",
|
||||||
@ -75,5 +78,7 @@ func addDutch(i18nObject *i18n.Bundle) *i18n.Bundle {
|
|||||||
Other: "uitchecken",
|
Other: "uitchecken",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// return the new i18nObject
|
||||||
return i18nObject
|
return i18nObject
|
||||||
}
|
}
|
||||||
|
@ -9,12 +9,16 @@ import (
|
|||||||
// the function to setup the localizer
|
// the function to setup the localizer
|
||||||
func getlocalizer() *i18n.Localizer {
|
func getlocalizer() *i18n.Localizer {
|
||||||
|
|
||||||
|
// detect the user's language
|
||||||
userLang, _ := jibber_jabber.DetectLanguage()
|
userLang, _ := jibber_jabber.DetectLanguage()
|
||||||
|
|
||||||
|
// create a i18n bundle that can be used to add translations and other things
|
||||||
var i18nObject = &i18n.Bundle{DefaultLanguage: language.English}
|
var i18nObject = &i18n.Bundle{DefaultLanguage: language.English}
|
||||||
|
|
||||||
// add translation file(s)
|
// add translation file(s)
|
||||||
i18nObject = addDutch(i18nObject)
|
i18nObject = addDutch(i18nObject)
|
||||||
|
|
||||||
|
// return the new localizer that can be used to translate text
|
||||||
return i18n.NewLocalizer(i18nObject, userLang)
|
return i18n.NewLocalizer(i18nObject, userLang)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user