-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a view basic translation functions and translation file #137
Merged
Merged
Changes from 11 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
62fc831
Added a view basic translation functions + tranlation file
mjarkk d9959eb
fixed @jesseduffield comment #137
mjarkk 65eb378
fixed typo
mjarkk f2dfcb6
Added more messages and text issue: #137
mjarkk dfafb98
tried to update to latest master
mjarkk 17dcfbc
Merge pull request #1 from jesseduffield/master
mjarkk 5ad97ad
Added the translation to some words again
mjarkk f792f74
Merge remote-tracking branch 'origin/master'
mjarkk dd7e93a
Added all the missing translations from dutch.go
mjarkk 0c39347
Added auto detection for the system language
mjarkk 6e51814
added some commands
mjarkk 0568b32
Added more translations
mjarkk 5cbacb0
make local i18n package confirm to project structure
jesseduffield 4d0702f
Merge branch 'master' of https://github.com/mjarkk/lazygit
jesseduffield 8e22d56
Merge pull request #2 from jesseduffield/master
mjarkk 73a1682
fixed package naming and added tr object to file_panel.go
mjarkk ba2b6fb
pull errors out of package scope and store sentinel errors on the gui…
jesseduffield d923796
Merge branch 'master' of https://github.com/mjarkk/lazygit
jesseduffield 883f436
can't go any further because of an error
mjarkk 9c97b75
Merge remote-tracking branch 'origin/master'
mjarkk 38a1a00
Fixed comment from myself on issue: 137
mjarkk be3f584
Added more translations
mjarkk 3dba246
Added translations for files_panel.go and fixed some typos
mjarkk 8418fa1
Fully translated pkg/gui/commit_message_panel.go
mjarkk d12cc5a
Fully translated pkg/gui/commits_panel.go
mjarkk 7e926cf
Added translation for pkg/gui/ confirmation_panel.go gui.go merge_pan…
mjarkk 10c5316
Merge pull request #3 from jesseduffield/master
mjarkk 295093a
Translated pkg/gui/stash_panel.go
mjarkk 50b41bf
Translated pkg/gui/view_helpers.go
mjarkk d00c46a
Added all english translations to a file and fixed some typos
mjarkk 9112278
Merge pull request #4 from jesseduffield/master
mjarkk 9abbfe5
Fully translated pkg/gui/confirmation_panel.go
mjarkk 88e1a81
Fixed comment on issue #137 from @jesseduffield
mjarkk 9074650
Fixed comments from jesseduffield on issue #137
mjarkk faf218f
Fixed comments from jesseduffield on issue #137
mjarkk fcf616b
Fixed it
mjarkk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package lang | ||
|
||
import ( | ||
"github.com/nicksnyder/go-i18n/v2/i18n" | ||
"golang.org/x/text/language" | ||
) | ||
|
||
// addDutch will add all the translations | ||
func addDutch(i18nObject *i18n.Bundle) *i18n.Bundle { | ||
|
||
// add the translations | ||
i18nObject.AddMessages(language.Dutch, | ||
&i18n.Message{ | ||
ID: "NotEnoughSpace", | ||
Other: "Niet genoeg ruimte om de panelen te renderen", | ||
}, &i18n.Message{ | ||
ID: "DiffTitle", | ||
Other: "Diff", | ||
}, &i18n.Message{ | ||
ID: "FilesTitle", | ||
Other: "Bestanden", | ||
}, &i18n.Message{ | ||
ID: "BranchesTitle", | ||
Other: "Branches", | ||
}, &i18n.Message{ | ||
ID: "CommitsTitle", | ||
Other: "Commits", | ||
}, &i18n.Message{ | ||
ID: "StashTitle", | ||
Other: "Stash", | ||
}, &i18n.Message{ | ||
ID: "CommitMessage", | ||
Other: "Commit Bericht", | ||
}, &i18n.Message{ | ||
ID: "CommitChanges", | ||
Other: "Commit Veranderingen", | ||
}, &i18n.Message{ | ||
ID: "StatusTitle", | ||
Other: "Status", | ||
}, &i18n.Message{ | ||
ID: "navigate", | ||
Other: "navigeer", | ||
}, &i18n.Message{ | ||
ID: "stashFiles", | ||
Other: "stash-bestanden", | ||
}, &i18n.Message{ | ||
ID: "open", | ||
Other: "open", | ||
}, &i18n.Message{ | ||
ID: "ignore", | ||
Other: "negeren", | ||
}, &i18n.Message{ | ||
ID: "delete", | ||
Other: "verwijderen", | ||
}, &i18n.Message{ | ||
ID: "toggleStaged", | ||
Other: "toggle staged", | ||
}, &i18n.Message{ | ||
ID: "refresh", | ||
Other: "verversen", | ||
}, &i18n.Message{ | ||
ID: "addPatch", | ||
Other: "verandering toevoegen", | ||
}, &i18n.Message{ | ||
ID: "edit", | ||
Other: "veranderen", | ||
}, &i18n.Message{ | ||
ID: "scroll", | ||
Other: "scroll", | ||
}, &i18n.Message{ | ||
ID: "abortMerge", | ||
Other: "samenvoegen afbreken", | ||
}, &i18n.Message{ | ||
ID: "resolveMergeConflicts", | ||
Other: "verhelp samenvoegen fouten", | ||
}, &i18n.Message{ | ||
ID: "checkout", | ||
Other: "uitchecken", | ||
}, | ||
) | ||
|
||
// return the new i18nObject | ||
return i18nObject | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package lang | ||
|
||
import ( | ||
"github.com/cloudfoundry/jibber_jabber" | ||
"github.com/nicksnyder/go-i18n/v2/i18n" | ||
"golang.org/x/text/language" | ||
) | ||
|
||
// the function to setup the localizer | ||
func getlocalizer() *i18n.Localizer { | ||
|
||
// detect the user's language | ||
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} | ||
|
||
// add translation file(s) | ||
i18nObject = addDutch(i18nObject) | ||
|
||
// return the new localizer that can be used to translate text | ||
return i18n.NewLocalizer(i18nObject, userLang) | ||
} | ||
|
||
// setup the localizer for later use | ||
var localizer = getlocalizer() | ||
|
||
// Localize handels the translations | ||
// expects i18n.LocalizeConfig as input: https://godoc.org/github.com/nicksnyder/go-i18n/v2/i18n#Localizer.MustLocalize | ||
// output: translated string | ||
func Localize(config *i18n.LocalizeConfig) string { | ||
return localizer.MustLocalize(config) | ||
} | ||
|
||
// SLocalize (short localize) is for 1 line localizations | ||
// ID: The id that is used in the .toml translation files | ||
// Other: the default message it needs to return if there is no translation found or the system is english | ||
func SLocalize(ID string, Other string) string { | ||
return Localize(&i18n.LocalizeConfig{ | ||
DefaultMessage: &i18n.Message{ | ||
ID: ID, | ||
Other: Other, | ||
}, | ||
}) | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIIIICE!