From 37bb89dac33cb4236bf817e1e2e09cb1cbfade5c Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 4 Oct 2020 11:00:48 +1100 Subject: [PATCH] type i18n --- go.mod | 2 - go.sum | 12 - main.go | 2 +- pkg/app/app.go | 12 +- pkg/commands/dummies.go | 2 +- pkg/commands/git.go | 10 +- pkg/commands/git_test.go | 14 +- pkg/commands/loading_commits.go | 6 +- pkg/commands/loading_commits_test.go | 2 +- pkg/commands/patch_rebases.go | 4 +- pkg/commands/pull_request.go | 4 +- pkg/commands/rebasing.go | 8 +- pkg/gui/branches_panel.go | 83 +- pkg/gui/cherry_picking.go | 6 +- pkg/gui/commit_files_panel.go | 14 +- pkg/gui/commit_message_panel.go | 10 +- pkg/gui/commits_panel.go | 85 +- pkg/gui/confirmation_panel.go | 9 +- pkg/gui/credentials_panel.go | 14 +- pkg/gui/custom_commands.go | 2 +- pkg/gui/diffing.go | 12 +- pkg/gui/discard_changes_menu_panel.go | 6 +- pkg/gui/files_panel.go | 60 +- pkg/gui/filtering.go | 4 +- pkg/gui/filtering_menu_panel.go | 10 +- pkg/gui/git_flow.go | 5 +- pkg/gui/global_handlers.go | 6 +- pkg/gui/gui.go | 19 +- pkg/gui/keybindings.go | 322 +- pkg/gui/layout.go | 24 +- pkg/gui/list_context.go | 10 +- pkg/gui/menu_panel.go | 8 +- pkg/gui/merge_panel.go | 18 +- pkg/gui/modes.go | 8 +- pkg/gui/options_menu_panel.go | 2 +- pkg/gui/patch_options_panel.go | 18 +- pkg/gui/quitting.go | 2 +- pkg/gui/rebase_options_panel.go | 10 +- pkg/gui/recent_repos_panel.go | 2 +- pkg/gui/reflog_panel.go | 4 +- pkg/gui/remote_branches_panel.go | 15 +- pkg/gui/remotes_panel.go | 22 +- pkg/gui/reset_menu_panel.go | 2 +- pkg/gui/staging_panel.go | 12 +- pkg/gui/stash_panel.go | 26 +- pkg/gui/status_panel.go | 2 +- pkg/gui/sub_commits_panel.go | 4 +- pkg/gui/submodules_panel.go | 44 +- pkg/gui/tags_panel.go | 17 +- pkg/gui/undoing.go | 14 +- pkg/gui/view_helpers.go | 12 +- pkg/gui/workspace_reset_options_panel.go | 12 +- pkg/i18n/dutch.go | 1543 ++------ pkg/i18n/english.go | 2107 ++++------ pkg/i18n/i18n.go | 102 +- pkg/i18n/i18n_test.go | 48 - pkg/i18n/polish.go | 1013 ++--- pkg/updates/updates.go | 18 +- pkg/utils/utils.go | 3 +- scripts/generate_cheatsheet.go | 46 +- .../github.com/nicksnyder/go-i18n/v2/LICENSE | 19 - .../nicksnyder/go-i18n/v2/i18n/bundle.go | 136 - .../nicksnyder/go-i18n/v2/i18n/doc.go | 24 - .../nicksnyder/go-i18n/v2/i18n/localizer.go | 234 -- .../nicksnyder/go-i18n/v2/i18n/message.go | 221 -- .../go-i18n/v2/i18n/message_template.go | 65 - .../nicksnyder/go-i18n/v2/i18n/parse.go | 166 - .../go-i18n/v2/internal/plural/doc.go | 3 - .../go-i18n/v2/internal/plural/form.go | 16 - .../go-i18n/v2/internal/plural/operands.go | 120 - .../go-i18n/v2/internal/plural/rule.go | 44 - .../go-i18n/v2/internal/plural/rule_gen.go | 589 --- .../go-i18n/v2/internal/plural/rules.go | 24 - .../go-i18n/v2/internal/template.go | 51 - vendor/golang.org/x/text/AUTHORS | 3 - vendor/golang.org/x/text/CONTRIBUTORS | 3 - vendor/golang.org/x/text/LICENSE | 27 - vendor/golang.org/x/text/PATENTS | 22 - .../x/text/internal/language/common.go | 16 - .../x/text/internal/language/compact.go | 29 - .../text/internal/language/compact/compact.go | 61 - .../internal/language/compact/language.go | 260 -- .../text/internal/language/compact/parents.go | 120 - .../text/internal/language/compact/tables.go | 1015 ----- .../x/text/internal/language/compact/tags.go | 91 - .../x/text/internal/language/compose.go | 167 - .../x/text/internal/language/coverage.go | 28 - .../x/text/internal/language/language.go | 596 --- .../x/text/internal/language/lookup.go | 412 -- .../x/text/internal/language/match.go | 226 -- .../x/text/internal/language/parse.go | 594 --- .../x/text/internal/language/tables.go | 3431 ----------------- .../x/text/internal/language/tags.go | 48 - vendor/golang.org/x/text/internal/tag/tag.go | 100 - vendor/golang.org/x/text/language/coverage.go | 187 - vendor/golang.org/x/text/language/doc.go | 102 - vendor/golang.org/x/text/language/go1_1.go | 38 - vendor/golang.org/x/text/language/go1_2.go | 11 - vendor/golang.org/x/text/language/language.go | 601 --- vendor/golang.org/x/text/language/match.go | 735 ---- vendor/golang.org/x/text/language/parse.go | 228 -- vendor/golang.org/x/text/language/tables.go | 298 -- vendor/golang.org/x/text/language/tags.go | 145 - vendor/modules.txt | 15 - 104 files changed, 2049 insertions(+), 15185 deletions(-) delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/LICENSE delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/i18n/bundle.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/i18n/doc.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/i18n/localizer.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/i18n/message.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/i18n/message_template.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/i18n/parse.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/doc.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/form.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/operands.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/rule.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/rule_gen.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/rules.go delete mode 100644 vendor/github.com/nicksnyder/go-i18n/v2/internal/template.go delete mode 100644 vendor/golang.org/x/text/AUTHORS delete mode 100644 vendor/golang.org/x/text/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/text/LICENSE delete mode 100644 vendor/golang.org/x/text/PATENTS delete mode 100644 vendor/golang.org/x/text/internal/language/common.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/compact.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/language.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/parents.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/tables.go delete mode 100644 vendor/golang.org/x/text/internal/language/compact/tags.go delete mode 100644 vendor/golang.org/x/text/internal/language/compose.go delete mode 100644 vendor/golang.org/x/text/internal/language/coverage.go delete mode 100644 vendor/golang.org/x/text/internal/language/language.go delete mode 100644 vendor/golang.org/x/text/internal/language/lookup.go delete mode 100644 vendor/golang.org/x/text/internal/language/match.go delete mode 100644 vendor/golang.org/x/text/internal/language/parse.go delete mode 100644 vendor/golang.org/x/text/internal/language/tables.go delete mode 100644 vendor/golang.org/x/text/internal/language/tags.go delete mode 100644 vendor/golang.org/x/text/internal/tag/tag.go delete mode 100644 vendor/golang.org/x/text/language/coverage.go delete mode 100644 vendor/golang.org/x/text/language/doc.go delete mode 100644 vendor/golang.org/x/text/language/go1_1.go delete mode 100644 vendor/golang.org/x/text/language/go1_2.go delete mode 100644 vendor/golang.org/x/text/language/language.go delete mode 100644 vendor/golang.org/x/text/language/match.go delete mode 100644 vendor/golang.org/x/text/language/parse.go delete mode 100644 vendor/golang.org/x/text/language/tables.go delete mode 100644 vendor/golang.org/x/text/language/tags.go diff --git a/go.mod b/go.mod index 77ee3fa0d..0ee90742b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/jesseduffield/lazygit go 1.14 require ( - github.com/BurntSushi/toml v0.3.1 // indirect github.com/OpenPeeDeeP/xdg v1.0.0 github.com/atotto/clipboard v0.1.2 github.com/aybabtme/humanlog v0.4.1 @@ -27,7 +26,6 @@ require ( github.com/mattn/go-colorable v0.1.7 // indirect github.com/mattn/go-runewidth v0.0.9 github.com/mgutz/str v1.2.0 - github.com/nicksnyder/go-i18n/v2 v2.0.3 github.com/onsi/ginkgo v1.10.3 // indirect github.com/onsi/gomega v1.7.1 // indirect github.com/sirupsen/logrus v1.4.2 diff --git a/go.sum b/go.sum index c28d2954d..61f6033dd 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,3 @@ -github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OpenPeeDeeP/xdg v1.0.0 h1:UDLmNjCGFZZCaVMB74DqYEtXkHxnTxcr4FeJVF9uCn8= github.com/OpenPeeDeeP/xdg v1.0.0/go.mod h1:tMoSueLQlMf0TCldjrJLNIjAc5qAOIcHt5REi88/Ygo= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= @@ -108,8 +105,6 @@ github.com/mgutz/str v1.2.0 h1:4IzWSdIz9qPQWLfKZ0rJcV0jcUDpxvP4JVZ4GXQyvSw= github.com/mgutz/str v1.2.0/go.mod h1:w1v0ofgLaJdoD0HpQ3fycxKD1WtxpjSo151pK/31q6w= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/nicksnyder/go-i18n/v2 v2.0.3 h1:ks/JkQiOEhhuF6jpNvx+Wih1NIiXzUnZeZVnJuI8R8M= -github.com/nicksnyder/go-i18n/v2 v2.0.3/go.mod h1:oDab7q8XCYMRlcrBnaY/7B1eOectbvj6B1UPBT+p5jo= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -140,7 +135,6 @@ github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70 github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -150,16 +144,13 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201002202402-0a1ea396d57c h1:dk0ukUIHmGHqASjP0iue2261isepFCC6XRCSd1nHgDw= golang.org/x/net v0.0.0-20201002202402-0a1ea396d57c/go.mod h1:iQL9McJNjoIa5mjH6nYTCTZXUN6RP+XW3eib7Ya3XcI= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170407050850-f3918c30c5c2/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -167,7 +158,6 @@ golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -180,7 +170,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -192,7 +181,6 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= diff --git a/main.go b/main.go index d2c9187dc..c5cd2f222 100644 --- a/main.go +++ b/main.go @@ -127,6 +127,6 @@ func main() { stackTrace := newErr.ErrorStack() app.Log.Error(stackTrace) - log.Fatal(fmt.Sprintf("%s\n\n%s", app.Tr.SLocalize("ErrorOccurred"), stackTrace)) + log.Fatal(fmt.Sprintf("%s\n\n%s", app.Tr.ErrorOccurred, stackTrace)) } } diff --git a/pkg/app/app.go b/pkg/app/app.go index fd8950ae7..9d3f53cc0 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -34,7 +34,7 @@ type App struct { OSCommand *oscommands.OSCommand GitCommand *commands.GitCommand Gui *gui.Gui - Tr *i18n.Localizer + Tr *i18n.TranslationSet Updater *updates.Updater // may only need this on the Gui ClientContext string } @@ -103,7 +103,7 @@ func NewApp(config config.AppConfigurer, filterPath string) (*App, error) { } var err error app.Log = newLogger(config) - app.Tr = i18n.NewLocalizer(app.Log) + app.Tr = i18n.NewTranslationSet(app.Log) // if we are being called in 'demon' mode, we can just return here app.ClientContext = os.Getenv("LAZYGIT_CLIENT_COMMAND") @@ -138,7 +138,7 @@ func NewApp(config config.AppConfigurer, filterPath string) (*App, error) { func (app *App) validateGitVersion() error { output, err := app.OSCommand.RunCommandWithOutput("git --version") // if we get an error anywhere here we'll show the same status - minVersionError := errors.New(app.Tr.SLocalize("minGitVersionError")) + minVersionError := errors.New(app.Tr.MinGitVersionError) if err != nil { return minVersionError } @@ -193,7 +193,7 @@ func (app *App) setupRepo() (bool, error) { } // Offer to initialize a new repository in current directory. - fmt.Print(app.Tr.SLocalize("CreateRepo")) + fmt.Print(app.Tr.CreateRepo) response, _ := bufio.NewReader(os.Stdin).ReadString('\n') if strings.Trim(response, " \n") != "y" { // check if we have a recent repo we can open @@ -275,7 +275,7 @@ func (app *App) Close() error { func (app *App) KnownError(err error) (string, bool) { errorMessage := err.Error() - knownErrorMessages := []string{app.Tr.SLocalize("minGitVersionError")} + knownErrorMessages := []string{app.Tr.MinGitVersionError} for _, message := range knownErrorMessages { if errorMessage == message { @@ -286,7 +286,7 @@ func (app *App) KnownError(err error) (string, bool) { mappings := []errorMapping{ { originalError: "fatal: not a git repository", - newError: app.Tr.SLocalize("notARepository"), + newError: app.Tr.NotARepository, }, } diff --git a/pkg/commands/dummies.go b/pkg/commands/dummies.go index da03d2f08..b7ec98501 100644 --- a/pkg/commands/dummies.go +++ b/pkg/commands/dummies.go @@ -17,7 +17,7 @@ func NewDummyGitCommandWithOSCommand(osCommand *oscommands.OSCommand) *GitComman return &GitCommand{ Log: utils.NewDummyLog(), OSCommand: osCommand, - Tr: i18n.NewLocalizer(utils.NewDummyLog()), + Tr: i18n.NewTranslationSet(utils.NewDummyLog()), Config: config.NewDummyAppConfig(), getGlobalGitConfig: func(string) (string, error) { return "", nil }, getLocalGitConfig: func(string) (string, error) { return "", nil }, diff --git a/pkg/commands/git.go b/pkg/commands/git.go index af1533886..63b0e6859 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -30,7 +30,7 @@ type GitCommand struct { Log *logrus.Entry OSCommand *oscommands.OSCommand Repo *gogit.Repository - Tr *i18n.Localizer + Tr *i18n.TranslationSet Config config.AppConfigurer getGlobalGitConfig func(string) (string, error) getLocalGitConfig func(string) (string, error) @@ -44,7 +44,7 @@ type GitCommand struct { } // NewGitCommand it runs git commands -func NewGitCommand(log *logrus.Entry, osCommand *oscommands.OSCommand, tr *i18n.Localizer, config config.AppConfigurer) (*GitCommand, error) { +func NewGitCommand(log *logrus.Entry, osCommand *oscommands.OSCommand, tr *i18n.TranslationSet, config config.AppConfigurer) (*GitCommand, error) { var repo *gogit.Repository // see what our default push behaviour is @@ -64,7 +64,7 @@ func NewGitCommand(log *logrus.Entry, osCommand *oscommands.OSCommand, tr *i18n. return nil, err } - if repo, err = setupRepository(gogit.PlainOpen, tr.SLocalize); err != nil { + if repo, err = setupRepository(gogit.PlainOpen, tr.GitconfigParseErr); err != nil { return nil, err } @@ -140,7 +140,7 @@ func resolvePath(path string) (string, error) { return filepath.EvalSymlinks(path) } -func setupRepository(openGitRepository func(string) (*gogit.Repository, error), sLocalize func(string) string) (*gogit.Repository, error) { +func setupRepository(openGitRepository func(string) (*gogit.Repository, error), gitConfigParseErrorStr string) (*gogit.Repository, error) { unresolvedPath := env.GetGitDirEnv() if unresolvedPath == "" { var err error @@ -159,7 +159,7 @@ func setupRepository(openGitRepository func(string) (*gogit.Repository, error), if err != nil { if strings.Contains(err.Error(), `unquoted '\' must be followed by new line`) { - return nil, errors.New(sLocalize("GitconfigParseErr")) + return nil, errors.New(gitConfigParseErrorStr) } return nil, err diff --git a/pkg/commands/git_test.go b/pkg/commands/git_test.go index e04903e39..ebac76e01 100644 --- a/pkg/commands/git_test.go +++ b/pkg/commands/git_test.go @@ -159,7 +159,7 @@ func TestSetupRepository(t *testing.T) { type scenario struct { testName string openGitRepository func(string) (*gogit.Repository, error) - sLocalize func(string) string + errorStr string test func(*gogit.Repository, error) } @@ -169,9 +169,7 @@ func TestSetupRepository(t *testing.T) { func(string) (*gogit.Repository, error) { return nil, fmt.Errorf(`unquoted '\' must be followed by new line`) }, - func(string) string { - return "error translated" - }, + "error translated", func(r *gogit.Repository, err error) { assert.Error(t, err) assert.EqualError(t, err, "error translated") @@ -182,7 +180,7 @@ func TestSetupRepository(t *testing.T) { func(string) (*gogit.Repository, error) { return nil, fmt.Errorf("Error from inside gogit") }, - func(string) string { return "" }, + "", func(r *gogit.Repository, err error) { assert.Error(t, err) assert.EqualError(t, err, "Error from inside gogit") @@ -196,7 +194,7 @@ func TestSetupRepository(t *testing.T) { assert.NoError(t, err) return r, nil }, - func(string) string { return "" }, + "", func(r *gogit.Repository, err error) { assert.NoError(t, err) assert.NotNil(t, r) @@ -206,7 +204,7 @@ func TestSetupRepository(t *testing.T) { for _, s := range scenarios { t.Run(s.testName, func(t *testing.T) { - s.test(setupRepository(s.openGitRepository, s.sLocalize)) + s.test(setupRepository(s.openGitRepository, s.errorStr)) }) } } @@ -254,7 +252,7 @@ func TestNewGitCommand(t *testing.T) { for _, s := range scenarios { t.Run(s.testName, func(t *testing.T) { s.setup() - s.test(NewGitCommand(utils.NewDummyLog(), oscommands.NewDummyOSCommand(), i18n.NewLocalizer(utils.NewDummyLog()), config.NewDummyAppConfig())) + s.test(NewGitCommand(utils.NewDummyLog(), oscommands.NewDummyOSCommand(), i18n.NewTranslationSet(utils.NewDummyLog()), config.NewDummyAppConfig())) }) } } diff --git a/pkg/commands/loading_commits.go b/pkg/commands/loading_commits.go index 72946aeb6..33954b23e 100644 --- a/pkg/commands/loading_commits.go +++ b/pkg/commands/loading_commits.go @@ -33,11 +33,11 @@ type CommitListBuilder struct { Log *logrus.Entry GitCommand *GitCommand OSCommand *oscommands.OSCommand - Tr *i18n.Localizer + Tr *i18n.TranslationSet } // NewCommitListBuilder builds a new commit list builder -func NewCommitListBuilder(log *logrus.Entry, gitCommand *GitCommand, osCommand *oscommands.OSCommand, tr *i18n.Localizer) *CommitListBuilder { +func NewCommitListBuilder(log *logrus.Entry, gitCommand *GitCommand, osCommand *oscommands.OSCommand, tr *i18n.TranslationSet) *CommitListBuilder { return &CommitListBuilder{ Log: log, GitCommand: gitCommand, @@ -170,7 +170,7 @@ func (c *CommitListBuilder) GetCommits(opts GetCommitsOptions) ([]*models.Commit if rebaseMode != "" { currentCommit := commits[len(rebasingCommits)] blue := color.New(color.FgYellow) - youAreHere := blue.Sprintf("<-- %s ---", c.Tr.SLocalize("YouAreHere")) + youAreHere := blue.Sprintf("<-- %s ---", c.Tr.YouAreHere) currentCommit.Name = fmt.Sprintf("%s %s", youAreHere, currentCommit.Name) } diff --git a/pkg/commands/loading_commits_test.go b/pkg/commands/loading_commits_test.go index beda2c574..c6c77f259 100644 --- a/pkg/commands/loading_commits_test.go +++ b/pkg/commands/loading_commits_test.go @@ -18,7 +18,7 @@ func NewDummyCommitListBuilder() *CommitListBuilder { Log: utils.NewDummyLog(), GitCommand: NewDummyGitCommandWithOSCommand(osCommand), OSCommand: osCommand, - Tr: i18n.NewLocalizer(utils.NewDummyLog()), + Tr: i18n.NewTranslationSet(utils.NewDummyLog()), } } diff --git a/pkg/commands/patch_rebases.go b/pkg/commands/patch_rebases.go index c51a24ed7..42e03f1e9 100644 --- a/pkg/commands/patch_rebases.go +++ b/pkg/commands/patch_rebases.go @@ -72,7 +72,7 @@ func (c *GitCommand) MovePatchToSelectedCommit(commits []*models.Commit, sourceC // one where we handle the possibility of a credential request, and the other // where we continue the rebase if c.usingGpg() { - return errors.New(c.Tr.SLocalize("DisabledForGPG")) + return errors.New(c.Tr.DisabledForGPG) } baseIndex := sourceCommitIdx + 1 @@ -139,7 +139,7 @@ func (c *GitCommand) MovePatchToSelectedCommit(commits []*models.Commit, sourceC func (c *GitCommand) PullPatchIntoIndex(commits []*models.Commit, commitIdx int, p *patch.PatchManager, stash bool) error { if stash { - if err := c.StashSave(c.Tr.SLocalize("StashPrefix") + commits[commitIdx].Sha); err != nil { + if err := c.StashSave(c.Tr.StashPrefix + commits[commitIdx].Sha); err != nil { return err } } diff --git a/pkg/commands/pull_request.go b/pkg/commands/pull_request.go index acceced52..3a820dbfd 100644 --- a/pkg/commands/pull_request.go +++ b/pkg/commands/pull_request.go @@ -94,7 +94,7 @@ func (pr *PullRequest) Create(branch *models.Branch) error { branchExistsOnRemote := pr.GitCommand.CheckRemoteBranchExists(branch) if !branchExistsOnRemote { - return errors.New(pr.GitCommand.Tr.SLocalize("NoBranchOnRemote")) + return errors.New(pr.GitCommand.Tr.NoBranchOnRemote) } repoURL := pr.GitCommand.GetRemoteURL() @@ -108,7 +108,7 @@ func (pr *PullRequest) Create(branch *models.Branch) error { } if gitService == nil { - return errors.New(pr.GitCommand.Tr.SLocalize("UnsupportedGitService")) + return errors.New(pr.GitCommand.Tr.UnsupportedGitService) } repoInfo := getRepoInfoFromURL(repoURL) diff --git a/pkg/commands/rebasing.go b/pkg/commands/rebasing.go index df1f43607..e7c28bd8d 100644 --- a/pkg/commands/rebasing.go +++ b/pkg/commands/rebasing.go @@ -26,7 +26,7 @@ func (c *GitCommand) MoveCommitDown(commits []*models.Commit, index int) error { // we must ensure that we have at least two commits after the selected one if len(commits) <= index+2 { // assuming they aren't picking the bottom commit - return errors.New(c.Tr.SLocalize("NoRoom")) + return errors.New(c.Tr.NoRoom) } todo := "" @@ -101,14 +101,14 @@ func (c *GitCommand) GenerateGenericRebaseTodo(commits []*models.Commit, actionI baseIndex := actionIndex + 1 if len(commits) <= baseIndex { - return "", "", errors.New(c.Tr.SLocalize("CannotRebaseOntoFirstCommit")) + return "", "", errors.New(c.Tr.CannotRebaseOntoFirstCommit) } if action == "squash" || action == "fixup" { baseIndex++ if len(commits) <= baseIndex { - return "", "", errors.New(c.Tr.SLocalize("CannotSquashOntoSecondCommit")) + return "", "", errors.New(c.Tr.CannotSquashOntoSecondCommit) } } @@ -212,7 +212,7 @@ func (c *GitCommand) BeginInteractiveRebaseForCommit(commits []*models.Commit, c // one where we handle the possibility of a credential request, and the other // where we continue the rebase if c.usingGpg() { - return errors.New(c.Tr.SLocalize("DisabledForGPG")) + return errors.New(c.Tr.DisabledForGPG) } todo, sha, err := c.GenerateGenericRebaseTodo(commits, commitIndex, "edit") diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index 8bc6fd93c..c8b63e0d5 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -7,6 +7,7 @@ import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" "github.com/jesseduffield/lazygit/pkg/commands/models" + "github.com/jesseduffield/lazygit/pkg/utils" ) // list panel functions @@ -28,7 +29,7 @@ func (gui *Gui) handleBranchSelect() error { var task updateTask branch := gui.getSelectedBranch() if branch == nil { - task = gui.createRenderStringTask(gui.Tr.SLocalize("NoBranchesThisRepo")) + task = gui.createRenderStringTask(gui.Tr.NoBranchesThisRepo) } else { cmd := gui.OSCommand.ExecutableFromString( gui.GitCommand.GetBranchGraphCmdStr(branch.Name), @@ -81,7 +82,7 @@ func (gui *Gui) handleBranchPress(g *gocui.Gui, v *gocui.View) error { return nil } if gui.State.Panels.Branches.SelectedLineIdx == 0 { - return gui.createErrorPanel(gui.Tr.SLocalize("AlreadyCheckedOutBranch")) + return gui.createErrorPanel(gui.Tr.AlreadyCheckedOutBranch) } branch := gui.getSelectedBranch() return gui.handleCheckoutRef(branch.Name, handleCheckoutRefOptions{}) @@ -99,7 +100,7 @@ func (gui *Gui) handleCreatePullRequestPress(g *gocui.Gui, v *gocui.View) error } func (gui *Gui) handleGitFetch(g *gocui.Gui, v *gocui.View) error { - if err := gui.createLoaderPanel(v, gui.Tr.SLocalize("FetchWait")); err != nil { + if err := gui.createLoaderPanel(v, gui.Tr.FetchWait); err != nil { return err } go func() { @@ -112,8 +113,8 @@ func (gui *Gui) handleGitFetch(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleForceCheckout(g *gocui.Gui, v *gocui.View) error { branch := gui.getSelectedBranch() - message := gui.Tr.SLocalize("SureForceCheckout") - title := gui.Tr.SLocalize("ForceCheckoutBranch") + message := gui.Tr.SureForceCheckout + title := gui.Tr.ForceCheckoutBranch return gui.ask(askOpts{ title: title, @@ -136,7 +137,7 @@ type handleCheckoutRefOptions struct { func (gui *Gui) handleCheckoutRef(ref string, options handleCheckoutRefOptions) error { waitingStatus := options.WaitingStatus if waitingStatus == "" { - waitingStatus = gui.Tr.SLocalize("CheckingOutStatus") + waitingStatus = gui.Tr.CheckingOutStatus } cmdOptions := commands.CheckoutOptions{Force: false, EnvVars: options.EnvVars} @@ -160,10 +161,10 @@ func (gui *Gui) handleCheckoutRef(ref string, options handleCheckoutRefOptions) // offer to autostash changes return gui.ask(askOpts{ - title: gui.Tr.SLocalize("AutoStashTitle"), - prompt: gui.Tr.SLocalize("AutoStashPrompt"), + title: gui.Tr.AutoStashTitle, + prompt: gui.Tr.AutoStashPrompt, handleConfirm: func() error { - if err := gui.GitCommand.StashSave(gui.Tr.SLocalize("StashPrefix") + ref); err != nil { + if err := gui.GitCommand.StashSave(gui.Tr.StashPrefix + ref); err != nil { return gui.surfaceError(err) } if err := gui.GitCommand.Checkout(ref, cmdOptions); err != nil { @@ -193,14 +194,14 @@ func (gui *Gui) handleCheckoutRef(ref string, options handleCheckoutRefOptions) } func (gui *Gui) handleCheckoutByName(g *gocui.Gui, v *gocui.View) error { - return gui.prompt(gui.Tr.SLocalize("BranchName")+":", "", func(response string) error { + return gui.prompt(gui.Tr.BranchName+":", "", func(response string) error { return gui.handleCheckoutRef(response, handleCheckoutRefOptions{ onRefNotFound: func(ref string) error { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("BranchNotFoundTitle"), - prompt: fmt.Sprintf("%s %s%s", gui.Tr.SLocalize("BranchNotFoundPrompt"), ref, "?"), + title: gui.Tr.BranchNotFoundTitle, + prompt: fmt.Sprintf("%s %s%s", gui.Tr.BranchNotFoundPrompt, ref, "?"), handleConfirm: func() error { return gui.createNewBranchWithName(ref) }, @@ -243,22 +244,22 @@ func (gui *Gui) deleteBranch(force bool) error { } checkedOutBranch := gui.getCheckedOutBranch() if checkedOutBranch.Name == selectedBranch.Name { - return gui.createErrorPanel(gui.Tr.SLocalize("CantDeleteCheckOutBranch")) + return gui.createErrorPanel(gui.Tr.CantDeleteCheckOutBranch) } return gui.deleteNamedBranch(selectedBranch, force) } func (gui *Gui) deleteNamedBranch(selectedBranch *models.Branch, force bool) error { - title := gui.Tr.SLocalize("DeleteBranch") - var messageID string + title := gui.Tr.DeleteBranch + var templateStr string if force { - messageID = "ForceDeleteBranchMessage" + templateStr = gui.Tr.ForceDeleteBranchMessage } else { - messageID = "DeleteBranchMessage" + templateStr = gui.Tr.DeleteBranchMessage } - message := gui.Tr.TemplateLocalize( - messageID, - Teml{ + message := utils.ResolvePlaceholderString( + templateStr, + map[string]string{ "selectedBranchName": selectedBranch.Name, }, ) @@ -290,11 +291,11 @@ func (gui *Gui) mergeBranchIntoCheckedOutBranch(branchName string) error { } checkedOutBranchName := gui.getCheckedOutBranch().Name if checkedOutBranchName == branchName { - return gui.createErrorPanel(gui.Tr.SLocalize("CantMergeBranchIntoItself")) + return gui.createErrorPanel(gui.Tr.CantMergeBranchIntoItself) } - prompt := gui.Tr.TemplateLocalize( - "ConfirmMerge", - Teml{ + prompt := utils.ResolvePlaceholderString( + gui.Tr.ConfirmMerge, + map[string]string{ "checkedOutBranch": checkedOutBranchName, "selectedBranch": branchName, }, @@ -302,7 +303,7 @@ func (gui *Gui) mergeBranchIntoCheckedOutBranch(branchName string) error { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("MergingTitle"), + title: gui.Tr.MergingTitle, prompt: prompt, handleConfirm: func() error { err := gui.GitCommand.Merge(branchName, commands.MergeOpts{}) @@ -332,11 +333,11 @@ func (gui *Gui) handleRebaseOntoBranch(selectedBranchName string) error { checkedOutBranch := gui.getCheckedOutBranch().Name if selectedBranchName == checkedOutBranch { - return gui.createErrorPanel(gui.Tr.SLocalize("CantRebaseOntoSelf")) + return gui.createErrorPanel(gui.Tr.CantRebaseOntoSelf) } - prompt := gui.Tr.TemplateLocalize( - "ConfirmRebase", - Teml{ + prompt := utils.ResolvePlaceholderString( + gui.Tr.ConfirmRebase, + map[string]string{ "checkedOutBranch": checkedOutBranch, "selectedBranch": selectedBranchName, }, @@ -344,7 +345,7 @@ func (gui *Gui) handleRebaseOntoBranch(selectedBranchName string) error { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("RebasingTitle"), + title: gui.Tr.RebasingTitle, prompt: prompt, handleConfirm: func() error { err := gui.GitCommand.RebaseBranch(selectedBranchName) @@ -362,10 +363,10 @@ func (gui *Gui) handleFastForward(g *gocui.Gui, v *gocui.View) error { return nil } if branch.Pushables == "?" { - return gui.createErrorPanel(gui.Tr.SLocalize("FwdNoUpstream")) + return gui.createErrorPanel(gui.Tr.FwdNoUpstream) } if branch.Pushables != "0" { - return gui.createErrorPanel(gui.Tr.SLocalize("FwdCommitsToPush")) + return gui.createErrorPanel(gui.Tr.FwdCommitsToPush) } upstream, err := gui.GitCommand.GetUpstreamForBranch(branch.Name) @@ -377,9 +378,9 @@ func (gui *Gui) handleFastForward(g *gocui.Gui, v *gocui.View) error { remoteName := split[0] remoteBranchName := strings.Join(split[1:], "/") - message := gui.Tr.TemplateLocalize( - "Fetching", - Teml{ + message := utils.ResolvePlaceholderString( + gui.Tr.Fetching, + map[string]string{ "from": fmt.Sprintf("%s/%s", remoteName, remoteBranchName), "to": branch.Name, }, @@ -417,7 +418,7 @@ func (gui *Gui) handleRenameBranch(g *gocui.Gui, v *gocui.View) error { // way to get it to show up in the reflog) promptForNewName := func() error { - return gui.prompt(gui.Tr.SLocalize("NewBranchNamePrompt")+" "+branch.Name+":", "", func(newBranchName string) error { + return gui.prompt(gui.Tr.NewBranchNamePrompt+" "+branch.Name+":", "", func(newBranchName string) error { if err := gui.GitCommand.RenameBranch(branch.Name, newBranchName); err != nil { return gui.surfaceError(err) } @@ -441,8 +442,8 @@ func (gui *Gui) handleRenameBranch(g *gocui.Gui, v *gocui.View) error { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("renameBranch"), - prompt: gui.Tr.SLocalize("RenameBranchWarning"), + title: gui.Tr.LcRenameBranch, + prompt: gui.Tr.RenameBranchWarning, handleConfirm: promptForNewName, }) } @@ -462,9 +463,9 @@ func (gui *Gui) handleNewBranchOffCurrentItem() error { return nil } - message := gui.Tr.TemplateLocalize( - "NewBranchNameBranchOff", - Teml{ + message := utils.ResolvePlaceholderString( + gui.Tr.NewBranchNameBranchOff, + map[string]string{ "branchName": item.Description(), }, ) diff --git a/pkg/gui/cherry_picking.go b/pkg/gui/cherry_picking.go index bf2b25ee1..a9620896a 100644 --- a/pkg/gui/cherry_picking.go +++ b/pkg/gui/cherry_picking.go @@ -144,10 +144,10 @@ func (gui *Gui) HandlePasteCommits() error { } return gui.ask(askOpts{ - title: gui.Tr.SLocalize("CherryPick"), - prompt: gui.Tr.SLocalize("SureCherryPick"), + title: gui.Tr.CherryPick, + prompt: gui.Tr.SureCherryPick, handleConfirm: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("CherryPickingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.CherryPickingStatus, func() error { err := gui.GitCommand.CherryPickCommits(gui.State.Modes.CherryPicking.CherryPickedCommits) return gui.handleGenericMergeCommandResult(err) }) diff --git a/pkg/gui/commit_files_panel.go b/pkg/gui/commit_files_panel.go index f8273723f..830d600d6 100644 --- a/pkg/gui/commit_files_panel.go +++ b/pkg/gui/commit_files_panel.go @@ -60,10 +60,10 @@ func (gui *Gui) handleDiscardOldFileChange(g *gocui.Gui, v *gocui.View) error { fileName := gui.State.CommitFiles[gui.State.Panels.CommitFiles.SelectedLineIdx].Name return gui.ask(askOpts{ - title: gui.Tr.SLocalize("DiscardFileChangesTitle"), - prompt: gui.Tr.SLocalize("DiscardFileChangesPrompt"), + title: gui.Tr.DiscardFileChangesTitle, + prompt: gui.Tr.DiscardFileChangesPrompt, handleConfirm: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("RebasingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error { if err := gui.GitCommand.DiscardOldFileChanges(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, fileName); err != nil { if err := gui.handleGenericMergeCommandResult(err); err != nil { return err @@ -137,8 +137,8 @@ func (gui *Gui) handleToggleFileForPatch(g *gocui.Gui, v *gocui.View) error { if gui.GitCommand.PatchManager.Active() && gui.GitCommand.PatchManager.To != commitFile.Parent { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("DiscardPatch"), - prompt: gui.Tr.SLocalize("DiscardPatchConfirm"), + title: gui.Tr.DiscardPatch, + prompt: gui.Tr.DiscardPatchConfirm, handleConfirm: func() error { gui.GitCommand.PatchManager.Reset() return toggleTheFile() @@ -184,8 +184,8 @@ func (gui *Gui) enterCommitFile(selectedLineIdx int) error { if gui.GitCommand.PatchManager.Active() && gui.GitCommand.PatchManager.To != commitFile.Parent { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("DiscardPatch"), - prompt: gui.Tr.SLocalize("DiscardPatchConfirm"), + title: gui.Tr.DiscardPatch, + prompt: gui.Tr.DiscardPatchConfirm, handlersManageFocus: true, handleConfirm: func() error { gui.GitCommand.PatchManager.Reset() diff --git a/pkg/gui/commit_message_panel.go b/pkg/gui/commit_message_panel.go index 3db714fa2..4a5597659 100644 --- a/pkg/gui/commit_message_panel.go +++ b/pkg/gui/commit_message_panel.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/jesseduffield/gocui" + "github.com/jesseduffield/lazygit/pkg/utils" ) // runSyncOrAsyncCommand takes the output of a command that may have returned @@ -28,7 +29,7 @@ func (gui *Gui) runSyncOrAsyncCommand(sub *exec.Cmd, err error) (bool, error) { func (gui *Gui) handleCommitConfirm(g *gocui.Gui, v *gocui.View) error { message := gui.trimmedContent(v) if message == "" { - return gui.createErrorPanel(gui.Tr.SLocalize("CommitWithoutMessageErr")) + return gui.createErrorPanel(gui.Tr.CommitWithoutMessageErr) } flags := "" skipHookPrefix := gui.Config.GetUserConfig().Git.SkipHookPrefix @@ -53,14 +54,15 @@ func (gui *Gui) handleCommitClose(g *gocui.Gui, v *gocui.View) error { } func (gui *Gui) handleCommitMessageFocused() error { - message := gui.Tr.TemplateLocalize( - "CommitMessageConfirm", - Teml{ + message := utils.ResolvePlaceholderString( + gui.Tr.CommitMessageConfirm, + map[string]string{ "keyBindClose": "esc", "keyBindConfirm": "enter", "keyBindNewLine": "tab", }, ) + gui.renderString("options", message) return nil } diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index 25e418dac..231ee4a98 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -6,6 +6,7 @@ import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" "github.com/jesseduffield/lazygit/pkg/commands/models" + "github.com/jesseduffield/lazygit/pkg/utils" ) // list panel functions @@ -35,7 +36,7 @@ func (gui *Gui) handleCommitSelect() error { var task updateTask commit := gui.getSelectedLocalCommit() if commit == nil { - task = gui.createRenderStringTask(gui.Tr.SLocalize("NoCommitsThisBranch")) + task = gui.createRenderStringTask(gui.Tr.NoCommitsThisBranch) } else { cmd := gui.OSCommand.ExecutableFromString( gui.GitCommand.ShowCmdStr(commit.Sha, gui.State.Modes.Filtering.Path), @@ -153,7 +154,7 @@ func (gui *Gui) handleCommitSquashDown(g *gocui.Gui, v *gocui.View) error { } if len(gui.State.Commits) <= 1 { - return gui.createErrorPanel(gui.Tr.SLocalize("YouNoCommitsToSquash")) + return gui.createErrorPanel(gui.Tr.YouNoCommitsToSquash) } applied, err := gui.handleMidRebaseCommand("squash") @@ -165,10 +166,10 @@ func (gui *Gui) handleCommitSquashDown(g *gocui.Gui, v *gocui.View) error { } return gui.ask(askOpts{ - title: gui.Tr.SLocalize("Squash"), - prompt: gui.Tr.SLocalize("SureSquashThisCommit"), + title: gui.Tr.Squash, + prompt: gui.Tr.SureSquashThisCommit, handleConfirm: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("SquashingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.SquashingStatus, func() error { err := gui.GitCommand.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "squash") return gui.handleGenericMergeCommandResult(err) }) @@ -182,7 +183,7 @@ func (gui *Gui) handleCommitFixup(g *gocui.Gui, v *gocui.View) error { } if len(gui.State.Commits) <= 1 { - return gui.createErrorPanel(gui.Tr.SLocalize("YouNoCommitsToSquash")) + return gui.createErrorPanel(gui.Tr.YouNoCommitsToSquash) } applied, err := gui.handleMidRebaseCommand("fixup") @@ -194,10 +195,10 @@ func (gui *Gui) handleCommitFixup(g *gocui.Gui, v *gocui.View) error { } return gui.ask(askOpts{ - title: gui.Tr.SLocalize("Fixup"), - prompt: gui.Tr.SLocalize("SureFixupThisCommit"), + title: gui.Tr.Fixup, + prompt: gui.Tr.SureFixupThisCommit, handleConfirm: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("FixingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.FixingStatus, func() error { err := gui.GitCommand.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "fixup") return gui.handleGenericMergeCommandResult(err) }) @@ -219,7 +220,7 @@ func (gui *Gui) handleRenameCommit(g *gocui.Gui, v *gocui.View) error { } if gui.State.Panels.Commits.SelectedLineIdx != 0 { - return gui.createErrorPanel(gui.Tr.SLocalize("OnlyRenameTopCommit")) + return gui.createErrorPanel(gui.Tr.OnlyRenameTopCommit) } commit := gui.getSelectedLocalCommit() @@ -232,7 +233,7 @@ func (gui *Gui) handleRenameCommit(g *gocui.Gui, v *gocui.View) error { return gui.surfaceError(err) } - return gui.prompt(gui.Tr.SLocalize("renameCommit"), message, func(response string) error { + return gui.prompt(gui.Tr.LcRenameCommit, message, func(response string) error { if err := gui.GitCommand.RenameCommit(response); err != nil { return gui.surfaceError(err) } @@ -280,7 +281,7 @@ func (gui *Gui) handleMidRebaseCommand(action string) (bool, error) { // our input or we set a lazygit client as the EDITOR env variable and have it // request us to edit the commit message when prompted. if action == "reword" { - return true, gui.createErrorPanel(gui.Tr.SLocalize("rewordNotSupported")) + return true, gui.createErrorPanel(gui.Tr.LcRewordNotSupported) } if err := gui.GitCommand.EditRebaseTodo(gui.State.Panels.Commits.SelectedLineIdx, action); err != nil { @@ -304,10 +305,10 @@ func (gui *Gui) handleCommitDelete(g *gocui.Gui, v *gocui.View) error { } return gui.ask(askOpts{ - title: gui.Tr.SLocalize("DeleteCommitTitle"), - prompt: gui.Tr.SLocalize("DeleteCommitPrompt"), + title: gui.Tr.DeleteCommitTitle, + prompt: gui.Tr.DeleteCommitPrompt, handleConfirm: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("DeletingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.DeletingStatus, func() error { err := gui.GitCommand.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "drop") return gui.handleGenericMergeCommandResult(err) }) @@ -333,7 +334,7 @@ func (gui *Gui) handleCommitMoveDown(g *gocui.Gui, v *gocui.View) error { return gui.refreshRebaseCommits() } - return gui.WithWaitingStatus(gui.Tr.SLocalize("MovingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.MovingStatus, func() error { err := gui.GitCommand.MoveCommitDown(gui.State.Commits, index) if err == nil { gui.State.Panels.Commits.SelectedLineIdx++ @@ -360,7 +361,7 @@ func (gui *Gui) handleCommitMoveUp(g *gocui.Gui, v *gocui.View) error { return gui.refreshRebaseCommits() } - return gui.WithWaitingStatus(gui.Tr.SLocalize("MovingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.MovingStatus, func() error { err := gui.GitCommand.MoveCommitDown(gui.State.Commits, index-1) if err == nil { gui.State.Panels.Commits.SelectedLineIdx-- @@ -382,7 +383,7 @@ func (gui *Gui) handleCommitEdit(g *gocui.Gui, v *gocui.View) error { return nil } - return gui.WithWaitingStatus(gui.Tr.SLocalize("RebasingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error { err = gui.GitCommand.InteractiveRebase(gui.State.Commits, gui.State.Panels.Commits.SelectedLineIdx, "edit") return gui.handleGenericMergeCommandResult(err) }) @@ -394,10 +395,10 @@ func (gui *Gui) handleCommitAmendTo(g *gocui.Gui, v *gocui.View) error { } return gui.ask(askOpts{ - title: gui.Tr.SLocalize("AmendCommitTitle"), - prompt: gui.Tr.SLocalize("AmendCommitPrompt"), + title: gui.Tr.AmendCommitTitle, + prompt: gui.Tr.AmendCommitPrompt, handleConfirm: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("AmendingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.AmendingStatus, func() error { err := gui.GitCommand.AmendTo(gui.State.Commits[gui.State.Panels.Commits.SelectedLineIdx].Sha) return gui.handleGenericMergeCommandResult(err) }) @@ -467,14 +468,16 @@ func (gui *Gui) handleCreateFixupCommit(g *gocui.Gui, v *gocui.View) error { return nil } + prompt := utils.ResolvePlaceholderString( + gui.Tr.SureCreateFixupCommit, + map[string]string{ + "commit": commit.Sha, + }, + ) + return gui.ask(askOpts{ - title: gui.Tr.SLocalize("CreateFixupCommit"), - prompt: gui.Tr.TemplateLocalize( - "SureCreateFixupCommit", - Teml{ - "commit": commit.Sha, - }, - ), + title: gui.Tr.CreateFixupCommit, + prompt: prompt, handleConfirm: func() error { if err := gui.GitCommand.CreateFixupCommit(commit.Sha); err != nil { return gui.surfaceError(err) @@ -495,16 +498,18 @@ func (gui *Gui) handleSquashAllAboveFixupCommits(g *gocui.Gui, v *gocui.View) er return nil } + prompt := utils.ResolvePlaceholderString( + gui.Tr.SureSquashAboveCommits, + map[string]string{ + "commit": commit.Sha, + }, + ) + return gui.ask(askOpts{ - title: gui.Tr.SLocalize("SquashAboveCommits"), - prompt: gui.Tr.TemplateLocalize( - "SureSquashAboveCommits", - Teml{ - "commit": commit.Sha, - }, - ), + title: gui.Tr.SquashAboveCommits, + prompt: prompt, handleConfirm: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("SquashingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.SquashingStatus, func() error { err := gui.GitCommand.SquashAllAboveFixupCommits(commit.Sha) return gui.handleGenericMergeCommandResult(err) }) @@ -525,7 +530,7 @@ func (gui *Gui) handleTagCommit(g *gocui.Gui, v *gocui.View) error { } func (gui *Gui) handleCreateLightweightTag(commitSha string) error { - return gui.prompt(gui.Tr.SLocalize("TagNameTitle"), "", func(response string) error { + return gui.prompt(gui.Tr.TagNameTitle, "", func(response string) error { if err := gui.GitCommand.CreateLightweightTag(response, commitSha); err != nil { return gui.surfaceError(err) } @@ -540,8 +545,8 @@ func (gui *Gui) handleCheckoutCommit(g *gocui.Gui, v *gocui.View) error { } return gui.ask(askOpts{ - title: gui.Tr.SLocalize("checkoutCommit"), - prompt: gui.Tr.SLocalize("SureCheckoutThisCommit"), + title: gui.Tr.LcCheckoutCommit, + prompt: gui.Tr.SureCheckoutThisCommit, handleConfirm: func() error { return gui.handleCheckoutRef(commit.Sha, handleCheckoutRefOptions{}) }, @@ -551,7 +556,7 @@ func (gui *Gui) handleCheckoutCommit(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleCreateCommitResetMenu(g *gocui.Gui, v *gocui.View) error { commit := gui.getSelectedLocalCommit() if commit == nil { - return gui.createErrorPanel(gui.Tr.SLocalize("NoCommitsThisBranch")) + return gui.createErrorPanel(gui.Tr.NoCommitsThisBranch) } return gui.createResetMenu(commit.Sha) diff --git a/pkg/gui/confirmation_panel.go b/pkg/gui/confirmation_panel.go index eabc57881..135ac782f 100644 --- a/pkg/gui/confirmation_panel.go +++ b/pkg/gui/confirmation_panel.go @@ -13,6 +13,7 @@ import ( "github.com/fatih/color" "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/theme" + "github.com/jesseduffield/lazygit/pkg/utils" ) type createPopupPanelOpts struct { @@ -205,9 +206,9 @@ func (gui *Gui) createPopupPanel(opts createPopupPanelOpts) error { } func (gui *Gui) setKeyBindings(opts createPopupPanelOpts) error { - actions := gui.Tr.TemplateLocalize( - "CloseConfirm", - Teml{ + actions := utils.ResolvePlaceholderString( + gui.Tr.CloseConfirm, + map[string]string{ "keyBindClose": "esc", "keyBindConfirm": "enter", }, @@ -240,7 +241,7 @@ func (gui *Gui) createErrorPanel(message string) error { } return gui.ask(askOpts{ - title: gui.Tr.SLocalize("Error"), + title: gui.Tr.Error, prompt: coloredMessage, }) } diff --git a/pkg/gui/credentials_panel.go b/pkg/gui/credentials_panel.go index 8620f7a23..d125e3c8f 100644 --- a/pkg/gui/credentials_panel.go +++ b/pkg/gui/credentials_panel.go @@ -4,6 +4,7 @@ import ( "strings" "github.com/jesseduffield/gocui" + "github.com/jesseduffield/lazygit/pkg/utils" ) type credentials chan string @@ -14,10 +15,10 @@ func (gui *Gui) promptUserForCredential(passOrUname string) string { gui.g.Update(func(g *gocui.Gui) error { credentialsView, _ := g.View("credentials") if passOrUname == "username" { - credentialsView.Title = gui.Tr.SLocalize("CredentialsUsername") + credentialsView.Title = gui.Tr.CredentialsUsername credentialsView.Mask = 0 } else { - credentialsView.Title = gui.Tr.SLocalize("CredentialsPassword") + credentialsView.Title = gui.Tr.CredentialsPassword credentialsView.Mask = '*' } @@ -53,13 +54,14 @@ func (gui *Gui) handleCloseCredentialsView(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleCredentialsViewFocused() error { keybindingConfig := gui.Config.GetUserConfig().Keybinding - message := gui.Tr.TemplateLocalize( - "CloseConfirm", - Teml{ + message := utils.ResolvePlaceholderString( + gui.Tr.CloseConfirm, + map[string]string{ "keyBindClose": gui.getKeyDisplay(keybindingConfig.Universal.Return), "keyBindConfirm": gui.getKeyDisplay(keybindingConfig.Universal.Confirm), }, ) + gui.renderString("options", message) return nil } @@ -69,7 +71,7 @@ func (gui *Gui) handleCredentialsPopup(cmdErr error) { if cmdErr != nil { errMessage := cmdErr.Error() if strings.Contains(errMessage, "Invalid username or password") { - errMessage = gui.Tr.SLocalize("PassUnameWrong") + errMessage = gui.Tr.PassUnameWrong } // we are not logging this error because it may contain a password gui.createErrorPanel(errMessage) diff --git a/pkg/gui/custom_commands.go b/pkg/gui/custom_commands.go index c4156852b..0d5179006 100644 --- a/pkg/gui/custom_commands.go +++ b/pkg/gui/custom_commands.go @@ -62,7 +62,7 @@ func (gui *Gui) handleCustomCommandKeybinding(customCommand config.CustomCommand loadingText := customCommand.LoadingText if loadingText == "" { - loadingText = gui.Tr.SLocalize("runningCustomCommandStatus") + loadingText = gui.Tr.LcRunningCustomCommandStatus } return gui.WithWaitingStatus(loadingText, func() error { gui.OSCommand.PrepareSubProcess(cmdStr) diff --git a/pkg/gui/diffing.go b/pkg/gui/diffing.go index 58a549d62..4a1d92a8d 100644 --- a/pkg/gui/diffing.go +++ b/pkg/gui/diffing.go @@ -114,7 +114,7 @@ func (gui *Gui) handleCreateDiffingMenuPanel(g *gocui.Gui, v *gocui.View) error name := name menuItems = append(menuItems, []*menuItem{ { - displayString: fmt.Sprintf("%s %s", gui.Tr.SLocalize("diff"), name), + displayString: fmt.Sprintf("%s %s", gui.Tr.LcDiff, name), onPress: func() error { gui.State.Modes.Diffing.Ref = name // can scope this down based on current view but too lazy right now @@ -126,9 +126,9 @@ func (gui *Gui) handleCreateDiffingMenuPanel(g *gocui.Gui, v *gocui.View) error menuItems = append(menuItems, []*menuItem{ { - displayString: gui.Tr.SLocalize("enterRefToDiff"), + displayString: gui.Tr.LcEnterRefToDiff, onPress: func() error { - return gui.prompt(gui.Tr.SLocalize("enteRefName"), "", func(response string) error { + return gui.prompt(gui.Tr.LcEnteRefName, "", func(response string) error { gui.State.Modes.Diffing.Ref = strings.TrimSpace(response) return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) }) @@ -139,14 +139,14 @@ func (gui *Gui) handleCreateDiffingMenuPanel(g *gocui.Gui, v *gocui.View) error if gui.State.Modes.Diffing.Active() { menuItems = append(menuItems, []*menuItem{ { - displayString: gui.Tr.SLocalize("swapDiff"), + displayString: gui.Tr.LcSwapDiff, onPress: func() error { gui.State.Modes.Diffing.Reverse = !gui.State.Modes.Diffing.Reverse return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) }, }, { - displayString: gui.Tr.SLocalize("exitDiffMode"), + displayString: gui.Tr.LcExitDiffMode, onPress: func() error { gui.State.Modes.Diffing = Diffing{} return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) @@ -155,5 +155,5 @@ func (gui *Gui) handleCreateDiffingMenuPanel(g *gocui.Gui, v *gocui.View) error }...) } - return gui.createMenu(gui.Tr.SLocalize("DiffingMenuTitle"), menuItems, createMenuOptions{showCancel: true}) + return gui.createMenu(gui.Tr.DiffingMenuTitle, menuItems, createMenuOptions{showCancel: true}) } diff --git a/pkg/gui/discard_changes_menu_panel.go b/pkg/gui/discard_changes_menu_panel.go index 9d79a70fa..1c1a8c4d4 100644 --- a/pkg/gui/discard_changes_menu_panel.go +++ b/pkg/gui/discard_changes_menu_panel.go @@ -29,7 +29,7 @@ func (gui *Gui) handleCreateDiscardMenu(g *gocui.Gui, v *gocui.View) error { menuItems = []*menuItem{ { - displayString: gui.Tr.SLocalize("submoduleStashAndReset"), + displayString: gui.Tr.LcSubmoduleStashAndReset, onPress: func() error { return gui.resetSubmodule(submodule) }, @@ -38,7 +38,7 @@ func (gui *Gui) handleCreateDiscardMenu(g *gocui.Gui, v *gocui.View) error { } else { menuItems = []*menuItem{ { - displayString: gui.Tr.SLocalize("discardAllChanges"), + displayString: gui.Tr.LcDiscardAllChanges, onPress: func() error { if err := gui.GitCommand.DiscardAllFileChanges(file); err != nil { return gui.surfaceError(err) @@ -50,7 +50,7 @@ func (gui *Gui) handleCreateDiscardMenu(g *gocui.Gui, v *gocui.View) error { if file.HasStagedChanges && file.HasUnstagedChanges { menuItems = append(menuItems, &menuItem{ - displayString: gui.Tr.SLocalize("discardUnstagedChanges"), + displayString: gui.Tr.LcDiscardUnstagedChanges, onPress: func() error { if err := gui.GitCommand.DiscardUnstagedFileChanges(file); err != nil { return gui.surfaceError(err) diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index 798a13618..b8f79a51d 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -38,7 +38,7 @@ func (gui *Gui) selectFile(alreadySelected bool) error { return gui.refreshMainViews(refreshMainOpts{ main: &viewUpdateOpts{ title: "", - task: gui.createRenderStringTask(gui.Tr.SLocalize("NoChangedFiles")), + task: gui.createRenderStringTask(gui.Tr.NoChangedFiles), }, }) } @@ -61,7 +61,7 @@ func (gui *Gui) selectFile(alreadySelected bool) error { cmd := gui.OSCommand.ExecutableFromString(cmdStr) refreshOpts := refreshMainOpts{main: &viewUpdateOpts{ - title: gui.Tr.SLocalize("UnstagedChanges"), + title: gui.Tr.UnstagedChanges, task: gui.createRunPtyTask(cmd), }} @@ -70,11 +70,11 @@ func (gui *Gui) selectFile(alreadySelected bool) error { cmd := gui.OSCommand.ExecutableFromString(cmdStr) refreshOpts.secondary = &viewUpdateOpts{ - title: gui.Tr.SLocalize("StagedChanges"), + title: gui.Tr.StagedChanges, task: gui.createRunPtyTask(cmd), } } else if !file.HasUnstagedChanges { - refreshOpts.main.title = gui.Tr.SLocalize("StagedChanges") + refreshOpts.main.title = gui.Tr.StagedChanges } return gui.refreshMainViews(refreshOpts) @@ -181,7 +181,7 @@ func (gui *Gui) enterFile(forceSecondaryFocused bool, selectedLineIdx int) error return gui.handleSwitchToMerge() } if file.HasMergeConflicts { - return gui.createErrorPanel(gui.Tr.SLocalize("FileStagingRequirements")) + return gui.createErrorPanel(gui.Tr.FileStagingRequirements) } gui.switchContext(gui.Contexts.Staging.Context) @@ -257,8 +257,8 @@ func (gui *Gui) handleIgnoreFile(g *gocui.Gui, v *gocui.View) error { if file.Tracked { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("IgnoreTracked"), - prompt: gui.Tr.SLocalize("IgnoreTrackedPrompt"), + title: gui.Tr.IgnoreTracked, + prompt: gui.Tr.IgnoreTrackedPrompt, handleConfirm: func() error { if err := gui.GitCommand.Ignore(file.Name); err != nil { return err @@ -281,7 +281,7 @@ func (gui *Gui) handleIgnoreFile(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleWIPCommitPress(g *gocui.Gui, filesView *gocui.View) error { skipHookPreifx := gui.Config.GetUserConfig().Git.SkipHookPrefix if skipHookPreifx == "" { - return gui.createErrorPanel(gui.Tr.SLocalize("SkipHookPrefixNotConfigured")) + return gui.createErrorPanel(gui.Tr.SkipHookPrefixNotConfigured) } gui.renderStringSync("commitMessage", skipHookPreifx) @@ -315,7 +315,7 @@ func (gui *Gui) handleCommitPress() error { prefixReplace := commitPrefixConfig.Replace rgx, err := regexp.Compile(prefixPattern) if err != nil { - return gui.createErrorPanel(fmt.Sprintf("%s: %s", gui.Tr.SLocalize("commitPrefixPatternError"), err.Error())) + return gui.createErrorPanel(fmt.Sprintf("%s: %s", gui.Tr.LcCommitPrefixPatternError, err.Error())) } prefix := rgx.ReplaceAllString(gui.getCheckedOutBranch().Name, prefixReplace) gui.renderString("commitMessage", prefix) @@ -337,8 +337,8 @@ func (gui *Gui) handleCommitPress() error { func (gui *Gui) promptToStageAllAndRetry(retry func() error) error { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("NoFilesStagedTitle"), - prompt: gui.Tr.SLocalize("NoFilesStagedPrompt"), + title: gui.Tr.NoFilesStagedTitle, + prompt: gui.Tr.NoFilesStagedPrompt, handleConfirm: func() error { if err := gui.GitCommand.StageAll(); err != nil { return gui.surfaceError(err) @@ -360,14 +360,14 @@ func (gui *Gui) handleAmendCommitPress() error { } if len(gui.State.Commits) == 0 { - return gui.createErrorPanel(gui.Tr.SLocalize("NoCommitToAmend")) + return gui.createErrorPanel(gui.Tr.NoCommitToAmend) } return gui.ask(askOpts{ - title: strings.Title(gui.Tr.SLocalize("AmendLastCommit")), - prompt: gui.Tr.SLocalize("SureToAmend"), + title: strings.Title(gui.Tr.AmendLastCommit), + prompt: gui.Tr.SureToAmend, handleConfirm: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("AmendingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.AmendingStatus, func() error { ok, err := gui.runSyncOrAsyncCommand(gui.GitCommand.AmendHead()) if err != nil { return err @@ -484,7 +484,7 @@ func (gui *Gui) handlePullFiles(g *gocui.Gui, v *gocui.View) error { } } - return gui.prompt(gui.Tr.SLocalize("EnterUpstream"), "origin/"+currentBranch.Name, func(upstream string) error { + return gui.prompt(gui.Tr.EnterUpstream, "origin/"+currentBranch.Name, func(upstream string) error { if err := gui.GitCommand.SetUpstreamBranch(upstream); err != nil { errorMessage := err.Error() if strings.Contains(errorMessage, "does not exist") { @@ -505,7 +505,7 @@ type PullFilesOptions struct { } func (gui *Gui) pullFiles(opts PullFilesOptions) error { - if err := gui.createLoaderPanel(gui.g.CurrentView(), gui.Tr.SLocalize("PullWait")); err != nil { + if err := gui.createLoaderPanel(gui.g.CurrentView(), gui.Tr.PullWait); err != nil { return err } @@ -548,7 +548,7 @@ func (gui *Gui) pullWithMode(mode string, opts PullFilesOptions) error { } func (gui *Gui) pushWithForceFlag(v *gocui.View, force bool, upstream string, args string) error { - if err := gui.createLoaderPanel(v, gui.Tr.SLocalize("PushWait")); err != nil { + if err := gui.createLoaderPanel(v, gui.Tr.PushWait); err != nil { return err } go func() { @@ -557,12 +557,12 @@ func (gui *Gui) pushWithForceFlag(v *gocui.View, force bool, upstream string, ar if err != nil && !force && strings.Contains(err.Error(), "Updates were rejected") { forcePushDisabled := gui.Config.GetUserConfig().Git.DisableForcePushing if forcePushDisabled { - gui.createErrorPanel(gui.Tr.SLocalize("UpdatesRejectedAndForcePushDisabled")) + gui.createErrorPanel(gui.Tr.UpdatesRejectedAndForcePushDisabled) return } gui.ask(askOpts{ - title: gui.Tr.SLocalize("ForcePush"), - prompt: gui.Tr.SLocalize("ForcePushPrompt"), + title: gui.Tr.ForcePush, + prompt: gui.Tr.ForcePushPrompt, handleConfirm: func() error { return gui.pushWithForceFlag(v, true, upstream, args) }, @@ -598,7 +598,7 @@ func (gui *Gui) pushFiles(g *gocui.Gui, v *gocui.View) error { if gui.GitCommand.PushToCurrent { return gui.pushWithForceFlag(v, false, "", "--set-upstream") } else { - return gui.prompt(gui.Tr.SLocalize("EnterUpstream"), "origin "+currentBranch.Name, func(response string) error { + return gui.prompt(gui.Tr.EnterUpstream, "origin "+currentBranch.Name, func(response string) error { return gui.pushWithForceFlag(v, false, response, "") }) } @@ -608,12 +608,12 @@ func (gui *Gui) pushFiles(g *gocui.Gui, v *gocui.View) error { forcePushDisabled := gui.Config.GetUserConfig().Git.DisableForcePushing if forcePushDisabled { - return gui.createErrorPanel(gui.Tr.SLocalize("ForcePushDisabled")) + return gui.createErrorPanel(gui.Tr.ForcePushDisabled) } return gui.ask(askOpts{ - title: gui.Tr.SLocalize("ForcePush"), - prompt: gui.Tr.SLocalize("ForcePushPrompt"), + title: gui.Tr.ForcePush, + prompt: gui.Tr.ForcePushPrompt, handleConfirm: func() error { return gui.pushWithForceFlag(v, true, "", "") }, @@ -627,7 +627,7 @@ func (gui *Gui) handleSwitchToMerge() error { } if !file.HasInlineMergeConflicts { - return gui.createErrorPanel(gui.Tr.SLocalize("FileNoMergeCons")) + return gui.createErrorPanel(gui.Tr.FileNoMergeCons) } return gui.switchContext(gui.Contexts.Merging.Context) @@ -650,7 +650,7 @@ func (gui *Gui) anyFilesWithMergeConflicts() bool { } func (gui *Gui) handleCustomCommand(g *gocui.Gui, v *gocui.View) error { - return gui.prompt(gui.Tr.SLocalize("CustomCommand"), "", func(command string) error { + return gui.prompt(gui.Tr.CustomCommand, "", func(command string) error { gui.SubProcess = gui.OSCommand.RunCustomCommand(command) return gui.Errors.ErrSubProcess }) @@ -659,20 +659,20 @@ func (gui *Gui) handleCustomCommand(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleCreateStashMenu(g *gocui.Gui, v *gocui.View) error { menuItems := []*menuItem{ { - displayString: gui.Tr.SLocalize("stashAllChanges"), + displayString: gui.Tr.LcStashAllChanges, onPress: func() error { return gui.handleStashSave(gui.GitCommand.StashSave) }, }, { - displayString: gui.Tr.SLocalize("stashStagedChanges"), + displayString: gui.Tr.LcStashStagedChanges, onPress: func() error { return gui.handleStashSave(gui.GitCommand.StashSaveStagedChanges) }, }, } - return gui.createMenu(gui.Tr.SLocalize("stashOptions"), menuItems, createMenuOptions{showCancel: true}) + return gui.createMenu(gui.Tr.LcStashOptions, menuItems, createMenuOptions{showCancel: true}) } func (gui *Gui) handleStashChanges(g *gocui.Gui, v *gocui.View) error { diff --git a/pkg/gui/filtering.go b/pkg/gui/filtering.go index 222e59d14..9213b611e 100644 --- a/pkg/gui/filtering.go +++ b/pkg/gui/filtering.go @@ -3,8 +3,8 @@ package gui func (gui *Gui) validateNotInFilterMode() (bool, error) { if gui.State.Modes.Filtering.Active() { err := gui.ask(askOpts{ - title: gui.Tr.SLocalize("MustExitFilterModeTitle"), - prompt: gui.Tr.SLocalize("MustExitFilterModePrompt"), + title: gui.Tr.MustExitFilterModeTitle, + prompt: gui.Tr.MustExitFilterModePrompt, handleConfirm: func() error { return gui.exitFilterMode() }, diff --git a/pkg/gui/filtering_menu_panel.go b/pkg/gui/filtering_menu_panel.go index 8925e1395..f79f0ca46 100644 --- a/pkg/gui/filtering_menu_panel.go +++ b/pkg/gui/filtering_menu_panel.go @@ -30,7 +30,7 @@ func (gui *Gui) handleCreateFilteringMenuPanel(g *gocui.Gui, v *gocui.View) erro if fileName != "" { menuItems = append(menuItems, &menuItem{ - displayString: fmt.Sprintf("%s '%s'", gui.Tr.SLocalize("filterBy"), fileName), + displayString: fmt.Sprintf("%s '%s'", gui.Tr.LcFilterBy, fileName), onPress: func() error { gui.State.Modes.Filtering.Path = fileName return gui.Errors.ErrRestart @@ -39,9 +39,9 @@ func (gui *Gui) handleCreateFilteringMenuPanel(g *gocui.Gui, v *gocui.View) erro } menuItems = append(menuItems, &menuItem{ - displayString: gui.Tr.SLocalize("filterPathOption"), + displayString: gui.Tr.LcFilterPathOption, onPress: func() error { - return gui.prompt(gui.Tr.SLocalize("enterFileName"), "", func(response string) error { + return gui.prompt(gui.Tr.LcEnterFileName, "", func(response string) error { gui.State.Modes.Filtering.Path = strings.TrimSpace(response) return gui.Errors.ErrRestart }) @@ -50,7 +50,7 @@ func (gui *Gui) handleCreateFilteringMenuPanel(g *gocui.Gui, v *gocui.View) erro if gui.State.Modes.Filtering.Active() { menuItems = append(menuItems, &menuItem{ - displayString: gui.Tr.SLocalize("exitFilterMode"), + displayString: gui.Tr.LcExitFilterMode, onPress: func() error { gui.State.Modes.Filtering.Path = "" return gui.Errors.ErrRestart @@ -58,5 +58,5 @@ func (gui *Gui) handleCreateFilteringMenuPanel(g *gocui.Gui, v *gocui.View) erro }) } - return gui.createMenu(gui.Tr.SLocalize("FilteringMenuTitle"), menuItems, createMenuOptions{showCancel: true}) + return gui.createMenu(gui.Tr.FilteringMenuTitle, menuItems, createMenuOptions{showCancel: true}) } diff --git a/pkg/gui/git_flow.go b/pkg/gui/git_flow.go index dc6827499..1b207b04e 100644 --- a/pkg/gui/git_flow.go +++ b/pkg/gui/git_flow.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/jesseduffield/gocui" + "github.com/jesseduffield/lazygit/pkg/utils" ) func (gui *Gui) gitFlowFinishBranch(gitFlowConfig string, branchName string) error { @@ -28,7 +29,7 @@ func (gui *Gui) gitFlowFinishBranch(gitFlowConfig string, branchName string) err } if branchType == "" { - return gui.createErrorPanel(gui.Tr.SLocalize("NotAGitFlowBranch")) + return gui.createErrorPanel(gui.Tr.NotAGitFlowBranch) } subProcess := gui.OSCommand.PrepareSubProcess("git", "flow", branchType, "finish", suffix) @@ -50,7 +51,7 @@ func (gui *Gui) handleCreateGitFlowMenu(g *gocui.Gui, v *gocui.View) error { startHandler := func(branchType string) func() error { return func() error { - title := gui.Tr.TemplateLocalize("NewBranchNamePrompt", map[string]interface{}{"branchType": branchType}) + title := utils.ResolvePlaceholderString(gui.Tr.NewGitFlowBranchPrompt, map[string]string{"branchType": branchType}) return gui.prompt(title, "", func(name string) error { subProcess := gui.OSCommand.PrepareSubProcess("git", "flow", branchType, "start", name) gui.SubProcess = subProcess diff --git a/pkg/gui/global_handlers.go b/pkg/gui/global_handlers.go index 99fea388c..e7c0eb888 100644 --- a/pkg/gui/global_handlers.go +++ b/pkg/gui/global_handlers.go @@ -149,7 +149,7 @@ func (gui *Gui) handleInfoClick(g *gocui.Gui, v *gocui.View) error { for _, mode := range gui.modeStatuses() { if mode.isActive() { - if width-cx > len(gui.Tr.SLocalize("(reset)")) { + if width-cx > len(gui.Tr.ResetInParentheses) { return nil } return mode.reset() @@ -157,7 +157,7 @@ func (gui *Gui) handleInfoClick(g *gocui.Gui, v *gocui.View) error { } // if we're not in an active mode we show the donate button - if cx <= len(gui.Tr.SLocalize("Donate"))+len(INFO_SECTION_PADDING) { + if cx <= len(gui.Tr.Donate)+len(INFO_SECTION_PADDING) { return gui.OSCommand.OpenLink("https://github.com/sponsors/jesseduffield") } return nil @@ -175,7 +175,7 @@ func (gui *Gui) fetch(canPromptForCredentials bool) (err error) { err = gui.GitCommand.Fetch(fetchOpts) if canPromptForCredentials && err != nil && strings.Contains(err.Error(), "exit status 128") { - gui.createErrorPanel(gui.Tr.SLocalize("PassUnameWrong")) + gui.createErrorPanel(gui.Tr.PassUnameWrong) } gui.refreshSidePanels(refreshOptions{scope: []int{BRANCHES, COMMITS, REMOTES, TAGS}, mode: ASYNC}) diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index acf00156d..e4a554181 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -67,8 +67,8 @@ type SentinelErrors struct { // localising things in the code. func (gui *Gui) GenerateSentinelErrors() { gui.Errors = SentinelErrors{ - ErrSubProcess: errors.New(gui.Tr.SLocalize("RunningSubprocess")), - ErrNoFiles: errors.New(gui.Tr.SLocalize("NoChangedFiles")), + ErrSubProcess: errors.New(gui.Tr.RunningSubprocess), + ErrNoFiles: errors.New(gui.Tr.NoChangedFiles), ErrSwitchRepo: errors.New("switching repo"), ErrRestart: errors.New("restarting"), } @@ -83,9 +83,6 @@ func (gui *Gui) sentinelErrorsArr() []error { } } -// Teml is short for template used to make the required map[string]interface{} shorter when using gui.Tr.SLocalize and gui.Tr.TemplateLocalize -type Teml i18n.Teml - // Gui wraps the gocui Gui object which handles rendering and events type Gui struct { g *gocui.Gui @@ -95,7 +92,7 @@ type Gui struct { SubProcess *exec.Cmd State *guiState Config config.AppConfigurer - Tr *i18n.Localizer + Tr *i18n.TranslationSet Errors SentinelErrors Updater *updates.Updater statusManager *statusManager @@ -391,7 +388,7 @@ func (gui *Gui) resetState() { // for now the split view will always be on // NewGui builds a new gui handler -func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *oscommands.OSCommand, tr *i18n.Localizer, config config.AppConfigurer, updater *updates.Updater, filterPath string, showRecentRepos bool) (*Gui, error) { +func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *oscommands.OSCommand, tr *i18n.TranslationSet, config config.AppConfigurer, updater *updates.Updater, filterPath string, showRecentRepos bool) (*Gui, error) { gui := &Gui{ Log: log, GitCommand: gitCommand, @@ -533,7 +530,7 @@ func (gui *Gui) runCommand() error { gui.SubProcess.Stdin = nil gui.SubProcess = nil - fmt.Fprintf(os.Stdout, "\n%s", utils.ColoredString(gui.Tr.SLocalize("pressEnterToReturn"), color.FgGreen)) + fmt.Fprintf(os.Stdout, "\n%s", utils.ColoredString(gui.Tr.PressEnterToReturn, color.FgGreen)) fmt.Scanln() // wait for enter press return nil @@ -580,7 +577,7 @@ func (gui *Gui) showIntroPopupMessage(done chan struct{}) error { return gui.ask(askOpts{ title: "", - prompt: gui.Tr.SLocalize("IntroPopupMessage"), + prompt: gui.Tr.IntroPopupMessage, handleConfirm: onConfirm, handleClose: onConfirm, }) @@ -610,8 +607,8 @@ func (gui *Gui) startBackgroundFetch() { err := gui.fetch(false) if err != nil && strings.Contains(err.Error(), "exit status 128") && isNew { _ = gui.ask(askOpts{ - title: gui.Tr.SLocalize("NoAutomaticGitFetchTitle"), - prompt: gui.Tr.SLocalize("NoAutomaticGitFetchBody"), + title: gui.Tr.NoAutomaticGitFetchTitle, + prompt: gui.Tr.NoAutomaticGitFetchBody, }) } else { gui.goEvery(time.Second*60, gui.stopChan, func() error { diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index f6d0363b6..a92434561 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -230,14 +230,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Key: gui.getKey(config.Universal.ScrollUpMain), Handler: gui.scrollUpMain, Alternative: "fn+up", - Description: gui.Tr.SLocalize("scrollUpMainPanel"), + Description: gui.Tr.LcScrollUpMainPanel, }, { ViewName: "", Key: gui.getKey(config.Universal.ScrollDownMain), Handler: gui.scrollDownMain, Alternative: "fn+down", - Description: gui.Tr.SLocalize("scrollDownMainPanel"), + Description: gui.Tr.LcScrollDownMainPanel, }, { ViewName: "", @@ -267,37 +267,37 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "", Key: gui.getKey(config.Universal.CreateRebaseOptionsMenu), Handler: gui.wrappedHandler(gui.handleCreateRebaseOptionsMenu), - Description: gui.Tr.SLocalize("ViewMergeRebaseOptions"), + Description: gui.Tr.ViewMergeRebaseOptions, }, { ViewName: "", Key: gui.getKey(config.Universal.CreatePatchOptionsMenu), Handler: gui.handleCreatePatchOptionsMenu, - Description: gui.Tr.SLocalize("ViewPatchOptions"), + Description: gui.Tr.ViewPatchOptions, }, { ViewName: "", Key: gui.getKey(config.Universal.PushFiles), Handler: gui.pushFiles, - Description: gui.Tr.SLocalize("push"), + Description: gui.Tr.LcPush, }, { ViewName: "", Key: gui.getKey(config.Universal.PullFiles), Handler: gui.handlePullFiles, - Description: gui.Tr.SLocalize("pull"), + Description: gui.Tr.LcPull, }, { ViewName: "", Key: gui.getKey(config.Universal.Refresh), Handler: gui.handleRefresh, - Description: gui.Tr.SLocalize("refresh"), + Description: gui.Tr.LcRefresh, }, { ViewName: "", Key: gui.getKey(config.Universal.OptionMenu), Handler: gui.handleCreateOptionsMenu, - Description: gui.Tr.SLocalize("openMenu"), + Description: gui.Tr.LcOpenMenu, }, { ViewName: "", @@ -315,489 +315,489 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "", Key: gui.getKey(config.Universal.Undo), Handler: gui.reflogUndo, - Description: gui.Tr.SLocalize("undoReflog"), + Description: gui.Tr.LcUndoReflog, }, { ViewName: "", Key: gui.getKey(config.Universal.Redo), Handler: gui.reflogRedo, - Description: gui.Tr.SLocalize("redoReflog"), + Description: gui.Tr.LcRedoReflog, }, { ViewName: "status", Key: gui.getKey(config.Universal.Edit), Handler: gui.handleEditConfig, - Description: gui.Tr.SLocalize("EditConfig"), + Description: gui.Tr.EditConfig, }, { ViewName: "", Key: gui.getKey(config.Universal.NextScreenMode), Handler: gui.nextScreenMode, - Description: gui.Tr.SLocalize("nextScreenMode"), + Description: gui.Tr.LcNextScreenMode, }, { ViewName: "", Key: gui.getKey(config.Universal.PrevScreenMode), Handler: gui.prevScreenMode, - Description: gui.Tr.SLocalize("prevScreenMode"), + Description: gui.Tr.LcPrevScreenMode, }, { ViewName: "status", Key: gui.getKey(config.Universal.OpenFile), Handler: gui.handleOpenConfig, - Description: gui.Tr.SLocalize("OpenConfig"), + Description: gui.Tr.OpenConfig, }, { ViewName: "status", Key: gui.getKey(config.Status.CheckForUpdate), Handler: gui.handleCheckForUpdate, - Description: gui.Tr.SLocalize("checkForUpdate"), + Description: gui.Tr.LcCheckForUpdate, }, { ViewName: "status", Key: gui.getKey(config.Status.RecentRepos), Handler: gui.wrappedHandler(gui.handleCreateRecentReposMenu), - Description: gui.Tr.SLocalize("SwitchRepo"), + Description: gui.Tr.SwitchRepo, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.CommitChanges), Handler: gui.wrappedHandler(gui.handleCommitPress), - Description: gui.Tr.SLocalize("CommitChanges"), + Description: gui.Tr.CommitChanges, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.CommitChangesWithoutHook), Handler: gui.handleWIPCommitPress, - Description: gui.Tr.SLocalize("commitChangesWithoutHook"), + Description: gui.Tr.LcCommitChangesWithoutHook, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.AmendLastCommit), Handler: gui.wrappedHandler(gui.handleAmendCommitPress), - Description: gui.Tr.SLocalize("AmendLastCommit"), + Description: gui.Tr.AmendLastCommit, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.CommitChangesWithEditor), Handler: gui.wrappedHandler(gui.handleCommitEditorPress), - Description: gui.Tr.SLocalize("CommitChangesWithEditor"), + Description: gui.Tr.CommitChangesWithEditor, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), Handler: gui.wrappedHandler(gui.handleFilePress), - Description: gui.Tr.SLocalize("toggleStaged"), + Description: gui.Tr.LcToggleStaged, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Remove), Handler: gui.handleCreateDiscardMenu, - Description: gui.Tr.SLocalize("viewDiscardOptions"), + Description: gui.Tr.LcViewDiscardOptions, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Edit), Handler: gui.handleFileEdit, - Description: gui.Tr.SLocalize("editFile"), + Description: gui.Tr.LcEditFile, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.OpenFile), Handler: gui.handleFileOpen, - Description: gui.Tr.SLocalize("openFile"), + Description: gui.Tr.LcOpenFile, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.IgnoreFile), Handler: gui.handleIgnoreFile, - Description: gui.Tr.SLocalize("ignoreFile"), + Description: gui.Tr.LcIgnoreFile, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.RefreshFiles), Handler: gui.handleRefreshFiles, - Description: gui.Tr.SLocalize("refreshFiles"), + Description: gui.Tr.LcRefreshFiles, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.StashAllChanges), Handler: gui.handleStashChanges, - Description: gui.Tr.SLocalize("stashAllChanges"), + Description: gui.Tr.LcStashAllChanges, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.ViewStashOptions), Handler: gui.handleCreateStashMenu, - Description: gui.Tr.SLocalize("viewStashOptions"), + Description: gui.Tr.LcViewStashOptions, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.ToggleStagedAll), Handler: gui.handleStageAll, - Description: gui.Tr.SLocalize("toggleStagedAll"), + Description: gui.Tr.LcToggleStagedAll, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.ViewResetOptions), Handler: gui.handleCreateResetMenu, - Description: gui.Tr.SLocalize("viewResetOptions"), + Description: gui.Tr.LcViewResetOptions, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), Handler: gui.handleEnterFile, - Description: gui.Tr.SLocalize("StageLines"), + Description: gui.Tr.StageLines, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Files.Fetch), Handler: gui.handleGitFetch, - Description: gui.Tr.SLocalize("fetch"), + Description: gui.Tr.LcFetch, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.CopyToClipboard), Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), - Description: gui.Tr.SLocalize("copyFileNameToClipboard"), + Description: gui.Tr.LcCopyFileNameToClipboard, }, { ViewName: "", Key: gui.getKey(config.Universal.ExecuteCustomCommand), Handler: gui.handleCustomCommand, - Description: gui.Tr.SLocalize("executeCustomCommand"), + Description: gui.Tr.LcExecuteCustomCommand, }, { ViewName: "files", Contexts: []string{FILES_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ViewResetOptions), Handler: gui.handleCreateResetToUpstreamMenu, - Description: gui.Tr.SLocalize("viewResetToUpstreamOptions"), + Description: gui.Tr.LcViewResetToUpstreamOptions, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), Handler: gui.handleBranchPress, - Description: gui.Tr.SLocalize("checkout"), + Description: gui.Tr.LcCheckout, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Branches.CreatePullRequest), Handler: gui.handleCreatePullRequestPress, - Description: gui.Tr.SLocalize("createPullRequest"), + Description: gui.Tr.LcCreatePullRequest, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Branches.CheckoutBranchByName), Handler: gui.handleCheckoutByName, - Description: gui.Tr.SLocalize("checkoutByName"), + Description: gui.Tr.LcCheckoutByName, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Branches.ForceCheckoutBranch), Handler: gui.handleForceCheckout, - Description: gui.Tr.SLocalize("forceCheckout"), + Description: gui.Tr.LcForceCheckout, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.New), Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem), - Description: gui.Tr.SLocalize("newBranch"), + Description: gui.Tr.LcNewBranch, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Remove), Handler: gui.handleDeleteBranch, - Description: gui.Tr.SLocalize("deleteBranch"), + Description: gui.Tr.LcDeleteBranch, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Branches.RebaseBranch), Handler: gui.handleRebaseOntoLocalBranch, - Description: gui.Tr.SLocalize("rebaseBranch"), + Description: gui.Tr.LcRebaseBranch, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Branches.MergeIntoCurrentBranch), Handler: gui.handleMerge, - Description: gui.Tr.SLocalize("mergeIntoCurrentBranch"), + Description: gui.Tr.LcMergeIntoCurrentBranch, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Branches.ViewGitFlowOptions), Handler: gui.handleCreateGitFlowMenu, - Description: gui.Tr.SLocalize("gitFlowOptions"), + Description: gui.Tr.LcGitFlowOptions, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Branches.FastForward), Handler: gui.handleFastForward, - Description: gui.Tr.SLocalize("FastForward"), + Description: gui.Tr.FastForward, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ViewResetOptions), Handler: gui.handleCreateResetToBranchMenu, - Description: gui.Tr.SLocalize("viewResetOptions"), + Description: gui.Tr.LcViewResetOptions, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Branches.RenameBranch), Handler: gui.handleRenameBranch, - Description: gui.Tr.SLocalize("renameBranch"), + Description: gui.Tr.LcRenameBranch, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.CopyToClipboard), Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), - Description: gui.Tr.SLocalize("copyBranchNameToClipboard"), + Description: gui.Tr.LcCopyBranchNameToClipboard, }, { ViewName: "branches", Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), Handler: gui.wrappedHandler(gui.handleSwitchToSubCommits), - Description: gui.Tr.SLocalize("viewCommits"), + Description: gui.Tr.LcViewCommits, }, { ViewName: "branches", Contexts: []string{TAGS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), Handler: gui.handleCheckoutTag, - Description: gui.Tr.SLocalize("checkout"), + Description: gui.Tr.LcCheckout, }, { ViewName: "branches", Contexts: []string{TAGS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Remove), Handler: gui.handleDeleteTag, - Description: gui.Tr.SLocalize("deleteTag"), + Description: gui.Tr.LcDeleteTag, }, { ViewName: "branches", Contexts: []string{TAGS_CONTEXT_KEY}, Key: gui.getKey(config.Branches.PushTag), Handler: gui.handlePushTag, - Description: gui.Tr.SLocalize("pushTag"), + Description: gui.Tr.LcPushTag, }, { ViewName: "branches", Contexts: []string{TAGS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.New), Handler: gui.handleCreateTag, - Description: gui.Tr.SLocalize("createTag"), + Description: gui.Tr.LcCreateTag, }, { ViewName: "branches", Contexts: []string{TAGS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ViewResetOptions), Handler: gui.handleCreateResetToTagMenu, - Description: gui.Tr.SLocalize("viewResetOptions"), + Description: gui.Tr.LcViewResetOptions, }, { ViewName: "branches", Contexts: []string{TAGS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), Handler: gui.wrappedHandler(gui.handleSwitchToSubCommits), - Description: gui.Tr.SLocalize("viewCommits"), + Description: gui.Tr.LcViewCommits, }, { ViewName: "branches", Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Return), Handler: gui.handleRemoteBranchesEscape, - Description: gui.Tr.SLocalize("ReturnToRemotesList"), + Description: gui.Tr.ReturnToRemotesList, }, { ViewName: "branches", Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ViewResetOptions), Handler: gui.handleCreateResetToRemoteBranchMenu, - Description: gui.Tr.SLocalize("viewResetOptions"), + Description: gui.Tr.LcViewResetOptions, }, { ViewName: "branches", Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), Handler: gui.wrappedHandler(gui.handleSwitchToSubCommits), - Description: gui.Tr.SLocalize("viewCommits"), + Description: gui.Tr.LcViewCommits, }, { ViewName: "branches", Contexts: []string{REMOTES_CONTEXT_KEY}, Key: gui.getKey(config.Branches.FetchRemote), Handler: gui.handleFetchRemote, - Description: gui.Tr.SLocalize("fetchRemote"), + Description: gui.Tr.LcFetchRemote, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.SquashDown), Handler: gui.handleCommitSquashDown, - Description: gui.Tr.SLocalize("squashDown"), + Description: gui.Tr.LcSquashDown, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.RenameCommit), Handler: gui.handleRenameCommit, - Description: gui.Tr.SLocalize("renameCommit"), + Description: gui.Tr.LcRenameCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.RenameCommitWithEditor), Handler: gui.handleRenameCommitEditor, - Description: gui.Tr.SLocalize("renameCommitEditor"), + Description: gui.Tr.LcRenameCommitEditor, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ViewResetOptions), Handler: gui.handleCreateCommitResetMenu, - Description: gui.Tr.SLocalize("resetToThisCommit"), + Description: gui.Tr.LcResetToThisCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.MarkCommitAsFixup), Handler: gui.handleCommitFixup, - Description: gui.Tr.SLocalize("fixupCommit"), + Description: gui.Tr.LcFixupCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CreateFixupCommit), Handler: gui.handleCreateFixupCommit, - Description: gui.Tr.SLocalize("createFixupCommit"), + Description: gui.Tr.LcCreateFixupCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.SquashAboveCommits), Handler: gui.handleSquashAllAboveFixupCommits, - Description: gui.Tr.SLocalize("squashAboveCommits"), + Description: gui.Tr.LcSquashAboveCommits, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Remove), Handler: gui.handleCommitDelete, - Description: gui.Tr.SLocalize("deleteCommit"), + Description: gui.Tr.LcDeleteCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.MoveDownCommit), Handler: gui.handleCommitMoveDown, - Description: gui.Tr.SLocalize("moveDownCommit"), + Description: gui.Tr.LcMoveDownCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.MoveUpCommit), Handler: gui.handleCommitMoveUp, - Description: gui.Tr.SLocalize("moveUpCommit"), + Description: gui.Tr.LcMoveUpCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Edit), Handler: gui.handleCommitEdit, - Description: gui.Tr.SLocalize("editCommit"), + Description: gui.Tr.LcEditCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.AmendToCommit), Handler: gui.handleCommitAmendTo, - Description: gui.Tr.SLocalize("amendToCommit"), + Description: gui.Tr.LcAmendToCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.PickCommit), Handler: gui.handleCommitPick, - Description: gui.Tr.SLocalize("pickCommit"), + Description: gui.Tr.LcPickCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.RevertCommit), Handler: gui.handleCommitRevert, - Description: gui.Tr.SLocalize("revertCommit"), + Description: gui.Tr.LcRevertCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CherryPickCopy), Handler: gui.wrappedHandler(gui.handleCopyCommit), - Description: gui.Tr.SLocalize("cherryPickCopy"), + Description: gui.Tr.LcCherryPickCopy, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.CopyToClipboard), Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), - Description: gui.Tr.SLocalize("copyCommitShaToClipboard"), + Description: gui.Tr.LcCopyCommitShaToClipboard, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CherryPickCopyRange), Handler: gui.wrappedHandler(gui.handleCopyCommitRange), - Description: gui.Tr.SLocalize("cherryPickCopyRange"), + Description: gui.Tr.LcCherryPickCopyRange, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.PasteCommits), Handler: gui.wrappedHandler(gui.HandlePasteCommits), - Description: gui.Tr.SLocalize("pasteCommits"), + Description: gui.Tr.LcPasteCommits, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), Handler: gui.wrappedHandler(gui.handleViewCommitFiles), - Description: gui.Tr.SLocalize("viewCommitFiles"), + Description: gui.Tr.LcViewCommitFiles, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CheckoutCommit), Handler: gui.handleCheckoutCommit, - Description: gui.Tr.SLocalize("checkoutCommit"), + Description: gui.Tr.LcCheckoutCommit, }, { ViewName: "commits", @@ -805,162 +805,162 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Key: gui.getKey(config.Universal.New), Modifier: gocui.ModNone, Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem), - Description: gui.Tr.SLocalize("createNewBranchFromCommit"), + Description: gui.Tr.LcCreateNewBranchFromCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.TagCommit), Handler: gui.handleTagCommit, - Description: gui.Tr.SLocalize("tagCommit"), + Description: gui.Tr.LcTagCommit, }, { ViewName: "commits", Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ResetCherryPick), Handler: gui.wrappedHandler(gui.exitCherryPickingMode), - Description: gui.Tr.SLocalize("resetCherryPick"), + Description: gui.Tr.LcResetCherryPick, }, { ViewName: "commits", Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), Handler: gui.wrappedHandler(gui.handleViewReflogCommitFiles), - Description: gui.Tr.SLocalize("viewCommitFiles"), + Description: gui.Tr.LcViewCommitFiles, }, { ViewName: "commits", Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), Handler: gui.handleCheckoutReflogCommit, - Description: gui.Tr.SLocalize("checkoutCommit"), + Description: gui.Tr.LcCheckoutCommit, }, { ViewName: "commits", Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ViewResetOptions), Handler: gui.handleCreateReflogResetMenu, - Description: gui.Tr.SLocalize("viewResetOptions"), + Description: gui.Tr.LcViewResetOptions, }, { ViewName: "commits", Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CherryPickCopy), Handler: gui.wrappedHandler(gui.handleCopyCommit), - Description: gui.Tr.SLocalize("cherryPickCopy"), + Description: gui.Tr.LcCherryPickCopy, }, { ViewName: "commits", Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CherryPickCopyRange), Handler: gui.wrappedHandler(gui.handleCopyCommitRange), - Description: gui.Tr.SLocalize("cherryPickCopyRange"), + Description: gui.Tr.LcCherryPickCopyRange, }, { ViewName: "commits", Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ResetCherryPick), Handler: gui.wrappedHandler(gui.exitCherryPickingMode), - Description: gui.Tr.SLocalize("resetCherryPick"), + Description: gui.Tr.LcResetCherryPick, }, { ViewName: "commits", Contexts: []string{REFLOG_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.CopyToClipboard), Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), - Description: gui.Tr.SLocalize("copyCommitShaToClipboard"), + Description: gui.Tr.LcCopyCommitShaToClipboard, }, { ViewName: "commitFiles", Key: gui.getKey(config.Universal.CopyToClipboard), Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), - Description: gui.Tr.SLocalize("copyCommitFileNameToClipboard"), + Description: gui.Tr.LcCopyCommitFileNameToClipboard, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), Handler: gui.wrappedHandler(gui.handleViewSubCommitFiles), - Description: gui.Tr.SLocalize("viewCommitFiles"), + Description: gui.Tr.LcViewCommitFiles, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), Handler: gui.handleCheckoutSubCommit, - Description: gui.Tr.SLocalize("checkoutCommit"), + Description: gui.Tr.LcCheckoutCommit, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ViewResetOptions), Handler: gui.wrappedHandler(gui.handleCreateSubCommitResetMenu), - Description: gui.Tr.SLocalize("viewResetOptions"), + Description: gui.Tr.LcViewResetOptions, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.New), Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem), - Description: gui.Tr.SLocalize("newBranch"), + Description: gui.Tr.LcNewBranch, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CherryPickCopy), Handler: gui.wrappedHandler(gui.handleCopyCommit), - Description: gui.Tr.SLocalize("cherryPickCopy"), + Description: gui.Tr.LcCherryPickCopy, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.CherryPickCopyRange), Handler: gui.wrappedHandler(gui.handleCopyCommitRange), - Description: gui.Tr.SLocalize("cherryPickCopyRange"), + Description: gui.Tr.LcCherryPickCopyRange, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Commits.ResetCherryPick), Handler: gui.wrappedHandler(gui.exitCherryPickingMode), - Description: gui.Tr.SLocalize("resetCherryPick"), + Description: gui.Tr.LcResetCherryPick, }, { ViewName: "branches", Contexts: []string{SUB_COMMITS_CONTEXT_KEY}, Key: gui.getKey(config.Universal.CopyToClipboard), Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), - Description: gui.Tr.SLocalize("copyCommitShaToClipboard"), + Description: gui.Tr.LcCopyCommitShaToClipboard, }, { ViewName: "stash", Key: gui.getKey(config.Universal.GoInto), Handler: gui.wrappedHandler(gui.handleViewStashFiles), - Description: gui.Tr.SLocalize("viewStashFiles"), + Description: gui.Tr.LcViewStashFiles, }, { ViewName: "stash", Key: gui.getKey(config.Universal.Select), Handler: gui.handleStashApply, - Description: gui.Tr.SLocalize("apply"), + Description: gui.Tr.LcApply, }, { ViewName: "stash", Key: gui.getKey(config.Stash.PopStash), Handler: gui.handleStashPop, - Description: gui.Tr.SLocalize("pop"), + Description: gui.Tr.LcPop, }, { ViewName: "stash", Key: gui.getKey(config.Universal.Remove), Handler: gui.handleStashDrop, - Description: gui.Tr.SLocalize("drop"), + Description: gui.Tr.LcDrop, }, { ViewName: "stash", Key: gui.getKey(config.Universal.New), Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem), - Description: gui.Tr.SLocalize("newBranch"), + Description: gui.Tr.LcNewBranch, }, { ViewName: "commitMessage", @@ -990,7 +990,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "menu", Key: gui.getKey(config.Universal.Return), Handler: gui.handleMenuClose, - Description: gui.Tr.SLocalize("closeMenu"), + Description: gui.Tr.LcCloseMenu, }, { ViewName: "information", @@ -1002,55 +1002,55 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "commitFiles", Key: gui.getKey(config.CommitFiles.CheckoutCommitFile), Handler: gui.handleCheckoutCommitFile, - Description: gui.Tr.SLocalize("checkoutCommitFile"), + Description: gui.Tr.LcCheckoutCommitFile, }, { ViewName: "commitFiles", Key: gui.getKey(config.Universal.Remove), Handler: gui.handleDiscardOldFileChange, - Description: gui.Tr.SLocalize("discardOldFileChange"), + Description: gui.Tr.LcDiscardOldFileChange, }, { ViewName: "commitFiles", Key: gui.getKey(config.Universal.OpenFile), Handler: gui.handleOpenOldCommitFile, - Description: gui.Tr.SLocalize("openFile"), + Description: gui.Tr.LcOpenFile, }, { ViewName: "commitFiles", Key: gui.getKey(config.Universal.Edit), Handler: gui.handleEditCommitFile, - Description: gui.Tr.SLocalize("editFile"), + Description: gui.Tr.LcEditFile, }, { ViewName: "commitFiles", Key: gui.getKey(config.Universal.Select), Handler: gui.handleToggleFileForPatch, - Description: gui.Tr.SLocalize("toggleAddToPatch"), + Description: gui.Tr.LcToggleAddToPatch, }, { ViewName: "commitFiles", Key: gui.getKey(config.Universal.GoInto), Handler: gui.handleEnterCommitFile, - Description: gui.Tr.SLocalize("enterFile"), + Description: gui.Tr.LcEnterFile, }, { ViewName: "", Key: gui.getKey(config.Universal.FilteringMenu), Handler: gui.handleCreateFilteringMenuPanel, - Description: gui.Tr.SLocalize("openScopingMenu"), + Description: gui.Tr.LcOpenScopingMenu, }, { ViewName: "", Key: gui.getKey(config.Universal.DiffingMenu), Handler: gui.handleCreateDiffingMenuPanel, - Description: gui.Tr.SLocalize("openDiffingMenu"), + Description: gui.Tr.LcOpenDiffingMenu, }, { ViewName: "", Key: gui.getKey(config.Universal.DiffingMenuAlt), Handler: gui.handleCreateDiffingMenuPanel, - Description: gui.Tr.SLocalize("openDiffingMenu"), + Description: gui.Tr.LcOpenDiffingMenu, }, { ViewName: "secondary", @@ -1076,7 +1076,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_NORMAL_CONTEXT_KEY}, Key: gocui.MouseWheelDown, Handler: gui.scrollDownMain, - Description: gui.Tr.SLocalize("ScrollDown"), + Description: gui.Tr.ScrollDown, Alternative: "fn+up", }, { @@ -1084,7 +1084,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_NORMAL_CONTEXT_KEY}, Key: gocui.MouseWheelUp, Handler: gui.scrollUpMain, - Description: gui.Tr.SLocalize("ScrollUp"), + Description: gui.Tr.ScrollUp, Alternative: "fn+down", }, { @@ -1106,56 +1106,56 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Return), Handler: gui.wrappedHandler(gui.handleStagingEscape), - Description: gui.Tr.SLocalize("ReturnToFilesPanel"), + Description: gui.Tr.ReturnToFilesPanel, }, { ViewName: "main", Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), Handler: gui.handleToggleStagedSelection, - Description: gui.Tr.SLocalize("StageSelection"), + Description: gui.Tr.StageSelection, }, { ViewName: "main", Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Remove), Handler: gui.handleResetSelection, - Description: gui.Tr.SLocalize("ResetSelection"), + Description: gui.Tr.ResetSelection, }, { ViewName: "main", Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.TogglePanel), Handler: gui.handleTogglePanel, - Description: gui.Tr.SLocalize("TogglePanel"), + Description: gui.Tr.TogglePanel, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Return), Handler: gui.wrappedHandler(gui.handleEscapePatchBuildingPanel), - Description: gui.Tr.SLocalize("ExitLineByLineMode"), + Description: gui.Tr.ExitLineByLineMode, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.OpenFile), Handler: gui.wrappedHandler(gui.handleOpenFileAtLine), - Description: gui.Tr.SLocalize("openFile"), + Description: gui.Tr.LcOpenFile, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevItem), Handler: gui.handleSelectPrevLine, - Description: gui.Tr.SLocalize("PrevLine"), + Description: gui.Tr.PrevLine, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextItem), Handler: gui.handleSelectNextLine, - Description: gui.Tr.SLocalize("NextLine"), + Description: gui.Tr.NextLine, }, { ViewName: "main", @@ -1190,14 +1190,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevBlock), Handler: gui.handleSelectPrevHunk, - Description: gui.Tr.SLocalize("PrevHunk"), + Description: gui.Tr.PrevHunk, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextBlock), Handler: gui.handleSelectNextHunk, - Description: gui.Tr.SLocalize("NextHunk"), + Description: gui.Tr.NextHunk, }, { ViewName: "main", @@ -1218,28 +1218,28 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Edit), Handler: gui.handleFileEdit, - Description: gui.Tr.SLocalize("editFile"), + Description: gui.Tr.LcEditFile, }, { ViewName: "main", Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.OpenFile), Handler: gui.handleFileOpen, - Description: gui.Tr.SLocalize("openFile"), + Description: gui.Tr.LcOpenFile, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), Handler: gui.handleToggleSelectionForPatch, - Description: gui.Tr.SLocalize("ToggleSelectionForPatch"), + Description: gui.Tr.ToggleSelectionForPatch, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Main.ToggleDragSelect), Handler: gui.handleToggleSelectRange, - Description: gui.Tr.SLocalize("ToggleDragSelect"), + Description: gui.Tr.ToggleDragSelect, }, // Alias 'V' -> 'v' { @@ -1247,14 +1247,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Main.ToggleDragSelectAlt), Handler: gui.handleToggleSelectRange, - Description: gui.Tr.SLocalize("ToggleDragSelect"), + Description: gui.Tr.ToggleDragSelect, }, { ViewName: "main", Contexts: []string{MAIN_PATCH_BUILDING_CONTEXT_KEY, MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Main.ToggleSelectHunk), Handler: gui.handleToggleSelectHunk, - Description: gui.Tr.SLocalize("ToggleSelectHunk"), + Description: gui.Tr.ToggleSelectHunk, }, { ViewName: "main", @@ -1289,70 +1289,70 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Files.CommitChanges), Handler: gui.wrappedHandler(gui.handleCommitPress), - Description: gui.Tr.SLocalize("CommitChanges"), + Description: gui.Tr.CommitChanges, }, { ViewName: "main", Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Files.CommitChangesWithoutHook), Handler: gui.handleWIPCommitPress, - Description: gui.Tr.SLocalize("commitChangesWithoutHook"), + Description: gui.Tr.LcCommitChangesWithoutHook, }, { ViewName: "main", Contexts: []string{MAIN_STAGING_CONTEXT_KEY}, Key: gui.getKey(config.Files.CommitChangesWithEditor), Handler: gui.wrappedHandler(gui.handleCommitEditorPress), - Description: gui.Tr.SLocalize("CommitChangesWithEditor"), + Description: gui.Tr.CommitChangesWithEditor, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Return), Handler: gui.wrappedHandler(gui.handleEscapeMerge), - Description: gui.Tr.SLocalize("ReturnToFilesPanel"), + Description: gui.Tr.ReturnToFilesPanel, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Select), Handler: gui.handlePickHunk, - Description: gui.Tr.SLocalize("PickHunk"), + Description: gui.Tr.PickHunk, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Main.PickBothHunks), Handler: gui.handlePickBothHunks, - Description: gui.Tr.SLocalize("PickBothHunks"), + Description: gui.Tr.PickBothHunks, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevBlock), Handler: gui.handleSelectPrevConflict, - Description: gui.Tr.SLocalize("PrevConflict"), + Description: gui.Tr.PrevConflict, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextBlock), Handler: gui.handleSelectNextConflict, - Description: gui.Tr.SLocalize("NextConflict"), + Description: gui.Tr.NextConflict, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.PrevItem), Handler: gui.handleSelectTop, - Description: gui.Tr.SLocalize("SelectTop"), + Description: gui.Tr.SelectTop, }, { ViewName: "main", Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.NextItem), Handler: gui.handleSelectBottom, - Description: gui.Tr.SLocalize("SelectBottom"), + Description: gui.Tr.SelectBottom, }, { ViewName: "main", @@ -1401,7 +1401,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{MAIN_MERGING_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Undo), Handler: gui.handlePopFileSnapshot, - Description: gui.Tr.SLocalize("undo"), + Description: gui.Tr.LcUndo, }, { ViewName: "branches", @@ -1415,21 +1415,21 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{REMOTES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.New), Handler: gui.handleAddRemote, - Description: gui.Tr.SLocalize("addNewRemote"), + Description: gui.Tr.LcAddNewRemote, }, { ViewName: "branches", Contexts: []string{REMOTES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Remove), Handler: gui.handleRemoveRemote, - Description: gui.Tr.SLocalize("removeRemote"), + Description: gui.Tr.LcRemoveRemote, }, { ViewName: "branches", Contexts: []string{REMOTES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Edit), Handler: gui.handleEditRemote, - Description: gui.Tr.SLocalize("editRemote"), + Description: gui.Tr.LcEditRemote, }, { ViewName: "branches", @@ -1437,42 +1437,42 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Key: gui.getKey(config.Universal.Select), // gonna use the exact same handler as the 'n' keybinding because everybody wants this to happen when they checkout a remote branch Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem), - Description: gui.Tr.SLocalize("checkout"), + Description: gui.Tr.LcCheckout, }, { ViewName: "branches", Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.New), Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem), - Description: gui.Tr.SLocalize("newBranch"), + Description: gui.Tr.LcNewBranch, }, { ViewName: "branches", Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Branches.MergeIntoCurrentBranch), Handler: gui.handleMergeRemoteBranch, - Description: gui.Tr.SLocalize("mergeIntoCurrentBranch"), + Description: gui.Tr.LcMergeIntoCurrentBranch, }, { ViewName: "branches", Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Remove), Handler: gui.handleDeleteRemoteBranch, - Description: gui.Tr.SLocalize("deleteBranch"), + Description: gui.Tr.LcDeleteBranch, }, { ViewName: "branches", Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Branches.RebaseBranch), Handler: gui.handleRebaseOntoRemoteBranch, - Description: gui.Tr.SLocalize("rebaseBranch"), + Description: gui.Tr.LcRebaseBranch, }, { ViewName: "branches", Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY}, Key: gui.getKey(config.Branches.SetUpstream), Handler: gui.handleSetBranchUpstream, - Description: gui.Tr.SLocalize("setUpstream"), + Description: gui.Tr.LcSetUpstream, }, { ViewName: "status", @@ -1539,56 +1539,56 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.CopyToClipboard), Handler: gui.wrappedHandler(gui.handleCopySelectedSideContextItemToClipboard), - Description: gui.Tr.SLocalize("copySubmoduleNameToClipboard"), + Description: gui.Tr.LcCopySubmoduleNameToClipboard, }, { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.GoInto), Handler: gui.forSubmodule(gui.handleSubmoduleEnter), - Description: gui.Tr.SLocalize("enterSubmodule"), + Description: gui.Tr.LcEnterSubmodule, }, { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Remove), Handler: gui.forSubmodule(gui.handleResetRemoveSubmodule), - Description: gui.Tr.SLocalize("viewResetAndRemoveOptions"), + Description: gui.Tr.LcViewResetAndRemoveOptions, }, { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey(config.Submodules.Update), Handler: gui.forSubmodule(gui.handleUpdateSubmodule), - Description: gui.Tr.SLocalize("submoduleUpdate"), + Description: gui.Tr.LcSubmoduleUpdate, }, { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.New), Handler: gui.wrappedHandler(gui.handleAddSubmodule), - Description: gui.Tr.SLocalize("addSubmodule"), + Description: gui.Tr.LcAddSubmodule, }, { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey(config.Universal.Edit), Handler: gui.forSubmodule(gui.handleEditSubmoduleUrl), - Description: gui.Tr.SLocalize("editSubmoduleUrl"), + Description: gui.Tr.LcEditSubmoduleUrl, }, { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey(config.Submodules.Init), Handler: gui.forSubmodule(gui.handleSubmoduleInit), - Description: gui.Tr.SLocalize("initSubmodule"), + Description: gui.Tr.LcInitSubmodule, }, { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey(config.Submodules.BulkMenu), Handler: gui.wrappedHandler(gui.handleBulkSubmoduleActionsMenu), - Description: gui.Tr.SLocalize("viewBulkSubmoduleOptions"), + Description: gui.Tr.LcViewBulkSubmoduleOptions, }, } @@ -1612,14 +1612,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: viewName, Key: gui.getKey(config.Universal.NextTab), Handler: gui.handleNextTab, - Description: gui.Tr.SLocalize("nextTab"), + Description: gui.Tr.LcNextTab, Tag: "navigation", }, { ViewName: viewName, Key: gui.getKey(config.Universal.PrevTab), Handler: gui.handlePrevTab, - Description: gui.Tr.SLocalize("prevTab"), + Description: gui.Tr.LcPrevTab, Tag: "navigation", }, }...) diff --git a/pkg/gui/layout.go b/pkg/gui/layout.go index e3befd819..5b3d0da4d 100644 --- a/pkg/gui/layout.go +++ b/pkg/gui/layout.go @@ -17,7 +17,7 @@ func (gui *Gui) informationStr() string { } if gui.g.Mouse { - donate := color.New(color.FgMagenta, color.Underline).Sprint(gui.Tr.SLocalize("Donate")) + donate := color.New(color.FgMagenta, color.Underline).Sprint(gui.Tr.Donate) return donate + " " + gui.Config.GetVersion() } else { return gui.Config.GetVersion() @@ -37,7 +37,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { if err.Error() != "unknown view" { return err } - v.Title = gui.Tr.SLocalize("NotEnoughSpace") + v.Title = gui.Tr.NotEnoughSpace v.Wrap = true _, _ = g.SetViewOnTop("limit") } @@ -104,7 +104,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { if err.Error() != "unknown view" { return err } - v.Title = gui.Tr.SLocalize("DiffTitle") + v.Title = gui.Tr.DiffTitle v.Wrap = true v.FgColor = textColor v.IgnoreCarriageReturns = true @@ -115,7 +115,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { if err.Error() != "unknown view" { return err } - secondaryView.Title = gui.Tr.SLocalize("DiffTitle") + secondaryView.Title = gui.Tr.DiffTitle secondaryView.Wrap = true secondaryView.FgColor = textColor secondaryView.IgnoreCarriageReturns = true @@ -127,7 +127,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { if err.Error() != "unknown view" { return err } - v.Title = gui.Tr.SLocalize("StatusTitle") + v.Title = gui.Tr.StatusTitle v.FgColor = textColor } @@ -137,7 +137,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { return err } filesView.Highlight = true - filesView.Title = gui.Tr.SLocalize("FilesTitle") + filesView.Title = gui.Tr.FilesTitle filesView.ContainsList = true } @@ -146,7 +146,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { if err.Error() != "unknown view" { return err } - branchesView.Title = gui.Tr.SLocalize("BranchesTitle") + branchesView.Title = gui.Tr.BranchesTitle branchesView.FgColor = textColor branchesView.ContainsList = true } @@ -156,7 +156,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { if err.Error() != "unknown view" { return err } - commitFilesView.Title = gui.Tr.SLocalize("CommitFiles") + commitFilesView.Title = gui.Tr.CommitFiles commitFilesView.FgColor = textColor commitFilesView.ContainsList = true } @@ -166,7 +166,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { if err.Error() != "unknown view" { return err } - commitsView.Title = gui.Tr.SLocalize("CommitsTitle") + commitsView.Title = gui.Tr.CommitsTitle commitsView.FgColor = textColor commitsView.ContainsList = true } @@ -176,7 +176,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { if err.Error() != "unknown view" { return err } - stashView.Title = gui.Tr.SLocalize("StashTitle") + stashView.Title = gui.Tr.StashTitle stashView.FgColor = textColor stashView.ContainsList = true } @@ -188,7 +188,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { return err } _, _ = g.SetViewOnBottom("commitMessage") - commitMessageView.Title = gui.Tr.SLocalize("CommitMessage") + commitMessageView.Title = gui.Tr.CommitMessage commitMessageView.FgColor = textColor commitMessageView.Editable = true commitMessageView.Editor = gocui.EditorFunc(gui.commitMessageEditor) @@ -202,7 +202,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { return err } _, _ = g.SetViewOnBottom("credentials") - credentialsView.Title = gui.Tr.SLocalize("CredentialsUsername") + credentialsView.Title = gui.Tr.CredentialsUsername credentialsView.FgColor = textColor credentialsView.Editable = true } diff --git a/pkg/gui/list_context.go b/pkg/gui/list_context.go index 02d99c6dc..83a4072f1 100644 --- a/pkg/gui/list_context.go +++ b/pkg/gui/list_context.go @@ -517,9 +517,9 @@ func (gui *Gui) getListContextKeyBindings() []*Binding { {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gocui.MouseWheelUp, Modifier: gocui.ModNone, Handler: listContext.handlePrevLine}, {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey(keybindingConfig.Universal.NextItemAlt), Modifier: gocui.ModNone, Handler: listContext.handleNextLine}, {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey(keybindingConfig.Universal.NextItem), Modifier: gocui.ModNone, Handler: listContext.handleNextLine}, - {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey(keybindingConfig.Universal.PrevPage), Modifier: gocui.ModNone, Handler: listContext.handlePrevPage, Description: gui.Tr.SLocalize("prevPage")}, - {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey(keybindingConfig.Universal.NextPage), Modifier: gocui.ModNone, Handler: listContext.handleNextPage, Description: gui.Tr.SLocalize("nextPage")}, - {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey(keybindingConfig.Universal.GotoTop), Modifier: gocui.ModNone, Handler: listContext.handleGotoTop, Description: gui.Tr.SLocalize("gotoTop")}, + {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey(keybindingConfig.Universal.PrevPage), Modifier: gocui.ModNone, Handler: listContext.handlePrevPage, Description: gui.Tr.LcPrevPage}, + {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey(keybindingConfig.Universal.NextPage), Modifier: gocui.ModNone, Handler: listContext.handleNextPage, Description: gui.Tr.LcNextPage}, + {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gui.getKey(keybindingConfig.Universal.GotoTop), Modifier: gocui.ModNone, Handler: listContext.handleGotoTop, Description: gui.Tr.LcGotoTop}, {ViewName: listContext.ViewName, Tag: "navigation", Contexts: []string{listContext.ContextKey}, Key: gocui.MouseWheelDown, Modifier: gocui.ModNone, Handler: listContext.handleNextLine}, {ViewName: listContext.ViewName, Contexts: []string{listContext.ContextKey}, Key: gocui.MouseLeft, Modifier: gocui.ModNone, Handler: listContext.handleClick}, }...) @@ -538,7 +538,7 @@ func (gui *Gui) getListContextKeyBindings() []*Binding { Contexts: []string{listContext.ContextKey}, Key: gui.getKey(keybindingConfig.Universal.StartSearch), Handler: openSearchHandler, - Description: gui.Tr.SLocalize("startSearch"), + Description: gui.Tr.LcStartSearch, Tag: "navigation", }, { @@ -546,7 +546,7 @@ func (gui *Gui) getListContextKeyBindings() []*Binding { Contexts: []string{listContext.ContextKey}, Key: gui.getKey(keybindingConfig.Universal.GotoBottom), Handler: gotoBottomHandler, - Description: gui.Tr.SLocalize("gotoBottom"), + Description: gui.Tr.LcGotoBottom, Tag: "navigation", }, }...) diff --git a/pkg/gui/menu_panel.go b/pkg/gui/menu_panel.go index bc783f2de..791529ba3 100644 --- a/pkg/gui/menu_panel.go +++ b/pkg/gui/menu_panel.go @@ -36,9 +36,9 @@ func (gui *Gui) getMenuOptions() map[string]string { keybindingConfig := gui.Config.GetUserConfig().Keybinding return map[string]string{ - gui.getKeyDisplay(keybindingConfig.Universal.Return): gui.Tr.SLocalize("close"), - fmt.Sprintf("%s %s", gui.getKeyDisplay(keybindingConfig.Universal.PrevItem), gui.getKeyDisplay(keybindingConfig.Universal.NextItem)): gui.Tr.SLocalize("navigate"), - gui.getKeyDisplay(keybindingConfig.Universal.Select): gui.Tr.SLocalize("execute"), + gui.getKeyDisplay(keybindingConfig.Universal.Return): gui.Tr.LcClose, + fmt.Sprintf("%s %s", gui.getKeyDisplay(keybindingConfig.Universal.PrevItem), gui.getKeyDisplay(keybindingConfig.Universal.NextItem)): gui.Tr.LcNavigate, + gui.getKeyDisplay(keybindingConfig.Universal.Select): gui.Tr.LcExecute, } } @@ -55,7 +55,7 @@ func (gui *Gui) createMenu(title string, items []*menuItem, createMenuOptions cr if createMenuOptions.showCancel { // this is mutative but I'm okay with that for now items = append(items, &menuItem{ - displayStrings: []string{gui.Tr.SLocalize("cancel")}, + displayStrings: []string{gui.Tr.LcCancel}, onPress: func() error { return nil }, diff --git a/pkg/gui/merge_panel.go b/pkg/gui/merge_panel.go index 736d969d7..e9d3626ed 100644 --- a/pkg/gui/merge_panel.go +++ b/pkg/gui/merge_panel.go @@ -244,7 +244,7 @@ func (gui *Gui) refreshMergePanel() error { return gui.refreshMainViews(refreshMainOpts{ main: &viewUpdateOpts{ - title: gui.Tr.SLocalize("MergeConflictsTitle"), + title: gui.Tr.MergeConflictsTitle, task: gui.createRenderStringWithoutScrollTask(content), noWrap: true, }, @@ -254,11 +254,11 @@ func (gui *Gui) refreshMergePanel() error { func (gui *Gui) catSelectedFile(g *gocui.Gui) (string, error) { item := gui.getSelectedFile() if item == nil { - return "", errors.New(gui.Tr.SLocalize("NoFilesDisplay")) + return "", errors.New(gui.Tr.NoFilesDisplay) } if item.Type != "file" { - return "", errors.New(gui.Tr.SLocalize("NotAFile")) + return "", errors.New(gui.Tr.NotAFile) } cat, err := gui.GitCommand.CatFile(item.Name) @@ -294,11 +294,11 @@ func (gui *Gui) getMergingOptions() map[string]string { keybindingConfig := gui.Config.GetUserConfig().Keybinding return map[string]string{ - fmt.Sprintf("%s %s", gui.getKeyDisplay(keybindingConfig.Universal.PrevItem), gui.getKeyDisplay(keybindingConfig.Universal.NextItem)): gui.Tr.SLocalize("selectHunk"), - fmt.Sprintf("%s %s", gui.getKeyDisplay(keybindingConfig.Universal.PrevBlock), gui.getKeyDisplay(keybindingConfig.Universal.NextBlock)): gui.Tr.SLocalize("navigateConflicts"), - gui.getKeyDisplay(keybindingConfig.Universal.Select): gui.Tr.SLocalize("pickHunk"), - gui.getKeyDisplay(keybindingConfig.Main.PickBothHunks): gui.Tr.SLocalize("pickBothHunks"), - gui.getKeyDisplay(keybindingConfig.Universal.Undo): gui.Tr.SLocalize("undo"), + fmt.Sprintf("%s %s", gui.getKeyDisplay(keybindingConfig.Universal.PrevItem), gui.getKeyDisplay(keybindingConfig.Universal.NextItem)): gui.Tr.LcSelectHunk, + fmt.Sprintf("%s %s", gui.getKeyDisplay(keybindingConfig.Universal.PrevBlock), gui.getKeyDisplay(keybindingConfig.Universal.NextBlock)): gui.Tr.LcNavigateConflicts, + gui.getKeyDisplay(keybindingConfig.Universal.Select): gui.Tr.LcPickHunk, + gui.getKeyDisplay(keybindingConfig.Main.PickBothHunks): gui.Tr.LcPickBothHunks, + gui.getKeyDisplay(keybindingConfig.Universal.Undo): gui.Tr.LcUndo, } } @@ -342,7 +342,7 @@ func (gui *Gui) promptToContinue() error { return gui.ask(askOpts{ title: "continue", - prompt: gui.Tr.SLocalize("ConflictsResolved"), + prompt: gui.Tr.ConflictsResolved, handlersManageFocus: true, handleConfirm: func() error { if err := gui.switchContext(gui.Contexts.Files.Context); err != nil { diff --git a/pkg/gui/modes.go b/pkg/gui/modes.go index 79239e91c..03ac76dd3 100644 --- a/pkg/gui/modes.go +++ b/pkg/gui/modes.go @@ -19,7 +19,7 @@ func (gui *Gui) modeStatuses() []modeStatus { isActive: gui.State.Modes.Diffing.Active, description: func() string { return utils.ColoredString( - fmt.Sprintf("%s %s %s", gui.Tr.SLocalize("showingGitDiff"), "git diff "+gui.diffStr(), utils.ColoredString(gui.Tr.SLocalize("(reset)"), color.Underline)), + fmt.Sprintf("%s %s %s", gui.Tr.LcShowingGitDiff, "git diff "+gui.diffStr(), utils.ColoredString(gui.Tr.ResetInParentheses, color.Underline)), color.FgMagenta, ) }, @@ -29,7 +29,7 @@ func (gui *Gui) modeStatuses() []modeStatus { isActive: gui.State.Modes.Filtering.Active, description: func() string { return utils.ColoredString( - fmt.Sprintf("%s '%s' %s", gui.Tr.SLocalize("filteringBy"), gui.State.Modes.Filtering.Path, utils.ColoredString(gui.Tr.SLocalize("(reset)"), color.Underline)), + fmt.Sprintf("%s '%s' %s", gui.Tr.LcFilteringBy, gui.State.Modes.Filtering.Path, utils.ColoredString(gui.Tr.ResetInParentheses, color.Underline)), color.FgRed, color.Bold, ) @@ -40,7 +40,7 @@ func (gui *Gui) modeStatuses() []modeStatus { isActive: gui.GitCommand.PatchManager.Active, description: func() string { return utils.ColoredString( - fmt.Sprintf("%s %s", gui.Tr.SLocalize("buildingPatch"), utils.ColoredString(gui.Tr.SLocalize("(reset)"), color.Underline)), + fmt.Sprintf("%s %s", gui.Tr.LcBuildingPatch, utils.ColoredString(gui.Tr.ResetInParentheses, color.Underline)), color.FgYellow, color.Bold, ) @@ -51,7 +51,7 @@ func (gui *Gui) modeStatuses() []modeStatus { isActive: gui.State.Modes.CherryPicking.Active, description: func() string { return utils.ColoredString( - fmt.Sprintf("%d commits copied %s", len(gui.State.Modes.CherryPicking.CherryPickedCommits), utils.ColoredString(gui.Tr.SLocalize("(reset)"), color.Underline)), + fmt.Sprintf("%d commits copied %s", len(gui.State.Modes.CherryPicking.CherryPickedCommits), utils.ColoredString(gui.Tr.ResetInParentheses, color.Underline)), color.FgCyan, ) }, diff --git a/pkg/gui/options_menu_panel.go b/pkg/gui/options_menu_panel.go index 9027685a9..291019ce3 100644 --- a/pkg/gui/options_menu_panel.go +++ b/pkg/gui/options_menu_panel.go @@ -54,5 +54,5 @@ func (gui *Gui) handleCreateOptionsMenu(g *gocui.Gui, v *gocui.View) error { } } - return gui.createMenu(strings.Title(gui.Tr.SLocalize("menu")), menuItems, createMenuOptions{}) + return gui.createMenu(strings.Title(gui.Tr.LcMenu), menuItems, createMenuOptions{}) } diff --git a/pkg/gui/patch_options_panel.go b/pkg/gui/patch_options_panel.go index 419efca23..89bdc1e56 100644 --- a/pkg/gui/patch_options_panel.go +++ b/pkg/gui/patch_options_panel.go @@ -8,7 +8,7 @@ import ( func (gui *Gui) handleCreatePatchOptionsMenu(g *gocui.Gui, v *gocui.View) error { if !gui.GitCommand.PatchManager.Active() { - return gui.createErrorPanel(gui.Tr.SLocalize("NoPatchError")) + return gui.createErrorPanel(gui.Tr.NoPatchError) } menuItems := []*menuItem{ @@ -61,7 +61,7 @@ func (gui *Gui) handleCreatePatchOptionsMenu(g *gocui.Gui, v *gocui.View) error } } - return gui.createMenu(gui.Tr.SLocalize("PatchOptionsTitle"), menuItems, createMenuOptions{showCancel: true}) + return gui.createMenu(gui.Tr.PatchOptionsTitle, menuItems, createMenuOptions{showCancel: true}) } func (gui *Gui) getPatchCommitIndex() int { @@ -75,7 +75,7 @@ func (gui *Gui) getPatchCommitIndex() int { func (gui *Gui) validateNormalWorkingTreeState() (bool, error) { if gui.GitCommand.WorkingTreeState() != "normal" { - return false, gui.createErrorPanel(gui.Tr.SLocalize("CantPatchWhileRebasingError")) + return false, gui.createErrorPanel(gui.Tr.CantPatchWhileRebasingError) } return true, nil } @@ -96,7 +96,7 @@ func (gui *Gui) handleDeletePatchFromCommit() error { return err } - return gui.WithWaitingStatus(gui.Tr.SLocalize("RebasingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error { commitIndex := gui.getPatchCommitIndex() err := gui.GitCommand.DeletePatchesFromCommit(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager) return gui.handleGenericMergeCommandResult(err) @@ -112,7 +112,7 @@ func (gui *Gui) handleMovePatchToSelectedCommit() error { return err } - return gui.WithWaitingStatus(gui.Tr.SLocalize("RebasingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error { commitIndex := gui.getPatchCommitIndex() err := gui.GitCommand.MovePatchToSelectedCommit(gui.State.Commits, commitIndex, gui.State.Panels.Commits.SelectedLineIdx, gui.GitCommand.PatchManager) return gui.handleGenericMergeCommandResult(err) @@ -129,7 +129,7 @@ func (gui *Gui) handlePullPatchIntoWorkingTree() error { } pull := func(stash bool) error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("RebasingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error { commitIndex := gui.getPatchCommitIndex() err := gui.GitCommand.PullPatchIntoIndex(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager, stash) return gui.handleGenericMergeCommandResult(err) @@ -138,8 +138,8 @@ func (gui *Gui) handlePullPatchIntoWorkingTree() error { if len(gui.trackedFiles()) > 0 { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("MustStashTitle"), - prompt: gui.Tr.SLocalize("MustStashWarning"), + title: gui.Tr.MustStashTitle, + prompt: gui.Tr.MustStashWarning, handleConfirm: func() error { return pull(true) }, @@ -158,7 +158,7 @@ func (gui *Gui) handlePullPatchIntoNewCommit() error { return err } - return gui.WithWaitingStatus(gui.Tr.SLocalize("RebasingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.RebasingStatus, func() error { commitIndex := gui.getPatchCommitIndex() err := gui.GitCommand.PullPatchIntoNewCommit(gui.State.Commits, commitIndex, gui.GitCommand.PatchManager) return gui.handleGenericMergeCommandResult(err) diff --git a/pkg/gui/quitting.go b/pkg/gui/quitting.go index 692296d29..6bcd49da9 100644 --- a/pkg/gui/quitting.go +++ b/pkg/gui/quitting.go @@ -75,7 +75,7 @@ func (gui *Gui) quit() error { if gui.Config.GetUserConfig().ConfirmOnQuit { return gui.ask(askOpts{ title: "", - prompt: gui.Tr.SLocalize("ConfirmQuit"), + prompt: gui.Tr.ConfirmQuit, handleConfirm: func() error { return gocui.ErrQuit }, diff --git a/pkg/gui/rebase_options_panel.go b/pkg/gui/rebase_options_panel.go index b8fc1d8a2..f36ea77ab 100644 --- a/pkg/gui/rebase_options_panel.go +++ b/pkg/gui/rebase_options_panel.go @@ -26,9 +26,9 @@ func (gui *Gui) handleCreateRebaseOptionsMenu() error { var title string if gui.GitCommand.WorkingTreeState() == "merging" { - title = gui.Tr.SLocalize("MergeOptionsTitle") + title = gui.Tr.MergeOptionsTitle } else { - title = gui.Tr.SLocalize("RebaseOptionsTitle") + title = gui.Tr.RebaseOptionsTitle } return gui.createMenu(title, menuItems, createMenuOptions{showCancel: true}) @@ -38,7 +38,7 @@ func (gui *Gui) genericMergeCommand(command string) error { status := gui.GitCommand.WorkingTreeState() if status != "merging" && status != "rebasing" { - return gui.createErrorPanel(gui.Tr.SLocalize("NotMergingOrRebasing")) + return gui.createErrorPanel(gui.Tr.NotMergingOrRebasing) } commandType := strings.Replace(status, "ing", "e", 1) @@ -77,8 +77,8 @@ func (gui *Gui) handleGenericMergeCommandResult(result error) error { return nil } else if strings.Contains(result.Error(), "When you have resolved this problem") || strings.Contains(result.Error(), "fix conflicts") || strings.Contains(result.Error(), "Resolve all conflicts manually") { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("FoundConflictsTitle"), - prompt: gui.Tr.SLocalize("FoundConflicts"), + title: gui.Tr.FoundConflictsTitle, + prompt: gui.Tr.FoundConflicts, handlersManageFocus: true, handleConfirm: func() error { return gui.switchContext(gui.Contexts.Files.Context) diff --git a/pkg/gui/recent_repos_panel.go b/pkg/gui/recent_repos_panel.go index ab17ee8d3..7b15dd41a 100644 --- a/pkg/gui/recent_repos_panel.go +++ b/pkg/gui/recent_repos_panel.go @@ -29,7 +29,7 @@ func (gui *Gui) handleCreateRecentReposMenu() error { } } - return gui.createMenu(gui.Tr.SLocalize("RecentRepos"), menuItems, createMenuOptions{showCancel: true}) + return gui.createMenu(gui.Tr.RecentRepos, menuItems, createMenuOptions{showCancel: true}) } func (gui *Gui) dispatchSwitchToRepo(path string) error { diff --git a/pkg/gui/reflog_panel.go b/pkg/gui/reflog_panel.go index 165e575a1..b089ac526 100644 --- a/pkg/gui/reflog_panel.go +++ b/pkg/gui/reflog_panel.go @@ -90,8 +90,8 @@ func (gui *Gui) handleCheckoutReflogCommit(g *gocui.Gui, v *gocui.View) error { } err := gui.ask(askOpts{ - title: gui.Tr.SLocalize("checkoutCommit"), - prompt: gui.Tr.SLocalize("SureCheckoutThisCommit"), + title: gui.Tr.LcCheckoutCommit, + prompt: gui.Tr.SureCheckoutThisCommit, handleConfirm: func() error { return gui.handleCheckoutRef(commit.Sha, handleCheckoutRefOptions{}) }, diff --git a/pkg/gui/remote_branches_panel.go b/pkg/gui/remote_branches_panel.go index b879272b3..1155529ce 100644 --- a/pkg/gui/remote_branches_panel.go +++ b/pkg/gui/remote_branches_panel.go @@ -5,6 +5,7 @@ import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands/models" + "github.com/jesseduffield/lazygit/pkg/utils" ) // list panel functions @@ -52,13 +53,13 @@ func (gui *Gui) handleDeleteRemoteBranch(g *gocui.Gui, v *gocui.View) error { if remoteBranch == nil { return nil } - message := fmt.Sprintf("%s '%s'?", gui.Tr.SLocalize("DeleteRemoteBranchMessage"), remoteBranch.FullName()) + message := fmt.Sprintf("%s '%s'?", gui.Tr.DeleteRemoteBranchMessage, remoteBranch.FullName()) return gui.ask(askOpts{ - title: gui.Tr.SLocalize("DeleteRemoteBranch"), + title: gui.Tr.DeleteRemoteBranch, prompt: message, handleConfirm: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("DeletingStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.DeletingStatus, func() error { if err := gui.GitCommand.DeleteRemoteBranch(remoteBranch.RemoteName, remoteBranch.Name); err != nil { return err } @@ -78,16 +79,16 @@ func (gui *Gui) handleSetBranchUpstream(g *gocui.Gui, v *gocui.View) error { selectedBranch := gui.getSelectedRemoteBranch() checkedOutBranch := gui.getCheckedOutBranch() - message := gui.Tr.TemplateLocalize( - "SetUpstreamMessage", - Teml{ + message := utils.ResolvePlaceholderString( + gui.Tr.SetUpstreamMessage, + map[string]string{ "checkedOut": checkedOutBranch.Name, "selected": selectedBranch.FullName(), }, ) return gui.ask(askOpts{ - title: gui.Tr.SLocalize("SetUpstreamTitle"), + title: gui.Tr.SetUpstreamTitle, prompt: message, handleConfirm: func() error { if err := gui.GitCommand.SetBranchUpstream(selectedBranch.RemoteName, selectedBranch.Name, checkedOutBranch.Name); err != nil { diff --git a/pkg/gui/remotes_panel.go b/pkg/gui/remotes_panel.go index 7a77a0074..c0258b890 100644 --- a/pkg/gui/remotes_panel.go +++ b/pkg/gui/remotes_panel.go @@ -80,8 +80,8 @@ func (gui *Gui) handleRemoteEnter() error { } func (gui *Gui) handleAddRemote(g *gocui.Gui, v *gocui.View) error { - return gui.prompt(gui.Tr.SLocalize("newRemoteName"), "", func(remoteName string) error { - return gui.prompt(gui.Tr.SLocalize("newRemoteUrl"), "", func(remoteUrl string) error { + return gui.prompt(gui.Tr.LcNewRemoteName, "", func(remoteName string) error { + return gui.prompt(gui.Tr.LcNewRemoteUrl, "", func(remoteUrl string) error { if err := gui.GitCommand.AddRemote(remoteName, remoteUrl); err != nil { return err } @@ -97,8 +97,8 @@ func (gui *Gui) handleRemoveRemote(g *gocui.Gui, v *gocui.View) error { } return gui.ask(askOpts{ - title: gui.Tr.SLocalize("removeRemote"), - prompt: gui.Tr.SLocalize("removeRemotePrompt") + " '" + remote.Name + "'?", + title: gui.Tr.LcRemoveRemote, + prompt: gui.Tr.LcRemoveRemotePrompt + " '" + remote.Name + "'?", handleConfirm: func() error { if err := gui.GitCommand.RemoveRemote(remote.Name); err != nil { return err @@ -115,9 +115,9 @@ func (gui *Gui) handleEditRemote(g *gocui.Gui, v *gocui.View) error { return nil } - editNameMessage := gui.Tr.TemplateLocalize( - "editRemoteName", - Teml{ + editNameMessage := utils.ResolvePlaceholderString( + gui.Tr.LcEditRemoteName, + map[string]string{ "remoteName": remote.Name, }, ) @@ -129,9 +129,9 @@ func (gui *Gui) handleEditRemote(g *gocui.Gui, v *gocui.View) error { } } - editUrlMessage := gui.Tr.TemplateLocalize( - "editRemoteUrl", - Teml{ + editUrlMessage := utils.ResolvePlaceholderString( + gui.Tr.LcEditRemoteUrl, + map[string]string{ "remoteName": updatedRemoteName, }, ) @@ -157,7 +157,7 @@ func (gui *Gui) handleFetchRemote(g *gocui.Gui, v *gocui.View) error { return nil } - return gui.WithWaitingStatus(gui.Tr.SLocalize("FetchingRemoteStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.FetchingRemoteStatus, func() error { gui.State.FetchMutex.Lock() defer gui.State.FetchMutex.Unlock() diff --git a/pkg/gui/reset_menu_panel.go b/pkg/gui/reset_menu_panel.go index 26b3cb427..547aa89d0 100644 --- a/pkg/gui/reset_menu_panel.go +++ b/pkg/gui/reset_menu_panel.go @@ -46,5 +46,5 @@ func (gui *Gui) createResetMenu(ref string) error { } } - return gui.createMenu(fmt.Sprintf("%s %s", gui.Tr.SLocalize("resetTo"), ref), menuItems, createMenuOptions{showCancel: true}) + return gui.createMenu(fmt.Sprintf("%s %s", gui.Tr.LcResetTo, ref), menuItems, createMenuOptions{showCancel: true}) } diff --git a/pkg/gui/staging_panel.go b/pkg/gui/staging_panel.go index b3d182d0f..d07ba463c 100644 --- a/pkg/gui/staging_panel.go +++ b/pkg/gui/staging_panel.go @@ -35,11 +35,11 @@ func (gui *Gui) refreshStagingPanel(forceSecondaryFocused bool, selectedLineIdx } if secondaryFocused { - gui.getMainView().Title = gui.Tr.SLocalize("StagedChanges") - gui.getSecondaryView().Title = gui.Tr.SLocalize("UnstagedChanges") + gui.getMainView().Title = gui.Tr.StagedChanges + gui.getSecondaryView().Title = gui.Tr.UnstagedChanges } else { - gui.getMainView().Title = gui.Tr.SLocalize("UnstagedChanges") - gui.getSecondaryView().Title = gui.Tr.SLocalize("StagedChanges") + gui.getMainView().Title = gui.Tr.UnstagedChanges + gui.getSecondaryView().Title = gui.Tr.StagedChanges } // note for custom diffs, we'll need to send a flag here saying not to use the custom diff @@ -105,8 +105,8 @@ func (gui *Gui) handleResetSelection(g *gocui.Gui, v *gocui.View) error { if !gui.Config.GetUserConfig().Gui.SkipUnstageLineWarning { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("UnstageLinesTitle"), - prompt: gui.Tr.SLocalize("UnstageLinesPrompt"), + title: gui.Tr.UnstageLinesTitle, + prompt: gui.Tr.UnstageLinesPrompt, handlersManageFocus: true, handleConfirm: func() error { if err := gui.switchContext(gui.Contexts.Staging.Context); err != nil { diff --git a/pkg/gui/stash_panel.go b/pkg/gui/stash_panel.go index 7e1afc2fd..d03a85c06 100644 --- a/pkg/gui/stash_panel.go +++ b/pkg/gui/stash_panel.go @@ -3,6 +3,7 @@ package gui import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands/models" + "github.com/jesseduffield/lazygit/pkg/utils" ) // list panel functions @@ -20,7 +21,7 @@ func (gui *Gui) handleStashEntrySelect() error { var task updateTask stashEntry := gui.getSelectedStashEntry() if stashEntry == nil { - task = gui.createRenderStringTask(gui.Tr.SLocalize("NoStashEntries")) + task = gui.createRenderStringTask(gui.Tr.NoStashEntries) } else { cmd := gui.OSCommand.ExecutableFromString( gui.GitCommand.ShowStashEntryCmdStr(stashEntry.Index), @@ -56,8 +57,8 @@ func (gui *Gui) handleStashApply(g *gocui.Gui, v *gocui.View) error { } return gui.ask(askOpts{ - title: gui.Tr.SLocalize("StashApply"), - prompt: gui.Tr.SLocalize("SureApplyStashEntry"), + title: gui.Tr.StashApply, + prompt: gui.Tr.SureApplyStashEntry, handleConfirm: func() error { return apply() }, @@ -76,8 +77,8 @@ func (gui *Gui) handleStashPop(g *gocui.Gui, v *gocui.View) error { } return gui.ask(askOpts{ - title: gui.Tr.SLocalize("StashPop"), - prompt: gui.Tr.SLocalize("SurePopStashEntry"), + title: gui.Tr.StashPop, + prompt: gui.Tr.SurePopStashEntry, handleConfirm: func() error { return pop() }, @@ -86,8 +87,8 @@ func (gui *Gui) handleStashPop(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) handleStashDrop(g *gocui.Gui, v *gocui.View) error { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("StashDrop"), - prompt: gui.Tr.SLocalize("SureDropStashEntry"), + title: gui.Tr.StashDrop, + prompt: gui.Tr.SureDropStashEntry, handleConfirm: func() error { return gui.stashDo("drop") }, @@ -97,12 +98,13 @@ func (gui *Gui) handleStashDrop(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) stashDo(method string) error { stashEntry := gui.getSelectedStashEntry() if stashEntry == nil { - errorMessage := gui.Tr.TemplateLocalize( - "NoStashTo", - Teml{ + errorMessage := utils.ResolvePlaceholderString( + gui.Tr.NoStashTo, + map[string]string{ "method": method, }, ) + return gui.createErrorPanel(errorMessage) } if err := gui.GitCommand.StashDo(stashEntry.Index, method); err != nil { @@ -113,9 +115,9 @@ func (gui *Gui) stashDo(method string) error { func (gui *Gui) handleStashSave(stashFunc func(message string) error) error { if len(gui.trackedFiles()) == 0 && len(gui.stagedFiles()) == 0 { - return gui.createErrorPanel(gui.Tr.SLocalize("NoTrackedStagedFilesStash")) + return gui.createErrorPanel(gui.Tr.NoTrackedStagedFilesStash) } - return gui.prompt(gui.Tr.SLocalize("StashChanges"), "", func(stashComment string) error { + return gui.prompt(gui.Tr.StashChanges, "", func(stashComment string) error { if err := stashFunc(stashComment); err != nil { return gui.surfaceError(err) } diff --git a/pkg/gui/status_panel.go b/pkg/gui/status_panel.go index d23fbc10e..26cad012d 100644 --- a/pkg/gui/status_panel.go +++ b/pkg/gui/status_panel.go @@ -57,7 +57,7 @@ func cursorInSubstring(cx int, prefix string, substring string) bool { func (gui *Gui) handleCheckForUpdate(g *gocui.Gui, v *gocui.View) error { gui.Updater.CheckForNewUpdate(gui.onUserUpdateCheckFinish, true) - return gui.createLoaderPanel(v, gui.Tr.SLocalize("CheckingForUpdates")) + return gui.createLoaderPanel(v, gui.Tr.CheckingForUpdates) } func (gui *Gui) handleStatusClick(g *gocui.Gui, v *gocui.View) error { diff --git a/pkg/gui/sub_commits_panel.go b/pkg/gui/sub_commits_panel.go index a44051bd8..24e9a3a39 100644 --- a/pkg/gui/sub_commits_panel.go +++ b/pkg/gui/sub_commits_panel.go @@ -46,8 +46,8 @@ func (gui *Gui) handleCheckoutSubCommit(g *gocui.Gui, v *gocui.View) error { } err := gui.ask(askOpts{ - title: gui.Tr.SLocalize("checkoutCommit"), - prompt: gui.Tr.SLocalize("SureCheckoutThisCommit"), + title: gui.Tr.LcCheckoutCommit, + prompt: gui.Tr.SureCheckoutThisCommit, handleConfirm: func() error { return gui.handleCheckoutRef(commit.Sha, handleCheckoutRefOptions{}) }, diff --git a/pkg/gui/submodules_panel.go b/pkg/gui/submodules_panel.go index 9e7b89a08..666e1afee 100644 --- a/pkg/gui/submodules_panel.go +++ b/pkg/gui/submodules_panel.go @@ -79,8 +79,8 @@ func (gui *Gui) enterSubmodule(submodule *models.SubmoduleConfig) error { func (gui *Gui) removeSubmodule(submodule *models.SubmoduleConfig) error { return gui.ask(askOpts{ - title: gui.Tr.SLocalize("RemoveSubmodule"), - prompt: gui.Tr.SLocalizef("RemoveSubmodulePrompt", submodule.Name), + title: gui.Tr.RemoveSubmodule, + prompt: fmt.Sprintf(gui.Tr.RemoveSubmodulePrompt, submodule.Name), handleConfirm: func() error { if err := gui.GitCommand.SubmoduleDelete(submodule); err != nil { return gui.surfaceError(err) @@ -92,7 +92,7 @@ func (gui *Gui) removeSubmodule(submodule *models.SubmoduleConfig) error { } func (gui *Gui) handleResetSubmodule(submodule *models.SubmoduleConfig) error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("resettingSubmoduleStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.LcResettingSubmoduleStatus, func() error { return gui.resetSubmodule(submodule) }) } @@ -126,12 +126,12 @@ func (gui *Gui) resetSubmodule(submodule *models.SubmoduleConfig) error { } func (gui *Gui) handleAddSubmodule() error { - return gui.prompt(gui.Tr.SLocalize("newSubmoduleUrl"), "", func(submoduleUrl string) error { + return gui.prompt(gui.Tr.LcNewSubmoduleUrl, "", func(submoduleUrl string) error { nameSuggestion := filepath.Base(strings.TrimSuffix(submoduleUrl, filepath.Ext(submoduleUrl))) - return gui.prompt(gui.Tr.SLocalize("newSubmoduleName"), nameSuggestion, func(submoduleName string) error { - return gui.prompt(gui.Tr.SLocalize("newSubmodulePath"), submoduleName, func(submodulePath string) error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("addingSubmoduleStatus"), func() error { + return gui.prompt(gui.Tr.LcNewSubmoduleName, nameSuggestion, func(submoduleName string) error { + return gui.prompt(gui.Tr.LcNewSubmodulePath, submoduleName, func(submodulePath string) error { + return gui.WithWaitingStatus(gui.Tr.LcAddingSubmoduleStatus, func() error { err := gui.GitCommand.SubmoduleAdd(submoduleName, submodulePath, submoduleUrl) gui.handleCredentialsPopup(err) @@ -143,8 +143,8 @@ func (gui *Gui) handleAddSubmodule() error { } func (gui *Gui) handleEditSubmoduleUrl(submodule *models.SubmoduleConfig) error { - return gui.prompt(gui.Tr.SLocalizef("updateSubmoduleUrl", submodule.Name), submodule.Url, func(newUrl string) error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("updatingSubmoduleUrlStatus"), func() error { + return gui.prompt(fmt.Sprintf(gui.Tr.LcUpdateSubmoduleUrl, submodule.Name), submodule.Url, func(newUrl string) error { + return gui.WithWaitingStatus(gui.Tr.LcUpdatingSubmoduleUrlStatus, func() error { err := gui.GitCommand.SubmoduleUpdateUrl(submodule.Name, submodule.Path, newUrl) gui.handleCredentialsPopup(err) @@ -154,7 +154,7 @@ func (gui *Gui) handleEditSubmoduleUrl(submodule *models.SubmoduleConfig) error } func (gui *Gui) handleSubmoduleInit(submodule *models.SubmoduleConfig) error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("initializingSubmoduleStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.LcInitializingSubmoduleStatus, func() error { err := gui.GitCommand.SubmoduleInit(submodule.Path) gui.handleCredentialsPopup(err) @@ -178,13 +178,13 @@ func (gui *Gui) forSubmodule(callback func(*models.SubmoduleConfig) error) func( func (gui *Gui) handleResetRemoveSubmodule(submodule *models.SubmoduleConfig) error { menuItems := []*menuItem{ { - displayString: gui.Tr.SLocalize("submoduleStashAndReset"), + displayString: gui.Tr.LcSubmoduleStashAndReset, onPress: func() error { return gui.resetSubmodule(submodule) }, }, { - displayString: gui.Tr.SLocalize("removeSubmodule"), + displayString: gui.Tr.LcRemoveSubmodule, onPress: func() error { return gui.removeSubmodule(submodule) }, @@ -197,9 +197,9 @@ func (gui *Gui) handleResetRemoveSubmodule(submodule *models.SubmoduleConfig) er func (gui *Gui) handleBulkSubmoduleActionsMenu() error { menuItems := []*menuItem{ { - displayStrings: []string{gui.Tr.SLocalize("bulkInitSubmodules"), utils.ColoredString(gui.GitCommand.SubmoduleBulkInitCmdStr(), color.FgGreen)}, + displayStrings: []string{gui.Tr.LcBulkInitSubmodules, utils.ColoredString(gui.GitCommand.SubmoduleBulkInitCmdStr(), color.FgGreen)}, onPress: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("runningCommand"), func() error { + return gui.WithWaitingStatus(gui.Tr.LcRunningCommand, func() error { if err := gui.OSCommand.RunCommand(gui.GitCommand.SubmoduleBulkInitCmdStr()); err != nil { return gui.surfaceError(err) } @@ -209,9 +209,9 @@ func (gui *Gui) handleBulkSubmoduleActionsMenu() error { }, }, { - displayStrings: []string{gui.Tr.SLocalize("bulkUpdateSubmodules"), utils.ColoredString(gui.GitCommand.SubmoduleBulkUpdateCmdStr(), color.FgYellow)}, + displayStrings: []string{gui.Tr.LcBulkUpdateSubmodules, utils.ColoredString(gui.GitCommand.SubmoduleBulkUpdateCmdStr(), color.FgYellow)}, onPress: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("runningCommand"), func() error { + return gui.WithWaitingStatus(gui.Tr.LcRunningCommand, func() error { if err := gui.OSCommand.RunCommand(gui.GitCommand.SubmoduleBulkUpdateCmdStr()); err != nil { return gui.surfaceError(err) } @@ -221,9 +221,9 @@ func (gui *Gui) handleBulkSubmoduleActionsMenu() error { }, }, { - displayStrings: []string{gui.Tr.SLocalize("submoduleStashAndReset"), utils.ColoredString(fmt.Sprintf("git stash in each submodule && %s", gui.GitCommand.SubmoduleForceBulkUpdateCmdStr()), color.FgRed)}, + displayStrings: []string{gui.Tr.LcSubmoduleStashAndReset, utils.ColoredString(fmt.Sprintf("git stash in each submodule && %s", gui.GitCommand.SubmoduleForceBulkUpdateCmdStr()), color.FgRed)}, onPress: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("runningCommand"), func() error { + return gui.WithWaitingStatus(gui.Tr.LcRunningCommand, func() error { if err := gui.GitCommand.ResetSubmodules(gui.State.Submodules); err != nil { return gui.surfaceError(err) } @@ -233,9 +233,9 @@ func (gui *Gui) handleBulkSubmoduleActionsMenu() error { }, }, { - displayStrings: []string{gui.Tr.SLocalize("bulkDeinitSubmodules"), utils.ColoredString(gui.GitCommand.SubmoduleBulkDeinitCmdStr(), color.FgRed)}, + displayStrings: []string{gui.Tr.LcBulkDeinitSubmodules, utils.ColoredString(gui.GitCommand.SubmoduleBulkDeinitCmdStr(), color.FgRed)}, onPress: func() error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("runningCommand"), func() error { + return gui.WithWaitingStatus(gui.Tr.LcRunningCommand, func() error { if err := gui.OSCommand.RunCommand(gui.GitCommand.SubmoduleBulkDeinitCmdStr()); err != nil { return gui.surfaceError(err) } @@ -246,11 +246,11 @@ func (gui *Gui) handleBulkSubmoduleActionsMenu() error { }, } - return gui.createMenu(gui.Tr.SLocalize("bulkSubmoduleOptions"), menuItems, createMenuOptions{showCancel: true}) + return gui.createMenu(gui.Tr.LcBulkSubmoduleOptions, menuItems, createMenuOptions{showCancel: true}) } func (gui *Gui) handleUpdateSubmodule(submodule *models.SubmoduleConfig) error { - return gui.WithWaitingStatus(gui.Tr.SLocalize("updatingSubmoduleStatus"), func() error { + return gui.WithWaitingStatus(gui.Tr.LcUpdatingSubmoduleStatus, func() error { err := gui.GitCommand.SubmoduleUpdate(submodule.Path) gui.handleCredentialsPopup(err) diff --git a/pkg/gui/tags_panel.go b/pkg/gui/tags_panel.go index ef20545a0..6478dc016 100644 --- a/pkg/gui/tags_panel.go +++ b/pkg/gui/tags_panel.go @@ -3,6 +3,7 @@ package gui import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands/models" + "github.com/jesseduffield/lazygit/pkg/utils" ) // list panel functions @@ -64,15 +65,15 @@ func (gui *Gui) handleDeleteTag(g *gocui.Gui, v *gocui.View) error { return nil } - prompt := gui.Tr.TemplateLocalize( - "DeleteTagPrompt", - Teml{ + prompt := utils.ResolvePlaceholderString( + gui.Tr.DeleteTagPrompt, + map[string]string{ "tagName": tag.Name, }, ) return gui.ask(askOpts{ - title: gui.Tr.SLocalize("DeleteTagTitle"), + title: gui.Tr.DeleteTagTitle, prompt: prompt, handleConfirm: func() error { if err := gui.GitCommand.DeleteTag(tag.Name); err != nil { @@ -89,9 +90,9 @@ func (gui *Gui) handlePushTag(g *gocui.Gui, v *gocui.View) error { return nil } - title := gui.Tr.TemplateLocalize( - "PushTagTitle", - Teml{ + title := utils.ResolvePlaceholderString( + gui.Tr.PushTagTitle, + map[string]string{ "tagName": tag.Name, }, ) @@ -105,7 +106,7 @@ func (gui *Gui) handlePushTag(g *gocui.Gui, v *gocui.View) error { } func (gui *Gui) handleCreateTag(g *gocui.Gui, v *gocui.View) error { - return gui.prompt(gui.Tr.SLocalize("CreateTagTitle"), "", func(tagName string) error { + return gui.prompt(gui.Tr.CreateTagTitle, "", func(tagName string) error { // leaving commit SHA blank so that we're just creating the tag for the current commit if err := gui.GitCommand.CreateLightweightTag(tagName, ""); err != nil { return gui.surfaceError(err) diff --git a/pkg/gui/undoing.go b/pkg/gui/undoing.go index d6f7c99e2..dad866bc8 100644 --- a/pkg/gui/undoing.go +++ b/pkg/gui/undoing.go @@ -85,10 +85,10 @@ func (gui *Gui) parseReflogForActions(onUserAction func(counter int, action refl func (gui *Gui) reflogUndo(g *gocui.Gui, v *gocui.View) error { undoEnvVars := []string{"GIT_REFLOG_ACTION=[lazygit undo]"} - undoingStatus := gui.Tr.SLocalize("UndoingStatus") + undoingStatus := gui.Tr.UndoingStatus if gui.GitCommand.WorkingTreeState() == "rebasing" { - return gui.createErrorPanel(gui.Tr.SLocalize("cantUndoWhileRebasing")) + return gui.createErrorPanel(gui.Tr.LcCantUndoWhileRebasing) } return gui.parseReflogForActions(func(counter int, action reflogAction) (bool, error) { @@ -116,10 +116,10 @@ func (gui *Gui) reflogUndo(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) reflogRedo(g *gocui.Gui, v *gocui.View) error { redoEnvVars := []string{"GIT_REFLOG_ACTION=[lazygit redo]"} - redoingStatus := gui.Tr.SLocalize("RedoingStatus") + redoingStatus := gui.Tr.RedoingStatus if gui.GitCommand.WorkingTreeState() == "rebasing" { - return gui.createErrorPanel(gui.Tr.SLocalize("cantRedoWhileRebasing")) + return gui.createErrorPanel(gui.Tr.LcCantRedoWhileRebasing) } return gui.parseReflogForActions(func(counter int, action reflogAction) (bool, error) { @@ -167,11 +167,11 @@ func (gui *Gui) handleHardResetWithAutoStash(commitSha string, options handleHar if dirtyWorkingTree { // offer to autostash changes return gui.ask(askOpts{ - title: gui.Tr.SLocalize("AutoStashTitle"), - prompt: gui.Tr.SLocalize("AutoStashPrompt"), + title: gui.Tr.AutoStashTitle, + prompt: gui.Tr.AutoStashPrompt, handleConfirm: func() error { return gui.WithWaitingStatus(options.WaitingStatus, func() error { - if err := gui.GitCommand.StashSave(gui.Tr.SLocalize("StashPrefix") + commitSha); err != nil { + if err := gui.GitCommand.StashSave(gui.Tr.StashPrefix + commitSha); err != nil { return gui.surfaceError(err) } if err := reset(); err != nil { diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 5b3ea5e60..67abfbc02 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -377,12 +377,12 @@ func (gui *Gui) globalOptionsMap() map[string]string { keybindingConfig := gui.Config.GetUserConfig().Keybinding return map[string]string{ - fmt.Sprintf("%s/%s", gui.getKeyDisplay(keybindingConfig.Universal.ScrollUpMain), gui.getKeyDisplay(keybindingConfig.Universal.ScrollDownMain)): gui.Tr.SLocalize("scroll"), - fmt.Sprintf("%s %s %s %s", gui.getKeyDisplay(keybindingConfig.Universal.PrevBlock), gui.getKeyDisplay(keybindingConfig.Universal.NextBlock), gui.getKeyDisplay(keybindingConfig.Universal.PrevItem), gui.getKeyDisplay(keybindingConfig.Universal.NextItem)): gui.Tr.SLocalize("navigate"), - gui.getKeyDisplay(keybindingConfig.Universal.Return): gui.Tr.SLocalize("cancel"), - gui.getKeyDisplay(keybindingConfig.Universal.Quit): gui.Tr.SLocalize("quit"), - gui.getKeyDisplay(keybindingConfig.Universal.OptionMenu): gui.Tr.SLocalize("menu"), - "1-5": gui.Tr.SLocalize("jump"), + fmt.Sprintf("%s/%s", gui.getKeyDisplay(keybindingConfig.Universal.ScrollUpMain), gui.getKeyDisplay(keybindingConfig.Universal.ScrollDownMain)): gui.Tr.LcScroll, + fmt.Sprintf("%s %s %s %s", gui.getKeyDisplay(keybindingConfig.Universal.PrevBlock), gui.getKeyDisplay(keybindingConfig.Universal.NextBlock), gui.getKeyDisplay(keybindingConfig.Universal.PrevItem), gui.getKeyDisplay(keybindingConfig.Universal.NextItem)): gui.Tr.LcNavigate, + gui.getKeyDisplay(keybindingConfig.Universal.Return): gui.Tr.LcCancel, + gui.getKeyDisplay(keybindingConfig.Universal.Quit): gui.Tr.LcQuit, + gui.getKeyDisplay(keybindingConfig.Universal.OptionMenu): gui.Tr.LcMenu, + "1-5": gui.Tr.LcJump, } } diff --git a/pkg/gui/workspace_reset_options_panel.go b/pkg/gui/workspace_reset_options_panel.go index 6695c6cb5..119eaaa71 100644 --- a/pkg/gui/workspace_reset_options_panel.go +++ b/pkg/gui/workspace_reset_options_panel.go @@ -12,13 +12,13 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error { nukeStr := "reset --hard HEAD && git clean -fd" if len(gui.State.Submodules) > 0 { - nukeStr = fmt.Sprintf("%s (%s)", nukeStr, gui.Tr.SLocalize("andResetSubmodules")) + nukeStr = fmt.Sprintf("%s (%s)", nukeStr, gui.Tr.LcAndResetSubmodules) } menuItems := []*menuItem{ { displayStrings: []string{ - gui.Tr.SLocalize("discardAllChangesToAllFiles"), + gui.Tr.LcDiscardAllChangesToAllFiles, red.Sprint(nukeStr), }, onPress: func() error { @@ -31,7 +31,7 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error { }, { displayStrings: []string{ - gui.Tr.SLocalize("discardAnyUnstagedChanges"), + gui.Tr.LcDiscardAnyUnstagedChanges, red.Sprint("git checkout -- ."), }, onPress: func() error { @@ -44,7 +44,7 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error { }, { displayStrings: []string{ - gui.Tr.SLocalize("discardUntrackedFiles"), + gui.Tr.LcDiscardUntrackedFiles, red.Sprint("git clean -fd"), }, onPress: func() error { @@ -57,7 +57,7 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error { }, { displayStrings: []string{ - gui.Tr.SLocalize("softReset"), + gui.Tr.LcSoftReset, red.Sprint("git reset --soft HEAD"), }, onPress: func() error { @@ -83,7 +83,7 @@ func (gui *Gui) handleCreateResetMenu(g *gocui.Gui, v *gocui.View) error { }, { displayStrings: []string{ - gui.Tr.SLocalize("hardReset"), + gui.Tr.LcHardReset, red.Sprint("git reset --hard HEAD"), }, onPress: func() error { diff --git a/pkg/i18n/dutch.go b/pkg/i18n/dutch.go index f56d4c1c7..93f942cae 100644 --- a/pkg/i18n/dutch.go +++ b/pkg/i18n/dutch.go @@ -1,1167 +1,382 @@ package i18n -import ( - "github.com/nicksnyder/go-i18n/v2/i18n" - "golang.org/x/text/language" -) - -// addDutch will add all dutch translations -func addDutch(i18nObject *i18n.Bundle) error { - - // add the translations - return 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: "LogTitle", - Other: "Log", - }, &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: "UnstagedChanges", - Other: `Unstaged wijzigingen`, - }, &i18n.Message{ - ID: "StagedChanges", - Other: `Staged Wijzigingen`, - }, &i18n.Message{ - ID: "PatchBuildingMainTitle", - Other: `Voeg lijnen/hunks toe aan Patch`, - }, &i18n.Message{ - ID: "MergingMainTitle", - Other: "Los merge conflicten op", - }, &i18n.Message{ - ID: "MainTitle", - Other: "Hooft", - }, &i18n.Message{ - ID: "StagingTitle", - Other: "Staging", - }, &i18n.Message{ - ID: "MergingTitle", - Other: "Merging", - }, &i18n.Message{ - ID: "NormalTitle", - Other: "Normaal", - }, &i18n.Message{ - ID: "CommitMessage", - Other: "Commit bericht", - }, &i18n.Message{ - ID: "CredentialsUsername", - Other: "Gebruikersnaam", - }, &i18n.Message{ - ID: "CredentialsPassword", - Other: "Wachtwoord", - }, &i18n.Message{ - ID: "PassUnameWrong", - Other: "Wachtwoord en/of gebruikersnaam verkeert", - }, &i18n.Message{ - ID: "CommitChanges", - Other: "Commit veranderingen", - }, &i18n.Message{ - ID: "AmendLastCommit", - Other: "wijzig laatste commit", - }, &i18n.Message{ - ID: "SureToAmend", - Other: "Weet je zeker dat je de laatste commit wilt wijzigen? U kunt het commit-bericht wijzigen vanuit het commits-paneel.", - }, &i18n.Message{ - ID: "NoCommitToAmend", - Other: "Er is geen commits om te wijzigen.", - }, &i18n.Message{ - ID: "CommitChangesWithEditor", - Other: "commit veranderingen met de git editor", - }, &i18n.Message{ - ID: "StatusTitle", - Other: "Status", - }, &i18n.Message{ - ID: "GlobalTitle", - Other: "Globaal", - }, &i18n.Message{ - ID: "navigate", - Other: "navigeer", - }, &i18n.Message{ - ID: "menu", - Other: "menu", - }, &i18n.Message{ - ID: "execute", - Other: "uitvoeren", - }, &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: "toggleStagedAll", - Other: "toggle staged alle", - }, &i18n.Message{ - ID: "refresh", - Other: "verversen", - }, &i18n.Message{ - ID: "push", - Other: "push", - }, &i18n.Message{ - ID: "pull", - Other: "pull", - }, &i18n.Message{ - ID: "edit", - Other: "bewerken", - }, &i18n.Message{ - ID: "scroll", - Other: "scroll", - }, &i18n.Message{ - ID: "abortMerge", - Other: "samenvoegen afbreken", - }, &i18n.Message{ - ID: "resolveMergeConflicts", - Other: "los merge conflicten op", - }, &i18n.Message{ - ID: "MergeConflictsTitle", - Other: "Merge Conflicten", - }, &i18n.Message{ - ID: "checkout", - Other: "uitchecken", - }, &i18n.Message{ - ID: "NoChangedFiles", - Other: "Geen bestanden veranderd", - }, &i18n.Message{ - ID: "FileHasNoUnstagedChanges", - Other: "Het bestand heeft geen unstaged veranderingen om toe te voegen", - }, &i18n.Message{ - ID: "CannotGitAdd", - Other: "Kan commando niet uitvoeren git add --path untracked files", - }, &i18n.Message{ - ID: "NoFilesDisplay", - Other: "Geen bestanden om te laten zien", - }, &i18n.Message{ - ID: "NotAFile", - Other: "Dit is geen bestand", - }, &i18n.Message{ - ID: "PullWait", - Other: "Pullen...", - }, &i18n.Message{ - ID: "PushWait", - Other: "Pushen...", - }, &i18n.Message{ - ID: "FetchWait", - Other: "Fetchen...", - }, &i18n.Message{ - ID: "FileNoMergeCons", - Other: "Dit bestand heeft geen merge conflicten", - }, &i18n.Message{ - ID: "softReset", - Other: "zacht reset", - }, &i18n.Message{ - ID: "SureTo", - Other: "Weet je het zeker dat je {{.fileName}} wilt {{.deleteVerb}} (je veranderingen zullen worden verwijderd)", - }, &i18n.Message{ - ID: "AlreadyCheckedOutBranch", - Other: "Je hebt deze branch al uitgecheckt", - }, &i18n.Message{ - ID: "SureForceCheckout", - Other: "Weet je zeker dat je het uitchecken wil forceren? Al je lokale verandering zullen worden verwijdert", - }, &i18n.Message{ - ID: "ForceCheckoutBranch", - Other: "Forceer uitchecken op deze branch", - }, &i18n.Message{ - ID: "BranchName", - Other: "Branch naam", - }, &i18n.Message{ - ID: "NewBranchNameBranchOff", - Other: "Nieuw branch naam (Branch is afgeleid van {{.branchName}})", - }, &i18n.Message{ - ID: "CantDeleteCheckOutBranch", - Other: "Je kan een uitgecheckte branch niet verwijderen!", - }, &i18n.Message{ - ID: "DeleteBranch", - Other: "Verwijder branch", - }, &i18n.Message{ - ID: "DeleteBranchMessage", - Other: "Weet je zeker dat je branch {{.selectedBranchName}} wilt verwijderen?", - }, &i18n.Message{ - ID: "ForceDeleteBranchMessage", - Other: "Weet je zeker dat je branch {{.selectedBranchName}} geforceerd wil verwijderen?", - }, &i18n.Message{ - ID: "rebaseBranch", - Other: "rebase branch", - }, &i18n.Message{ - ID: "CantRebaseOntoSelf", - Other: "Je kan niet een branch rebasen op zichzelf", - }, &i18n.Message{ - ID: "CantMergeBranchIntoItself", - Other: "Je kan niet een branch in zichzelf mergen", - }, &i18n.Message{ - ID: "forceCheckout", - Other: "forceer checkout", - }, &i18n.Message{ - ID: "merge", - Other: "samenvoegen", - }, &i18n.Message{ - ID: "checkoutByName", - Other: "uitchecken bij naam", - }, &i18n.Message{ - ID: "newBranch", - Other: "nieuwe branch", - }, &i18n.Message{ - ID: "deleteBranch", - Other: "verwijder branch", - }, &i18n.Message{ - ID: "forceDeleteBranch", - Other: "verwijder branch (forceer)", - }, &i18n.Message{ - ID: "NoBranchesThisRepo", - Other: "Geen branches voor deze repo", - }, &i18n.Message{ - ID: "NoTrackingThisBranch", - Other: "deze branch wordt niet gevolgd", - }, &i18n.Message{ - ID: "CommitMessageConfirm", - Other: "{{.keyBindClose}}: Sluiten, {{.keyBindNewLine}}: Nieuwe lijn, {{.keyBindConfirm}}: Bevestig", - }, &i18n.Message{ - ID: "CommitWithoutMessageErr", - Other: "Je kan geen commit maken zonder commit bericht", - }, &i18n.Message{ - ID: "CloseConfirm", - Other: "{{.keyBindClose}}: Sluiten, {{.keyBindConfirm}}: Bevestig", - }, &i18n.Message{ - ID: "close", - Other: "sluiten", - }, &i18n.Message{ - ID: "quit", - Other: "quit", - }, &i18n.Message{ - ID: "SureResetThisCommit", - Other: "Weet je het zeker dat je wil resetten naar deze commit?", - }, &i18n.Message{ - ID: "ResetToCommit", - Other: "Reset Naar Commit", - }, &i18n.Message{ - ID: "squashDown", - Other: "squash beneden", - }, &i18n.Message{ - ID: "rename", - Other: "hernoemen", - }, &i18n.Message{ - ID: "resetToThisCommit", - Other: "reset naar deze commit", - }, &i18n.Message{ - ID: "fixupCommit", - Other: "Fixup commit", - }, &i18n.Message{ - ID: "NoCommitsThisBranch", - Other: "Er zijn geen commits voor deze branch", - }, &i18n.Message{ - ID: "OnlySquashTopmostCommit", - Other: "Kan alleen bovenste commit squashen", - }, &i18n.Message{ - ID: "YouNoCommitsToSquash", - Other: "Je hebt geen commits om mee te squashen", - }, &i18n.Message{ - ID: "CantFixupWhileUnstagedChanges", - Other: "Kan geen Fixup uitvoeren op unstaged veranderingen", - }, &i18n.Message{ - ID: "Fixup", - Other: "Fixup", - }, &i18n.Message{ - ID: "SureFixupThisCommit", - Other: "Weet je zeker dat je fixup wil uitvoeren op deze commit? De commit hieronder zol worden squashed in deze", - }, &i18n.Message{ - ID: "SureSquashThisCommit", - Other: "Weet je zeker dat je deze commit wil samenvoegen met de commit hieronder?", - }, &i18n.Message{ - ID: "Squash", - Other: "Squash", - }, &i18n.Message{ - ID: "pickCommit", - Other: "kies commit (wanneer midden in rebase)", - }, &i18n.Message{ - ID: "revertCommit", - Other: "commit ongedaan maken", - }, &i18n.Message{ - ID: "OnlyRenameTopCommit", - Other: "Je kan alleen de bovenste commit hernoemen", - }, &i18n.Message{ - ID: "renameCommit", - Other: "hernoem commit", - }, &i18n.Message{ - ID: "deleteCommit", - Other: "verwijder commit", - }, &i18n.Message{ - ID: "moveDownCommit", - Other: "verplaats commit 1 naar beneden", - }, &i18n.Message{ - ID: "moveUpCommit", - Other: "verplaats commit 1 naar boven", - }, &i18n.Message{ - ID: "editCommit", - Other: "wijzig commit", - }, &i18n.Message{ - ID: "amendToCommit", - Other: "wijzig commit met staged veranderingen", - }, &i18n.Message{ - ID: "renameCommitEditor", - Other: "hernoem commit met editor", - }, &i18n.Message{ - ID: "PotentialErrInGetselectedCommit", - Other: "Er is mogelijk een error in getSelected Commit (geen match tussen ui en state)", - }, &i18n.Message{ - ID: "NoCommitsThisBranch", - Other: "Geen commits in deze branch", - }, &i18n.Message{ - ID: "Error", - Other: "Foutmelding", - }, &i18n.Message{ - ID: "RunningSubprocess", - Other: "subprocess lopend", - }, &i18n.Message{ - ID: "selectHunk", - Other: "selecteer stuk", - }, &i18n.Message{ - ID: "navigateConflicts", - Other: "navigeer conflicts", - }, &i18n.Message{ - ID: "pickHunk", - Other: "kies stuk", - }, &i18n.Message{ - ID: "pickBothHunks", - Other: "kies beide stukken", - }, &i18n.Message{ - ID: "undo", - Other: "ongedaan maken", - }, &i18n.Message{ - ID: "undoReflog", - Other: "ongedaan maken (via reflog) (experimenteel)", - }, &i18n.Message{ - ID: "redoReflog", - Other: "redo (via reflog) (experimenteel)", - }, &i18n.Message{ - ID: "pop", - Other: "pop", - }, &i18n.Message{ - ID: "drop", - Other: "laten vallen", - }, &i18n.Message{ - ID: "apply", - Other: "toepassen", - }, &i18n.Message{ - ID: "NoStashEntries", - Other: "Geen stash items", - }, &i18n.Message{ - ID: "StashDrop", - Other: "Stash laten vallen", - }, &i18n.Message{ - ID: "SureDropStashEntry", - Other: "Weet je het zeker dat je deze stash entry wil laten vallen?", - }, &i18n.Message{ - ID: "StashPop", - Other: "Stash pop", - }, &i18n.Message{ - ID: "SurePopStashEntry", - Other: "Weet je zeker dat je deze stash entry wil poppen?", - }, &i18n.Message{ - ID: "StashApply", - Other: "Stash toepassen", - }, &i18n.Message{ - ID: "SureApplyStashEntry", - Other: "Weet je zeker dat je deze stash entry wil toepassen?", - }, &i18n.Message{ - ID: "NoStashTo", - Other: "Geen stash voor {{.method}}", - }, &i18n.Message{ - ID: "NoTrackedStagedFilesStash", - Other: "Je hebt geen tracked/staged bestanden om te laten stashen", - }, &i18n.Message{ - ID: "StashChanges", - Other: "Stash veranderingen", - }, &i18n.Message{ - ID: "IssntListOfViews", - Other: "{{.name}} is niet in de lijst van weergaves", - }, &i18n.Message{ - ID: "newFocusedViewIs", - Other: "nieuw gefocussed weergave is {{.newFocusedView}}", - }, &i18n.Message{ - ID: "NoChangedFiles", - Other: "Geen veranderde bestanden", - }, &i18n.Message{ - ID: "MergeAborted", - Other: "Merge afgebroken", - }, &i18n.Message{ - ID: "OpenConfig", - Other: "open config bestand", - }, &i18n.Message{ - ID: "EditConfig", - Other: "verander config bestand", - }, &i18n.Message{ - ID: "ForcePush", - Other: "Forceer push", - }, &i18n.Message{ - ID: "ForcePushPrompt", - Other: "Jouw branch is afgeweken van de remote branch. Druk 'esc' om te annuleren, of 'enter' om geforceert te pushen.", - }, &i18n.Message{ - ID: "ForcePushDisabled", - Other: "Your branch has diverged from the remote branch and you've disabled force pushing", - }, &i18n.Message{ - ID: "UpdatesRejectedAndForcePushDisabled", - Other: "Updates were rejected and you have disabled force pushing", - }, &i18n.Message{ - ID: "checkForUpdate", - Other: "check voor updates", - }, &i18n.Message{ - ID: "CheckingForUpdates", - Other: "zoeken naar updates...", - }, &i18n.Message{ - ID: "OnLatestVersionErr", - Other: "Je hebt al de laatste versie", - }, &i18n.Message{ - ID: "MajorVersionErr", - Other: "Nieuwe versie ({{.newVersion}}) is niet backwards compatibele vergeleken met de huidige versie ({{.currentVersion}})", - }, &i18n.Message{ - ID: "CouldNotFindBinaryErr", - Other: "Kon geen binary vinden op {{.url}}", - }, &i18n.Message{ - ID: "AnonymousReportingTitle", - Other: "Help lazygit te verbeteren", - }, &i18n.Message{ - ID: "AnonymousReportingPrompt", - Other: "Zou je anonieme data rapportage willen aanzetten om lazygit beter te kunnen maken? (enter/esc)", - }, &i18n.Message{ - ID: "IntroPopupMessage", - Other: `Bedankt voor het gebruik maken van lazygit! 2 dingen die je moet weten: - -1) Als je meer van lazygit zijn features wilt leren bekijk dan deze video: - https://youtu.be/CPLdltN7wgE - -2) Als je git gebruikt, ben je een programmeur! Met jouw hulp kunnen we lazygit verbeteren, dus overweeg om een ​​donateur te worden en mee te doen aan het plezier op - https://github.com/jesseduffield/lazygit`, - }, &i18n.Message{ - ID: "GitconfigParseErr", - Other: `Gogit kon je gitconfig bestand niet goed parsen door de aanwezigheid van losstaande '\' tekens. Het weghalen van deze tekens zou het probleem moeten oplossen. `, - }, &i18n.Message{ - ID: "editFile", - Other: `verander bestand`, - }, &i18n.Message{ - ID: "openFile", - Other: `open bestand`, - }, &i18n.Message{ - ID: "ignoreFile", - Other: `voeg toe aan .gitignore`, - }, &i18n.Message{ - ID: "refreshFiles", - Other: `refresh bestanden`, - }, &i18n.Message{ - ID: "mergeIntoCurrentBranch", - Other: `merge in met huidige checked out branch`, - }, &i18n.Message{ - ID: "ConfirmQuit", - Other: `Weet je zeker dat je dit programma wil sluiten?`, - }, &i18n.Message{ - ID: "SwitchRepo", - Other: "wissel naar een recente repo", - }, &i18n.Message{ - ID: "UnsupportedGitService", - Other: `Niet-ondersteunde git-service`, - }, &i18n.Message{ - ID: "createPullRequest", - Other: `maak een pull-aanvraag`, - }, &i18n.Message{ - ID: "NoBranchOnRemote", - Other: `Deze branch bestaat niet op de remote. U moet het eerst naar de remote pushen.`, - }, &i18n.Message{ - ID: "fetch", - Other: `fetch`, - }, &i18n.Message{ - ID: "NoAutomaticGitFetchTitle", - Other: `Geen automatische git fetch`, - }, &i18n.Message{ - ID: "NoAutomaticGitFetchBody", - Other: `Lazygit kan niet "git fetch" uitvoeren in een privé repository, gebruik f in het branches paneel om "git fetch" manueel uit te voeren`, - }, &i18n.Message{ - ID: "StageLines", - Other: `stage individuele hunks/lijnen`, - }, &i18n.Message{ - ID: "FileStagingRequirements", - Other: `Kan alleen individuele lijnen stagen van getrackte bestanden met onstaged veranderingen`, - }, &i18n.Message{ - ID: "SelectHunk", - Other: `selecteer hunk`, - }, &i18n.Message{ - ID: "StageSelection", - Other: `toggle lijnen staged / unstaged`, - }, &i18n.Message{ - ID: "ResetSelection", - Other: `verwijdert change (git reset)`, - }, &i18n.Message{ - ID: "ToggleDragSelect", - Other: `toggle drag selecteer`, - }, &i18n.Message{ - ID: "ToggleSelectHunk", - Other: `toggle selecteer hunk`, - }, &i18n.Message{ - ID: "ToggleSelectionForPatch", - Other: `voeg toe/verwijder lijn(en) in patch`, - }, &i18n.Message{ - ID: "TogglePanel", - Other: `ga naar een ander paneel`, - }, &i18n.Message{ - ID: "CantStageStaged", - Other: `Je kan niet al gestaged verandering stagen!`, - }, &i18n.Message{ - ID: "ReturnToFilesPanel", - Other: `ga terug naar het bestanden paneel`, - }, &i18n.Message{ - ID: "CantFindHunks", - Other: `Kan geen hunks vinden in deze patch`, - }, &i18n.Message{ - ID: "CantFindHunk", - Other: `Kan geen hunk vinden`, - }, &i18n.Message{ - ID: "FastForward", - Other: `fast-forward deze branch vanaf zijn upstream`, - }, &i18n.Message{ - ID: "Fetching", - Other: "fetching en fast-forwarding {{.from}} -> {{.to}} ...", - }, &i18n.Message{ - ID: "FoundConflicts", - Other: "Conflicten!, Om af te breken druk 'esc', anders druk op 'enter'", - }, &i18n.Message{ - ID: "FoundConflictsTitle", - Other: "Auto-merge mislukt", - }, &i18n.Message{ - ID: "Undo", - Other: "ongedaan maken", - }, &i18n.Message{ - ID: "PickHunk", - Other: "kies hunk", - }, &i18n.Message{ - ID: "PickBothHunks", - Other: "kies bijde hunks", - }, &i18n.Message{ - ID: "ViewMergeRebaseOptions", - Other: "bekijk merge/rebase opties", - }, &i18n.Message{ - ID: "NotMergingOrRebasing", - Other: "Je bent momenteel niet aan het rebasen of mergen", - }, &i18n.Message{ - ID: "RecentRepos", - Other: "recente repositories", - }, &i18n.Message{ - ID: "MergeOptionsTitle", - Other: "Merge Opties", - }, &i18n.Message{ - ID: "RebaseOptionsTitle", - Other: "Rebase Opties", - }, &i18n.Message{ - ID: "CommitMessageTitle", - Other: "Commit Bericht", - }, &i18n.Message{ - ID: "LocalBranchesTitle", - Other: "Branches Tab", - }, &i18n.Message{ - ID: "SearchTitle", - Other: "Zoek", - }, &i18n.Message{ - ID: "TagsTitle", - Other: "Tags Tab", - }, &i18n.Message{ - ID: "BranchCommitsTitle", - Other: "Commits Tab", - }, &i18n.Message{ - ID: "MenuTitle", - Other: "Menu", - }, &i18n.Message{ - ID: "RemotesTitle", - Other: "Remotes Tab", - }, &i18n.Message{ - ID: "CredentialsTitle", - Other: "Credentials", - }, &i18n.Message{ - ID: "RemoteBranchesTitle", - Other: "Remote Branches (in Remotes tab)", - }, &i18n.Message{ - ID: "PatchBuildingTitle", - Other: "Patch Bouwen", - }, &i18n.Message{ - ID: "InformationTitle", - Other: "Informatie", - }, &i18n.Message{ - ID: "SecondaryTitle", - Other: "Secondary", - }, &i18n.Message{ - ID: "ReflogCommitsTitle", - Other: "Reflog Tab", - }, &i18n.Message{ - ID: "Title", - Other: "Title", - }, &i18n.Message{ - ID: "GlobalTitle", - Other: "Globaale Sneltoetsen", - }, &i18n.Message{ - ID: "MerginTitle", - Other: "Mergen", - }, &i18n.Message{ - ID: "ConflictsResolved", - Other: "alle merge conflicten zijn opgelost. Wilt je verder gaan?", - }, &i18n.Message{ - ID: "RebasingTitle", - Other: "Rebasen", - }, &i18n.Message{ - ID: "MergingTitle", - Other: "Merggen", - }, &i18n.Message{ - ID: "ConfirmRebase", - Other: "Weet je zeker dat je {{.checkedOutBranch}} op {{.selectedBranch}} wil rebasen?", - }, &i18n.Message{ - ID: "ConfirmMerge", - Other: "Weet je zeker dat je {{.selectedBranch}} in {{.checkedOutBranch}} wil mergen?", - }, &i18n.Message{ - ID: "FwdNoUpstream", - Other: "Kan niet de branch vooruitspoelen zonder upstream", - }, &i18n.Message{ - ID: "FwdCommitsToPush", - Other: "Je kan niet vooruitspoelen als de branch geen nieuwe commits heeft", - }, &i18n.Message{ - ID: "ErrorOccurred", - Other: "Er is iets fout gegaan! Zou je hier een issue aan willen maken: https://github.com/jesseduffield/lazygit/issues", - }, &i18n.Message{ - ID: "NoRoom", - Other: "Niet genoeg ruimte", - }, &i18n.Message{ - ID: "YouAreHere", - Other: "JE BENT HIER", - }, &i18n.Message{ - ID: "rewordNotSupported", - Other: "herformatteren van commits in interactief rebasen is nog niet ondersteund", - }, &i18n.Message{ - ID: "cherryPickCopy", - Other: "kopiëer commit (cherry-pick)", - }, &i18n.Message{ - ID: "cherryPickCopyRange", - Other: "kopiëer commit reeks (cherry-pick)", - }, &i18n.Message{ - ID: "pasteCommits", - Other: "plak commits (cherry-pick)", - }, &i18n.Message{ - ID: "SureCherryPick", - Other: "Weet je zeker dat je de gekopieerde commits naar deze branch wil cherry-picken?", - }, &i18n.Message{ - ID: "CherryPick", - Other: "Cherry-Pick", - }, &i18n.Message{ - ID: "CannotRebaseOntoFirstCommit", - Other: "Je kan niet interactief rebasen naar de eerste commit", - }, &i18n.Message{ - ID: "CannotSquashOntoSecondCommit", - Other: "Je kan niet een squash/fixup doen naar de 2de commit", - }, &i18n.Message{ - ID: "Donate", - Other: "Doneer", - }, &i18n.Message{ - ID: "PrevLine", - Other: "selecteer de vorige lijn", - }, &i18n.Message{ - ID: "NextLine", - Other: "selecteer de volgende lijn", - }, &i18n.Message{ - ID: "PrevHunk", - Other: "selecteer de vorige hunk", - }, &i18n.Message{ - ID: "NextHunk", - Other: "selecteer de volgende hunk", - }, &i18n.Message{ - ID: "PrevConflict", - Other: "selecteer voorgaand conflict", - }, &i18n.Message{ - ID: "NextConflict", - Other: "selecteer volgende conflict", - }, &i18n.Message{ - ID: "SelectTop", - Other: "selecteer bovenste hunk", - }, &i18n.Message{ - ID: "SelectBottom", - Other: "selecteer onderste hunk", - }, &i18n.Message{ - ID: "ScrollDown", - Other: "scroll omlaag", - }, &i18n.Message{ - ID: "ScrollUp", - Other: "scroll omhoog", - }, &i18n.Message{ - ID: "scrollUpMainPanel", - Other: "scroll naar beneden vanaf hooft paneel", - }, &i18n.Message{ - ID: "scrollDownMainPanel", - Other: "scroll naar beneden vabaf hooft paneel", - }, &i18n.Message{ - ID: "AmendCommitTitle", - Other: "Commit wijzigen", - }, &i18n.Message{ - ID: "AmendCommitPrompt", - Other: "Weet je zeker dat je deze commit wil wijzigen met de vorige staged bestanden?", - }, &i18n.Message{ - ID: "DeleteCommitTitle", - Other: "Verwijder Commit", - }, &i18n.Message{ - ID: "DeleteCommitPrompt", - Other: "Weet je zeker dat je deze commit wil verwijderen?", - }, &i18n.Message{ - ID: "SquashingStatus", - Other: "squashen", - }, &i18n.Message{ - ID: "FixingStatus", - Other: "fixing up", - }, &i18n.Message{ - ID: "DeletingStatus", - Other: "verwijderen", - }, &i18n.Message{ - ID: "MovingStatus", - Other: "verplaatsen", - }, &i18n.Message{ - ID: "RebasingStatus", - Other: "rebasen", - }, &i18n.Message{ - ID: "AmendingStatus", - Other: "wijzigen", - }, &i18n.Message{ - ID: "CherryPickingStatus", - Other: "cherry-picken", - }, &i18n.Message{ - ID: "UndoingStatus", - Other: "ongedaan maken", - }, &i18n.Message{ - ID: "RedoingStatus", - Other: "redoing", - }, &i18n.Message{ - ID: "CheckingOutStatus", - Other: "uitchecken", - }, &i18n.Message{ - ID: "CommitFiles", - Other: "Commit bestanden", - }, &i18n.Message{ - ID: "viewCommitFiles", - Other: "bekijk gecommite bestanden", - }, &i18n.Message{ - ID: "CommitFilesTitle", - Other: "Commit bestanden", - }, &i18n.Message{ - ID: "goBack", - Other: "ga terug", - }, &i18n.Message{ - ID: "NoCommiteFiles", - Other: "Geen bestanden voor deze commit", - }, &i18n.Message{ - ID: "checkoutCommitFile", - Other: "bestand uitchecken", - }, &i18n.Message{ - ID: "discardOldFileChange", - Other: "uitsluit deze commit zijn veranderingen aan dit bestand", - }, &i18n.Message{ - ID: "DiscardFileChangesTitle", - Other: "uitsluit bestand zijn veranderingen", - }, &i18n.Message{ - ID: "DiscardFileChangesPrompt", - Other: "Weet je zeker dat je de wijzigingen van deze commit in dit bestand wilt weggooien? Als dit bestand is gecreëerd in deze commit dan zal dit bestand worden verwijdert", - }, &i18n.Message{ - ID: "DisabledForGPG", - Other: "Onderdelen niet beschikbaar voor gebruikers die GPG gebruiken", - }, &i18n.Message{ - ID: "CreateRepo", - Other: "Niet in een git repository. Creëer een nieuwe git repository? (y/n): ", - }, &i18n.Message{ - ID: "AutoStashTitle", - Other: "Autostash?", - }, &i18n.Message{ - ID: "AutoStashPrompt", - Other: "Je moet je veranderingen stashen en poppen om ze over te bregen. Dit automatisch doen? (enter/esc)", - }, &i18n.Message{ - ID: "StashPrefix", - Other: "Auto-stashing veranderingen voor ", - }, &i18n.Message{ - ID: "viewDiscardOptions", - Other: "bekijk 'veranderingen ongedaan maken' opties", - }, &i18n.Message{ - ID: "cancel", - Other: "anuleren", - }, &i18n.Message{ - ID: "discardAllChanges", - Other: "negeer alle wijzigingen", - }, &i18n.Message{ - ID: "discardUnstagedChanges", - Other: "negeer unstaged wijzigingen", - }, &i18n.Message{ - ID: "discardAllChangesToAllFiles", - Other: "verwijder werkende tree", - }, &i18n.Message{ - ID: "discardAnyUnstagedChanges", - Other: "discard unstaged wijzigingen", - }, &i18n.Message{ - ID: "discardUntrackedFiles", - Other: "negeer niet-gevonden bestanden", - }, &i18n.Message{ - ID: "viewResetOptions", - Other: `bekijk reset opties`, - }, &i18n.Message{ - ID: "hardReset", - Other: "harde reset", - }, &i18n.Message{ - ID: "hardResetUpstream", - Other: "harde naar upstream branch", - }, &i18n.Message{ - ID: "viewResetOptions", - Other: `bekijk reset opties`, - }, &i18n.Message{ - ID: "createFixupCommit", - Other: `creëer fixup commit voor deze commit`, - }, &i18n.Message{ - ID: "squashAboveCommits", - Other: `squash bovenstaande commits`, - }, &i18n.Message{ - ID: "SquashAboveCommits", - Other: `Squash bovenstaande commits`, - }, &i18n.Message{ - ID: "SureSquashAboveCommits", - Other: `Weet je zeker dat je alles wil squash/fixup! voor de bovenstaand commits {{.commit}}?`, - }, &i18n.Message{ - ID: "CreateFixupCommit", - Other: `Creëer fixup commit`, - }, &i18n.Message{ - ID: "SureCreateFixupCommit", - Other: `Weet je zeker dat je een fixup wil maken! commit voor commit {{.commit}}?`, - }, &i18n.Message{ - ID: "executeCustomCommand", - Other: "voor aangepast commando uit", - }, &i18n.Message{ - ID: "CustomCommand", - Other: "Aangepast commando:", - }, &i18n.Message{ - ID: "commitChangesWithoutHook", - Other: "commit veranderingen zonder pre-commit hook", - }, &i18n.Message{ - ID: "SkipHookPrefixNotConfigured", - Other: "Je hebt nog niet een commit bericht voorvoegsel ingesteld voor het overslaan van hooks. Set `git.skipHookPrefix = 'WIP'` in je config", - }, &i18n.Message{ - ID: "resetTo", - Other: `reset naar`, - }, &i18n.Message{ - ID: "pressEnterToReturn", - Other: "Press om terug te gaan naar lazygit", - }, &i18n.Message{ - ID: "viewStashOptions", - Other: "bekijk stash opties", - }, &i18n.Message{ - ID: "stashAllChanges", - Other: "stash-bestanden", - }, &i18n.Message{ - ID: "stashStagedChanges", - Other: "stash staged wijzigingen", - }, &i18n.Message{ - ID: "stashOptions", - Other: "Stash opties", - }, &i18n.Message{ - ID: "notARepository", - Other: "Fout: must be run inside a git repository", - }, &i18n.Message{ - ID: "jump", - Other: "ga naar paneel", - }, &i18n.Message{ - ID: "DiscardPatch", - Other: "Patch weg gooien", - }, &i18n.Message{ - ID: "DiscardPatchConfirm", - Other: "Je kan alleen maar een patch bouwen van 1 commit. actueel patch weg gooien?", - }, &i18n.Message{ - ID: "CantPatchWhileRebasingError", - Other: "Je kan geen patch bouwen of patch commando uitvoeren wanneer je in een merging of rebasing state zit", - }, &i18n.Message{ - ID: "toggleAddToPatch", - Other: "toggle bestand inbegrepen in patch", - }, &i18n.Message{ - ID: "ViewPatchOptions", - Other: "bekijk aangepaste patch opties", - }, &i18n.Message{ - ID: "PatchOptionsTitle", - Other: "Patch Opties", - }, &i18n.Message{ - ID: "NoPatchError", - Other: "Nog geen patch gecreëerd. Om een patch te bouwen gebruik 'space' op een commit bestand of 'enter' om een spesiefieke lijnen toe te voegen", - }, &i18n.Message{ - ID: "enterFile", - Other: "enter bestand to add selecteered lines to the patch", - }, &i18n.Message{ - ID: "ExitLineByLineMode", - Other: `sluit lijn-bij-lijn mode`, - }, &i18n.Message{ - ID: "EnterUpstream", - Other: `Enter upstream als ' '`, - }, &i18n.Message{ - ID: "EnterUpstreamWithSlash", - Other: `Enter upstream als '/'`, - }, &i18n.Message{ - ID: "notTrackingRemote", - Other: "(nog geen remote aan het volgen)", - }, &i18n.Message{ - ID: "ReturnToRemotesList", - Other: `Ga terug naar remotes lijst`, - }, &i18n.Message{ - ID: "addNewRemote", - Other: `voeg een nieuwe remote toe`, - }, &i18n.Message{ - ID: "newRemoteName", - Other: `Nieuwe remote name:`, - }, &i18n.Message{ - ID: "newRemoteUrl", - Other: `Nieuwe remote url:`, - }, &i18n.Message{ - ID: "editRemoteName", - Other: `Enter updated remote naam voor {{ .remoteName }}:`, - }, &i18n.Message{ - ID: "editRemoteUrl", - Other: `Enter updated remote url voor {{ .remoteName }}:`, - }, &i18n.Message{ - ID: "removeRemote", - Other: `verwijder remote`, - }, &i18n.Message{ - ID: "removeRemotePrompt", - Other: "Weet je zeker dat je deze remote wilt verwijderen", - }, &i18n.Message{ - ID: "DeleteRemoteBranch", - Other: "Verwijder Remote Branch", - }, &i18n.Message{ - ID: "DeleteRemoteBranchMessage", - Other: "Weet je zeker dat je deze remote branch wilt verwijderen", - }, &i18n.Message{ - ID: "setUpstream", - Other: "stel in als upstream van uitgecheckte branch", - }, &i18n.Message{ - ID: "SetUpstreamTitle", - Other: "Stel in als upstream branch", - }, &i18n.Message{ - ID: "SetUpstreamMessage", - Other: "Weet je zeker dat je de upstream branch van '{{.checkedOut}}' naar '{{.selected}}' wilt zetten", - }, &i18n.Message{ - ID: "editRemote", - Other: "wijzig remote", - }, &i18n.Message{ - ID: "tagCommit", - Other: "tag commit", - }, &i18n.Message{ - ID: "TagNameTitle", - Other: "Tag naam:", - }, &i18n.Message{ - ID: "deleteTag", - Other: "verwijder tag", - }, &i18n.Message{ - ID: "DeleteTagTitle", - Other: "Verwijder tag", - }, &i18n.Message{ - ID: "DeleteTagPrompt", - Other: "Weet je zeker dat je '{{.tagName}}' wil verwijderen?", - }, &i18n.Message{ - ID: "PushTagTitle", - Other: "remote om tag '{{.tagName}}' te pushen naar:", - }, &i18n.Message{ - ID: "pushTag", - Other: "push tag", - }, &i18n.Message{ - ID: "createTag", - Other: "creëer tag", - }, &i18n.Message{ - ID: "CreateTagTitle", - Other: "Tag naam:", - }, &i18n.Message{ - ID: "fetchRemote", - Other: "fetch remote", - }, &i18n.Message{ - ID: "FetchingRemoteStatus", - Other: "remote fetchen", - }, &i18n.Message{ - ID: "checkoutCommit", - Other: "checkout commit", - }, &i18n.Message{ - ID: "SureCheckoutThisCommit", - Other: "Weet je zeker dat je deze commit wil uitchecken?", - }, &i18n.Message{ - ID: "gitFlowOptions", - Other: "laat git-flow opties zien", - }, &i18n.Message{ - ID: "NotAGitFlowBranch", - Other: "Dit lijkt geen git flow branch te zijn", - }, &i18n.Message{ - ID: "NewBranchNamePrompt", - Other: "nieuwe {{.branchType}} naam:", - }, &i18n.Message{ - ID: "IgnoreTracked", - Other: "Negeer tracked bestand", - }, &i18n.Message{ - ID: "IgnoreTrackedPrompt", - Other: "weet je zeker dat je een getracked bestand wil negeeren?", - }, &i18n.Message{ - ID: "viewResetToUpstreamOptions", - Other: "bekijk upstream reset opties", - }, &i18n.Message{ - ID: "nextScreenMode", - Other: "volgende schermmode (normaal/half/groot )", - }, &i18n.Message{ - ID: "prevScreenMode", - Other: "vorige schermmode", - }, &i18n.Message{ - ID: "startSearch", - Other: "start met zoekken", - }, &i18n.Message{ - ID: "Panel", - Other: "Paneel", - }, &i18n.Message{ - ID: "Keybindings", - Other: "Sneltoetsen", - }, &i18n.Message{ - ID: "renameBranch", - Other: "hernoem branch", - }, &i18n.Message{ - ID: "NewBranchNamePrompt", - Other: "Noem een nieuwe branch naam", - }, &i18n.Message{ - ID: "RenameBranchWarning", - Other: "Deze branch volgt een remote. Deze actie zal alleen de locale branch name wijzigen niet de naam van de remote branch. Verder gaan?", - }, &i18n.Message{ - ID: "openMenu", - Other: "open menu", - }, &i18n.Message{ - ID: "closeMenu", - Other: "sluit menu", - }, &i18n.Message{ - ID: "resetCherryPick", - Other: "reset cherry-picked (gecopieerde) commits selectie", - }, &i18n.Message{ - ID: "nextTab", - Other: "volgende tab", - }, &i18n.Message{ - ID: "prevTab", - Other: "vorige tab", - }, &i18n.Message{ - ID: "cantUndoWhileRebasing", - Other: "Kan niet ongedaan maken terwijl je aan het rebasen bent", - }, &i18n.Message{ - ID: "cantRedoWhileRebasing", - Other: "Kan niet opnieuw doen (redo) terwijl je aan het rebasen bent", - }, &i18n.Message{ - ID: "MustStashWarning", - Other: "Een patch in de index stoppen verijst stashen en onstashen van je wijzigingen. Als iets verkeert gaat kan je je bestanden terug vinden in de stash. Verder gaan?", - }, &i18n.Message{ - ID: "MustStashTitle", - Other: "Moet stashen", - }, &i18n.Message{ - ID: "ConfirmationTitle", - Other: "Bevestigings Paneel", - }, &i18n.Message{ - ID: "prevPage", - Other: "vorige pagina", - }, &i18n.Message{ - ID: "nextPage", - Other: "volgende pagina", - }, &i18n.Message{ - ID: "gotoTop", - Other: "scroll naar boven", - }, &i18n.Message{ - ID: "gotoBottom", - Other: "scroll naar beneden", - }, &i18n.Message{ - ID: "filteringBy", - Other: "filteren bij", - }, &i18n.Message{ - ID: "(reset)", - Other: "(reset)", - }, &i18n.Message{ - ID: "openScopingMenu", - Other: "bekijk scoping opties", - }, &i18n.Message{ - ID: "filterBy", - Other: "filter bij", - }, &i18n.Message{ - ID: "exitFilterMode", - Other: "stop met filteren bij pad", - }, &i18n.Message{ - ID: "filterPathOption", - Other: "vulin pad om op te filteren", - }, &i18n.Message{ - ID: "enterFileName", - Other: "vulin path:", - }, &i18n.Message{ - ID: "FilteringMenuTitle", - Other: "Filteren", - }, &i18n.Message{ - ID: "MustExitFilterModeTitle", - Other: "Command niet beschikbaar", - }, &i18n.Message{ - ID: "MustExitFilterModePrompt", - Other: "Command niet beschikbaar in filter mode. Sluit filter mode?", - }, &i18n.Message{ - ID: "diff", - Other: "diff", - }, &i18n.Message{ - ID: "enterRefToDiff", - Other: "vulin ref to diff", - }, &i18n.Message{ - ID: "enteRefName", - Other: "vulin ref:", - }, &i18n.Message{ - ID: "exitDiffMode", - Other: "sluit diff mode", - }, &i18n.Message{ - ID: "DiffingMenuTitle", - Other: "Diffen", - }, &i18n.Message{ - ID: "swapDiff", - Other: "keer diff richting om", - }, &i18n.Message{ - ID: "openDiffingMenu", - Other: "open diff menu", - }, &i18n.Message{ - ID: "showingGitDiff", - Other: "laat output zien voor:", - }, &i18n.Message{ - ID: "copyCommitShaToClipboard", - Other: "copieer commit SHA naar clipboard", - }, &i18n.Message{ - ID: "copyBranchNameToClipboard", - Other: "copieer branch name naar clipboard", - }, &i18n.Message{ - ID: "copyFileNameToClipboard", - Other: "kopieer de bestandsnaam naar het klembord", - }, &i18n.Message{ - ID: "copyCommitFileNameToClipboard", - Other: "kopieer de vastgelegde bestandsnaam naar het klembord", - }, &i18n.Message{ - ID: "commitPrefixPatternError", - Other: "Fout in commitPrefix patroon", - }, &i18n.Message{ - ID: "NoFilesStagedTitle", - Other: "geen bestanden gestaged", - }, &i18n.Message{ - ID: "NoFilesStagedPrompt", - Other: "Je hebt geen bestanden gestaged. Commit alle bestanden?", - }, &i18n.Message{ - ID: "BranchNotFoundTitle", - Other: "Branch niet gevonden", - }, &i18n.Message{ - ID: "BranchNotFoundPrompt", - Other: "Branch niet gevonden. Creëer een nieuwe branch genaamd", - }, - ) +func dutchTranslationSet() TranslationSet { + return TranslationSet{ + NotEnoughSpace: "Niet genoeg ruimte om de panelen te renderen", + DiffTitle: "Diff", + LogTitle: "Log", + FilesTitle: "Bestanden", + BranchesTitle: "Branches", + CommitsTitle: "Commits", + StashTitle: "Stash", + UnstagedChanges: `Unstaged wijzigingen`, + StagedChanges: `Staged Wijzigingen`, + PatchBuildingMainTitle: `Voeg lijnen/hunks toe aan Patch`, + MergingMainTitle: "Los merge conflicten op", + MainTitle: "Hooft", + StagingTitle: "Staging", + NormalTitle: "Normaal", + CommitMessage: "Commit bericht", + CredentialsUsername: "Gebruikersnaam", + CredentialsPassword: "Wachtwoord", + PassUnameWrong: "Wachtwoord en/of gebruikersnaam verkeert", + CommitChanges: "Commit veranderingen", + AmendLastCommit: "wijzig laatste commit", + SureToAmend: "Weet je zeker dat je de laatste commit wilt wijzigen? U kunt het commit-bericht wijzigen vanuit het commits-paneel.", + NoCommitToAmend: "Er is geen commits om te wijzigen.", + CommitChangesWithEditor: "commit veranderingen met de git editor", + StatusTitle: "Status", + LcNavigate: "navigeer", + LcMenu: "menu", + LcExecute: "uitvoeren", + LcOpen: "open", + LcIgnore: "negeren", + LcDelete: "verwijderen", + LcToggleStaged: "toggle staged", + LcToggleStagedAll: "toggle staged alle", + LcRefresh: "verversen", + LcPush: "push", + LcPull: "pull", + LcEdit: "bewerken", + LcScroll: "scroll", + LcAbortMerge: "samenvoegen afbreken", + LcResolveMergeConflicts: "los merge conflicten op", + MergeConflictsTitle: "Merge Conflicten", + LcCheckout: "uitchecken", + FileHasNoUnstagedChanges: "Het bestand heeft geen unstaged veranderingen om toe te voegen", + CannotGitAdd: "Kan commando niet uitvoeren git add --path untracked files", + NoFilesDisplay: "Geen bestanden om te laten zien", + NotAFile: "Dit is geen bestand", + PullWait: "Pullen...", + PushWait: "Pushen...", + FetchWait: "Fetchen...", + FileNoMergeCons: "Dit bestand heeft geen merge conflicten", + LcSoftReset: "zacht reset", + SureTo: "Weet je het zeker dat je {{.fileName}} wilt {{.deleteVerb}} (je veranderingen zullen worden verwijderd)", + AlreadyCheckedOutBranch: "Je hebt deze branch al uitgecheckt", + SureForceCheckout: "Weet je zeker dat je het uitchecken wil forceren? Al je lokale verandering zullen worden verwijdert", + ForceCheckoutBranch: "Forceer uitchecken op deze branch", + BranchName: "Branch naam", + NewBranchNameBranchOff: "Nieuw branch naam (Branch is afgeleid van {{.branchName}})", + CantDeleteCheckOutBranch: "Je kan een uitgecheckte branch niet verwijderen!", + DeleteBranch: "Verwijder branch", + DeleteBranchMessage: "Weet je zeker dat je branch {{.selectedBranchName}} wilt verwijderen?", + ForceDeleteBranchMessage: "Weet je zeker dat je branch {{.selectedBranchName}} geforceerd wil verwijderen?", + LcRebaseBranch: "rebase branch", + CantRebaseOntoSelf: "Je kan niet een branch rebasen op zichzelf", + CantMergeBranchIntoItself: "Je kan niet een branch in zichzelf mergen", + LcForceCheckout: "forceer checkout", + LcMerge: "samenvoegen", + LcCheckoutByName: "uitchecken bij naam", + LcNewBranch: "nieuwe branch", + LcDeleteBranch: "verwijder branch", + LcForceDeleteBranch: "verwijder branch (forceer)", + NoBranchesThisRepo: "Geen branches voor deze repo", + NoTrackingThisBranch: "deze branch wordt niet gevolgd", + CommitMessageConfirm: "{{.keyBindClose}}: Sluiten, {{.keyBindNewLine}}: Nieuwe lijn, {{.keyBindConfirm}}: Bevestig", + CommitWithoutMessageErr: "Je kan geen commit maken zonder commit bericht", + CloseConfirm: "{{.keyBindClose}}: Sluiten, {{.keyBindConfirm}}: Bevestig", + LcClose: "sluiten", + LcQuit: "quit", + SureResetThisCommit: "Weet je het zeker dat je wil resetten naar deze commit?", + ResetToCommit: "Reset Naar Commit", + LcSquashDown: "squash beneden", + LcRename: "hernoemen", + LcResetToThisCommit: "reset naar deze commit", + LcFixupCommit: "Fixup commit", + OnlySquashTopmostCommit: "Kan alleen bovenste commit squashen", + YouNoCommitsToSquash: "Je hebt geen commits om mee te squashen", + CantFixupWhileUnstagedChanges: "Kan geen Fixup uitvoeren op unstaged veranderingen", + Fixup: "Fixup", + SureFixupThisCommit: "Weet je zeker dat je fixup wil uitvoeren op deze commit? De commit hieronder zol worden squashed in deze", + SureSquashThisCommit: "Weet je zeker dat je deze commit wil samenvoegen met de commit hieronder?", + Squash: "Squash", + LcPickCommit: "kies commit (wanneer midden in rebase)", + LcRevertCommit: "commit ongedaan maken", + OnlyRenameTopCommit: "Je kan alleen de bovenste commit hernoemen", + LcRenameCommit: "hernoem commit", + LcDeleteCommit: "verwijder commit", + LcMoveDownCommit: "verplaats commit 1 naar beneden", + LcMoveUpCommit: "verplaats commit 1 naar boven", + LcEditCommit: "wijzig commit", + LcAmendToCommit: "wijzig commit met staged veranderingen", + LcRenameCommitEditor: "hernoem commit met editor", + PotentialErrInGetselectedCommit: "Er is mogelijk een error in getSelected Commit (geen match tussen ui en state)", + NoCommitsThisBranch: "Geen commits in deze branch", + Error: "Foutmelding", + RunningSubprocess: "subprocess lopend", + LcSelectHunk: "selecteer stuk", + LcNavigateConflicts: "navigeer conflicts", + LcPickHunk: "kies stuk", + LcPickBothHunks: "kies beide stukken", + LcUndo: "ongedaan maken", + LcUndoReflog: "ongedaan maken (via reflog) (experimenteel)", + LcRedoReflog: "redo (via reflog) (experimenteel)", + LcPop: "pop", + LcDrop: "laten vallen", + LcApply: "toepassen", + NoStashEntries: "Geen stash items", + StashDrop: "Stash laten vallen", + SureDropStashEntry: "Weet je het zeker dat je deze stash entry wil laten vallen?", + StashPop: "Stash pop", + SurePopStashEntry: "Weet je zeker dat je deze stash entry wil poppen?", + StashApply: "Stash toepassen", + SureApplyStashEntry: "Weet je zeker dat je deze stash entry wil toepassen?", + NoStashTo: "Geen stash voor {{.method}}", + NoTrackedStagedFilesStash: "Je hebt geen tracked/staged bestanden om te laten stashen", + StashChanges: "Stash veranderingen", + IssntListOfViews: "{{.name}} is niet in de lijst van weergaves", + LcNewFocusedViewIs: "nieuw gefocussed weergave is {{.newFocusedView}}", + NoChangedFiles: "Geen veranderde bestanden", + MergeAborted: "Merge afgebroken", + OpenConfig: "open config bestand", + EditConfig: "verander config bestand", + ForcePush: "Forceer push", + ForcePushPrompt: "Jouw branch is afgeweken van de remote branch. Druk 'esc' om te annuleren, of 'enter' om geforceert te pushen.", + ForcePushDisabled: "Your branch has diverged from the remote branch and you've disabled force pushing", + UpdatesRejectedAndForcePushDisabled: "Updates were rejected and you have disabled force pushing", + LcCheckForUpdate: "check voor updates", + CheckingForUpdates: "zoeken naar updates...", + OnLatestVersionErr: "Je hebt al de laatste versie", + MajorVersionErr: "Nieuwe versie ({{.newVersion}}) is niet backwards compatibele vergeleken met de huidige versie ({{.currentVersion}})", + CouldNotFindBinaryErr: "Kon geen binary vinden op {{.url}}", + AnonymousReportingTitle: "Help lazygit te verbeteren", + AnonymousReportingPrompt: "Zou je anonieme data rapportage willen aanzetten om lazygit beter te kunnen maken? (enter/esc)", + IntroPopupMessage: "Bedankt voor het gebruik maken van lazygit! 2 dingen die je moet weten:\n\n1) Als je meer van lazygit zijn features wilt leren bekijk dan deze video:\n https://youtu.be/CPLdltN7wgE\n\n2) Als je git gebruikt, ben je een programmeur! Met jouw hulp kunnen we lazygit verbeteren, dus overweeg om een ​​donateur te worden en mee te doen aan het plezier op\n https://github.com/jesseduffield/lazygit", + GitconfigParseErr: `Gogit kon je gitconfig bestand niet goed parsen door de aanwezigheid van losstaande '\' tekens. Het weghalen van deze tekens zou het probleem moeten oplossen. `, + LcEditFile: `verander bestand`, + LcOpenFile: `open bestand`, + LcIgnoreFile: `voeg toe aan .gitignore`, + LcRefreshFiles: `refresh bestanden`, + LcMergeIntoCurrentBranch: `merge in met huidige checked out branch`, + ConfirmQuit: `Weet je zeker dat je dit programma wil sluiten?`, + SwitchRepo: "wissel naar een recente repo", + UnsupportedGitService: `Niet-ondersteunde git-service`, + LcCreatePullRequest: `maak een pull-aanvraag`, + NoBranchOnRemote: `Deze branch bestaat niet op de remote. U moet het eerst naar de remote pushen.`, + LcFetch: `fetch`, + NoAutomaticGitFetchTitle: `Geen automatische git fetch`, + NoAutomaticGitFetchBody: `Lazygit kan niet "git fetch" uitvoeren in een privé repository, gebruik f in het branches paneel om "git fetch" manueel uit te voeren`, + StageLines: `stage individuele hunks/lijnen`, + FileStagingRequirements: `Kan alleen individuele lijnen stagen van getrackte bestanden met onstaged veranderingen`, + SelectHunk: `selecteer hunk`, + StageSelection: `toggle lijnen staged / unstaged`, + ResetSelection: `verwijdert change (git reset)`, + ToggleDragSelect: `toggle drag selecteer`, + ToggleSelectHunk: `toggle selecteer hunk`, + ToggleSelectionForPatch: `voeg toe/verwijder lijn(en) in patch`, + TogglePanel: `ga naar een ander paneel`, + CantStageStaged: `Je kan niet al gestaged verandering stagen!`, + ReturnToFilesPanel: `ga terug naar het bestanden paneel`, + CantFindHunks: `Kan geen hunks vinden in deze patch`, + CantFindHunk: `Kan geen hunk vinden`, + FastForward: `fast-forward deze branch vanaf zijn upstream`, + Fetching: "fetching en fast-forwarding {{.from}} -> {{.to}} ...", + FoundConflicts: "Conflicten!, Om af te breken druk 'esc', anders druk op 'enter'", + FoundConflictsTitle: "Auto-merge mislukt", + Undo: "ongedaan maken", + PickHunk: "kies hunk", + PickBothHunks: "kies bijde hunks", + ViewMergeRebaseOptions: "bekijk merge/rebase opties", + NotMergingOrRebasing: "Je bent momenteel niet aan het rebasen of mergen", + RecentRepos: "recente repositories", + MergeOptionsTitle: "Merge Opties", + RebaseOptionsTitle: "Rebase Opties", + CommitMessageTitle: "Commit Bericht", + LocalBranchesTitle: "Branches Tab", + SearchTitle: "Zoek", + TagsTitle: "Tags Tab", + BranchCommitsTitle: "Commits Tab", + MenuTitle: "Menu", + RemotesTitle: "Remotes Tab", + CredentialsTitle: "Credentials", + RemoteBranchesTitle: "Remote Branches (in Remotes tab)", + PatchBuildingTitle: "Patch Bouwen", + InformationTitle: "Informatie", + SecondaryTitle: "Secondary", + ReflogCommitsTitle: "Reflog Tab", + Title: "Title", + GlobalTitle: "Globaale Sneltoetsen", + ConflictsResolved: "alle merge conflicten zijn opgelost. Wilt je verder gaan?", + RebasingTitle: "Rebasen", + MergingTitle: "Merggen", + ConfirmRebase: "Weet je zeker dat je {{.checkedOutBranch}} op {{.selectedBranch}} wil rebasen?", + ConfirmMerge: "Weet je zeker dat je {{.selectedBranch}} in {{.checkedOutBranch}} wil mergen?", + FwdNoUpstream: "Kan niet de branch vooruitspoelen zonder upstream", + FwdCommitsToPush: "Je kan niet vooruitspoelen als de branch geen nieuwe commits heeft", + ErrorOccurred: "Er is iets fout gegaan! Zou je hier een issue aan willen maken: https://github.com/jesseduffield/lazygit/issues", + NoRoom: "Niet genoeg ruimte", + YouAreHere: "JE BENT HIER", + LcRewordNotSupported: "herformatteren van commits in interactief rebasen is nog niet ondersteund", + LcCherryPickCopy: "kopiëer commit (cherry-pick)", + LcCherryPickCopyRange: "kopiëer commit reeks (cherry-pick)", + LcPasteCommits: "plak commits (cherry-pick)", + SureCherryPick: "Weet je zeker dat je de gekopieerde commits naar deze branch wil cherry-picken?", + CherryPick: "Cherry-Pick", + CannotRebaseOntoFirstCommit: "Je kan niet interactief rebasen naar de eerste commit", + CannotSquashOntoSecondCommit: "Je kan niet een squash/fixup doen naar de 2de commit", + Donate: "Doneer", + PrevLine: "selecteer de vorige lijn", + NextLine: "selecteer de volgende lijn", + PrevHunk: "selecteer de vorige hunk", + NextHunk: "selecteer de volgende hunk", + PrevConflict: "selecteer voorgaand conflict", + NextConflict: "selecteer volgende conflict", + SelectTop: "selecteer bovenste hunk", + SelectBottom: "selecteer onderste hunk", + ScrollDown: "scroll omlaag", + ScrollUp: "scroll omhoog", + LcScrollUpMainPanel: "scroll naar beneden vanaf hooft paneel", + LcScrollDownMainPanel: "scroll naar beneden vabaf hooft paneel", + AmendCommitTitle: "Commit wijzigen", + AmendCommitPrompt: "Weet je zeker dat je deze commit wil wijzigen met de vorige staged bestanden?", + DeleteCommitTitle: "Verwijder Commit", + DeleteCommitPrompt: "Weet je zeker dat je deze commit wil verwijderen?", + SquashingStatus: "squashen", + FixingStatus: "fixing up", + DeletingStatus: "verwijderen", + MovingStatus: "verplaatsen", + RebasingStatus: "rebasen", + AmendingStatus: "wijzigen", + CherryPickingStatus: "cherry-picken", + UndoingStatus: "ongedaan maken", + RedoingStatus: "redoing", + CheckingOutStatus: "uitchecken", + CommitFiles: "Commit bestanden", + LcViewCommitFiles: "bekijk gecommite bestanden", + CommitFilesTitle: "Commit bestanden", + LcGoBack: "ga terug", + NoCommiteFiles: "Geen bestanden voor deze commit", + LcCheckoutCommitFile: "bestand uitchecken", + LcDiscardOldFileChange: "uitsluit deze commit zijn veranderingen aan dit bestand", + DiscardFileChangesTitle: "uitsluit bestand zijn veranderingen", + DiscardFileChangesPrompt: "Weet je zeker dat je de wijzigingen van deze commit in dit bestand wilt weggooien? Als dit bestand is gecreëerd in deze commit dan zal dit bestand worden verwijdert", + DisabledForGPG: "Onderdelen niet beschikbaar voor gebruikers die GPG gebruiken", + CreateRepo: "Niet in een git repository. Creëer een nieuwe git repository? (y/n): ", + AutoStashTitle: "Autostash?", + AutoStashPrompt: "Je moet je veranderingen stashen en poppen om ze over te bregen. Dit automatisch doen? (enter/esc)", + StashPrefix: "Auto-stashing veranderingen voor ", + LcViewDiscardOptions: "bekijk 'veranderingen ongedaan maken' opties", + LcCancel: "anuleren", + LcDiscardAllChanges: "negeer alle wijzigingen", + LcDiscardUnstagedChanges: "negeer unstaged wijzigingen", + LcDiscardAllChangesToAllFiles: "verwijder werkende tree", + LcDiscardAnyUnstagedChanges: "discard unstaged wijzigingen", + LcDiscardUntrackedFiles: "negeer niet-gevonden bestanden", + LcViewResetOptions: `bekijk reset opties`, + LcHardReset: "harde reset", + LcHardResetUpstream: "harde naar upstream branch", + LcCreateFixupCommit: `creëer fixup commit voor deze commit`, + LcSquashAboveCommits: `squash bovenstaande commits`, + SquashAboveCommits: `Squash bovenstaande commits`, + SureSquashAboveCommits: `Weet je zeker dat je alles wil squash/fixup! voor de bovenstaand commits {{.commit}}?`, + CreateFixupCommit: `Creëer fixup commit`, + SureCreateFixupCommit: `Weet je zeker dat je een fixup wil maken! commit voor commit {{.commit}}?`, + LcExecuteCustomCommand: "voor aangepast commando uit", + CustomCommand: "Aangepast commando:", + LcCommitChangesWithoutHook: "commit veranderingen zonder pre-commit hook", + SkipHookPrefixNotConfigured: "Je hebt nog niet een commit bericht voorvoegsel ingesteld voor het overslaan van hooks. Set `git.skipHookPrefix = 'WIP'` in je config", + LcResetTo: `reset naar`, + PressEnterToReturn: "Press om terug te gaan naar lazygit", + LcViewStashOptions: "bekijk stash opties", + LcStashAllChanges: "stash-bestanden", + LcStashStagedChanges: "stash staged wijzigingen", + LcStashOptions: "Stash opties", + NotARepository: "Fout: must be run inside a git repository", + LcJump: "ga naar paneel", + DiscardPatch: "Patch weg gooien", + DiscardPatchConfirm: "Je kan alleen maar een patch bouwen van 1 commit. actueel patch weg gooien?", + CantPatchWhileRebasingError: "Je kan geen patch bouwen of patch commando uitvoeren wanneer je in een merging of rebasing state zit", + LcToggleAddToPatch: "toggle bestand inbegrepen in patch", + ViewPatchOptions: "bekijk aangepaste patch opties", + PatchOptionsTitle: "Patch Opties", + NoPatchError: "Nog geen patch gecreëerd. Om een patch te bouwen gebruik 'space' op een commit bestand of 'enter' om een spesiefieke lijnen toe te voegen", + LcEnterFile: "enter bestand to add selecteered lines to the patch", + ExitLineByLineMode: `sluit lijn-bij-lijn mode`, + EnterUpstream: `Enter upstream als ' '`, + EnterUpstreamWithSlash: `Enter upstream als '/'`, + LcNotTrackingRemote: "(nog geen remote aan het volgen)", + ReturnToRemotesList: `Ga terug naar remotes lijst`, + LcAddNewRemote: `voeg een nieuwe remote toe`, + LcNewRemoteName: `Nieuwe remote name:`, + LcNewRemoteUrl: `Nieuwe remote url:`, + LcEditRemoteName: `Enter updated remote naam voor {{ .remoteName }}:`, + LcEditRemoteUrl: `Enter updated remote url voor {{ .remoteName }}:`, + LcRemoveRemote: `verwijder remote`, + LcRemoveRemotePrompt: "Weet je zeker dat je deze remote wilt verwijderen", + DeleteRemoteBranch: "Verwijder Remote Branch", + DeleteRemoteBranchMessage: "Weet je zeker dat je deze remote branch wilt verwijderen", + LcSetUpstream: "stel in als upstream van uitgecheckte branch", + SetUpstreamTitle: "Stel in als upstream branch", + SetUpstreamMessage: "Weet je zeker dat je de upstream branch van '{{.checkedOut}}' naar '{{.selected}}' wilt zetten", + LcEditRemote: "wijzig remote", + LcTagCommit: "tag commit", + TagNameTitle: "Tag naam:", + LcDeleteTag: "verwijder tag", + DeleteTagTitle: "Verwijder tag", + DeleteTagPrompt: "Weet je zeker dat je '{{.tagName}}' wil verwijderen?", + PushTagTitle: "remote om tag '{{.tagName}}' te pushen naar:", + LcPushTag: "push tag", + LcCreateTag: "creëer tag", + CreateTagTitle: "Tag naam:", + LcFetchRemote: "fetch remote", + FetchingRemoteStatus: "remote fetchen", + LcCheckoutCommit: "checkout commit", + SureCheckoutThisCommit: "Weet je zeker dat je deze commit wil uitchecken?", + LcGitFlowOptions: "laat git-flow opties zien", + NotAGitFlowBranch: "Dit lijkt geen git flow branch te zijn", + NewGitFlowBranchPrompt: "nieuwe {{.branchType}} naam:", + IgnoreTracked: "Negeer tracked bestand", + IgnoreTrackedPrompt: "weet je zeker dat je een getracked bestand wil negeeren?", + LcViewResetToUpstreamOptions: "bekijk upstream reset opties", + LcNextScreenMode: "volgende schermmode (normaal/half/groot )", + LcPrevScreenMode: "vorige schermmode", + LcStartSearch: "start met zoekken", + Panel: "Paneel", + Keybindings: "Sneltoetsen", + LcRenameBranch: "hernoem branch", + NewBranchNamePrompt: "Noem een nieuwe branch naam", + RenameBranchWarning: "Deze branch volgt een remote. Deze actie zal alleen de locale branch name wijzigen niet de naam van de remote branch. Verder gaan?", + LcOpenMenu: "open menu", + LcCloseMenu: "sluit menu", + LcResetCherryPick: "reset cherry-picked (gecopieerde) commits selectie", + LcNextTab: "volgende tab", + LcPrevTab: "vorige tab", + LcCantUndoWhileRebasing: "Kan niet ongedaan maken terwijl je aan het rebasen bent", + LcCantRedoWhileRebasing: "Kan niet opnieuw doen (redo) terwijl je aan het rebasen bent", + MustStashWarning: "Een patch in de index stoppen verijst stashen en onstashen van je wijzigingen. Als iets verkeert gaat kan je je bestanden terug vinden in de stash. Verder gaan?", + MustStashTitle: "Moet stashen", + ConfirmationTitle: "Bevestigings Paneel", + LcPrevPage: "vorige pagina", + LcNextPage: "volgende pagina", + LcGotoTop: "scroll naar boven", + LcGotoBottom: "scroll naar beneden", + LcFilteringBy: "filteren bij", + ResetInParentheses: "(reset)", + LcOpenScopingMenu: "bekijk scoping opties", + LcFilterBy: "filter bij", + LcExitFilterMode: "stop met filteren bij pad", + LcFilterPathOption: "vulin pad om op te filteren", + LcEnterFileName: "vulin path:", + FilteringMenuTitle: "Filteren", + MustExitFilterModeTitle: "Command niet beschikbaar", + MustExitFilterModePrompt: "Command niet beschikbaar in filter mode. Sluit filter mode?", + LcDiff: "diff", + LcEnterRefToDiff: "vulin ref to diff", + LcEnteRefName: "vulin ref:", + LcExitDiffMode: "sluit diff mode", + DiffingMenuTitle: "Diffen", + LcSwapDiff: "keer diff richting om", + LcOpenDiffingMenu: "open diff menu", + LcShowingGitDiff: "laat output zien voor:", + LcCopyCommitShaToClipboard: "copieer commit SHA naar clipboard", + LcCopyBranchNameToClipboard: "copieer branch name naar clipboard", + LcCopyFileNameToClipboard: "kopieer de bestandsnaam naar het klembord", + LcCopyCommitFileNameToClipboard: "kopieer de vastgelegde bestandsnaam naar het klembord", + LcCommitPrefixPatternError: "Fout in commitPrefix patroon", + NoFilesStagedTitle: "geen bestanden gestaged", + NoFilesStagedPrompt: "Je hebt geen bestanden gestaged. Commit alle bestanden?", + BranchNotFoundTitle: "Branch niet gevonden", + BranchNotFoundPrompt: "Branch niet gevonden. Creëer een nieuwe branch genaamd", + } } diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index acaf233ff..9e8feca60 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -10,1277 +10,838 @@ Todo list when making a new translation package i18n -import ( - "github.com/nicksnyder/go-i18n/v2/i18n" - "golang.org/x/text/language" -) - -func addEnglish(i18nObject *i18n.Bundle) error { - - return i18nObject.AddMessages(language.English, - &i18n.Message{ - ID: "NotEnoughSpace", - Other: "Not enough space to render panels", - }, &i18n.Message{ - ID: "DiffTitle", - Other: "Diff", - }, &i18n.Message{ - ID: "LogTitle", - Other: "Log", - }, &i18n.Message{ - ID: "FilesTitle", - Other: "Files", - }, &i18n.Message{ - ID: "BranchesTitle", - Other: "Branches", - }, &i18n.Message{ - ID: "CommitsTitle", - Other: "Commits", - }, &i18n.Message{ - ID: "StashTitle", - Other: "Stash", - }, &i18n.Message{ - ID: "UnstagedChanges", - Other: `Unstaged Changes`, - }, &i18n.Message{ - ID: "StagedChanges", - Other: `Staged Changes`, - }, &i18n.Message{ - ID: "PatchBuildingMainTitle", - Other: `Add Lines/Hunks To Patch`, - }, &i18n.Message{ - ID: "MergingMainTitle", - Other: "Resolve merge conflicts", - }, &i18n.Message{ - ID: "MainTitle", - Other: "Main", - }, &i18n.Message{ - ID: "StagingTitle", - Other: "Staging", - }, &i18n.Message{ - ID: "MergingTitle", - Other: "Merging", - }, &i18n.Message{ - ID: "NormalTitle", - Other: "Normal", - }, &i18n.Message{ - ID: "CommitMessage", - Other: "Commit message", - }, &i18n.Message{ - ID: "CredentialsUsername", - Other: "Username", - }, &i18n.Message{ - ID: "CredentialsPassword", - Other: "Password", - }, &i18n.Message{ - ID: "PassUnameWrong", - Other: "Password and/or username wrong", - }, &i18n.Message{ - ID: "CommitChanges", - Other: "commit changes", - }, &i18n.Message{ - ID: "AmendLastCommit", - Other: "amend last commit", - }, &i18n.Message{ - ID: "SureToAmend", - Other: "Are you sure you want to amend last commit? Afterwards, you can change commit message from the commits panel.", - }, &i18n.Message{ - ID: "NoCommitToAmend", - Other: "There's no commit to amend.", - }, &i18n.Message{ - ID: "CommitChangesWithEditor", - Other: "commit changes using git editor", - }, &i18n.Message{ - ID: "StatusTitle", - Other: "Status", - }, &i18n.Message{ - ID: "GlobalTitle", - Other: "Global", - }, &i18n.Message{ - ID: "navigate", - Other: "navigate", - }, &i18n.Message{ - ID: "menu", - Other: "menu", - }, &i18n.Message{ - ID: "execute", - Other: "execute", - }, &i18n.Message{ - ID: "open", - Other: "open", - }, &i18n.Message{ - ID: "ignore", - Other: "ignore", - }, &i18n.Message{ - ID: "delete", - Other: "delete", - }, &i18n.Message{ - ID: "toggleStaged", - Other: "toggle staged", - }, &i18n.Message{ - ID: "toggleStagedAll", - Other: "stage/unstage all", - }, &i18n.Message{ - ID: "refresh", - Other: "refresh", - }, &i18n.Message{ - ID: "push", - Other: "push", - }, &i18n.Message{ - ID: "pull", - Other: "pull", - }, &i18n.Message{ - ID: "edit", - Other: "edit", - }, &i18n.Message{ - ID: "scroll", - Other: "scroll", - }, &i18n.Message{ - ID: "abortMerge", - Other: "abort merge", - }, &i18n.Message{ - ID: "resolveMergeConflicts", - Other: "resolve merge conflicts", - }, &i18n.Message{ - ID: "MergeConflictsTitle", - Other: "Merge Conflicts", - }, &i18n.Message{ - ID: "checkout", - Other: "checkout", - }, &i18n.Message{ - ID: "NoChangedFiles", - Other: "No changed files", - }, &i18n.Message{ - ID: "FileHasNoUnstagedChanges", - Other: "File has no unstaged changes to add", - }, &i18n.Message{ - ID: "CannotGitAdd", - Other: "Cannot git add --patch untracked files", - }, &i18n.Message{ - ID: "NoFilesDisplay", - Other: "No file to display", - }, &i18n.Message{ - ID: "NotAFile", - Other: "Not a file", - }, &i18n.Message{ - ID: "PullWait", - Other: "Pulling...", - }, &i18n.Message{ - ID: "PushWait", - Other: "Pushing...", - }, &i18n.Message{ - ID: "FetchWait", - Other: "Fetching...", - }, &i18n.Message{ - ID: "FileNoMergeCons", - Other: "This file has no inline merge conflicts", - }, &i18n.Message{ - ID: "softReset", - Other: "soft reset", - }, &i18n.Message{ - ID: "SureTo", - Other: "Are you sure you want to {{.deleteVerb}} {{.fileName}} (you will lose your changes)?", - }, &i18n.Message{ - ID: "AlreadyCheckedOutBranch", - Other: "You have already checked out this branch", - }, &i18n.Message{ - ID: "SureForceCheckout", - Other: "Are you sure you want force checkout? You will lose all local changes", - }, &i18n.Message{ - ID: "ForceCheckoutBranch", - Other: "Force Checkout Branch", - }, &i18n.Message{ - ID: "BranchName", - Other: "Branch name", - }, &i18n.Message{ - ID: "NewBranchNameBranchOff", - Other: "New Branch Name (Branch is off of {{.branchName}})", - }, &i18n.Message{ - ID: "CantDeleteCheckOutBranch", - Other: "You cannot delete the checked out branch!", - }, &i18n.Message{ - ID: "DeleteBranch", - Other: "Delete Branch", - }, &i18n.Message{ - ID: "DeleteBranchMessage", - Other: "Are you sure you want to delete the branch {{.selectedBranchName}}?", - }, &i18n.Message{ - ID: "ForceDeleteBranchMessage", - Other: "{{.selectedBranchName}} is not fully merged. Are you sure you want to delete it?", - }, &i18n.Message{ - ID: "rebaseBranch", - Other: "rebase checked-out branch onto this branch", - }, &i18n.Message{ - ID: "CantRebaseOntoSelf", - Other: "You cannot rebase a branch onto itself", - }, &i18n.Message{ - ID: "CantMergeBranchIntoItself", - Other: "You cannot merge a branch into itself", - }, &i18n.Message{ - ID: "forceCheckout", - Other: "force checkout", - }, &i18n.Message{ - ID: "merge", - Other: "merge", - }, &i18n.Message{ - ID: "checkoutByName", - Other: "checkout by name", - }, &i18n.Message{ - ID: "newBranch", - Other: "new branch", - }, &i18n.Message{ - ID: "deleteBranch", - Other: "delete branch", - }, &i18n.Message{ - ID: "forceDeleteBranch", - Other: "delete branch (force)", - }, &i18n.Message{ - ID: "NoBranchesThisRepo", - Other: "No branches for this repo", - }, &i18n.Message{ - ID: "NoTrackingThisBranch", - Other: "There is no tracking for this branch", - }, &i18n.Message{ - ID: "CommitMessageConfirm", - Other: "{{.keyBindClose}}: close, {{.keyBindNewLine}}: new line, {{.keyBindConfirm}}: confirm", - }, &i18n.Message{ - ID: "CommitWithoutMessageErr", - Other: "You cannot commit without a commit message", - }, &i18n.Message{ - ID: "CloseConfirm", - Other: "{{.keyBindClose}}: close, {{.keyBindConfirm}}: confirm", - }, &i18n.Message{ - ID: "close", - Other: "close", - }, &i18n.Message{ - ID: "quit", - Other: "quit", - }, &i18n.Message{ - ID: "SureResetThisCommit", - Other: "Are you sure you want to reset to this commit?", - }, &i18n.Message{ - ID: "ResetToCommit", - Other: "Reset To Commit", - }, &i18n.Message{ - ID: "squashDown", - Other: "squash down", - }, &i18n.Message{ - ID: "rename", - Other: "rename", - }, &i18n.Message{ - ID: "resetToThisCommit", - Other: "reset to this commit", - }, &i18n.Message{ - ID: "fixupCommit", - Other: "fixup commit", - }, &i18n.Message{ - ID: "NoCommitsThisBranch", - Other: "No commits for this branch", - }, &i18n.Message{ - ID: "OnlySquashTopmostCommit", - Other: "Can only squash topmost commit", - }, &i18n.Message{ - ID: "YouNoCommitsToSquash", - Other: "You have no commits to squash with", - }, &i18n.Message{ - ID: "CantFixupWhileUnstagedChanges", - Other: "Can't fixup while there are unstaged changes", - }, &i18n.Message{ - ID: "Fixup", - Other: "Fixup", - }, &i18n.Message{ - ID: "SureFixupThisCommit", - Other: "Are you sure you want to 'fixup' this commit? It will be merged into the commit below", - }, &i18n.Message{ - ID: "SureSquashThisCommit", - Other: "Are you sure you want to squash this commit into the commit below?", - }, &i18n.Message{ - ID: "Squash", - Other: "Squash", - }, &i18n.Message{ - ID: "pickCommit", - Other: "pick commit (when mid-rebase)", - }, &i18n.Message{ - ID: "revertCommit", - Other: "revert commit", - }, &i18n.Message{ - ID: "OnlyRenameTopCommit", - Other: "Can only reword topmost commit from within lazygit. Use shift+R instead", - }, &i18n.Message{ - ID: "renameCommit", - Other: "reword commit", - }, &i18n.Message{ - ID: "deleteCommit", - Other: "delete commit", - }, &i18n.Message{ - ID: "moveDownCommit", - Other: "move commit down one", - }, &i18n.Message{ - ID: "moveUpCommit", - Other: "move commit up one", - }, &i18n.Message{ - ID: "editCommit", - Other: "edit commit", - }, &i18n.Message{ - ID: "amendToCommit", - Other: "amend commit with staged changes", - }, &i18n.Message{ - ID: "renameCommitEditor", - Other: "rename commit with editor", - }, &i18n.Message{ - ID: "PotentialErrInGetselectedCommit", - Other: "potential error in getSelected Commit (mismatched ui and state)", - }, &i18n.Message{ - ID: "NoCommitsThisBranch", - Other: "No commits for this branch", - }, &i18n.Message{ - ID: "Error", - Other: "Error", - }, &i18n.Message{ - ID: "RunningSubprocess", - Other: "running subprocess", - }, &i18n.Message{ - ID: "selectHunk", - Other: "select hunk", - }, &i18n.Message{ - ID: "navigateConflicts", - Other: "navigate conflicts", - }, &i18n.Message{ - ID: "pickHunk", - Other: "pick hunk", - }, &i18n.Message{ - ID: "pickBothHunks", - Other: "pick both hunks", - }, &i18n.Message{ - ID: "undo", - Other: "undo", - }, &i18n.Message{ - ID: "undoReflog", - Other: "undo (via reflog) (experimental)", - }, &i18n.Message{ - ID: "redoReflog", - Other: "redo (via reflog) (experimental)", - }, &i18n.Message{ - ID: "pop", - Other: "pop", - }, &i18n.Message{ - ID: "drop", - Other: "drop", - }, &i18n.Message{ - ID: "apply", - Other: "apply", - }, &i18n.Message{ - ID: "NoStashEntries", - Other: "No stash entries", - }, &i18n.Message{ - ID: "StashDrop", - Other: "Stash drop", - }, &i18n.Message{ - ID: "SureDropStashEntry", - Other: "Are you sure you want to drop this stash entry?", - }, &i18n.Message{ - ID: "StashPop", - Other: "Stash pop", - }, &i18n.Message{ - ID: "SurePopStashEntry", - Other: "Are you sure you want to pop this stash entry?", - }, &i18n.Message{ - ID: "StashApply", - Other: "Stash apply", - }, &i18n.Message{ - ID: "SureApplyStashEntry", - Other: "Are you sure you want to apply this stash entry?", - }, &i18n.Message{ - ID: "NoStashTo", - Other: "No stash to {{.method}}", - }, &i18n.Message{ - ID: "NoTrackedStagedFilesStash", - Other: "You have no tracked/staged files to stash", - }, &i18n.Message{ - ID: "StashChanges", - Other: "Stash changes", - }, &i18n.Message{ - ID: "IssntListOfViews", - Other: "{{.name}} is not in the list of views", - }, &i18n.Message{ - ID: "newFocusedViewIs", - Other: "new focused view is {{.newFocusedView}}", - }, &i18n.Message{ - ID: "NoChangedFiles", - Other: "No changed files", - }, &i18n.Message{ - ID: "MergeAborted", - Other: "Merge aborted", - }, &i18n.Message{ - ID: "OpenConfig", - Other: "open config file", - }, &i18n.Message{ - ID: "EditConfig", - Other: "edit config file", - }, &i18n.Message{ - ID: "ForcePush", - Other: "Force push", - }, &i18n.Message{ - ID: "ForcePushPrompt", - Other: "Your branch has diverged from the remote branch. Press 'esc' to cancel, or 'enter' to force push.", - }, &i18n.Message{ - ID: "ForcePushDisabled", - Other: "Your branch has diverged from the remote branch and you've disabled force pushing", - }, &i18n.Message{ - ID: "UpdatesRejectedAndForcePushDisabled", - Other: "Updates were rejected and you have disabled force pushing", - }, &i18n.Message{ - ID: "checkForUpdate", - Other: "check for update", - }, &i18n.Message{ - ID: "CheckingForUpdates", - Other: "Checking for updates...", - }, &i18n.Message{ - ID: "OnLatestVersionErr", - Other: "You already have the latest version", - }, &i18n.Message{ - ID: "MajorVersionErr", - Other: "New version ({{.newVersion}}) has non-backwards compatible changes compared to the current version ({{.currentVersion}})", - }, &i18n.Message{ - ID: "CouldNotFindBinaryErr", - Other: "Could not find any binary at {{.url}}", - }, &i18n.Message{ - ID: "AnonymousReportingTitle", - Other: "Help make lazygit better", - }, &i18n.Message{ - ID: "AnonymousReportingPrompt", - Other: "Would you like to enable anonymous reporting data to help improve lazygit? (enter/esc)", - }, &i18n.Message{ - ID: "IntroPopupMessage", - Other: `Thanks for using lazygit! Two things to share with you: - -1) If you want to learn about lazygit's features, watch this vid: - https://youtu.be/CPLdltN7wgE - -2) If you're using git, that makes you a programmer! With your help we can make lazygit better, so consider becoming a contributor and joining the fun at - https://github.com/jesseduffield/lazygit`, - }, &i18n.Message{ - ID: "GitconfigParseErr", - Other: `Gogit failed to parse your gitconfig file due to the presence of unquoted '\' characters. Removing these should fix the issue.`, - }, &i18n.Message{ - ID: "editFile", - Other: `edit file`, - }, &i18n.Message{ - ID: "openFile", - Other: `open file`, - }, &i18n.Message{ - ID: "ignoreFile", - Other: `add to .gitignore`, - }, &i18n.Message{ - ID: "refreshFiles", - Other: `refresh files`, - }, &i18n.Message{ - ID: "mergeIntoCurrentBranch", - Other: `merge into currently checked out branch`, - }, &i18n.Message{ - ID: "ConfirmQuit", - Other: `Are you sure you want to quit?`, - }, &i18n.Message{ - ID: "SwitchRepo", - Other: `switch to a recent repo`, - }, &i18n.Message{ - ID: "UnsupportedGitService", - Other: `Unsupported git service`, - }, &i18n.Message{ - ID: "createPullRequest", - Other: `create pull request`, - }, &i18n.Message{ - ID: "NoBranchOnRemote", - Other: `This branch doesn't exist on remote. You need to push it to remote first.`, - }, &i18n.Message{ - ID: "fetch", - Other: `fetch`, - }, &i18n.Message{ - ID: "NoAutomaticGitFetchTitle", - Other: `No automatic git fetch`, - }, &i18n.Message{ - ID: "NoAutomaticGitFetchBody", - Other: `Lazygit can't use "git fetch" in a private repo; use 'f' in the files panel to run "git fetch" manually`, - }, &i18n.Message{ - ID: "StageLines", - Other: `stage individual hunks/lines`, - }, &i18n.Message{ - ID: "FileStagingRequirements", - Other: `Can only stage individual lines for tracked files`, - }, &i18n.Message{ - ID: "SelectHunk", - Other: `select hunk`, - }, &i18n.Message{ - ID: "StageSelection", - Other: `toggle line staged / unstaged`, - }, &i18n.Message{ - ID: "ResetSelection", - Other: `delete change (git reset)`, - }, &i18n.Message{ - ID: "ToggleDragSelect", - Other: `toggle drag select`, - }, &i18n.Message{ - ID: "ToggleSelectHunk", - Other: `toggle select hunk`, - }, &i18n.Message{ - ID: "ToggleSelectionForPatch", - Other: `add/remove line(s) to patch`, - }, &i18n.Message{ - ID: "TogglePanel", - Other: `switch to other panel`, - }, &i18n.Message{ - ID: "CantStageStaged", - Other: `You can't stage an already staged change!`, - }, &i18n.Message{ - ID: "ReturnToFilesPanel", - Other: `return to files panel`, - }, &i18n.Message{ - ID: "CantFindHunks", - Other: `Could not find any hunks in this patch`, - }, &i18n.Message{ - ID: "CantFindHunk", - Other: `Could not find hunk`, - }, &i18n.Message{ - ID: "FastForward", - Other: `fast-forward this branch from its upstream`, - }, &i18n.Message{ - ID: "Fetching", - Other: "fetching and fast-forwarding {{.from}} -> {{.to}} ...", - }, &i18n.Message{ - ID: "FoundConflicts", - Other: "Conflicts! To abort press 'esc', otherwise press 'enter'", - }, &i18n.Message{ - ID: "FoundConflictsTitle", - Other: "Auto-merge failed", - }, &i18n.Message{ - ID: "Undo", - Other: "undo", - }, &i18n.Message{ - ID: "PickHunk", - Other: "pick hunk", - }, &i18n.Message{ - ID: "PickBothHunks", - Other: "pick both hunks", - }, &i18n.Message{ - ID: "ViewMergeRebaseOptions", - Other: "view merge/rebase options", - }, &i18n.Message{ - ID: "NotMergingOrRebasing", - Other: "You are currently neither rebasing nor merging", - }, &i18n.Message{ - ID: "RecentRepos", - Other: "recent repositories", - }, &i18n.Message{ - ID: "MergeOptionsTitle", - Other: "Merge Options", - }, &i18n.Message{ - ID: "RebaseOptionsTitle", - Other: "Rebase Options", - }, &i18n.Message{ - ID: "CommitMessageTitle", - Other: "Commit Message", - }, &i18n.Message{ - ID: "LocalBranchesTitle", - Other: "Branches Tab", - }, &i18n.Message{ - ID: "SearchTitle", - Other: "Search", - }, &i18n.Message{ - ID: "TagsTitle", - Other: "Tags Tab", - }, &i18n.Message{ - ID: "BranchCommitsTitle", - Other: "Commits Tab", - }, &i18n.Message{ - ID: "MenuTitle", - Other: "Menu", - }, &i18n.Message{ - ID: "RemotesTitle", - Other: "Remotes Tab", - }, &i18n.Message{ - ID: "CredentialsTitle", - Other: "Credentials", - }, &i18n.Message{ - ID: "RemoteBranchesTitle", - Other: "Remote Branches (in Remotes tab)", - }, &i18n.Message{ - ID: "PatchBuildingTitle", - Other: "Patch Building", - }, &i18n.Message{ - ID: "InformationTitle", - Other: "Information", - }, &i18n.Message{ - ID: "SecondaryTitle", - Other: "Secondary", - }, &i18n.Message{ - ID: "ReflogCommitsTitle", - Other: "Reflog Tab", - }, &i18n.Message{ - ID: "Title", - Other: "Title", - }, &i18n.Message{ - ID: "GlobalTitle", - Other: "Global Keybindings", - }, &i18n.Message{ - ID: "MerginTitle", - Other: "Mergin", - }, &i18n.Message{ - ID: "ConflictsResolved", - Other: "all merge conflicts resolved. Continue?", - }, &i18n.Message{ - ID: "RebasingTitle", - Other: "Rebasing", - }, &i18n.Message{ - ID: "MergingTitle", - Other: "Merging", - }, &i18n.Message{ - ID: "ConfirmRebase", - Other: "Are you sure you want to rebase {{.checkedOutBranch}} onto {{.selectedBranch}}?", - }, &i18n.Message{ - ID: "ConfirmMerge", - Other: "Are you sure you want to merge {{.selectedBranch}} into {{.checkedOutBranch}}?", - }, &i18n.Message{}, &i18n.Message{ - ID: "FwdNoUpstream", - Other: "Cannot fast-forward a branch with no upstream", - }, &i18n.Message{ - ID: "FwdCommitsToPush", - Other: "Cannot fast-forward a branch with commits to push", - }, &i18n.Message{ - ID: "ErrorOccurred", - Other: "An error occurred! Please create an issue at https://github.com/jesseduffield/lazygit/issues", - }, &i18n.Message{ - ID: "NoRoom", - Other: "Not enough room", - }, &i18n.Message{ - ID: "YouAreHere", - Other: "YOU ARE HERE", - }, &i18n.Message{ - ID: "rewordNotSupported", - Other: "rewording commits while interactively rebasing is not currently supported", - }, &i18n.Message{ - ID: "cherryPickCopy", - Other: "copy commit (cherry-pick)", - }, &i18n.Message{ - ID: "cherryPickCopyRange", - Other: "copy commit range (cherry-pick)", - }, &i18n.Message{ - ID: "pasteCommits", - Other: "paste commits (cherry-pick)", - }, &i18n.Message{ - ID: "SureCherryPick", - Other: "Are you sure you want to cherry-pick the copied commits onto this branch?", - }, &i18n.Message{ - ID: "CherryPick", - Other: "Cherry-Pick", - }, &i18n.Message{ - ID: "CannotRebaseOntoFirstCommit", - Other: "You cannot interactive rebase onto the first commit", - }, &i18n.Message{ - ID: "CannotSquashOntoSecondCommit", - Other: "You cannot squash/fixup onto the second commit", - }, &i18n.Message{ - ID: "Donate", - Other: "Donate", - }, &i18n.Message{ - ID: "PrevLine", - Other: "select previous line", - }, &i18n.Message{ - ID: "NextLine", - Other: "select next line", - }, &i18n.Message{ - ID: "PrevHunk", - Other: "select previous hunk", - }, &i18n.Message{ - ID: "NextHunk", - Other: "select next hunk", - }, &i18n.Message{ - ID: "PrevConflict", - Other: "select previous conflict", - }, &i18n.Message{ - ID: "NextConflict", - Other: "select next conflict", - }, &i18n.Message{ - ID: "SelectTop", - Other: "select top hunk", - }, &i18n.Message{ - ID: "SelectBottom", - Other: "select bottom hunk", - }, &i18n.Message{ - ID: "ScrollDown", - Other: "scroll down", - }, &i18n.Message{ - ID: "ScrollUp", - Other: "scroll up", - }, &i18n.Message{ - ID: "scrollUpMainPanel", - Other: "scroll up main panel", - }, &i18n.Message{ - ID: "scrollDownMainPanel", - Other: "scroll down main panel", - }, &i18n.Message{ - ID: "AmendCommitTitle", - Other: "Amend Commit", - }, &i18n.Message{ - ID: "AmendCommitPrompt", - Other: "Are you sure you want to amend this commit with your staged files?", - }, &i18n.Message{ - ID: "DeleteCommitTitle", - Other: "Delete Commit", - }, &i18n.Message{ - ID: "DeleteCommitPrompt", - Other: "Are you sure you want to delete this commit?", - }, &i18n.Message{ - ID: "SquashingStatus", - Other: "squashing", - }, &i18n.Message{ - ID: "FixingStatus", - Other: "fixing up", - }, &i18n.Message{ - ID: "DeletingStatus", - Other: "deleting", - }, &i18n.Message{ - ID: "MovingStatus", - Other: "moving", - }, &i18n.Message{ - ID: "RebasingStatus", - Other: "rebasing", - }, &i18n.Message{ - ID: "AmendingStatus", - Other: "amending", - }, &i18n.Message{ - ID: "CherryPickingStatus", - Other: "cherry-picking", - }, &i18n.Message{ - ID: "UndoingStatus", - Other: "undoing", - }, &i18n.Message{ - ID: "RedoingStatus", - Other: "redoing", - }, &i18n.Message{ - ID: "CheckingOutStatus", - Other: "checking out", - }, &i18n.Message{ - ID: "CommitFiles", - Other: "Commit files", - }, &i18n.Message{ - ID: "viewCommitFiles", - Other: "view commit's files", - }, &i18n.Message{ - ID: "CommitFilesTitle", - Other: "Commit Files", - }, &i18n.Message{ - ID: "goBack", - Other: "go back", - }, &i18n.Message{ - ID: "NoCommiteFiles", - Other: "No files for this commit", - }, &i18n.Message{ - ID: "checkoutCommitFile", - Other: "checkout file", - }, &i18n.Message{ - ID: "discardOldFileChange", - Other: "discard this commit's changes to this file", - }, &i18n.Message{ - ID: "DiscardFileChangesTitle", - Other: "Discard file changes", - }, &i18n.Message{ - ID: "DiscardFileChangesPrompt", - Other: "Are you sure you want to discard this commit's changes to this file? If this file was created in this commit, it will be deleted", - }, &i18n.Message{ - ID: "DisabledForGPG", - Other: "Feature not available for users using GPG", - }, &i18n.Message{ - ID: "CreateRepo", - Other: "Not in a git repository. Create a new git repository? (y/n): ", - }, &i18n.Message{ - ID: "AutoStashTitle", - Other: "Autostash?", - }, &i18n.Message{ - ID: "AutoStashPrompt", - Other: "You must stash and pop your changes to bring them across. Do this automatically? (enter/esc)", - }, &i18n.Message{ - ID: "StashPrefix", - Other: "Auto-stashing changes for ", - }, &i18n.Message{ - ID: "viewDiscardOptions", - Other: "view 'discard changes' options", - }, &i18n.Message{ - ID: "cancel", - Other: "cancel", - }, &i18n.Message{ - ID: "discardAllChanges", - Other: "discard all changes", - }, &i18n.Message{ - ID: "discardUnstagedChanges", - Other: "discard unstaged changes", - }, &i18n.Message{ - ID: "discardAllChangesToAllFiles", - Other: "nuke working tree", - }, &i18n.Message{ - ID: "discardAnyUnstagedChanges", - Other: "discard unstaged changes", - }, &i18n.Message{ - ID: "discardUntrackedFiles", - Other: "discard untracked files", - }, &i18n.Message{ - ID: "hardReset", - Other: "hard reset", - }, &i18n.Message{ - ID: "hardResetUpstream", - Other: "hard reset to upstream branch", - }, &i18n.Message{ - ID: "viewResetOptions", - Other: `view reset options`, - }, &i18n.Message{ - ID: "createFixupCommit", - Other: `create fixup commit for this commit`, - }, &i18n.Message{ - ID: "squashAboveCommits", - Other: `squash above commits`, - }, &i18n.Message{ - ID: "SquashAboveCommits", - Other: `Squash above commits`, - }, &i18n.Message{ - ID: "SureSquashAboveCommits", - Other: `Are you sure you want to squash all fixup! commits above {{.commit}}?`, - }, &i18n.Message{ - ID: "CreateFixupCommit", - Other: `Create fixup commit`, - }, &i18n.Message{ - ID: "SureCreateFixupCommit", - Other: `Are you sure you want to create a fixup! commit for commit {{.commit}}?`, - }, &i18n.Message{ - ID: "executeCustomCommand", - Other: "execute custom command", - }, &i18n.Message{ - ID: "CustomCommand", - Other: "Custom Command:", - }, &i18n.Message{ - ID: "commitChangesWithoutHook", - Other: "commit changes without pre-commit hook", - }, &i18n.Message{ - ID: "SkipHookPrefixNotConfigured", - Other: "You have not configured a commit message prefix for skipping hooks. Set `git.skipHookPrefix = 'WIP'` in your config", - }, &i18n.Message{ - ID: "resetTo", - Other: `reset to`, - }, &i18n.Message{ - ID: "pressEnterToReturn", - Other: "Press enter to return to lazygit", - }, &i18n.Message{ - ID: "viewStashOptions", - Other: "view stash options", - }, &i18n.Message{ - ID: "stashAllChanges", - Other: "stash changes", - }, &i18n.Message{ - ID: "stashStagedChanges", - Other: "stash staged changes", - }, &i18n.Message{ - ID: "stashOptions", - Other: "Stash options", - }, &i18n.Message{ - ID: "notARepository", - Other: "Error: must be run inside a git repository", - }, &i18n.Message{ - ID: "jump", - Other: "jump to panel", - }, &i18n.Message{ - ID: "DiscardPatch", - Other: "Discard Patch", - }, &i18n.Message{ - ID: "DiscardPatchConfirm", - Other: "You can only build a patch from one commit/stash-entry at a time. Discard current patch?", - }, &i18n.Message{ - ID: "CantPatchWhileRebasingError", - Other: "You cannot build a patch or run patch commands while in a merging or rebasing state", - }, &i18n.Message{ - ID: "toggleAddToPatch", - Other: "toggle file included in patch", - }, &i18n.Message{ - ID: "ViewPatchOptions", - Other: "view custom patch options", - }, &i18n.Message{ - ID: "PatchOptionsTitle", - Other: "Patch Options", - }, &i18n.Message{ - ID: "NoPatchError", - Other: "No patch created yet. To start building a patch, use 'space' on a commit file or enter to add specific lines", - }, &i18n.Message{ - ID: "enterFile", - Other: "enter file to add selected lines to the patch", - }, &i18n.Message{ - ID: "ExitLineByLineMode", - Other: `exit line-by-line mode`, - }, &i18n.Message{ - ID: "EnterUpstream", - Other: `Enter upstream as ' '`, - }, &i18n.Message{ - ID: "EnterUpstreamWithSlash", - Other: `Enter upstream as '/'`, - }, &i18n.Message{ - ID: "notTrackingRemote", - Other: "(not tracking any remote)", - }, &i18n.Message{ - ID: "ReturnToRemotesList", - Other: `Return to remotes list`, - }, &i18n.Message{ - ID: "addNewRemote", - Other: `add new remote`, - }, &i18n.Message{ - ID: "newRemoteName", - Other: `New remote name:`, - }, &i18n.Message{ - ID: "newRemoteUrl", - Other: `New remote url:`, - }, &i18n.Message{ - ID: "editRemoteName", - Other: `Enter updated remote name for {{ .remoteName }}:`, - }, &i18n.Message{ - ID: "editRemoteUrl", - Other: `Enter updated remote url for {{ .remoteName }}:`, - }, &i18n.Message{ - ID: "removeRemote", - Other: `remove remote`, - }, &i18n.Message{ - ID: "removeRemotePrompt", - Other: "Are you sure you want to remove remote", - }, &i18n.Message{ - ID: "DeleteRemoteBranch", - Other: "Delete Remote Branch", - }, &i18n.Message{ - ID: "DeleteRemoteBranchMessage", - Other: "Are you sure you want to delete remote branch", - }, &i18n.Message{ - ID: "setUpstream", - Other: "set as upstream of checked-out branch", - }, &i18n.Message{ - ID: "SetUpstreamTitle", - Other: "Set upstream branch", - }, &i18n.Message{ - ID: "SetUpstreamMessage", - Other: "Are you sure you want to set the upstream branch of '{{.checkedOut}}' to '{{.selected}}'", - }, &i18n.Message{ - ID: "editRemote", - Other: "edit remote", - }, &i18n.Message{ - ID: "tagCommit", - Other: "tag commit", - }, &i18n.Message{ - ID: "TagNameTitle", - Other: "Tag name:", - }, &i18n.Message{ - ID: "deleteTag", - Other: "delete tag", - }, &i18n.Message{ - ID: "DeleteTagTitle", - Other: "Delete tag", - }, &i18n.Message{ - ID: "DeleteTagPrompt", - Other: "Are you sure you want to delete tag '{{.tagName}}'?", - }, &i18n.Message{ - ID: "PushTagTitle", - Other: "remote to push tag '{{.tagName}}' to:", - }, &i18n.Message{ - ID: "pushTag", - Other: "push tag", - }, &i18n.Message{ - ID: "createTag", - Other: "create tag", - }, &i18n.Message{ - ID: "CreateTagTitle", - Other: "Tag name:", - }, &i18n.Message{ - ID: "fetchRemote", - Other: "fetch remote", - }, &i18n.Message{ - ID: "FetchingRemoteStatus", - Other: "fetching remote", - }, &i18n.Message{ - ID: "checkoutCommit", - Other: "checkout commit", - }, &i18n.Message{ - ID: "SureCheckoutThisCommit", - Other: "Are you sure you want to checkout this commit?", - }, &i18n.Message{ - ID: "gitFlowOptions", - Other: "show git-flow options", - }, &i18n.Message{ - ID: "NotAGitFlowBranch", - Other: "This does not seem to be a git flow branch", - }, &i18n.Message{ - ID: "NewBranchNamePrompt", - Other: "new {{.branchType}} name:", - }, &i18n.Message{ - ID: "IgnoreTracked", - Other: "Ignore tracked file", - }, &i18n.Message{ - ID: "IgnoreTrackedPrompt", - Other: "Are you sure you want to ignore a tracked file?", - }, &i18n.Message{ - ID: "viewResetToUpstreamOptions", - Other: "view upstream reset options", - }, &i18n.Message{ - ID: "nextScreenMode", - Other: "next screen mode (normal/half/fullscreen)", - }, &i18n.Message{ - ID: "prevScreenMode", - Other: "prev screen mode", - }, &i18n.Message{ - ID: "startSearch", - Other: "start search", - }, &i18n.Message{ - ID: "Panel", - Other: "Panel", - }, &i18n.Message{ - ID: "Keybindings", - Other: "Keybindings", - }, &i18n.Message{ - ID: "renameBranch", - Other: "rename branch", - }, &i18n.Message{ - ID: "NewBranchNamePrompt", - Other: "Enter new branch name for branch", - }, &i18n.Message{ - ID: "RenameBranchWarning", - Other: "This branch is tracking a remote. This action will only rename the local branch name, not the name of the remote branch. Continue?", - }, &i18n.Message{ - ID: "openMenu", - Other: "open menu", - }, &i18n.Message{ - ID: "closeMenu", - Other: "close menu", - }, &i18n.Message{ - ID: "resetCherryPick", - Other: "reset cherry-picked (copied) commits selection", - }, &i18n.Message{ - ID: "nextTab", - Other: "next tab", - }, &i18n.Message{ - ID: "prevTab", - Other: "previous tab", - }, &i18n.Message{ - ID: "cantUndoWhileRebasing", - Other: "Can't undo while rebasing", - }, &i18n.Message{ - ID: "cantRedoWhileRebasing", - Other: "Can't redo while rebasing", - }, &i18n.Message{ - ID: "MustStashWarning", - Other: "Pulling a patch out into the index requires stashing and unstashing your changes. If something goes wrong, you'll be able to access your files from the stash. Continue?", - }, &i18n.Message{ - ID: "MustStashTitle", - Other: "Must stash", - }, &i18n.Message{ - ID: "ConfirmationTitle", - Other: "Confirmation Panel", - }, &i18n.Message{ - ID: "prevPage", - Other: "previous page", - }, &i18n.Message{ - ID: "nextPage", - Other: "next page", - }, &i18n.Message{ - ID: "gotoTop", - Other: "scroll to top", - }, &i18n.Message{ - ID: "gotoBottom", - Other: "scroll to bottom", - }, &i18n.Message{ - ID: "filteringBy", - Other: "filtering by", - }, &i18n.Message{ - ID: "(reset)", - Other: "(reset)", - }, &i18n.Message{ - ID: "openScopingMenu", - Other: "view scoping options", - }, &i18n.Message{ - ID: "filterBy", - Other: "filter by", - }, &i18n.Message{ - ID: "exitFilterMode", - Other: "stop filtering by path", - }, &i18n.Message{ - ID: "filterPathOption", - Other: "enter path to filter by", - }, &i18n.Message{ - ID: "enterFileName", - Other: "enter path:", - }, &i18n.Message{ - ID: "FilteringMenuTitle", - Other: "Filtering", - }, &i18n.Message{ - ID: "MustExitFilterModeTitle", - Other: "Command not available", - }, &i18n.Message{ - ID: "MustExitFilterModePrompt", - Other: "Command not available in filtered mode. Exit filtered mode?", - }, &i18n.Message{ - ID: "diff", - Other: "diff", - }, &i18n.Message{ - ID: "enterRefToDiff", - Other: "enter ref to diff", - }, &i18n.Message{ - ID: "enteRefName", - Other: "enter ref:", - }, &i18n.Message{ - ID: "exitDiffMode", - Other: "exit diff mode", - }, &i18n.Message{ - ID: "DiffingMenuTitle", - Other: "Diffing", - }, &i18n.Message{ - ID: "swapDiff", - Other: "reverse diff direction", - }, &i18n.Message{ - ID: "openDiffingMenu", - Other: "open diff menu", - }, &i18n.Message{ - ID: "showingGitDiff", - Other: "showing output for:", - }, &i18n.Message{ - ID: "copyCommitShaToClipboard", - Other: "copy commit SHA to clipboard", - }, &i18n.Message{ - ID: "copyBranchNameToClipboard", - Other: "copy branch name to clipboard", - }, &i18n.Message{ - ID: "copyFileNameToClipboard", - Other: "copy the file name to the clipboard", - }, &i18n.Message{ - ID: "copyCommitFileNameToClipboard", - Other: "copy the committed file name to the clipboard", - }, &i18n.Message{ - ID: "commitPrefixPatternError", - Other: "Error in commitPrefix pattern", - }, &i18n.Message{ - ID: "NoFilesStagedTitle", - Other: "No files staged", - }, &i18n.Message{ - ID: "NoFilesStagedPrompt", - Other: "You have not staged any files. Commit all files?", - }, &i18n.Message{ - ID: "BranchNotFoundTitle", - Other: "Branch not found", - }, &i18n.Message{ - ID: "BranchNotFoundPrompt", - Other: "Branch not found. Create a new branch named", - }, &i18n.Message{ - ID: "UnstageLinesTitle", - Other: "Unstage lines", - }, &i18n.Message{ - ID: "UnstageLinesPrompt", - Other: "Are you sure you want to delete the selected lines (git reset)? It is irreversible.\nTo disable this dialogue set the config key of 'gui.skipUnstageLineWarning' to true", - }, &i18n.Message{ - ID: "createNewBranchFromCommit", - Other: "create new branch off of commit", - }, &i18n.Message{ - ID: "viewStashFiles", - Other: "view stash entry's files", - }, &i18n.Message{ - ID: "buildingPatch", - Other: "building patch", - }, &i18n.Message{ - ID: "viewCommits", - Other: "view commits", - }, &i18n.Message{ - ID: "minGitVersionError", - Other: "Git version must be at least 2.0 (i.e. from 2014 onwards). Please upgrade your git version. Alternatively raise an issue at https://github.com/jesseduffield/lazygit/issues for lazygit to be more backwards compatible.", - }, &i18n.Message{ - ID: "runningCustomCommandStatus", - Other: "running custom command", - }, &i18n.Message{ - ID: "submoduleStashAndReset", - Other: "stash uncommitted submodule changes and update", - }, &i18n.Message{ - ID: "andResetSubmodules", - Other: "and reset submodules", - }, &i18n.Message{ - ID: "enterSubmodule", - Other: "enter submodule", - }, &i18n.Message{ - ID: "copySubmoduleNameToClipboard", - Other: "copy submodule name to clipboard", - }, &i18n.Message{ - ID: "RemoveSubmodule", - Other: "Remove submodule", - }, &i18n.Message{ - ID: "removeSubmodule", - Other: "remove submodule", - }, &i18n.Message{ - ID: "RemoveSubmodulePrompt", - Other: "Are you sure you want to remove submodule '%s' and its corresponding directory? This is irreversible.", - }, &i18n.Message{ - ID: "resettingSubmoduleStatus", - Other: "resetting submodule", - }, &i18n.Message{ - ID: "newSubmoduleName", - Other: "new submodule name:", - }, &i18n.Message{ - ID: "newSubmoduleUrl", - Other: "new submodule URL:", - }, &i18n.Message{ - ID: "newSubmodulePath", - Other: "new submodule path:", - }, &i18n.Message{ - ID: "addSubmodule", - Other: "add new submodule", - }, &i18n.Message{ - ID: "addingSubmoduleStatus", - Other: "adding submodule", - }, &i18n.Message{ - ID: "updateSubmoduleUrl", - Other: "update URL for submodule '%s'", - }, &i18n.Message{ - ID: "updatingSubmoduleUrlStatus", - Other: "updating URL", - }, &i18n.Message{ - ID: "editSubmoduleUrl", - Other: "update submodule URL", - }, &i18n.Message{ - ID: "initializingSubmoduleStatus", - Other: "initializing submodule", - }, &i18n.Message{ - ID: "initSubmodule", - Other: "initialize submodule", - }, &i18n.Message{ - ID: "viewResetAndRemoveOptions", - Other: "view reset and remove submodule options", - }, &i18n.Message{ - ID: "submoduleUpdate", - Other: "update submodule", - }, &i18n.Message{ - ID: "updatingSubmoduleStatus", - Other: "updating submodule", - }, &i18n.Message{ - ID: "bulkInitSubmodules", - Other: "bulk init submodules", - }, &i18n.Message{ - ID: "bulkUpdateSubmodules", - Other: "bulk update submodules", - }, &i18n.Message{ - ID: "bulkDeinitSubmodules", - Other: "bulk deinit submodules", - }, &i18n.Message{ - ID: "viewBulkSubmoduleOptions", - Other: "view bulk submodule options", - }, &i18n.Message{ - ID: "bulkSubmoduleOptions", - Other: "bulk submodule options", - }, &i18n.Message{ - ID: "runningCommand", - Other: "running command", - }, &i18n.Message{ - ID: "SubCommitsTitle", - Other: "Sub-commits", - }, &i18n.Message{ - ID: "SubmodulesTitle", - Other: "Submodules", - }, &i18n.Message{ - ID: "NavigationTitle", - Other: "List Panel Navigation", - }, - ) +type TranslationSet struct { + NotEnoughSpace string + DiffTitle string + LogTitle string + FilesTitle string + BranchesTitle string + CommitsTitle string + StashTitle string + UnstagedChanges string + StagedChanges string + PatchBuildingMainTitle string + MergingMainTitle string + MainTitle string + StagingTitle string + MergingTitle string + NormalTitle string + CommitMessage string + CredentialsUsername string + CredentialsPassword string + PassUnameWrong string + CommitChanges string + AmendLastCommit string + SureToAmend string + NoCommitToAmend string + CommitChangesWithEditor string + StatusTitle string + GlobalTitle string + LcNavigate string + LcMenu string + LcExecute string + LcOpen string + LcIgnore string + LcDelete string + LcToggleStaged string + LcToggleStagedAll string + LcRefresh string + LcPush string + LcPull string + LcEdit string + LcScroll string + LcAbortMerge string + LcResolveMergeConflicts string + MergeConflictsTitle string + LcCheckout string + NoChangedFiles string + FileHasNoUnstagedChanges string + CannotGitAdd string + NoFilesDisplay string + NotAFile string + PullWait string + PushWait string + FetchWait string + FileNoMergeCons string + LcSoftReset string + SureTo string + AlreadyCheckedOutBranch string + SureForceCheckout string + ForceCheckoutBranch string + BranchName string + NewBranchNameBranchOff string + CantDeleteCheckOutBranch string + DeleteBranch string + DeleteBranchMessage string + ForceDeleteBranchMessage string + LcRebaseBranch string + CantRebaseOntoSelf string + CantMergeBranchIntoItself string + LcForceCheckout string + LcMerge string + LcCheckoutByName string + LcNewBranch string + LcDeleteBranch string + LcForceDeleteBranch string + NoBranchesThisRepo string + NoTrackingThisBranch string + CommitMessageConfirm string + CommitWithoutMessageErr string + CloseConfirm string + LcClose string + LcQuit string + SureResetThisCommit string + ResetToCommit string + LcSquashDown string + LcRename string + LcResetToThisCommit string + LcFixupCommit string + OnlySquashTopmostCommit string + YouNoCommitsToSquash string + CantFixupWhileUnstagedChanges string + Fixup string + SureFixupThisCommit string + SureSquashThisCommit string + Squash string + LcPickCommit string + LcRevertCommit string + OnlyRenameTopCommit string + LcRenameCommit string + LcDeleteCommit string + LcMoveDownCommit string + LcMoveUpCommit string + LcEditCommit string + LcAmendToCommit string + LcRenameCommitEditor string + PotentialErrInGetselectedCommit string + NoCommitsThisBranch string + Error string + RunningSubprocess string + LcSelectHunk string + LcNavigateConflicts string + LcPickHunk string + LcPickBothHunks string + LcUndo string + LcUndoReflog string + LcRedoReflog string + LcPop string + LcDrop string + LcApply string + NoStashEntries string + StashDrop string + SureDropStashEntry string + StashPop string + SurePopStashEntry string + StashApply string + SureApplyStashEntry string + NoStashTo string + NoTrackedStagedFilesStash string + StashChanges string + IssntListOfViews string + LcNewFocusedViewIs string + MergeAborted string + OpenConfig string + EditConfig string + ForcePush string + ForcePushPrompt string + ForcePushDisabled string + UpdatesRejectedAndForcePushDisabled string + LcCheckForUpdate string + CheckingForUpdates string + OnLatestVersionErr string + MajorVersionErr string + CouldNotFindBinaryErr string + AnonymousReportingTitle string + AnonymousReportingPrompt string + IntroPopupMessage string + GitconfigParseErr string + LcEditFile string + LcOpenFile string + LcIgnoreFile string + LcRefreshFiles string + LcMergeIntoCurrentBranch string + ConfirmQuit string + SwitchRepo string + UnsupportedGitService string + LcCreatePullRequest string + NoBranchOnRemote string + LcFetch string + NoAutomaticGitFetchTitle string + NoAutomaticGitFetchBody string + StageLines string + FileStagingRequirements string + SelectHunk string + StageSelection string + ResetSelection string + ToggleDragSelect string + ToggleSelectHunk string + ToggleSelectionForPatch string + TogglePanel string + CantStageStaged string + ReturnToFilesPanel string + CantFindHunks string + CantFindHunk string + FastForward string + Fetching string + FoundConflicts string + FoundConflictsTitle string + Undo string + PickHunk string + PickBothHunks string + ViewMergeRebaseOptions string + NotMergingOrRebasing string + RecentRepos string + MergeOptionsTitle string + RebaseOptionsTitle string + CommitMessageTitle string + LocalBranchesTitle string + SearchTitle string + TagsTitle string + BranchCommitsTitle string + MenuTitle string + RemotesTitle string + CredentialsTitle string + RemoteBranchesTitle string + PatchBuildingTitle string + InformationTitle string + SecondaryTitle string + ReflogCommitsTitle string + Title string + ConflictsResolved string + RebasingTitle string + ConfirmRebase string + ConfirmMerge string + FwdNoUpstream string + FwdCommitsToPush string + ErrorOccurred string + NoRoom string + YouAreHere string + LcRewordNotSupported string + LcCherryPickCopy string + LcCherryPickCopyRange string + LcPasteCommits string + SureCherryPick string + CherryPick string + CannotRebaseOntoFirstCommit string + CannotSquashOntoSecondCommit string + Donate string + PrevLine string + NextLine string + PrevHunk string + NextHunk string + PrevConflict string + NextConflict string + SelectTop string + SelectBottom string + ScrollDown string + ScrollUp string + LcScrollUpMainPanel string + LcScrollDownMainPanel string + AmendCommitTitle string + AmendCommitPrompt string + DeleteCommitTitle string + DeleteCommitPrompt string + SquashingStatus string + FixingStatus string + DeletingStatus string + MovingStatus string + RebasingStatus string + AmendingStatus string + CherryPickingStatus string + UndoingStatus string + RedoingStatus string + CheckingOutStatus string + CommitFiles string + LcViewCommitFiles string + CommitFilesTitle string + LcGoBack string + NoCommiteFiles string + LcCheckoutCommitFile string + LcDiscardOldFileChange string + DiscardFileChangesTitle string + DiscardFileChangesPrompt string + DisabledForGPG string + CreateRepo string + AutoStashTitle string + AutoStashPrompt string + StashPrefix string + LcViewDiscardOptions string + LcCancel string + LcDiscardAllChanges string + LcDiscardUnstagedChanges string + LcDiscardAllChangesToAllFiles string + LcDiscardAnyUnstagedChanges string + LcDiscardUntrackedFiles string + LcHardReset string + LcHardResetUpstream string + LcViewResetOptions string + LcCreateFixupCommit string + LcSquashAboveCommits string + SquashAboveCommits string + SureSquashAboveCommits string + CreateFixupCommit string + SureCreateFixupCommit string + LcExecuteCustomCommand string + CustomCommand string + LcCommitChangesWithoutHook string + SkipHookPrefixNotConfigured string + LcResetTo string + PressEnterToReturn string + LcViewStashOptions string + LcStashAllChanges string + LcStashStagedChanges string + LcStashOptions string + NotARepository string + LcJump string + DiscardPatch string + DiscardPatchConfirm string + CantPatchWhileRebasingError string + LcToggleAddToPatch string + ViewPatchOptions string + PatchOptionsTitle string + NoPatchError string + LcEnterFile string + ExitLineByLineMode string + EnterUpstream string + EnterUpstreamWithSlash string + LcNotTrackingRemote string + ReturnToRemotesList string + LcAddNewRemote string + LcNewRemoteName string + LcNewRemoteUrl string + LcEditRemoteName string + LcEditRemoteUrl string + LcRemoveRemote string + LcRemoveRemotePrompt string + DeleteRemoteBranch string + DeleteRemoteBranchMessage string + LcSetUpstream string + SetUpstreamTitle string + SetUpstreamMessage string + LcEditRemote string + LcTagCommit string + TagNameTitle string + LcDeleteTag string + DeleteTagTitle string + DeleteTagPrompt string + PushTagTitle string + LcPushTag string + LcCreateTag string + CreateTagTitle string + LcFetchRemote string + FetchingRemoteStatus string + LcCheckoutCommit string + SureCheckoutThisCommit string + LcGitFlowOptions string + NotAGitFlowBranch string + NewBranchNamePrompt string + IgnoreTracked string + IgnoreTrackedPrompt string + LcViewResetToUpstreamOptions string + LcNextScreenMode string + LcPrevScreenMode string + LcStartSearch string + Panel string + Keybindings string + LcRenameBranch string + NewGitFlowBranchPrompt string + RenameBranchWarning string + LcOpenMenu string + LcCloseMenu string + LcResetCherryPick string + LcNextTab string + LcPrevTab string + LcCantUndoWhileRebasing string + LcCantRedoWhileRebasing string + MustStashWarning string + MustStashTitle string + ConfirmationTitle string + LcPrevPage string + LcNextPage string + LcGotoTop string + LcGotoBottom string + LcFilteringBy string + ResetInParentheses string + LcOpenScopingMenu string + LcFilterBy string + LcExitFilterMode string + LcFilterPathOption string + LcEnterFileName string + FilteringMenuTitle string + MustExitFilterModeTitle string + MustExitFilterModePrompt string + LcDiff string + LcEnterRefToDiff string + LcEnteRefName string + LcExitDiffMode string + DiffingMenuTitle string + LcSwapDiff string + LcOpenDiffingMenu string + LcShowingGitDiff string + LcCopyCommitShaToClipboard string + LcCopyBranchNameToClipboard string + LcCopyFileNameToClipboard string + LcCopyCommitFileNameToClipboard string + LcCommitPrefixPatternError string + NoFilesStagedTitle string + NoFilesStagedPrompt string + BranchNotFoundTitle string + BranchNotFoundPrompt string + UnstageLinesTitle string + UnstageLinesPrompt string + LcCreateNewBranchFromCommit string + LcViewStashFiles string + LcBuildingPatch string + LcViewCommits string + MinGitVersionError string + LcRunningCustomCommandStatus string + LcSubmoduleStashAndReset string + LcAndResetSubmodules string + LcEnterSubmodule string + LcCopySubmoduleNameToClipboard string + RemoveSubmodule string + LcRemoveSubmodule string + RemoveSubmodulePrompt string + LcResettingSubmoduleStatus string + LcNewSubmoduleName string + LcNewSubmoduleUrl string + LcNewSubmodulePath string + LcAddSubmodule string + LcAddingSubmoduleStatus string + LcUpdateSubmoduleUrl string + LcUpdatingSubmoduleUrlStatus string + LcEditSubmoduleUrl string + LcInitializingSubmoduleStatus string + LcInitSubmodule string + LcViewResetAndRemoveOptions string + LcSubmoduleUpdate string + LcUpdatingSubmoduleStatus string + LcBulkInitSubmodules string + LcBulkUpdateSubmodules string + LcBulkDeinitSubmodules string + LcViewBulkSubmoduleOptions string + LcBulkSubmoduleOptions string + LcRunningCommand string + SubCommitsTitle string + SubmodulesTitle string + NavigationTitle string +} + +func englishTranslationSet() TranslationSet { + return TranslationSet{ + NotEnoughSpace: "Not enough space to render panels", + DiffTitle: "Diff", + LogTitle: "Log", + FilesTitle: "Files", + BranchesTitle: "Branches", + CommitsTitle: "Commits", + StashTitle: "Stash", + UnstagedChanges: `Unstaged Changes`, + StagedChanges: `Staged Changes`, + PatchBuildingMainTitle: `Add Lines/Hunks To Patch`, + MergingMainTitle: "Resolve merge conflicts", + MainTitle: "Main", + StagingTitle: "Staging", + MergingTitle: "Merging", + NormalTitle: "Normal", + CommitMessage: "Commit message", + CredentialsUsername: "Username", + CredentialsPassword: "Password", + PassUnameWrong: "Password and/or username wrong", + CommitChanges: "commit changes", + AmendLastCommit: "amend last commit", + SureToAmend: "Are you sure you want to amend last commit? Afterwards, you can change commit message from the commits panel.", + NoCommitToAmend: "There's no commit to amend.", + CommitChangesWithEditor: "commit changes using git editor", + StatusTitle: "Status", + LcNavigate: "navigate", + LcMenu: "menu", + LcExecute: "execute", + LcOpen: "open", + LcIgnore: "ignore", + LcDelete: "delete", + LcToggleStaged: "toggle staged", + LcToggleStagedAll: "stage/unstage all", + LcRefresh: "refresh", + LcPush: "push", + LcPull: "pull", + LcEdit: "edit", + LcScroll: "scroll", + LcAbortMerge: "abort merge", + LcResolveMergeConflicts: "resolve merge conflicts", + MergeConflictsTitle: "Merge Conflicts", + LcCheckout: "checkout", + NoChangedFiles: "No changed files", + FileHasNoUnstagedChanges: "File has no unstaged changes to add", + CannotGitAdd: "Cannot git add --patch untracked files", + NoFilesDisplay: "No file to display", + NotAFile: "Not a file", + PullWait: "Pulling...", + PushWait: "Pushing...", + FetchWait: "Fetching...", + FileNoMergeCons: "This file has no inline merge conflicts", + LcSoftReset: "soft reset", + SureTo: "Are you sure you want to {{.deleteVerb}} {{.fileName}} (you will lose your changes)?", + AlreadyCheckedOutBranch: "You have already checked out this branch", + SureForceCheckout: "Are you sure you want force checkout? You will lose all local changes", + ForceCheckoutBranch: "Force Checkout Branch", + BranchName: "Branch name", + NewBranchNameBranchOff: "New Branch Name (Branch is off of {{.branchName}})", + CantDeleteCheckOutBranch: "You cannot delete the checked out branch!", + DeleteBranch: "Delete Branch", + DeleteBranchMessage: "Are you sure you want to delete the branch {{.selectedBranchName}}?", + ForceDeleteBranchMessage: "{{.selectedBranchName}} is not fully merged. Are you sure you want to delete it?", + LcRebaseBranch: "rebase checked-out branch onto this branch", + CantRebaseOntoSelf: "You cannot rebase a branch onto itself", + CantMergeBranchIntoItself: "You cannot merge a branch into itself", + LcForceCheckout: "force checkout", + LcMerge: "merge", + LcCheckoutByName: "checkout by name", + LcNewBranch: "new branch", + LcDeleteBranch: "delete branch", + LcForceDeleteBranch: "delete branch (force)", + NoBranchesThisRepo: "No branches for this repo", + NoTrackingThisBranch: "There is no tracking for this branch", + CommitMessageConfirm: "{{.keyBindClose}}: close, {{.keyBindNewLine}}: new line, {{.keyBindConfirm}}: confirm", + CommitWithoutMessageErr: "You cannot commit without a commit message", + CloseConfirm: "{{.keyBindClose}}: close, {{.keyBindConfirm}}: confirm", + LcClose: "close", + LcQuit: "quit", + SureResetThisCommit: "Are you sure you want to reset to this commit?", + ResetToCommit: "Reset To Commit", + LcSquashDown: "squash down", + LcRename: "rename", + LcResetToThisCommit: "reset to this commit", + LcFixupCommit: "fixup commit", + NoCommitsThisBranch: "No commits for this branch", + OnlySquashTopmostCommit: "Can only squash topmost commit", + YouNoCommitsToSquash: "You have no commits to squash with", + CantFixupWhileUnstagedChanges: "Can't fixup while there are unstaged changes", + Fixup: "Fixup", + SureFixupThisCommit: "Are you sure you want to 'fixup' this commit? It will be merged into the commit below", + SureSquashThisCommit: "Are you sure you want to squash this commit into the commit below?", + Squash: "Squash", + LcPickCommit: "pick commit (when mid-rebase)", + LcRevertCommit: "revert commit", + OnlyRenameTopCommit: "Can only reword topmost commit from within lazygit. Use shift+R instead", + LcRenameCommit: "reword commit", + LcDeleteCommit: "delete commit", + LcMoveDownCommit: "move commit down one", + LcMoveUpCommit: "move commit up one", + LcEditCommit: "edit commit", + LcAmendToCommit: "amend commit with staged changes", + LcRenameCommitEditor: "rename commit with editor", + PotentialErrInGetselectedCommit: "potential error in getSelected Commit (mismatched ui and state)", + Error: "Error", + RunningSubprocess: "running subprocess", + LcSelectHunk: "select hunk", + LcNavigateConflicts: "navigate conflicts", + LcPickHunk: "pick hunk", + LcPickBothHunks: "pick both hunks", + LcUndo: "undo", + LcUndoReflog: "undo (via reflog) (experimental)", + LcRedoReflog: "redo (via reflog) (experimental)", + LcPop: "pop", + LcDrop: "drop", + LcApply: "apply", + NoStashEntries: "No stash entries", + StashDrop: "Stash drop", + SureDropStashEntry: "Are you sure you want to drop this stash entry?", + StashPop: "Stash pop", + SurePopStashEntry: "Are you sure you want to pop this stash entry?", + StashApply: "Stash apply", + SureApplyStashEntry: "Are you sure you want to apply this stash entry?", + NoStashTo: "No stash to {{.method}}", + NoTrackedStagedFilesStash: "You have no tracked/staged files to stash", + StashChanges: "Stash changes", + IssntListOfViews: "{{.name}} is not in the list of views", + LcNewFocusedViewIs: "new focused view is {{.newFocusedView}}", + MergeAborted: "Merge aborted", + OpenConfig: "open config file", + EditConfig: "edit config file", + ForcePush: "Force push", + ForcePushPrompt: "Your branch has diverged from the remote branch. Press 'esc' to cancel, or 'enter' to force push.", + ForcePushDisabled: "Your branch has diverged from the remote branch and you've disabled force pushing", + UpdatesRejectedAndForcePushDisabled: "Updates were rejected and you have disabled force pushing", + LcCheckForUpdate: "check for update", + CheckingForUpdates: "Checking for updates...", + OnLatestVersionErr: "You already have the latest version", + MajorVersionErr: "New version ({{.newVersion}}) has non-backwards compatible changes compared to the current version ({{.currentVersion}})", + CouldNotFindBinaryErr: "Could not find any binary at {{.url}}", + AnonymousReportingTitle: "Help make lazygit better", + AnonymousReportingPrompt: "Would you like to enable anonymous reporting data to help improve lazygit? (enter/esc)", + IntroPopupMessage: "Thanks for using lazygit! Two things to share with you:\n\n1) If you want to learn about lazygit's features, watch this vid:\n https://youtu.be/CPLdltN7wgE\n\n2) If you're using git, that makes you a programmer! With your help we can make lazygit better, so consider becoming a contributor and joining the fun at\n https://github.com/jesseduffield/lazygit", + GitconfigParseErr: `Gogit failed to parse your gitconfig file due to the presence of unquoted '\' characters. Removing these should fix the issue.`, + LcEditFile: `edit file`, + LcOpenFile: `open file`, + LcIgnoreFile: `add to .gitignore`, + LcRefreshFiles: `refresh files`, + LcMergeIntoCurrentBranch: `merge into currently checked out branch`, + ConfirmQuit: `Are you sure you want to quit?`, + SwitchRepo: `switch to a recent repo`, + UnsupportedGitService: `Unsupported git service`, + LcCreatePullRequest: `create pull request`, + NoBranchOnRemote: `This branch doesn't exist on remote. You need to push it to remote first.`, + LcFetch: `fetch`, + NoAutomaticGitFetchTitle: `No automatic git fetch`, + NoAutomaticGitFetchBody: `Lazygit can't use "git fetch" in a private repo; use 'f' in the files panel to run "git fetch" manually`, + StageLines: `stage individual hunks/lines`, + FileStagingRequirements: `Can only stage individual lines for tracked files`, + SelectHunk: `select hunk`, + StageSelection: `toggle line staged / unstaged`, + ResetSelection: `delete change (git reset)`, + ToggleDragSelect: `toggle drag select`, + ToggleSelectHunk: `toggle select hunk`, + ToggleSelectionForPatch: `add/remove line(s) to patch`, + TogglePanel: `switch to other panel`, + CantStageStaged: `You can't stage an already staged change!`, + ReturnToFilesPanel: `return to files panel`, + CantFindHunks: `Could not find any hunks in this patch`, + CantFindHunk: `Could not find hunk`, + FastForward: `fast-forward this branch from its upstream`, + Fetching: "fetching and fast-forwarding {{.from}} -> {{.to}} ...", + FoundConflicts: "Conflicts! To abort press 'esc', otherwise press 'enter'", + FoundConflictsTitle: "Auto-merge failed", + Undo: "undo", + PickHunk: "pick hunk", + PickBothHunks: "pick both hunks", + ViewMergeRebaseOptions: "view merge/rebase options", + NotMergingOrRebasing: "You are currently neither rebasing nor merging", + RecentRepos: "recent repositories", + MergeOptionsTitle: "Merge Options", + RebaseOptionsTitle: "Rebase Options", + CommitMessageTitle: "Commit Message", + LocalBranchesTitle: "Branches Tab", + SearchTitle: "Search", + TagsTitle: "Tags Tab", + BranchCommitsTitle: "Commits Tab", + MenuTitle: "Menu", + RemotesTitle: "Remotes Tab", + CredentialsTitle: "Credentials", + RemoteBranchesTitle: "Remote Branches (in Remotes tab)", + PatchBuildingTitle: "Patch Building", + InformationTitle: "Information", + SecondaryTitle: "Secondary", + ReflogCommitsTitle: "Reflog Tab", + Title: "Title", + GlobalTitle: "Global Keybindings", + ConflictsResolved: "all merge conflicts resolved. Continue?", + RebasingTitle: "Rebasing", + ConfirmRebase: "Are you sure you want to rebase {{.checkedOutBranch}} onto {{.selectedBranch}}?", + ConfirmMerge: "Are you sure you want to merge {{.selectedBranch}} into {{.checkedOutBranch}}?", + FwdNoUpstream: "Cannot fast-forward a branch with no upstream", + FwdCommitsToPush: "Cannot fast-forward a branch with commits to push", + ErrorOccurred: "An error occurred! Please create an issue at https://github.com/jesseduffield/lazygit/issues", + NoRoom: "Not enough room", + YouAreHere: "YOU ARE HERE", + LcRewordNotSupported: "rewording commits while interactively rebasing is not currently supported", + LcCherryPickCopy: "copy commit (cherry-pick)", + LcCherryPickCopyRange: "copy commit range (cherry-pick)", + LcPasteCommits: "paste commits (cherry-pick)", + SureCherryPick: "Are you sure you want to cherry-pick the copied commits onto this branch?", + CherryPick: "Cherry-Pick", + CannotRebaseOntoFirstCommit: "You cannot interactive rebase onto the first commit", + CannotSquashOntoSecondCommit: "You cannot squash/fixup onto the second commit", + Donate: "Donate", + PrevLine: "select previous line", + NextLine: "select next line", + PrevHunk: "select previous hunk", + NextHunk: "select next hunk", + PrevConflict: "select previous conflict", + NextConflict: "select next conflict", + SelectTop: "select top hunk", + SelectBottom: "select bottom hunk", + ScrollDown: "scroll down", + ScrollUp: "scroll up", + LcScrollUpMainPanel: "scroll up main panel", + LcScrollDownMainPanel: "scroll down main panel", + AmendCommitTitle: "Amend Commit", + AmendCommitPrompt: "Are you sure you want to amend this commit with your staged files?", + DeleteCommitTitle: "Delete Commit", + DeleteCommitPrompt: "Are you sure you want to delete this commit?", + SquashingStatus: "squashing", + FixingStatus: "fixing up", + DeletingStatus: "deleting", + MovingStatus: "moving", + RebasingStatus: "rebasing", + AmendingStatus: "amending", + CherryPickingStatus: "cherry-picking", + UndoingStatus: "undoing", + RedoingStatus: "redoing", + CheckingOutStatus: "checking out", + CommitFiles: "Commit files", + LcViewCommitFiles: "view commit's files", + CommitFilesTitle: "Commit Files", + LcGoBack: "go back", + NoCommiteFiles: "No files for this commit", + LcCheckoutCommitFile: "checkout file", + LcDiscardOldFileChange: "discard this commit's changes to this file", + DiscardFileChangesTitle: "Discard file changes", + DiscardFileChangesPrompt: "Are you sure you want to discard this commit's changes to this file? If this file was created in this commit, it will be deleted", + DisabledForGPG: "Feature not available for users using GPG", + CreateRepo: "Not in a git repository. Create a new git repository? (y/n): ", + AutoStashTitle: "Autostash?", + AutoStashPrompt: "You must stash and pop your changes to bring them across. Do this automatically? (enter/esc)", + StashPrefix: "Auto-stashing changes for ", + LcViewDiscardOptions: "view 'discard changes' options", + LcCancel: "cancel", + LcDiscardAllChanges: "discard all changes", + LcDiscardUnstagedChanges: "discard unstaged changes", + LcDiscardAllChangesToAllFiles: "nuke working tree", + LcDiscardAnyUnstagedChanges: "discard unstaged changes", + LcDiscardUntrackedFiles: "discard untracked files", + LcHardReset: "hard reset", + LcHardResetUpstream: "hard reset to upstream branch", + LcViewResetOptions: `view reset options`, + LcCreateFixupCommit: `create fixup commit for this commit`, + LcSquashAboveCommits: `squash above commits`, + SquashAboveCommits: `Squash above commits`, + SureSquashAboveCommits: `Are you sure you want to squash all fixup! commits above {{.commit}}?`, + CreateFixupCommit: `Create fixup commit`, + SureCreateFixupCommit: `Are you sure you want to create a fixup! commit for commit {{.commit}}?`, + LcExecuteCustomCommand: "execute custom command", + CustomCommand: "Custom Command:", + LcCommitChangesWithoutHook: "commit changes without pre-commit hook", + SkipHookPrefixNotConfigured: "You have not configured a commit message prefix for skipping hooks. Set `git.skipHookPrefix = 'WIP'` in your config", + LcResetTo: `reset to`, + PressEnterToReturn: "Press enter to return to lazygit", + LcViewStashOptions: "view stash options", + LcStashAllChanges: "stash changes", + LcStashStagedChanges: "stash staged changes", + LcStashOptions: "Stash options", + NotARepository: "Error: must be run inside a git repository", + LcJump: "jump to panel", + DiscardPatch: "Discard Patch", + DiscardPatchConfirm: "You can only build a patch from one commit/stash-entry at a time. Discard current patch?", + CantPatchWhileRebasingError: "You cannot build a patch or run patch commands while in a merging or rebasing state", + LcToggleAddToPatch: "toggle file included in patch", + ViewPatchOptions: "view custom patch options", + PatchOptionsTitle: "Patch Options", + NoPatchError: "No patch created yet. To start building a patch, use 'space' on a commit file or enter to add specific lines", + LcEnterFile: "enter file to add selected lines to the patch", + ExitLineByLineMode: `exit line-by-line mode`, + EnterUpstream: `Enter upstream as ' '`, + EnterUpstreamWithSlash: `Enter upstream as '/'`, + LcNotTrackingRemote: "(not tracking any remote)", + ReturnToRemotesList: `Return to remotes list`, + LcAddNewRemote: `add new remote`, + LcNewRemoteName: `New remote name:`, + LcNewRemoteUrl: `New remote url:`, + LcEditRemoteName: `Enter updated remote name for {{ .remoteName }}:`, + LcEditRemoteUrl: `Enter updated remote url for {{ .remoteName }}:`, + LcRemoveRemote: `remove remote`, + LcRemoveRemotePrompt: "Are you sure you want to remove remote", + DeleteRemoteBranch: "Delete Remote Branch", + DeleteRemoteBranchMessage: "Are you sure you want to delete remote branch", + LcSetUpstream: "set as upstream of checked-out branch", + SetUpstreamTitle: "Set upstream branch", + SetUpstreamMessage: "Are you sure you want to set the upstream branch of '{{.checkedOut}}' to '{{.selected}}'", + LcEditRemote: "edit remote", + LcTagCommit: "tag commit", + TagNameTitle: "Tag name:", + LcDeleteTag: "delete tag", + DeleteTagTitle: "Delete tag", + DeleteTagPrompt: "Are you sure you want to delete tag '{{.tagName}}'?", + PushTagTitle: "remote to push tag '{{.tagName}}' to:", + LcPushTag: "push tag", + LcCreateTag: "create tag", + CreateTagTitle: "Tag name:", + LcFetchRemote: "fetch remote", + FetchingRemoteStatus: "fetching remote", + LcCheckoutCommit: "checkout commit", + SureCheckoutThisCommit: "Are you sure you want to checkout this commit?", + LcGitFlowOptions: "show git-flow options", + NotAGitFlowBranch: "This does not seem to be a git flow branch", + NewGitFlowBranchPrompt: "new {{.branchType}} name:", + IgnoreTracked: "Ignore tracked file", + IgnoreTrackedPrompt: "Are you sure you want to ignore a tracked file?", + LcViewResetToUpstreamOptions: "view upstream reset options", + LcNextScreenMode: "next screen mode (normal/half/fullscreen)", + LcPrevScreenMode: "prev screen mode", + LcStartSearch: "start search", + Panel: "Panel", + Keybindings: "Keybindings", + LcRenameBranch: "rename branch", + NewBranchNamePrompt: "Enter new branch name for branch", + RenameBranchWarning: "This branch is tracking a remote. This action will only rename the local branch name, not the name of the remote branch. Continue?", + LcOpenMenu: "open menu", + LcCloseMenu: "close menu", + LcResetCherryPick: "reset cherry-picked (copied) commits selection", + LcNextTab: "next tab", + LcPrevTab: "previous tab", + LcCantUndoWhileRebasing: "Can't undo while rebasing", + LcCantRedoWhileRebasing: "Can't redo while rebasing", + MustStashWarning: "Pulling a patch out into the index requires stashing and unstashing your changes. If something goes wrong, you'll be able to access your files from the stash. Continue?", + MustStashTitle: "Must stash", + ConfirmationTitle: "Confirmation Panel", + LcPrevPage: "previous page", + LcNextPage: "next page", + LcGotoTop: "scroll to top", + LcGotoBottom: "scroll to bottom", + LcFilteringBy: "filtering by", + ResetInParentheses: "(reset)", + LcOpenScopingMenu: "view scoping options", + LcFilterBy: "filter by", + LcExitFilterMode: "stop filtering by path", + LcFilterPathOption: "enter path to filter by", + LcEnterFileName: "enter path:", + FilteringMenuTitle: "Filtering", + MustExitFilterModeTitle: "Command not available", + MustExitFilterModePrompt: "Command not available in filtered mode. Exit filtered mode?", + LcDiff: "diff", + LcEnterRefToDiff: "enter ref to diff", + LcEnteRefName: "enter ref:", + LcExitDiffMode: "exit diff mode", + DiffingMenuTitle: "Diffing", + LcSwapDiff: "reverse diff direction", + LcOpenDiffingMenu: "open diff menu", + LcShowingGitDiff: "showing output for:", + LcCopyCommitShaToClipboard: "copy commit SHA to clipboard", + LcCopyBranchNameToClipboard: "copy branch name to clipboard", + LcCopyFileNameToClipboard: "copy the file name to the clipboard", + LcCopyCommitFileNameToClipboard: "copy the committed file name to the clipboard", + LcCommitPrefixPatternError: "Error in commitPrefix pattern", + NoFilesStagedTitle: "No files staged", + NoFilesStagedPrompt: "You have not staged any files. Commit all files?", + BranchNotFoundTitle: "Branch not found", + BranchNotFoundPrompt: "Branch not found. Create a new branch named", + UnstageLinesTitle: "Unstage lines", + UnstageLinesPrompt: "Are you sure you want to delete the selected lines (git reset)? It is irreversible.\nTo disable this dialogue set the config key of 'gui.skipUnstageLineWarning' to true", + LcCreateNewBranchFromCommit: "create new branch off of commit", + LcViewStashFiles: "view stash entry's files", + LcBuildingPatch: "building patch", + LcViewCommits: "view commits", + MinGitVersionError: "Git version must be at least 2.0 (i.e. from 2014 onwards). Please upgrade your git version. Alternatively raise an issue at https://github.com/jesseduffield/lazygit/issues for lazygit to be more backwards compatible.", + LcRunningCustomCommandStatus: "running custom command", + LcSubmoduleStashAndReset: "stash uncommitted submodule changes and update", + LcAndResetSubmodules: "and reset submodules", + LcEnterSubmodule: "enter submodule", + LcCopySubmoduleNameToClipboard: "copy submodule name to clipboard", + RemoveSubmodule: "Remove submodule", + LcRemoveSubmodule: "remove submodule", + RemoveSubmodulePrompt: "Are you sure you want to remove submodule '%s' and its corresponding directory? This is irreversible.", + LcResettingSubmoduleStatus: "resetting submodule", + LcNewSubmoduleName: "new submodule name:", + LcNewSubmoduleUrl: "new submodule URL:", + LcNewSubmodulePath: "new submodule path:", + LcAddSubmodule: "add new submodule", + LcAddingSubmoduleStatus: "adding submodule", + LcUpdateSubmoduleUrl: "update URL for submodule '%s'", + LcUpdatingSubmoduleUrlStatus: "updating URL", + LcEditSubmoduleUrl: "update submodule URL", + LcInitializingSubmoduleStatus: "initializing submodule", + LcInitSubmodule: "initialize submodule", + LcViewResetAndRemoveOptions: "view reset and remove submodule options", + LcSubmoduleUpdate: "update submodule", + LcUpdatingSubmoduleStatus: "updating submodule", + LcBulkInitSubmodules: "bulk init submodules", + LcBulkUpdateSubmodules: "bulk update submodules", + LcBulkDeinitSubmodules: "bulk deinit submodules", + LcViewBulkSubmoduleOptions: "view bulk submodule options", + LcBulkSubmoduleOptions: "bulk submodule options", + LcRunningCommand: "running command", + SubCommitsTitle: "Sub-commits", + SubmodulesTitle: "Submodules", + NavigationTitle: "List Panel Navigation", + } } diff --git a/pkg/i18n/i18n.go b/pkg/i18n/i18n.go index 62240c3ea..6759c9cf5 100644 --- a/pkg/i18n/i18n.go +++ b/pkg/i18n/i18n.go @@ -1,89 +1,42 @@ package i18n import ( - "fmt" + "strings" "github.com/cloudfoundry/jibber_jabber" - "github.com/nicksnyder/go-i18n/v2/i18n" + "github.com/imdario/mergo" "github.com/sirupsen/logrus" - "golang.org/x/text/language" ) -// Teml is short for template used to make the required map[string]interface{} shorter when using gui.Tr.SLocalize and gui.Tr.TemplateLocalize -type Teml map[string]interface{} - // Localizer will translate a message into the user's language type Localizer struct { - i18nLocalizer *i18n.Localizer - language string - Log *logrus.Entry + Log *logrus.Entry + S TranslationSet } -// NewLocalizer creates a new Localizer -func NewLocalizer(log *logrus.Entry) *Localizer { +// NewTranslationSet creates a new Localizer +func NewTranslationSet(log *logrus.Entry) *TranslationSet { userLang := detectLanguage(jibber_jabber.DetectLanguage) log.Info("language: " + userLang) - return setupLocalizer(log, userLang) -} + baseSet := englishTranslationSet() -// 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 (l *Localizer) Localize(config *i18n.LocalizeConfig) string { - return l.i18nLocalizer.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 (l *Localizer) SLocalize(ID string) string { - return l.Localize(&i18n.LocalizeConfig{ - DefaultMessage: &i18n.Message{ - ID: ID, - }, - }) -} - -// TemplateLocalize allows the Other input to be dynamic -func (l *Localizer) TemplateLocalize(ID string, TemplateData map[string]interface{}) string { - return l.Localize(&i18n.LocalizeConfig{ - DefaultMessage: &i18n.Message{ - ID: ID, - }, - TemplateData: TemplateData, - }) -} - -func (l *Localizer) SLocalizef(ID string, args ...interface{}) string { - str := l.Localize(&i18n.LocalizeConfig{ - DefaultMessage: &i18n.Message{ - ID: ID, - }, - }) - - return fmt.Sprintf(str, args...) -} - -// GetLanguage returns the currently selected language, e.g 'en' -func (l *Localizer) GetLanguage() string { - return l.language -} - -// add translation file(s) -func addBundles(log *logrus.Entry, i18nBundle *i18n.Bundle) { - fs := []func(*i18n.Bundle) error{ - addPolish, - addDutch, - addEnglish, + for languageCode, translationSet := range GetTranslationSets() { + if strings.HasPrefix(userLang, languageCode) { + _ = mergo.Merge(&baseSet, translationSet, mergo.WithOverride) + } } - for _, f := range fs { - if err := f(i18nBundle); err != nil { - log.Fatal(err) + return &baseSet +} - } +// GetTranslationSets gets all the translation sets, keyed by language code +func GetTranslationSets() map[string]TranslationSet { + return map[string]TranslationSet{ + "pl": polishTranslationSet(), + "nl": dutchTranslationSet(), + "en": englishTranslationSet(), } } @@ -95,20 +48,3 @@ func detectLanguage(langDetector func() (string, error)) string { return "C" } - -// setupLocalizer creates a new localizer using given userLang -func setupLocalizer(log *logrus.Entry, userLang string) *Localizer { - // create a i18n bundle that can be used to add translations and other things - i18nBundle := i18n.NewBundle(language.English) - - addBundles(log, i18nBundle) - - // return the new localizer that can be used to translate text - i18nLocalizer := i18n.NewLocalizer(i18nBundle, userLang) - - return &Localizer{ - i18nLocalizer: i18nLocalizer, - language: userLang, - Log: log, - } -} diff --git a/pkg/i18n/i18n_test.go b/pkg/i18n/i18n_test.go index 0739d6dc6..cc06e3572 100644 --- a/pkg/i18n/i18n_test.go +++ b/pkg/i18n/i18n_test.go @@ -5,8 +5,6 @@ import ( "io/ioutil" "testing" - "github.com/nicksnyder/go-i18n/v2/i18n" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" ) @@ -17,11 +15,6 @@ func getDummyLog() *logrus.Entry { return log.WithField("test", "test") } -// TestNewLocalizer is a function. -func TestNewLocalizer(t *testing.T) { - assert.NotNil(t, NewLocalizer(getDummyLog())) -} - // TestDetectLanguage is a function. func TestDetectLanguage(t *testing.T) { type scenario struct { @@ -48,44 +41,3 @@ func TestDetectLanguage(t *testing.T) { assert.EqualValues(t, s.expected, detectLanguage(s.langDetector)) } } - -// TestLocalizer is a function. -func TestLocalizer(t *testing.T) { - type scenario struct { - userLang string - test func(*Localizer) - } - - scenarios := []scenario{ - { - "C", - func(l *Localizer) { - assert.EqualValues(t, "C", l.GetLanguage()) - assert.Equal(t, "Diff", l.Localize(&i18n.LocalizeConfig{ - DefaultMessage: &i18n.Message{ - ID: "DiffTitle", - }, - })) - assert.Equal(t, "Diff", l.SLocalize("DiffTitle")) - assert.Equal(t, "Are you sure you want to delete the branch test?", l.TemplateLocalize("DeleteBranchMessage", Teml{"selectedBranchName": "test"})) - }, - }, - { - "nl", - func(l *Localizer) { - assert.EqualValues(t, "nl", l.GetLanguage()) - assert.Equal(t, "Diff", l.Localize(&i18n.LocalizeConfig{ - DefaultMessage: &i18n.Message{ - ID: "DiffTitle", - }, - })) - assert.Equal(t, "Diff", l.SLocalize("DiffTitle")) - assert.Equal(t, "Weet je zeker dat je branch test wilt verwijderen?", l.TemplateLocalize("DeleteBranchMessage", Teml{"selectedBranchName": "test"})) - }, - }, - } - - for _, s := range scenarios { - s.test(setupLocalizer(getDummyLog(), s.userLang)) - } -} diff --git a/pkg/i18n/polish.go b/pkg/i18n/polish.go index 5d1ff7373..c08db3f4a 100644 --- a/pkg/i18n/polish.go +++ b/pkg/i18n/polish.go @@ -1,766 +1,253 @@ package i18n -import ( - "github.com/nicksnyder/go-i18n/v2/i18n" - "golang.org/x/text/language" -) - -func addPolish(i18nObject *i18n.Bundle) error { - - return i18nObject.AddMessages(language.Polish, - &i18n.Message{ - ID: "NotEnoughSpace", - Other: "Za mało miejsca do wyświetlenia paneli", - }, &i18n.Message{ - ID: "DiffTitle", - Other: "Różnice", - }, &i18n.Message{ - ID: "LogTitle", - Other: "Log", - }, &i18n.Message{ - ID: "FilesTitle", - Other: "Pliki", - }, &i18n.Message{ - ID: "BranchesTitle", - Other: "Gałęzie", - }, &i18n.Message{ - ID: "CommitsTitle", - Other: "Commity", - }, &i18n.Message{ - ID: "CommitsDiffTitle", - Other: "Commits (specific diff mode)", - }, &i18n.Message{ - ID: "CommitsDiff", - Other: "select commit to diff with another commit", - }, &i18n.Message{ - ID: "StashTitle", - Other: "Schowek", - }, &i18n.Message{ - ID: "UnstagedChanges", - Other: `Unstaged Changes`, - }, &i18n.Message{ - ID: "StagedChanges", - Other: `Staged Changes`, - }, &i18n.Message{ - ID: "MergingMainTitle", - Other: "Resolve merge conflicts", - }, &i18n.Message{ - ID: "CommitMessage", - Other: "Wiadomość commita", - }, &i18n.Message{ - ID: "CredentialsUsername", - Other: "Username", - }, &i18n.Message{ - ID: "CredentialsPassword", - Other: "Password", - }, &i18n.Message{ - ID: "PassUnameWrong", - Other: "Password and/or username wrong", - }, &i18n.Message{ - ID: "CommitChanges", - Other: "commituj zmiany", - }, &i18n.Message{ - ID: "AmendLastCommit", - Other: "zmień ostatnie zatwierdzenie", - }, &i18n.Message{ - ID: "SureToAmend", - Other: "Czy na pewno chcesz zmienić ostatnie zatwierdzenie? Możesz zmienić komunikat zatwierdzenia z panelu zatwierdzeń.", - }, &i18n.Message{ - ID: "NoCommitToAmend", - Other: "Nie ma zobowiązania do zmiany.", - }, &i18n.Message{ - ID: "CommitChangesWithEditor", - Other: "commituj zmiany używając edytora z gita", - }, &i18n.Message{ - ID: "StatusTitle", - Other: "Status", - }, &i18n.Message{ - ID: "GlobalTitle", - Other: "Globalne", - }, &i18n.Message{ - ID: "navigate", - Other: "nawiguj", - }, &i18n.Message{ - ID: "menu", - Other: "menu", - }, &i18n.Message{ - ID: "execute", - Other: "wykonaj", - }, &i18n.Message{ - ID: "open", - Other: "otwórz", - }, &i18n.Message{ - ID: "ignore", - Other: "ignoruj", - }, &i18n.Message{ - ID: "delete", - Other: "usuń", - }, &i18n.Message{ - ID: "toggleStaged", - Other: "przełącz zatwierdzenie", - }, &i18n.Message{ - ID: "toggleStagedAll", - Other: "przełącz wszystkie zatwierdzenia", - }, &i18n.Message{ - ID: "refresh", - Other: "odśwież", - }, &i18n.Message{ - ID: "edit", - Other: "edytuj", - }, &i18n.Message{ - ID: "scroll", - Other: "przewiń", - }, &i18n.Message{ - ID: "abortMerge", - Other: "o scalaniu", - }, &i18n.Message{ - ID: "resolveMergeConflicts", - Other: "rozwiąż konflikty scalania", - }, &i18n.Message{ - ID: "checkout", - Other: "przełącz", - }, &i18n.Message{ - ID: "NoChangedFiles", - Other: "Brak zmienionych plików", - }, &i18n.Message{ - ID: "FileHasNoUnstagedChanges", - Other: "Plik nie zawiera żadnych nieopublikowanych zmian do dodania", - }, &i18n.Message{ - ID: "CannotGitAdd", - Other: "Nie można git add --patch nieśledzonych plików", - }, &i18n.Message{ - ID: "NoFilesDisplay", - Other: "Brak pliku do wyświetlenia", - }, &i18n.Message{ - ID: "PullWait", - Other: "Wciąganie zmian...", - }, &i18n.Message{ - ID: "PushWait", - Other: "Wypychanie zmian...", - }, &i18n.Message{ - ID: "FetchWait", - Other: "Fetching...", - }, &i18n.Message{ - ID: "FileNoMergeCons", - Other: "Ten plik nie powoduje konfliktów scalania", - }, &i18n.Message{ - ID: "SureTo", - Other: "Jesteś pewny, że chcesz {{.deleteVerb}} {{.fileName}} (stracisz swoje wprowadzone zmiany)?", - }, &i18n.Message{ - ID: "AlreadyCheckedOutBranch", - Other: "Już przęłączono na tą gałąź", - }, &i18n.Message{ - ID: "SureForceCheckout", - Other: "Jesteś pewny, że chcesz wymusić przełączenie? Stracisz wszystkie lokalne zmiany", - }, &i18n.Message{ - ID: "ForceCheckoutBranch", - Other: "Wymuś przełączenie gałęzi", - }, &i18n.Message{ - ID: "BranchName", - Other: "Nazwa gałęzi", - }, &i18n.Message{ - ID: "NewBranchNameBranchOff", - Other: "Nazwa nowej gałęzi (gałąź na bazie {{.branchName}})", - }, &i18n.Message{ - ID: "CantDeleteCheckOutBranch", - Other: "Nie możesz usunąć obecnej przełączonej gałęzi!", - }, &i18n.Message{ - ID: "DeleteBranch", - Other: "Usuń gałąź", - }, &i18n.Message{ - ID: "DeleteBranchMessage", - Other: "Jesteś pewien, że chcesz usunąć gałąź {{.selectedBranchName}} ?", - }, &i18n.Message{ - ID: "ForceDeleteBranchMessage", - Other: "Na pewno wymusić usunięcie gałęzi {{.selectedBranchName}}?", - }, &i18n.Message{ - ID: "rebaseBranch", - Other: "rebase branch", - }, &i18n.Message{ - ID: "CantRebaseOntoSelf", - Other: "You cannot rebase a branch onto itself", - }, &i18n.Message{ - ID: "CantMergeBranchIntoItself", - Other: "Nie możesz scalić gałęzi do samej siebie", - }, &i18n.Message{ - ID: "forceCheckout", - Other: "wymuś przełączenie", - }, &i18n.Message{ - ID: "merge", - Other: "scal", - }, &i18n.Message{ - ID: "checkoutByName", - Other: "przełącz używając nazwy", - }, &i18n.Message{ - ID: "newBranch", - Other: "nowa gałąź", - }, &i18n.Message{ - ID: "deleteBranch", - Other: "usuń gałąź", - }, &i18n.Message{ - ID: "forceDeleteBranch", - Other: "usuń gałąź (wymuś)", - }, &i18n.Message{ - ID: "NoBranchesThisRepo", - Other: "Brak gałęzi dla tego repozytorium", - }, &i18n.Message{ - ID: "NoTrackingThisBranch", - Other: "Brak śledzenia dla tej gałęzi", - }, &i18n.Message{ - ID: "CommitMessageConfirm", - Other: "{{.keyBindClose}}: zamknij, {{.keyBindNewLine}}: new line, {{.keyBindConfirm}}: potwierdź", - }, &i18n.Message{ - ID: "CommitWithoutMessageErr", - Other: "Nie możesz commitować bez podania wiadomości", - }, &i18n.Message{ - ID: "CloseConfirm", - Other: "{{.keyBindClose}}: zamknij, {{.keyBindConfirm}}: potwierdź", - }, &i18n.Message{ - ID: "close", - Other: "zamknij", - }, &i18n.Message{ - ID: "SureResetThisCommit", - Other: "Jesteś pewny, że chcesz zresetować ten commit?", - }, &i18n.Message{ - ID: "ResetToCommit", - Other: "Zresetuj, aby commitować", - }, &i18n.Message{ - ID: "squashDown", - Other: "ściśnij w dół", - }, &i18n.Message{ - ID: "rename", - Other: "przemianuj", - }, &i18n.Message{ - ID: "resetToThisCommit", - Other: "zresetuj do tego commita", - }, &i18n.Message{ - ID: "fixupCommit", - Other: "napraw commit", - }, &i18n.Message{ - ID: "NoCommitsThisBranch", - Other: "Brak commitów dla tej gałęzi", - }, &i18n.Message{ - ID: "OnlySquashTopmostCommit", - Other: "Można tylko ścisnąć najwyższy commit", - }, &i18n.Message{ - ID: "YouNoCommitsToSquash", - Other: "Nie masz commitów do ściśnięcia", - }, &i18n.Message{ - ID: "CantFixupWhileUnstagedChanges", - Other: "Nie można wykonać naprawy, kiedy istnieją niezatwierdzone zmiany", - }, &i18n.Message{ - ID: "Fixup", - Other: "Napraw", - }, &i18n.Message{ - ID: "SureFixupThisCommit", - Other: "Jesteś pewny, ze chcesz naprawić ten commit? Commit poniżej zostanie ściśnięty w górę wraz z tym", - }, &i18n.Message{ - ID: "OnlyRenameTopCommit", - Other: "Można przmianować tylko najwyższy commit", - }, &i18n.Message{ - ID: "renameCommit", - Other: "przemianuj commit", - }, &i18n.Message{ - ID: "renameCommitEditor", - Other: "przemianuj commit w edytorze", - }, &i18n.Message{ - ID: "PotentialErrInGetselectedCommit", - Other: "potencjalny błąd w getSelected Commit (niedopasowane ui i stan)", - }, &i18n.Message{ - ID: "Error", - Other: "Błąd", - }, &i18n.Message{ - ID: "RunningSubprocess", - Other: "uruchomiony podproces", - }, &i18n.Message{ - ID: "selectHunk", - Other: "wybierz kawałek", - }, &i18n.Message{ - ID: "navigateConflicts", - Other: "nawiguj konflikty", - }, &i18n.Message{ - ID: "pickHunk", - Other: "wybierz kawałek", - }, &i18n.Message{ - ID: "pickBothHunks", - Other: "wybierz oba kawałki", - }, &i18n.Message{ - ID: "undo", - Other: "cofnij", - }, &i18n.Message{ - ID: "pop", - Other: "wyciągnij", - }, &i18n.Message{ - ID: "drop", - Other: "porzuć", - }, &i18n.Message{ - ID: "apply", - Other: "zastosuj", - }, &i18n.Message{ - ID: "NoStashEntries", - Other: "Brak pozycji w schowku", - }, &i18n.Message{ - ID: "StashDrop", - Other: "Porzuć schowek", - }, &i18n.Message{ - ID: "SureDropStashEntry", - Other: "Jesteś pewny, że chcesz porzucić tę pozycję w schowku?", - }, &i18n.Message{ - ID: "NoStashTo", - Other: "Brak schowka dla {{.method}}", - }, &i18n.Message{ - ID: "NoTrackedStagedFilesStash", - Other: "Nie masz śledzonych/zatwierdzonych plików do przechowania", - }, &i18n.Message{ - ID: "StashChanges", - Other: "Przechowaj zmiany", - }, &i18n.Message{ - ID: "IssntListOfViews", - Other: "{{.name}} nie jest na liście widoków", - }, &i18n.Message{ - ID: "newFocusedViewIs", - Other: "nowy skupiony widok to {{.newFocusedView}}", - }, &i18n.Message{ - ID: "MergeAborted", - Other: "Scalanie anulowane", - }, &i18n.Message{ - ID: "OpenConfig", - Other: "otwórz plik konfiguracyjny", - }, &i18n.Message{ - ID: "EditConfig", - Other: "edytuj plik konfiguracyjny", - }, &i18n.Message{ - ID: "ForcePush", - Other: "Wymuś wypchnięcie", - }, &i18n.Message{ - ID: "ForcePushPrompt", - Other: "Twoja gałąź rozeszła się z gałęzią zdalną. Wciśnij 'esc' aby anulować lub 'enter' aby wymusić wypchnięcie.", - }, &i18n.Message{ - ID: "ForcePushDisabled", - Other: "Your branch has diverged from the remote branch and you've disabled force pushing", - }, &i18n.Message{ - ID: "UpdatesRejectedAndForcePushDisabled", - Other: "Updates were rejected and you have disabled force pushing", - }, &i18n.Message{ - ID: "checkForUpdate", - Other: "sprawdź aktualizacje", - }, &i18n.Message{ - ID: "CheckingForUpdates", - Other: "Sprawdzanie aktualizacji...", - }, &i18n.Message{ - ID: "OnLatestVersionErr", - Other: "Już posiadasz najnowszą wersję", - }, &i18n.Message{ - ID: "MajorVersionErr", - Other: "Nowa wersja ({{.newVersion}}) posiada niekompatybilne zmiany w porównaniu do obecnej wersji ({{.currentVersion}})", - }, &i18n.Message{ - ID: "CouldNotFindBinaryErr", - Other: "Nie można znaleźć pliku binarnego w {{.url}}", - }, &i18n.Message{ - ID: "AnonymousReportingTitle", - Other: "Help make lazygit better", - }, &i18n.Message{ - ID: "AnonymousReportingPrompt", - Other: "Włączyć anonimowe raportowanie błędów w celu pomocy w usprawnianiu lazygita (enter/esc)?", - }, &i18n.Message{ - ID: "editFile", - Other: `edytuj plik`, - }, &i18n.Message{ - ID: "openFile", - Other: `otwórz plik`, - }, &i18n.Message{ - ID: "ignoreFile", - Other: `dodaj do .gitignore`, - }, &i18n.Message{ - ID: "refreshFiles", - Other: `odśwież pliki`, - }, &i18n.Message{ - ID: "mergeIntoCurrentBranch", - Other: `scal do obecnej gałęzi`, - }, &i18n.Message{ - ID: "ConfirmQuit", - Other: `Na pewno chcesz wyjść z programu?`, - }, &i18n.Message{ - ID: "UnsupportedGitService", - Other: `Nieobsługiwana usługa git`, - }, &i18n.Message{ - ID: "createPullRequest", - Other: `utwórz żądanie wyciągnięcia`, - }, &i18n.Message{ - ID: "NoBranchOnRemote", - Other: `Ta gałąź nie istnieje na zdalnym. Najpierw musisz go odepchnąć na odległość.`, - }, &i18n.Message{ - ID: "fetch", - Other: `fetch`, - }, &i18n.Message{ - ID: "NoAutomaticGitFetchTitle", - Other: `No automatic git fetch`, - }, &i18n.Message{ - ID: "NoAutomaticGitFetchBody", - Other: `Lazygit can't use "git fetch" in a private repo use f in the branches panel to run "git fetch" manually`, - }, &i18n.Message{ - ID: "StageLines", - Other: `zatwierdź pojedyncze linie`, - }, &i18n.Message{ - ID: "FileStagingRequirements", - Other: `Można tylko zatwierdzić pojedyncze linie dla śledzonych plików z niezatwierdzonymi zmianami`, - }, &i18n.Message{ - ID: "StagingTitle", - Other: `Zatwierdzanie`, - }, &i18n.Message{ - ID: "StageHunk", - Other: `zatwierdź kawałek`, - }, &i18n.Message{ - ID: "StageLine", - Other: `zatwierdź linię`, - }, &i18n.Message{ - ID: "ReturnToFilesPanel", - Other: `wróć do panelu plików`, - }, &i18n.Message{ - ID: "CantFindHunks", - Other: `Nie można znaleźć żadnych kawałków w tej łatce`, - }, &i18n.Message{ - ID: "CantFindHunk", - Other: `Nie można znaleźć kawałka`, - }, &i18n.Message{ - ID: "RebasingTitle", - Other: "Rebasing", - }, &i18n.Message{ - ID: "MergingTitle", - Other: "Merging", - }, &i18n.Message{ - ID: "ConfirmRebase", - Other: "Are you sure you want to rebase {{.checkedOutBranch}} onto {{.selectedBranch}}?", - }, &i18n.Message{ - ID: "ConfirmMerge", - Other: "Are you sure you want to merge {{.selectedBranch}} into {{.checkedOutBranch}}?", - }, &i18n.Message{}, &i18n.Message{ - ID: "FwdNoUpstream", - Other: "Cannot fast-forward a branch with no upstream", - }, &i18n.Message{ - ID: "FwdCommitsToPush", - Other: "Cannot fast-forward a branch with commits to push", - }, &i18n.Message{ - ID: "ErrorOccurred", - Other: "An error occurred! Please create an issue at https://github.com/jesseduffield/lazygit/issues", - }, &i18n.Message{ - ID: "MainTitle", - Other: "Main", - }, &i18n.Message{ - ID: "NormalTitle", - Other: "Normal", - }, &i18n.Message{ - ID: "softReset", - Other: "soft reset", - }, &i18n.Message{ - ID: "SureSquashThisCommit", - Other: "Are you sure you want to squash this commit into the commit below?", - }, &i18n.Message{ - ID: "Squash", - Other: "Squash", - }, &i18n.Message{ - ID: "pickCommit", - Other: "pick commit (when mid-rebase)", - }, &i18n.Message{ - ID: "revertCommit", - Other: "revert commit", - }, &i18n.Message{ - ID: "deleteCommit", - Other: "delete commit", - }, &i18n.Message{ - ID: "moveDownCommit", - Other: "move commit down one", - }, &i18n.Message{ - ID: "moveUpCommit", - Other: "move commit up one", - }, &i18n.Message{ - ID: "editCommit", - Other: "edit commit", - }, &i18n.Message{ - ID: "amendToCommit", - Other: "amend commit with staged changes", - }, &i18n.Message{ - ID: "FoundConflicts", - Other: "Conflicts! To abort press 'esc', otherwise press 'enter'", - }, &i18n.Message{ - ID: "FoundConflictsTitle", - Other: "Auto-merge failed", - }, &i18n.Message{ - ID: "Undo", - Other: "undo", - }, &i18n.Message{ - ID: "PickHunk", - Other: "pick hunk", - }, &i18n.Message{ - ID: "PickBothHunks", - Other: "pick both hunks", - }, &i18n.Message{ - ID: "ViewMergeRebaseOptions", - Other: "view merge/rebase options", - }, &i18n.Message{ - ID: "NotMergingOrRebasing", - Other: "You are currently neither rebasing nor merging", - }, &i18n.Message{ - ID: "RecentRepos", - Other: "recent repositories", - }, &i18n.Message{ - ID: "MergeOptionsTitle", - Other: "Merge Options", - }, &i18n.Message{ - ID: "RebaseOptionsTitle", - Other: "Rebase Options", - }, &i18n.Message{ - ID: "ConflictsResolved", - Other: "all merge conflicts resolved. Continue?", - }, &i18n.Message{ - ID: "NoRoom", - Other: "Not enough room", - }, &i18n.Message{ - ID: "YouAreHere", - Other: "YOU ARE HERE", - }, &i18n.Message{ - ID: "rewordNotSupported", - Other: "rewording commits while interactively rebasing is not currently supported", - }, &i18n.Message{ - ID: "cherryPickCopy", - Other: "copy commit (cherry-pick)", - }, &i18n.Message{ - ID: "cherryPickCopyRange", - Other: "copy commit range (cherry-pick)", - }, &i18n.Message{ - ID: "pasteCommits", - Other: "paste commits (cherry-pick)", - }, &i18n.Message{ - ID: "SureCherryPick", - Other: "Are you sure you want to cherry-pick the copied commits onto this branch?", - }, &i18n.Message{ - ID: "CherryPick", - Other: "Cherry-Pick", - }, &i18n.Message{ - ID: "CannotRebaseOntoFirstCommit", - Other: "You cannot interactive rebase onto the first commit", - }, &i18n.Message{ - ID: "CannotSquashOntoSecondCommit", - Other: "You cannot squash/fixup onto the second commit", - }, &i18n.Message{ - ID: "Donate", - Other: "Donate", - }, &i18n.Message{ - ID: "PrevLine", - Other: "select previous line", - }, &i18n.Message{ - ID: "NextLine", - Other: "select next line", - }, &i18n.Message{ - ID: "PrevHunk", - Other: "select previous hunk", - }, &i18n.Message{ - ID: "NextHunk", - Other: "select next hunk", - }, &i18n.Message{ - ID: "PrevConflict", - Other: "select previous conflict", - }, &i18n.Message{ - ID: "NextConflict", - Other: "select next conflict", - }, &i18n.Message{ - ID: "SelectTop", - Other: "select top hunk", - }, &i18n.Message{ - ID: "SelectBottom", - Other: "select bottom hunk", - }, &i18n.Message{ - ID: "ScrollDown", - Other: "scroll down", - }, &i18n.Message{ - ID: "ScrollUp", - Other: "scroll up", - }, &i18n.Message{ - ID: "AmendCommitTitle", - Other: "Amend Commit", - }, &i18n.Message{ - ID: "AmendCommitPrompt", - Other: "Are you sure you want to amend this commit with your staged files?", - }, &i18n.Message{ - ID: "DeleteCommitTitle", - Other: "Delete Commit", - }, &i18n.Message{ - ID: "DeleteCommitPrompt", - Other: "Are you sure you want to delete this commit?", - }, &i18n.Message{ - ID: "SquashingStatus", - Other: "squashing", - }, &i18n.Message{ - ID: "FixingStatus", - Other: "fixing up", - }, &i18n.Message{ - ID: "DeletingStatus", - Other: "deleting", - }, &i18n.Message{ - ID: "MovingStatus", - Other: "moving", - }, &i18n.Message{ - ID: "RebasingStatus", - Other: "rebasing", - }, &i18n.Message{ - ID: "AmendingStatus", - Other: "amending", - }, &i18n.Message{ - ID: "CherryPickingStatus", - Other: "cherry-picking", - }, &i18n.Message{ - ID: "CommitFiles", - Other: "Commit files", - }, &i18n.Message{ - ID: "viewCommitFiles", - Other: "view commit's files", - }, &i18n.Message{ - ID: "CommitFilesTitle", - Other: "Commit files", - }, &i18n.Message{ - ID: "goBack", - Other: "go back", - }, &i18n.Message{ - ID: "NoCommiteFiles", - Other: "No files for this commit", - }, &i18n.Message{ - ID: "checkoutCommitFile", - Other: "checkout file", - }, &i18n.Message{ - ID: "discardOldFileChange", - Other: "discard this commit's changes to this file", - }, &i18n.Message{ - ID: "DiscardFileChangesTitle", - Other: "Discard file changes", - }, &i18n.Message{ - ID: "DiscardFileChangesPrompt", - Other: "Are you sure you want to discard this commit's changes to this file? If this file was created in this commit, it will be deleted", - }, &i18n.Message{ - ID: "DisabledForGPG", - Other: "Feature not available for users using GPG", - }, &i18n.Message{ - ID: "CreateRepo", - Other: "Not in a git repository. Create a new git repository? (y/n): ", - }, &i18n.Message{ - ID: "AutoStashTitle", - Other: "Autostash?", - }, &i18n.Message{ - ID: "AutoStashPrompt", - Other: "You must stash and pop your changes to bring them across. Do this automatically? (enter/esc)", - }, &i18n.Message{ - ID: "StashPrefix", - Other: "Auto-stashing changes for ", - }, &i18n.Message{ - ID: "viewDiscardOptions", - Other: "view 'discard changes' options", - }, &i18n.Message{ - ID: "cancel", - Other: "cancel", - }, &i18n.Message{ - ID: "discardAllChanges", - Other: "discard all changes", - }, &i18n.Message{ - ID: "discardUnstagedChanges", - Other: "discard unstaged changes", - }, &i18n.Message{ - ID: "discardAllChangesToAllFiles", - Other: "nuke working tree", - }, &i18n.Message{ - ID: "discardAnyUnstagedChanges", - Other: "discard unstaged changes", - }, &i18n.Message{ - ID: "discardUntrackedFiles", - Other: "discard untracked files", - }, &i18n.Message{ - ID: "hardReset", - Other: "hard reset", - }, &i18n.Message{ - ID: "viewResetOptions", - Other: `view reset options`, - }, &i18n.Message{ - ID: "createFixupCommit", - Other: `create fixup commit for this commit`, - }, &i18n.Message{ - ID: "squashAboveCommits", - Other: `squash above commits`, - }, &i18n.Message{ - ID: "SquashAboveCommits", - Other: `Squash above commits`, - }, &i18n.Message{ - ID: "SureSquashAboveCommits", - Other: `Are you sure you want to squash all fixup! commits above {{.commit}}?`, - }, &i18n.Message{ - ID: "CreateFixupCommit", - Other: `Create fixup commit`, - }, &i18n.Message{ - ID: "SureCreateFixupCommit", - Other: `Are you sure you want to create a fixup! commit for commit {{.commit}}?`, - }, &i18n.Message{ - ID: "executeCustomCommand", - Other: "execute custom command", - }, &i18n.Message{ - ID: "CustomCommand", - Other: "Custom Command:", - }, &i18n.Message{ - ID: "commitChangesWithoutHook", - Other: "commit changes without pre-commit hook", - }, &i18n.Message{ - ID: "SkipHookPrefixNotConfigured", - Other: "You have not configured a commit message prefix for skipping hooks. Set `git.skipHookPrefix = 'WIP'` in your config", - }, &i18n.Message{ - ID: "resetTo", - Other: `reset to`, - }, &i18n.Message{ - ID: "pressEnterToReturn", - Other: "Press enter to return to lazygit", - }, &i18n.Message{ - ID: "viewStashOptions", - Other: "view stash options", - }, &i18n.Message{ - ID: "stashAllChanges", - Other: "przechowaj pliki", - }, &i18n.Message{ - ID: "stashStagedChanges", - Other: "stash staged changes", - }, &i18n.Message{ - ID: "stashOptions", - Other: "Stash options", - }, &i18n.Message{ - ID: "notARepository", - Other: "Error: must be run inside a git repository", - }, &i18n.Message{ - ID: "jump", - Other: "jump to panel", - }, &i18n.Message{ - ID: "ExitLineByLineMode", - Other: `exit line-by-line mode`, - }, &i18n.Message{ - ID: "EnterUpstream", - Other: `Enter upstream as ' '`, - }, &i18n.Message{ - ID: "ReturnToRemotesList", - Other: `return to remotes list`, - }, &i18n.Message{ - ID: "IgnoreTracked", - Other: "Ignore tracked file", - }, &i18n.Message{ - ID: "IgnoreTrackedPrompt", - Other: "Are you sure you want to ignore a tracked file?", - }, &i18n.Message{ - ID: "commitPrefixPatternError", - Other: "Error in commitPrefix pattern", - }, &i18n.Message{ - ID: "NoFilesStagedTitle", - Other: "No files staged", - }, &i18n.Message{ - ID: "NoFilesStagedPrompt", - Other: "You have not staged any files. Commit all files?", - }, &i18n.Message{ - ID: "BranchNotFoundTitle", - Other: "Branch not found", - }, &i18n.Message{ - ID: "BranchNotFoundPrompt", - Other: "Branch not found. Create a new branch named", - }, - ) +func polishTranslationSet() TranslationSet { + return TranslationSet{ + NotEnoughSpace: "Za mało miejsca do wyświetlenia paneli", + DiffTitle: "Różnice", + LogTitle: "Log", + FilesTitle: "Pliki", + BranchesTitle: "Gałęzie", + CommitsTitle: "Commity", + StashTitle: "Schowek", + UnstagedChanges: `Unstaged Changes`, + StagedChanges: `Staged Changes`, + MergingMainTitle: "Resolve merge conflicts", + CommitMessage: "Wiadomość commita", + CredentialsUsername: "Username", + CredentialsPassword: "Password", + PassUnameWrong: "Password and/or username wrong", + CommitChanges: "commituj zmiany", + AmendLastCommit: "zmień ostatnie zatwierdzenie", + SureToAmend: "Czy na pewno chcesz zmienić ostatnie zatwierdzenie? Możesz zmienić komunikat zatwierdzenia z panelu zatwierdzeń.", + NoCommitToAmend: "Nie ma zobowiązania do zmiany.", + CommitChangesWithEditor: "commituj zmiany używając edytora z gita", + StatusTitle: "Status", + GlobalTitle: "Globalne", + LcNavigate: "nawiguj", + LcMenu: "menu", + LcExecute: "wykonaj", + LcOpen: "otwórz", + LcIgnore: "ignoruj", + LcDelete: "usuń", + LcToggleStaged: "przełącz zatwierdzenie", + LcToggleStagedAll: "przełącz wszystkie zatwierdzenia", + LcRefresh: "odśwież", + LcEdit: "edytuj", + LcScroll: "przewiń", + LcAbortMerge: "o scalaniu", + LcResolveMergeConflicts: "rozwiąż konflikty scalania", + LcCheckout: "przełącz", + NoChangedFiles: "Brak zmienionych plików", + FileHasNoUnstagedChanges: "Plik nie zawiera żadnych nieopublikowanych zmian do dodania", + CannotGitAdd: "Nie można git add --patch nieśledzonych plików", + NoFilesDisplay: "Brak pliku do wyświetlenia", + PullWait: "Wciąganie zmian...", + PushWait: "Wypychanie zmian...", + FetchWait: "Fetching...", + FileNoMergeCons: "Ten plik nie powoduje konfliktów scalania", + SureTo: "Jesteś pewny, że chcesz {{.deleteVerb}} {{.fileName}} (stracisz swoje wprowadzone zmiany)?", + AlreadyCheckedOutBranch: "Już przęłączono na tą gałąź", + SureForceCheckout: "Jesteś pewny, że chcesz wymusić przełączenie? Stracisz wszystkie lokalne zmiany", + ForceCheckoutBranch: "Wymuś przełączenie gałęzi", + BranchName: "Nazwa gałęzi", + NewBranchNameBranchOff: "Nazwa nowej gałęzi (gałąź na bazie {{.branchName}})", + CantDeleteCheckOutBranch: "Nie możesz usunąć obecnej przełączonej gałęzi!", + DeleteBranch: "Usuń gałąź", + DeleteBranchMessage: "Jesteś pewien, że chcesz usunąć gałąź {{.selectedBranchName}} ?", + ForceDeleteBranchMessage: "Na pewno wymusić usunięcie gałęzi {{.selectedBranchName}}?", + LcRebaseBranch: "rebase branch", + CantRebaseOntoSelf: "You cannot rebase a branch onto itself", + CantMergeBranchIntoItself: "Nie możesz scalić gałęzi do samej siebie", + LcForceCheckout: "wymuś przełączenie", + LcMerge: "scal", + LcCheckoutByName: "przełącz używając nazwy", + LcNewBranch: "nowa gałąź", + LcDeleteBranch: "usuń gałąź", + LcForceDeleteBranch: "usuń gałąź (wymuś)", + NoBranchesThisRepo: "Brak gałęzi dla tego repozytorium", + NoTrackingThisBranch: "Brak śledzenia dla tej gałęzi", + CommitMessageConfirm: "{{.keyBindClose}}: zamknij, {{.keyBindNewLine}}: new line, {{.keyBindConfirm}}: potwierdź", + CommitWithoutMessageErr: "Nie możesz commitować bez podania wiadomości", + CloseConfirm: "{{.keyBindClose}}: zamknij, {{.keyBindConfirm}}: potwierdź", + LcClose: "zamknij", + SureResetThisCommit: "Jesteś pewny, że chcesz zresetować ten commit?", + ResetToCommit: "Zresetuj, aby commitować", + LcSquashDown: "ściśnij w dół", + LcRename: "przemianuj", + LcResetToThisCommit: "zresetuj do tego commita", + LcFixupCommit: "napraw commit", + NoCommitsThisBranch: "Brak commitów dla tej gałęzi", + OnlySquashTopmostCommit: "Można tylko ścisnąć najwyższy commit", + YouNoCommitsToSquash: "Nie masz commitów do ściśnięcia", + CantFixupWhileUnstagedChanges: "Nie można wykonać naprawy, kiedy istnieją niezatwierdzone zmiany", + Fixup: "Napraw", + SureFixupThisCommit: "Jesteś pewny, ze chcesz naprawić ten commit? Commit poniżej zostanie ściśnięty w górę wraz z tym", + OnlyRenameTopCommit: "Można przmianować tylko najwyższy commit", + LcRenameCommit: "przemianuj commit", + LcRenameCommitEditor: "przemianuj commit w edytorze", + PotentialErrInGetselectedCommit: "potencjalny błąd w getSelected Commit (niedopasowane ui i stan)", + Error: "Błąd", + RunningSubprocess: "uruchomiony podproces", + LcSelectHunk: "wybierz kawałek", + LcNavigateConflicts: "nawiguj konflikty", + LcPickHunk: "wybierz kawałek", + LcPickBothHunks: "wybierz oba kawałki", + LcUndo: "cofnij", + LcPop: "wyciągnij", + LcDrop: "porzuć", + LcApply: "zastosuj", + NoStashEntries: "Brak pozycji w schowku", + StashDrop: "Porzuć schowek", + SureDropStashEntry: "Jesteś pewny, że chcesz porzucić tę pozycję w schowku?", + NoStashTo: "Brak schowka dla {{.method}}", + NoTrackedStagedFilesStash: "Nie masz śledzonych/zatwierdzonych plików do przechowania", + StashChanges: "Przechowaj zmiany", + IssntListOfViews: "{{.name}} nie jest na liście widoków", + LcNewFocusedViewIs: "nowy skupiony widok to {{.newFocusedView}}", + MergeAborted: "Scalanie anulowane", + OpenConfig: "otwórz plik konfiguracyjny", + EditConfig: "edytuj plik konfiguracyjny", + ForcePush: "Wymuś wypchnięcie", + ForcePushPrompt: "Twoja gałąź rozeszła się z gałęzią zdalną. Wciśnij 'esc' aby anulować lub 'enter' aby wymusić wypchnięcie.", + ForcePushDisabled: "Your branch has diverged from the remote branch and you've disabled force pushing", + UpdatesRejectedAndForcePushDisabled: "Updates were rejected and you have disabled force pushing", + LcCheckForUpdate: "sprawdź aktualizacje", + CheckingForUpdates: "Sprawdzanie aktualizacji...", + OnLatestVersionErr: "Już posiadasz najnowszą wersję", + MajorVersionErr: "Nowa wersja ({{.newVersion}}) posiada niekompatybilne zmiany w porównaniu do obecnej wersji ({{.currentVersion}})", + CouldNotFindBinaryErr: "Nie można znaleźć pliku binarnego w {{.url}}", + AnonymousReportingTitle: "Help make lazygit better", + AnonymousReportingPrompt: "Włączyć anonimowe raportowanie błędów w celu pomocy w usprawnianiu lazygita (enter/esc)?", + LcEditFile: `edytuj plik`, + LcOpenFile: `otwórz plik`, + LcIgnoreFile: `dodaj do .gitignore`, + LcRefreshFiles: `odśwież pliki`, + LcMergeIntoCurrentBranch: `scal do obecnej gałęzi`, + ConfirmQuit: `Na pewno chcesz wyjść z programu?`, + UnsupportedGitService: `Nieobsługiwana usługa git`, + LcCreatePullRequest: `utwórz żądanie wyciągnięcia`, + NoBranchOnRemote: `Ta gałąź nie istnieje na zdalnym. Najpierw musisz go odepchnąć na odległość.`, + LcFetch: `fetch`, + NoAutomaticGitFetchTitle: `No automatic git fetch`, + NoAutomaticGitFetchBody: `Lazygit can't use "git fetch" in a private repo use f in the branches panel to run "git fetch" manually`, + StageLines: `zatwierdź pojedyncze linie`, + FileStagingRequirements: `Można tylko zatwierdzić pojedyncze linie dla śledzonych plików z niezatwierdzonymi zmianami`, + StagingTitle: `Zatwierdzanie`, + ReturnToFilesPanel: `wróć do panelu plików`, + CantFindHunks: `Nie można znaleźć żadnych kawałków w tej łatce`, + CantFindHunk: `Nie można znaleźć kawałka`, + RebasingTitle: "Rebasing", + MergingTitle: "Merging", + ConfirmRebase: "Are you sure you want to rebase {{.checkedOutBranch}} onto {{.selectedBranch}}?", + ConfirmMerge: "Are you sure you want to merge {{.selectedBranch}} into {{.checkedOutBranch}}?", + FwdNoUpstream: "Cannot fast-forward a branch with no upstream", + FwdCommitsToPush: "Cannot fast-forward a branch with commits to push", + ErrorOccurred: "An error occurred! Please create an issue at https://github.com/jesseduffield/lazygit/issues", + MainTitle: "Main", + NormalTitle: "Normal", + LcSoftReset: "soft reset", + SureSquashThisCommit: "Are you sure you want to squash this commit into the commit below?", + Squash: "Squash", + LcPickCommit: "pick commit (when mid-rebase)", + LcRevertCommit: "revert commit", + LcDeleteCommit: "delete commit", + LcMoveDownCommit: "move commit down one", + LcMoveUpCommit: "move commit up one", + LcEditCommit: "edit commit", + LcAmendToCommit: "amend commit with staged changes", + FoundConflicts: "Conflicts! To abort press 'esc', otherwise press 'enter'", + FoundConflictsTitle: "Auto-merge failed", + Undo: "undo", + PickHunk: "pick hunk", + PickBothHunks: "pick both hunks", + ViewMergeRebaseOptions: "view merge/rebase options", + NotMergingOrRebasing: "You are currently neither rebasing nor merging", + RecentRepos: "recent repositories", + MergeOptionsTitle: "Merge Options", + RebaseOptionsTitle: "Rebase Options", + ConflictsResolved: "all merge conflicts resolved. Continue?", + NoRoom: "Not enough room", + YouAreHere: "YOU ARE HERE", + LcRewordNotSupported: "rewording commits while interactively rebasing is not currently supported", + LcCherryPickCopy: "copy commit (cherry-pick)", + LcCherryPickCopyRange: "copy commit range (cherry-pick)", + LcPasteCommits: "paste commits (cherry-pick)", + SureCherryPick: "Are you sure you want to cherry-pick the copied commits onto this branch?", + CherryPick: "Cherry-Pick", + CannotRebaseOntoFirstCommit: "You cannot interactive rebase onto the first commit", + CannotSquashOntoSecondCommit: "You cannot squash/fixup onto the second commit", + Donate: "Donate", + PrevLine: "select previous line", + NextLine: "select next line", + PrevHunk: "select previous hunk", + NextHunk: "select next hunk", + PrevConflict: "select previous conflict", + NextConflict: "select next conflict", + SelectTop: "select top hunk", + SelectBottom: "select bottom hunk", + ScrollDown: "scroll down", + ScrollUp: "scroll up", + AmendCommitTitle: "Amend Commit", + AmendCommitPrompt: "Are you sure you want to amend this commit with your staged files?", + DeleteCommitTitle: "Delete Commit", + DeleteCommitPrompt: "Are you sure you want to delete this commit?", + SquashingStatus: "squashing", + FixingStatus: "fixing up", + DeletingStatus: "deleting", + MovingStatus: "moving", + RebasingStatus: "rebasing", + AmendingStatus: "amending", + CherryPickingStatus: "cherry-picking", + CommitFiles: "Commit files", + LcViewCommitFiles: "view commit's files", + CommitFilesTitle: "Commit files", + LcGoBack: "go back", + NoCommiteFiles: "No files for this commit", + LcCheckoutCommitFile: "checkout file", + LcDiscardOldFileChange: "discard this commit's changes to this file", + DiscardFileChangesTitle: "Discard file changes", + DiscardFileChangesPrompt: "Are you sure you want to discard this commit's changes to this file? If this file was created in this commit, it will be deleted", + DisabledForGPG: "Feature not available for users using GPG", + CreateRepo: "Not in a git repository. Create a new git repository? (y/n): ", + AutoStashTitle: "Autostash?", + AutoStashPrompt: "You must stash and pop your changes to bring them across. Do this automatically? (enter/esc)", + StashPrefix: "Auto-stashing changes for ", + LcViewDiscardOptions: "view 'discard changes' options", + LcCancel: "cancel", + LcDiscardAllChanges: "discard all changes", + LcDiscardUnstagedChanges: "discard unstaged changes", + LcDiscardAllChangesToAllFiles: "nuke working tree", + LcDiscardAnyUnstagedChanges: "discard unstaged changes", + LcDiscardUntrackedFiles: "discard untracked files", + LcHardReset: "hard reset", + LcViewResetOptions: `view reset options`, + LcCreateFixupCommit: `create fixup commit for this commit`, + LcSquashAboveCommits: `squash above commits`, + SquashAboveCommits: `Squash above commits`, + SureSquashAboveCommits: `Are you sure you want to squash all fixup! commits above {{.commit}}?`, + CreateFixupCommit: `Create fixup commit`, + SureCreateFixupCommit: `Are you sure you want to create a fixup! commit for commit {{.commit}}?`, + LcExecuteCustomCommand: "execute custom command", + CustomCommand: "Custom Command:", + LcCommitChangesWithoutHook: "commit changes without pre-commit hook", + SkipHookPrefixNotConfigured: "You have not configured a commit message prefix for skipping hooks. Set `git.skipHookPrefix = 'WIP'` in your config", + LcResetTo: `reset to`, + PressEnterToReturn: "Press enter to return to lazygit", + LcViewStashOptions: "view stash options", + LcStashAllChanges: "przechowaj pliki", + LcStashStagedChanges: "stash staged changes", + LcStashOptions: "Stash options", + NotARepository: "Error: must be run inside a git repository", + LcJump: "jump to panel", + ExitLineByLineMode: `exit line-by-line mode`, + EnterUpstream: `Enter upstream as ' '`, + ReturnToRemotesList: `return to remotes list`, + IgnoreTracked: "Ignore tracked file", + IgnoreTrackedPrompt: "Are you sure you want to ignore a tracked file?", + LcCommitPrefixPatternError: "Error in commitPrefix pattern", + NoFilesStagedTitle: "No files staged", + NoFilesStagedPrompt: "You have not staged any files. Commit all files?", + BranchNotFoundTitle: "Branch not found", + BranchNotFoundPrompt: "Branch not found. Create a new branch named", + } } diff --git a/pkg/updates/updates.go b/pkg/updates/updates.go index 4c25e0f63..163773e58 100644 --- a/pkg/updates/updates.go +++ b/pkg/updates/updates.go @@ -18,6 +18,7 @@ import ( "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/i18n" + "github.com/jesseduffield/lazygit/pkg/utils" "github.com/sirupsen/logrus" ) @@ -26,7 +27,7 @@ type Updater struct { Log *logrus.Entry Config config.AppConfigurer OSCommand *oscommands.OSCommand - Tr *i18n.Localizer + Tr *i18n.TranslationSet } // Updaterer implements the check and update methods @@ -40,7 +41,7 @@ const ( ) // NewUpdater creates a new updater -func NewUpdater(log *logrus.Entry, config config.AppConfigurer, osCommand *oscommands.OSCommand, tr *i18n.Localizer) (*Updater, error) { +func NewUpdater(log *logrus.Entry, config config.AppConfigurer, osCommand *oscommands.OSCommand, tr *i18n.TranslationSet) (*Updater, error) { contextLogger := log.WithField("context", "updates") return &Updater{ @@ -106,13 +107,12 @@ func (u *Updater) checkForNewUpdate() (string, error) { u.Log.Info("New version is " + newVersion) if newVersion == currentVersion { - return "", errors.New(u.Tr.SLocalize("OnLatestVersionErr")) + return "", errors.New(u.Tr.OnLatestVersionErr) } if u.majorVersionDiffers(currentVersion, newVersion) { - errMessage := u.Tr.TemplateLocalize( - "MajorVersionErr", - i18n.Teml{ + errMessage := utils.ResolvePlaceholderString( + u.Tr.MajorVersionErr, map[string]string{ "newVersion": newVersion, "currentVersion": currentVersion, }, @@ -126,12 +126,12 @@ func (u *Updater) checkForNewUpdate() (string, error) { } u.Log.Info("Checking for resource at url " + rawUrl) if !u.verifyResourceFound(rawUrl) { - errMessage := u.Tr.TemplateLocalize( - "CouldNotFindBinaryErr", - i18n.Teml{ + errMessage := utils.ResolvePlaceholderString( + u.Tr.CouldNotFindBinaryErr, map[string]string{ "url": rawUrl, }, ) + return "", errors.New(errMessage) } u.Log.Info("Verified resource is available, ready to update") diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index b535431ee..c4d1dbe7e 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -101,7 +101,8 @@ func Loader() string { // ResolvePlaceholderString populates a template with values func ResolvePlaceholderString(str string, arguments map[string]string) string { for key, value := range arguments { - str = strings.Replace(str, "{{"+key+"}}", value, -1) + str = strings.ReplaceAll(str, "{{"+key+"}}", value) + str = strings.ReplaceAll(str, "{{."+key+"}}", value) } return str } diff --git a/scripts/generate_cheatsheet.go b/scripts/generate_cheatsheet.go index 53a816ff5..b90f93edf 100644 --- a/scripts/generate_cheatsheet.go +++ b/scripts/generate_cheatsheet.go @@ -51,8 +51,44 @@ func writeString(file *os.File, str string) { } func localisedTitle(mApp *app.App, str string) string { - viewTitle := strings.Title(str) + "Title" - return mApp.Tr.SLocalize(viewTitle) + tr := mApp.Tr + + contextTitleMap := map[string]string{ + "global": tr.GlobalTitle, + "navigation": tr.NavigationTitle, + "branches": tr.BranchesTitle, + "localBranches": tr.LocalBranchesTitle, + "files": tr.FilesTitle, + "status": tr.StatusTitle, + "submodules": tr.SubmodulesTitle, + "subCommits": tr.SubCommitsTitle, + "remoteBranches": tr.RemoteBranchesTitle, + "remotes": tr.RemotesTitle, + "reflogCommits": tr.ReflogCommitsTitle, + "tags": tr.TagsTitle, + "commitFiles": tr.CommitFilesTitle, + "commitMessage": tr.CommitMessageTitle, + "commits": tr.CommitsTitle, + "confirmation": tr.ConfirmationTitle, + "credentials": tr.CredentialsTitle, + "information": tr.InformationTitle, + "main": tr.MainTitle, + "patchBuilding": tr.PatchBuildingTitle, + "merging": tr.MergingTitle, + "normal": tr.NormalTitle, + "staging": tr.StagingTitle, + "menu": tr.MenuTitle, + "search": tr.SearchTitle, + "secondary": tr.SecondaryTitle, + "stash": tr.StashTitle, + } + + title, ok := contextTitleMap[str] + if !ok { + panic(fmt.Sprintf("title not found for %s", str)) + } + + return title } func formatTitle(title string) string { @@ -155,14 +191,14 @@ outer: translatedView := localisedTitle(mApp, viewName) var title string if contextAndView.subtitle == "" { - addendum := " " + mApp.Tr.SLocalize("Panel") + addendum := " " + mApp.Tr.Panel if viewName == "global" || viewName == "navigation" { addendum = "" } title = fmt.Sprintf("%s%s", translatedView, addendum) } else { translatedContextName := localisedTitle(mApp, contextAndView.subtitle) - title = fmt.Sprintf("%s %s (%s)", translatedView, mApp.Tr.SLocalize("Panel"), translatedContextName) + title = fmt.Sprintf("%s %s (%s)", translatedView, mApp.Tr.Panel, translatedContextName) } for _, binding := range contextBindings { @@ -194,7 +230,7 @@ func addBinding(title string, bindingSections []*bindingSection, binding *gui.Bi } func formatSections(mApp *app.App, bindingSections []*bindingSection) string { - content := fmt.Sprintf("# Lazygit %s\n", mApp.Tr.SLocalize("Keybindings")) + content := fmt.Sprintf("# Lazygit %s\n", mApp.Tr.Keybindings) for _, section := range bindingSections { content += formatTitle(section.title) diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/LICENSE b/vendor/github.com/nicksnyder/go-i18n/v2/LICENSE deleted file mode 100644 index 609cce797..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 Nick Snyder https://github.com/nicksnyder - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/i18n/bundle.go b/vendor/github.com/nicksnyder/go-i18n/v2/i18n/bundle.go deleted file mode 100644 index 62bcd4355..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/i18n/bundle.go +++ /dev/null @@ -1,136 +0,0 @@ -package i18n - -import ( - "fmt" - "io/ioutil" - - "github.com/nicksnyder/go-i18n/v2/internal/plural" - - "golang.org/x/text/language" -) - -// UnmarshalFunc unmarshals data into v. -type UnmarshalFunc func(data []byte, v interface{}) error - -// Bundle stores a set of messages and pluralization rules. -// Most applications only need a single bundle -// that is initialized early in the application's lifecycle. -// It is not goroutine safe to modify the bundle while Localizers -// are reading from it. -type Bundle struct { - defaultLanguage language.Tag - unmarshalFuncs map[string]UnmarshalFunc - messageTemplates map[language.Tag]map[string]*MessageTemplate - pluralRules plural.Rules - tags []language.Tag - matcher language.Matcher -} - -// artTag is the language tag used for artifical languages -// https://en.wikipedia.org/wiki/Codes_for_constructed_languages -var artTag = language.MustParse("art") - -// NewBundle returns a bundle with a default language and a default set of plural rules. -func NewBundle(defaultLanguage language.Tag) *Bundle { - b := &Bundle{ - defaultLanguage: defaultLanguage, - pluralRules: plural.DefaultRules(), - } - b.pluralRules[artTag] = b.pluralRules.Rule(language.English) - b.addTag(defaultLanguage) - return b -} - -// RegisterUnmarshalFunc registers an UnmarshalFunc for format. -func (b *Bundle) RegisterUnmarshalFunc(format string, unmarshalFunc UnmarshalFunc) { - if b.unmarshalFuncs == nil { - b.unmarshalFuncs = make(map[string]UnmarshalFunc) - } - b.unmarshalFuncs[format] = unmarshalFunc -} - -// LoadMessageFile loads the bytes from path -// and then calls ParseMessageFileBytes. -func (b *Bundle) LoadMessageFile(path string) (*MessageFile, error) { - buf, err := ioutil.ReadFile(path) - if err != nil { - return nil, err - } - return b.ParseMessageFileBytes(buf, path) -} - -// MustLoadMessageFile is similar to LoadTranslationFile -// except it panics if an error happens. -func (b *Bundle) MustLoadMessageFile(path string) { - if _, err := b.LoadMessageFile(path); err != nil { - panic(err) - } -} - -// ParseMessageFileBytes parses the bytes in buf to add translations to the bundle. -// -// The format of the file is everything after the last ".". -// -// The language tag of the file is everything after the second to last "." or after the last path separator, but before the format. -func (b *Bundle) ParseMessageFileBytes(buf []byte, path string) (*MessageFile, error) { - messageFile, err := ParseMessageFileBytes(buf, path, b.unmarshalFuncs) - if err != nil { - return nil, err - } - if err := b.AddMessages(messageFile.Tag, messageFile.Messages...); err != nil { - return nil, err - } - return messageFile, nil -} - -// MustParseMessageFileBytes is similar to ParseMessageFileBytes -// except it panics if an error happens. -func (b *Bundle) MustParseMessageFileBytes(buf []byte, path string) { - if _, err := b.ParseMessageFileBytes(buf, path); err != nil { - panic(err) - } -} - -// AddMessages adds messages for a language. -// It is useful if your messages are in a format not supported by ParseMessageFileBytes. -func (b *Bundle) AddMessages(tag language.Tag, messages ...*Message) error { - pluralRule := b.pluralRules.Rule(tag) - if pluralRule == nil { - return fmt.Errorf("no plural rule registered for %s", tag) - } - if b.messageTemplates == nil { - b.messageTemplates = map[language.Tag]map[string]*MessageTemplate{} - } - if b.messageTemplates[tag] == nil { - b.messageTemplates[tag] = map[string]*MessageTemplate{} - b.addTag(tag) - } - for _, m := range messages { - b.messageTemplates[tag][m.ID] = NewMessageTemplate(m) - } - return nil -} - -// MustAddMessages is similar to AddMessages except it panics if an error happens. -func (b *Bundle) MustAddMessages(tag language.Tag, messages ...*Message) { - if err := b.AddMessages(tag, messages...); err != nil { - panic(err) - } -} - -func (b *Bundle) addTag(tag language.Tag) { - for _, t := range b.tags { - if t == tag { - // Tag already exists - return - } - } - b.tags = append(b.tags, tag) - b.matcher = language.NewMatcher(b.tags) -} - -// LanguageTags returns the list of language tags -// of all the translations loaded into the bundle -func (b *Bundle) LanguageTags() []language.Tag { - return b.tags -} diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/i18n/doc.go b/vendor/github.com/nicksnyder/go-i18n/v2/i18n/doc.go deleted file mode 100644 index 73d7a0697..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/i18n/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -// Package i18n provides support for looking up messages -// according to a set of locale preferences. -// -// Create a Bundle to use for the lifetime of your application. -// bundle := i18n.NewBundle(language.English) -// -// Load translations into your bundle during initialization. -// bundle.LoadMessageFile("en-US.yaml") -// -// Create a Localizer to use for a set of language preferences. -// func(w http.ResponseWriter, r *http.Request) { -// lang := r.FormValue("lang") -// accept := r.Header.Get("Accept-Language") -// localizer := i18n.NewLocalizer(bundle, lang, accept) -// } -// -// Use the Localizer to lookup messages. -// localizer.MustLocalize(&i18n.LocalizeConfig{ -// DefaultMessage: &i18n.Message{ -// ID: "HelloWorld", -// Other: "Hello World!", -// }, -// }) -package i18n diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/i18n/localizer.go b/vendor/github.com/nicksnyder/go-i18n/v2/i18n/localizer.go deleted file mode 100644 index 5d3b0df13..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/i18n/localizer.go +++ /dev/null @@ -1,234 +0,0 @@ -package i18n - -import ( - "fmt" - - "text/template" - - "github.com/nicksnyder/go-i18n/v2/internal/plural" - "golang.org/x/text/language" -) - -// Localizer provides Localize and MustLocalize methods that return localized messages. -type Localizer struct { - // bundle contains the messages that can be returned by the Localizer. - bundle *Bundle - - // tags is the list of language tags that the Localizer checks - // in order when localizing a message. - tags []language.Tag -} - -// NewLocalizer returns a new Localizer that looks up messages -// in the bundle according to the language preferences in langs. -// It can parse Accept-Language headers as defined in http://www.ietf.org/rfc/rfc2616.txt. -func NewLocalizer(bundle *Bundle, langs ...string) *Localizer { - return &Localizer{ - bundle: bundle, - tags: parseTags(langs), - } -} - -func parseTags(langs []string) []language.Tag { - tags := []language.Tag{} - for _, lang := range langs { - t, _, err := language.ParseAcceptLanguage(lang) - if err != nil { - continue - } - tags = append(tags, t...) - } - return tags -} - -// LocalizeConfig configures a call to the Localize method on Localizer. -type LocalizeConfig struct { - // MessageID is the id of the message to lookup. - // This field is ignored if DefaultMessage is set. - MessageID string - - // TemplateData is the data passed when executing the message's template. - // If TemplateData is nil and PluralCount is not nil, then the message template - // will be executed with data that contains the plural count. - TemplateData interface{} - - // PluralCount determines which plural form of the message is used. - PluralCount interface{} - - // DefaultMessage is used if the message is not found in any message files. - DefaultMessage *Message - - // Funcs is used to extend the Go template engine's built in functions - Funcs template.FuncMap -} - -type invalidPluralCountErr struct { - messageID string - pluralCount interface{} - err error -} - -func (e *invalidPluralCountErr) Error() string { - return fmt.Sprintf("invalid plural count %#v for message id %q: %s", e.pluralCount, e.messageID, e.err) -} - -// MessageNotFoundErr is returned from Localize when a message could not be found. -type MessageNotFoundErr struct { - messageID string -} - -func (e *MessageNotFoundErr) Error() string { - return fmt.Sprintf("message %q not found", e.messageID) -} - -type pluralizeErr struct { - messageID string - tag language.Tag -} - -func (e *pluralizeErr) Error() string { - return fmt.Sprintf("unable to pluralize %q because there no plural rule for %q", e.messageID, e.tag) -} - -type messageIDMismatchErr struct { - messageID string - defaultMessageID string -} - -func (e *messageIDMismatchErr) Error() string { - return fmt.Sprintf("message id %q does not match default message id %q", e.messageID, e.defaultMessageID) -} - -// Localize returns a localized message. -func (l *Localizer) Localize(lc *LocalizeConfig) (string, error) { - msg, _, err := l.LocalizeWithTag(lc) - return msg, err -} - -// Localize returns a localized message. -func (l *Localizer) LocalizeMessage(msg *Message) (string, error) { - return l.Localize(&LocalizeConfig{ - DefaultMessage: msg, - }) -} - -// TODO: uncomment this (and the test) when extract has been updated to extract these call sites too. -// Localize returns a localized message. -// func (l *Localizer) LocalizeMessageID(messageID string) (string, error) { -// return l.Localize(&LocalizeConfig{ -// MessageID: messageID, -// }) -// } - -// LocalizeWithTag returns a localized message and the language tag. -// It may return a best effort localized message even if an error happens. -func (l *Localizer) LocalizeWithTag(lc *LocalizeConfig) (string, language.Tag, error) { - messageID := lc.MessageID - if lc.DefaultMessage != nil { - if messageID != "" && messageID != lc.DefaultMessage.ID { - return "", language.Und, &messageIDMismatchErr{messageID: messageID, defaultMessageID: lc.DefaultMessage.ID} - } - messageID = lc.DefaultMessage.ID - } - - var operands *plural.Operands - templateData := lc.TemplateData - if lc.PluralCount != nil { - var err error - operands, err = plural.NewOperands(lc.PluralCount) - if err != nil { - return "", language.Und, &invalidPluralCountErr{messageID: messageID, pluralCount: lc.PluralCount, err: err} - } - if templateData == nil { - templateData = map[string]interface{}{ - "PluralCount": lc.PluralCount, - } - } - } - - tag, template := l.getTemplate(messageID, lc.DefaultMessage) - if template == nil { - return "", language.Und, &MessageNotFoundErr{messageID: messageID} - } - - pluralForm := l.pluralForm(tag, operands) - if pluralForm == plural.Invalid { - return "", language.Und, &pluralizeErr{messageID: messageID, tag: tag} - } - - msg, err := template.Execute(pluralForm, templateData, lc.Funcs) - if err != nil { - // Attempt to fallback to "Other" pluralization in case translations are incomplete. - if pluralForm != plural.Other { - msg2, err2 := template.Execute(plural.Other, templateData, lc.Funcs) - if err2 == nil { - return msg2, tag, err - } - } - return "", language.Und, err - } - return msg, tag, nil -} - -func (l *Localizer) getTemplate(id string, defaultMessage *Message) (language.Tag, *MessageTemplate) { - // Fast path. - // Optimistically assume this message id is defined in each language. - fastTag, template := l.matchTemplate(id, defaultMessage, l.bundle.matcher, l.bundle.tags) - if template != nil { - return fastTag, template - } - - if len(l.bundle.tags) <= 1 { - return l.bundle.defaultLanguage, nil - } - - // Slow path. - // We didn't find a translation for the tag suggested by the default matcher - // so we need to create a new matcher that contains only the tags in the bundle - // that have this message. - foundTags := make([]language.Tag, 0, len(l.bundle.messageTemplates)+1) - foundTags = append(foundTags, l.bundle.defaultLanguage) - - for t, templates := range l.bundle.messageTemplates { - template := templates[id] - if template == nil || template.Other == "" { - continue - } - foundTags = append(foundTags, t) - } - - return l.matchTemplate(id, defaultMessage, language.NewMatcher(foundTags), foundTags) -} - -func (l *Localizer) matchTemplate(id string, defaultMessage *Message, matcher language.Matcher, tags []language.Tag) (language.Tag, *MessageTemplate) { - _, i, _ := matcher.Match(l.tags...) - tag := tags[i] - templates := l.bundle.messageTemplates[tag] - if templates != nil && templates[id] != nil { - return tag, templates[id] - } - if tag == l.bundle.defaultLanguage && defaultMessage != nil { - return tag, NewMessageTemplate(defaultMessage) - } - return tag, nil -} - -func (l *Localizer) pluralForm(tag language.Tag, operands *plural.Operands) plural.Form { - if operands == nil { - return plural.Other - } - pluralRule := l.bundle.pluralRules.Rule(tag) - if pluralRule == nil { - return plural.Invalid - } - return pluralRule.PluralFormFunc(operands) -} - -// MustLocalize is similar to Localize, except it panics if an error happens. -func (l *Localizer) MustLocalize(lc *LocalizeConfig) string { - localized, err := l.Localize(lc) - if err != nil { - panic(err) - } - return localized -} diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/i18n/message.go b/vendor/github.com/nicksnyder/go-i18n/v2/i18n/message.go deleted file mode 100644 index f8f789a50..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/i18n/message.go +++ /dev/null @@ -1,221 +0,0 @@ -package i18n - -import ( - "fmt" - "strings" -) - -// Message is a string that can be localized. -type Message struct { - // ID uniquely identifies the message. - ID string - - // Hash uniquely identifies the content of the message - // that this message was translated from. - Hash string - - // Description describes the message to give additional - // context to translators that may be relevant for translation. - Description string - - // LeftDelim is the left Go template delimiter. - LeftDelim string - - // RightDelim is the right Go template delimiter.`` - RightDelim string - - // Zero is the content of the message for the CLDR plural form "zero". - Zero string - - // One is the content of the message for the CLDR plural form "one". - One string - - // Two is the content of the message for the CLDR plural form "two". - Two string - - // Few is the content of the message for the CLDR plural form "few". - Few string - - // Many is the content of the message for the CLDR plural form "many". - Many string - - // Other is the content of the message for the CLDR plural form "other". - Other string -} - -// NewMessage parses data and returns a new message. -func NewMessage(data interface{}) (*Message, error) { - m := &Message{} - if err := m.unmarshalInterface(data); err != nil { - return nil, err - } - return m, nil -} - -// MustNewMessage is similar to NewMessage except it panics if an error happens. -func MustNewMessage(data interface{}) *Message { - m, err := NewMessage(data) - if err != nil { - panic(err) - } - return m -} - -// unmarshalInterface unmarshals a message from data. -func (m *Message) unmarshalInterface(v interface{}) error { - strdata, err := stringMap(v) - if err != nil { - return err - } - for k, v := range strdata { - switch strings.ToLower(k) { - case "id": - m.ID = v - case "description": - m.Description = v - case "hash": - m.Hash = v - case "leftdelim": - m.LeftDelim = v - case "rightdelim": - m.RightDelim = v - case "zero": - m.Zero = v - case "one": - m.One = v - case "two": - m.Two = v - case "few": - m.Few = v - case "many": - m.Many = v - case "other": - m.Other = v - } - } - return nil -} - -type keyTypeErr struct { - key interface{} -} - -func (err *keyTypeErr) Error() string { - return fmt.Sprintf("expected key to be a string but got %#v", err.key) -} - -type valueTypeErr struct { - value interface{} -} - -func (err *valueTypeErr) Error() string { - return fmt.Sprintf("unsupported type %#v", err.value) -} - -func stringMap(v interface{}) (map[string]string, error) { - switch value := v.(type) { - case string: - return map[string]string{ - "other": value, - }, nil - case map[string]string: - return value, nil - case map[string]interface{}: - strdata := make(map[string]string, len(value)) - for k, v := range value { - err := stringSubmap(k, v, strdata) - if err != nil { - return nil, err - } - } - return strdata, nil - case map[interface{}]interface{}: - strdata := make(map[string]string, len(value)) - for k, v := range value { - kstr, ok := k.(string) - if !ok { - return nil, &keyTypeErr{key: k} - } - err := stringSubmap(kstr, v, strdata) - if err != nil { - return nil, err - } - } - return strdata, nil - default: - return nil, &valueTypeErr{value: value} - } -} - -func stringSubmap(k string, v interface{}, strdata map[string]string) error { - if k == "translation" { - switch vt := v.(type) { - case string: - strdata["other"] = vt - default: - v1Message, err := stringMap(v) - if err != nil { - return err - } - for kk, vv := range v1Message { - strdata[kk] = vv - } - } - return nil - } - - switch vt := v.(type) { - case string: - strdata[k] = vt - return nil - case nil: - return nil - default: - return fmt.Errorf("expected value for key %q be a string but got %#v", k, v) - } -} - -// isMessage tells whether the given data is a message, or a map containing -// nested messages. -// A map is assumed to be a message if it contains any of the "reserved" keys: -// "id", "description", "hash", "leftdelim", "rightdelim", "zero", "one", "two", "few", "many", "other" -// with a string value. -// e.g., -// - {"message": {"description": "world"}} is a message -// - {"message": {"description": "world", "foo": "bar"}} is a message ("foo" key is ignored) -// - {"notmessage": {"description": {"hello": "world"}}} is not -// - {"notmessage": {"foo": "bar"}} is not -func isMessage(v interface{}) bool { - reservedKeys := []string{"id", "description", "hash", "leftdelim", "rightdelim", "zero", "one", "two", "few", "many", "other"} - switch data := v.(type) { - case string: - return true - case map[string]interface{}: - for _, key := range reservedKeys { - val, ok := data[key] - if !ok { - continue - } - _, ok = val.(string) - if !ok { - continue - } - // v is a message if it contains a "reserved" key holding a string value - return true - } - case map[interface{}]interface{}: - for _, key := range reservedKeys { - val, ok := data[key] - if !ok { - continue - } - _, ok = val.(string) - if !ok { - continue - } - // v is a message if it contains a "reserved" key holding a string value - return true - } - } - return false -} diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/i18n/message_template.go b/vendor/github.com/nicksnyder/go-i18n/v2/i18n/message_template.go deleted file mode 100644 index a1a619e2f..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/i18n/message_template.go +++ /dev/null @@ -1,65 +0,0 @@ -package i18n - -import ( - "fmt" - - "text/template" - - "github.com/nicksnyder/go-i18n/v2/internal" - "github.com/nicksnyder/go-i18n/v2/internal/plural" -) - -// MessageTemplate is an executable template for a message. -type MessageTemplate struct { - *Message - PluralTemplates map[plural.Form]*internal.Template -} - -// NewMessageTemplate returns a new message template. -func NewMessageTemplate(m *Message) *MessageTemplate { - pluralTemplates := map[plural.Form]*internal.Template{} - setPluralTemplate(pluralTemplates, plural.Zero, m.Zero, m.LeftDelim, m.RightDelim) - setPluralTemplate(pluralTemplates, plural.One, m.One, m.LeftDelim, m.RightDelim) - setPluralTemplate(pluralTemplates, plural.Two, m.Two, m.LeftDelim, m.RightDelim) - setPluralTemplate(pluralTemplates, plural.Few, m.Few, m.LeftDelim, m.RightDelim) - setPluralTemplate(pluralTemplates, plural.Many, m.Many, m.LeftDelim, m.RightDelim) - setPluralTemplate(pluralTemplates, plural.Other, m.Other, m.LeftDelim, m.RightDelim) - if len(pluralTemplates) == 0 { - return nil - } - return &MessageTemplate{ - Message: m, - PluralTemplates: pluralTemplates, - } -} - -func setPluralTemplate(pluralTemplates map[plural.Form]*internal.Template, pluralForm plural.Form, src, leftDelim, rightDelim string) { - if src != "" { - pluralTemplates[pluralForm] = &internal.Template{ - Src: src, - LeftDelim: leftDelim, - RightDelim: rightDelim, - } - } -} - -type pluralFormNotFoundError struct { - pluralForm plural.Form - messageID string -} - -func (e pluralFormNotFoundError) Error() string { - return fmt.Sprintf("message %q has no plural form %q", e.messageID, e.pluralForm) -} - -// Execute executes the template for the plural form and template data. -func (mt *MessageTemplate) Execute(pluralForm plural.Form, data interface{}, funcs template.FuncMap) (string, error) { - t := mt.PluralTemplates[pluralForm] - if t == nil { - return "", pluralFormNotFoundError{ - pluralForm: pluralForm, - messageID: mt.Message.ID, - } - } - return t.Execute(funcs, data) -} diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/i18n/parse.go b/vendor/github.com/nicksnyder/go-i18n/v2/i18n/parse.go deleted file mode 100644 index 57dd7fe7f..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/i18n/parse.go +++ /dev/null @@ -1,166 +0,0 @@ -package i18n - -import ( - "encoding/json" - "errors" - "fmt" - "os" - - "golang.org/x/text/language" -) - -// MessageFile represents a parsed message file. -type MessageFile struct { - Path string - Tag language.Tag - Format string - Messages []*Message -} - -// ParseMessageFileBytes returns the messages parsed from file. -func ParseMessageFileBytes(buf []byte, path string, unmarshalFuncs map[string]UnmarshalFunc) (*MessageFile, error) { - lang, format := parsePath(path) - tag := language.Make(lang) - messageFile := &MessageFile{ - Path: path, - Tag: tag, - Format: format, - } - if len(buf) == 0 { - return messageFile, nil - } - unmarshalFunc := unmarshalFuncs[messageFile.Format] - if unmarshalFunc == nil { - if messageFile.Format == "json" { - unmarshalFunc = json.Unmarshal - } else { - return nil, fmt.Errorf("no unmarshaler registered for %s", messageFile.Format) - } - } - var err error - var raw interface{} - if err = unmarshalFunc(buf, &raw); err != nil { - return nil, err - } - - if messageFile.Messages, err = recGetMessages(raw, isMessage(raw), true); err != nil { - return nil, err - } - - return messageFile, nil -} - -const nestedSeparator = "." - -var errInvalidTranslationFile = errors.New("invalid translation file, expected key-values, got a single value") - -// recGetMessages looks for translation messages inside "raw" parameter, -// scanning nested maps using recursion. -func recGetMessages(raw interface{}, isMapMessage, isInitialCall bool) ([]*Message, error) { - var messages []*Message - var err error - - switch data := raw.(type) { - case string: - if isInitialCall { - return nil, errInvalidTranslationFile - } - m, err := NewMessage(data) - return []*Message{m}, err - - case map[string]interface{}: - if isMapMessage { - m, err := NewMessage(data) - return []*Message{m}, err - } - messages = make([]*Message, 0, len(data)) - for id, data := range data { - // recursively scan map items - messages, err = addChildMessages(id, data, messages) - if err != nil { - return nil, err - } - } - - case map[interface{}]interface{}: - if isMapMessage { - m, err := NewMessage(data) - return []*Message{m}, err - } - messages = make([]*Message, 0, len(data)) - for id, data := range data { - strid, ok := id.(string) - if !ok { - return nil, fmt.Errorf("expected key to be string but got %#v", id) - } - // recursively scan map items - messages, err = addChildMessages(strid, data, messages) - if err != nil { - return nil, err - } - } - - case []interface{}: - // Backward compatibility for v1 file format. - messages = make([]*Message, 0, len(data)) - for _, data := range data { - // recursively scan slice items - childMessages, err := recGetMessages(data, isMessage(data), false) - if err != nil { - return nil, err - } - messages = append(messages, childMessages...) - } - - default: - return nil, fmt.Errorf("unsupported file format %T", raw) - } - - return messages, nil -} - -func addChildMessages(id string, data interface{}, messages []*Message) ([]*Message, error) { - isChildMessage := isMessage(data) - childMessages, err := recGetMessages(data, isChildMessage, false) - if err != nil { - return nil, err - } - for _, m := range childMessages { - if isChildMessage { - if m.ID == "" { - m.ID = id // start with innermost key - } - } else { - m.ID = id + nestedSeparator + m.ID // update ID with each nested key on the way - } - messages = append(messages, m) - } - return messages, nil -} - -func parsePath(path string) (langTag, format string) { - formatStartIdx := -1 - for i := len(path) - 1; i >= 0; i-- { - c := path[i] - if os.IsPathSeparator(c) { - if formatStartIdx != -1 { - langTag = path[i+1 : formatStartIdx] - } - return - } - if path[i] == '.' { - if formatStartIdx != -1 { - langTag = path[i+1 : formatStartIdx] - return - } - if formatStartIdx == -1 { - format = path[i+1:] - formatStartIdx = i - } - } - } - if formatStartIdx != -1 { - langTag = path[:formatStartIdx] - } - return -} diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/doc.go b/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/doc.go deleted file mode 100644 index c2a71d53e..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package plural provides support for pluralizing messages -// according to CLDR rules http://cldr.unicode.org/index/cldr-spec/plural-rules -package plural diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/form.go b/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/form.go deleted file mode 100644 index 287a87f22..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/form.go +++ /dev/null @@ -1,16 +0,0 @@ -package plural - -// Form represents a language pluralization form as defined here: -// http://cldr.unicode.org/index/cldr-spec/plural-rules -type Form string - -// All defined plural forms. -const ( - Invalid Form = "" - Zero Form = "zero" - One Form = "one" - Two Form = "two" - Few Form = "few" - Many Form = "many" - Other Form = "other" -) diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/operands.go b/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/operands.go deleted file mode 100644 index 4d2972659..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/operands.go +++ /dev/null @@ -1,120 +0,0 @@ -package plural - -import ( - "fmt" - "strconv" - "strings" -) - -// Operands is a representation of http://unicode.org/reports/tr35/tr35-numbers.html#Operands -type Operands struct { - N float64 // absolute value of the source number (integer and decimals) - I int64 // integer digits of n - V int64 // number of visible fraction digits in n, with trailing zeros - W int64 // number of visible fraction digits in n, without trailing zeros - F int64 // visible fractional digits in n, with trailing zeros - T int64 // visible fractional digits in n, without trailing zeros -} - -// NEqualsAny returns true if o represents an integer equal to any of the arguments. -func (o *Operands) NEqualsAny(any ...int64) bool { - for _, i := range any { - if o.I == i && o.T == 0 { - return true - } - } - return false -} - -// NModEqualsAny returns true if o represents an integer equal to any of the arguments modulo mod. -func (o *Operands) NModEqualsAny(mod int64, any ...int64) bool { - modI := o.I % mod - for _, i := range any { - if modI == i && o.T == 0 { - return true - } - } - return false -} - -// NInRange returns true if o represents an integer in the closed interval [from, to]. -func (o *Operands) NInRange(from, to int64) bool { - return o.T == 0 && from <= o.I && o.I <= to -} - -// NModInRange returns true if o represents an integer in the closed interval [from, to] modulo mod. -func (o *Operands) NModInRange(mod, from, to int64) bool { - modI := o.I % mod - return o.T == 0 && from <= modI && modI <= to -} - -// NewOperands returns the operands for number. -func NewOperands(number interface{}) (*Operands, error) { - switch number := number.(type) { - case int: - return newOperandsInt64(int64(number)), nil - case int8: - return newOperandsInt64(int64(number)), nil - case int16: - return newOperandsInt64(int64(number)), nil - case int32: - return newOperandsInt64(int64(number)), nil - case int64: - return newOperandsInt64(number), nil - case string: - return newOperandsString(number) - case float32, float64: - return nil, fmt.Errorf("floats should be formatted into a string") - default: - return nil, fmt.Errorf("invalid type %T; expected integer or string", number) - } -} - -func newOperandsInt64(i int64) *Operands { - if i < 0 { - i = -i - } - return &Operands{float64(i), i, 0, 0, 0, 0} -} - -func newOperandsString(s string) (*Operands, error) { - if s[0] == '-' { - s = s[1:] - } - n, err := strconv.ParseFloat(s, 64) - if err != nil { - return nil, err - } - ops := &Operands{N: n} - parts := strings.SplitN(s, ".", 2) - ops.I, err = strconv.ParseInt(parts[0], 10, 64) - if err != nil { - return nil, err - } - if len(parts) == 1 { - return ops, nil - } - fraction := parts[1] - ops.V = int64(len(fraction)) - for i := ops.V - 1; i >= 0; i-- { - if fraction[i] != '0' { - ops.W = i + 1 - break - } - } - if ops.V > 0 { - f, err := strconv.ParseInt(fraction, 10, 0) - if err != nil { - return nil, err - } - ops.F = f - } - if ops.W > 0 { - t, err := strconv.ParseInt(fraction[:ops.W], 10, 0) - if err != nil { - return nil, err - } - ops.T = t - } - return ops, nil -} diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/rule.go b/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/rule.go deleted file mode 100644 index 0869c84ff..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/rule.go +++ /dev/null @@ -1,44 +0,0 @@ -package plural - -import ( - "golang.org/x/text/language" -) - -// Rule defines the CLDR plural rules for a language. -// http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html -// http://unicode.org/reports/tr35/tr35-numbers.html#Operands -type Rule struct { - PluralForms map[Form]struct{} - PluralFormFunc func(*Operands) Form -} - -func addPluralRules(rules Rules, ids []string, ps *Rule) { - for _, id := range ids { - if id == "root" { - continue - } - tag := language.MustParse(id) - rules[tag] = ps - } -} - -func newPluralFormSet(pluralForms ...Form) map[Form]struct{} { - set := make(map[Form]struct{}, len(pluralForms)) - for _, plural := range pluralForms { - set[plural] = struct{}{} - } - return set -} - -func intInRange(i, from, to int64) bool { - return from <= i && i <= to -} - -func intEqualsAny(i int64, any ...int64) bool { - for _, a := range any { - if i == a { - return true - } - } - return false -} diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/rule_gen.go b/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/rule_gen.go deleted file mode 100644 index b089925c0..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/rule_gen.go +++ /dev/null @@ -1,589 +0,0 @@ -// This file is generated by i18n/plural/codegen/generate.sh; DO NOT EDIT - -package plural - -// DefaultRules returns a map of Rules generated from CLDR language data. -func DefaultRules() Rules { - rules := Rules{} - - addPluralRules(rules, []string{"bm", "bo", "dz", "id", "ig", "ii", "in", "ja", "jbo", "jv", "jw", "kde", "kea", "km", "ko", "lkt", "lo", "ms", "my", "nqo", "root", "sah", "ses", "sg", "th", "to", "vi", "wo", "yo", "yue", "zh"}, &Rule{ - PluralForms: newPluralFormSet(Other), - PluralFormFunc: func(ops *Operands) Form { - return Other - }, - }) - addPluralRules(rules, []string{"am", "as", "bn", "fa", "gu", "hi", "kn", "zu"}, &Rule{ - PluralForms: newPluralFormSet(One, Other), - PluralFormFunc: func(ops *Operands) Form { - // i = 0 or n = 1 - if intEqualsAny(ops.I, 0) || - ops.NEqualsAny(1) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"ff", "fr", "hy", "kab"}, &Rule{ - PluralForms: newPluralFormSet(One, Other), - PluralFormFunc: func(ops *Operands) Form { - // i = 0,1 - if intEqualsAny(ops.I, 0, 1) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"pt"}, &Rule{ - PluralForms: newPluralFormSet(One, Other), - PluralFormFunc: func(ops *Operands) Form { - // i = 0..1 - if intInRange(ops.I, 0, 1) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"ast", "ca", "de", "en", "et", "fi", "fy", "gl", "ia", "io", "it", "ji", "nl", "pt_PT", "sc", "scn", "sv", "sw", "ur", "yi"}, &Rule{ - PluralForms: newPluralFormSet(One, Other), - PluralFormFunc: func(ops *Operands) Form { - // i = 1 and v = 0 - if intEqualsAny(ops.I, 1) && intEqualsAny(ops.V, 0) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"si"}, &Rule{ - PluralForms: newPluralFormSet(One, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 0,1 or i = 0 and f = 1 - if ops.NEqualsAny(0, 1) || - intEqualsAny(ops.I, 0) && intEqualsAny(ops.F, 1) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"ak", "bh", "guw", "ln", "mg", "nso", "pa", "ti", "wa"}, &Rule{ - PluralForms: newPluralFormSet(One, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 0..1 - if ops.NInRange(0, 1) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"tzm"}, &Rule{ - PluralForms: newPluralFormSet(One, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 0..1 or n = 11..99 - if ops.NInRange(0, 1) || - ops.NInRange(11, 99) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"af", "asa", "az", "bem", "bez", "bg", "brx", "ce", "cgg", "chr", "ckb", "dv", "ee", "el", "eo", "es", "eu", "fo", "fur", "gsw", "ha", "haw", "hu", "jgo", "jmc", "ka", "kaj", "kcg", "kk", "kkj", "kl", "ks", "ksb", "ku", "ky", "lb", "lg", "mas", "mgo", "ml", "mn", "mr", "nah", "nb", "nd", "ne", "nn", "nnh", "no", "nr", "ny", "nyn", "om", "or", "os", "pap", "ps", "rm", "rof", "rwk", "saq", "sd", "sdh", "seh", "sn", "so", "sq", "ss", "ssy", "st", "syr", "ta", "te", "teo", "tig", "tk", "tn", "tr", "ts", "ug", "uz", "ve", "vo", "vun", "wae", "xh", "xog"}, &Rule{ - PluralForms: newPluralFormSet(One, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 1 - if ops.NEqualsAny(1) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"da"}, &Rule{ - PluralForms: newPluralFormSet(One, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 1 or t != 0 and i = 0,1 - if ops.NEqualsAny(1) || - !intEqualsAny(ops.T, 0) && intEqualsAny(ops.I, 0, 1) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"is"}, &Rule{ - PluralForms: newPluralFormSet(One, Other), - PluralFormFunc: func(ops *Operands) Form { - // t = 0 and i % 10 = 1 and i % 100 != 11 or t != 0 - if intEqualsAny(ops.T, 0) && intEqualsAny(ops.I%10, 1) && !intEqualsAny(ops.I%100, 11) || - !intEqualsAny(ops.T, 0) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"mk"}, &Rule{ - PluralForms: newPluralFormSet(One, Other), - PluralFormFunc: func(ops *Operands) Form { - // v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%10, 1) && !intEqualsAny(ops.I%100, 11) || - intEqualsAny(ops.F%10, 1) && !intEqualsAny(ops.F%100, 11) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"ceb", "fil", "tl"}, &Rule{ - PluralForms: newPluralFormSet(One, Other), - PluralFormFunc: func(ops *Operands) Form { - // v = 0 and i = 1,2,3 or v = 0 and i % 10 != 4,6,9 or v != 0 and f % 10 != 4,6,9 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I, 1, 2, 3) || - intEqualsAny(ops.V, 0) && !intEqualsAny(ops.I%10, 4, 6, 9) || - !intEqualsAny(ops.V, 0) && !intEqualsAny(ops.F%10, 4, 6, 9) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"lv", "prg"}, &Rule{ - PluralForms: newPluralFormSet(Zero, One, Other), - PluralFormFunc: func(ops *Operands) Form { - // n % 10 = 0 or n % 100 = 11..19 or v = 2 and f % 100 = 11..19 - if ops.NModEqualsAny(10, 0) || - ops.NModInRange(100, 11, 19) || - intEqualsAny(ops.V, 2) && intInRange(ops.F%100, 11, 19) { - return Zero - } - // n % 10 = 1 and n % 100 != 11 or v = 2 and f % 10 = 1 and f % 100 != 11 or v != 2 and f % 10 = 1 - if ops.NModEqualsAny(10, 1) && !ops.NModEqualsAny(100, 11) || - intEqualsAny(ops.V, 2) && intEqualsAny(ops.F%10, 1) && !intEqualsAny(ops.F%100, 11) || - !intEqualsAny(ops.V, 2) && intEqualsAny(ops.F%10, 1) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"lag"}, &Rule{ - PluralForms: newPluralFormSet(Zero, One, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 0 - if ops.NEqualsAny(0) { - return Zero - } - // i = 0,1 and n != 0 - if intEqualsAny(ops.I, 0, 1) && !ops.NEqualsAny(0) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"ksh"}, &Rule{ - PluralForms: newPluralFormSet(Zero, One, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 0 - if ops.NEqualsAny(0) { - return Zero - } - // n = 1 - if ops.NEqualsAny(1) { - return One - } - return Other - }, - }) - addPluralRules(rules, []string{"iu", "naq", "se", "sma", "smi", "smj", "smn", "sms"}, &Rule{ - PluralForms: newPluralFormSet(One, Two, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 1 - if ops.NEqualsAny(1) { - return One - } - // n = 2 - if ops.NEqualsAny(2) { - return Two - } - return Other - }, - }) - addPluralRules(rules, []string{"shi"}, &Rule{ - PluralForms: newPluralFormSet(One, Few, Other), - PluralFormFunc: func(ops *Operands) Form { - // i = 0 or n = 1 - if intEqualsAny(ops.I, 0) || - ops.NEqualsAny(1) { - return One - } - // n = 2..10 - if ops.NInRange(2, 10) { - return Few - } - return Other - }, - }) - addPluralRules(rules, []string{"mo", "ro"}, &Rule{ - PluralForms: newPluralFormSet(One, Few, Other), - PluralFormFunc: func(ops *Operands) Form { - // i = 1 and v = 0 - if intEqualsAny(ops.I, 1) && intEqualsAny(ops.V, 0) { - return One - } - // v != 0 or n = 0 or n % 100 = 2..19 - if !intEqualsAny(ops.V, 0) || - ops.NEqualsAny(0) || - ops.NModInRange(100, 2, 19) { - return Few - } - return Other - }, - }) - addPluralRules(rules, []string{"bs", "hr", "sh", "sr"}, &Rule{ - PluralForms: newPluralFormSet(One, Few, Other), - PluralFormFunc: func(ops *Operands) Form { - // v = 0 and i % 10 = 1 and i % 100 != 11 or f % 10 = 1 and f % 100 != 11 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%10, 1) && !intEqualsAny(ops.I%100, 11) || - intEqualsAny(ops.F%10, 1) && !intEqualsAny(ops.F%100, 11) { - return One - } - // v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14 - if intEqualsAny(ops.V, 0) && intInRange(ops.I%10, 2, 4) && !intInRange(ops.I%100, 12, 14) || - intInRange(ops.F%10, 2, 4) && !intInRange(ops.F%100, 12, 14) { - return Few - } - return Other - }, - }) - addPluralRules(rules, []string{"gd"}, &Rule{ - PluralForms: newPluralFormSet(One, Two, Few, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 1,11 - if ops.NEqualsAny(1, 11) { - return One - } - // n = 2,12 - if ops.NEqualsAny(2, 12) { - return Two - } - // n = 3..10,13..19 - if ops.NInRange(3, 10) || ops.NInRange(13, 19) { - return Few - } - return Other - }, - }) - addPluralRules(rules, []string{"sl"}, &Rule{ - PluralForms: newPluralFormSet(One, Two, Few, Other), - PluralFormFunc: func(ops *Operands) Form { - // v = 0 and i % 100 = 1 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%100, 1) { - return One - } - // v = 0 and i % 100 = 2 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%100, 2) { - return Two - } - // v = 0 and i % 100 = 3..4 or v != 0 - if intEqualsAny(ops.V, 0) && intInRange(ops.I%100, 3, 4) || - !intEqualsAny(ops.V, 0) { - return Few - } - return Other - }, - }) - addPluralRules(rules, []string{"dsb", "hsb"}, &Rule{ - PluralForms: newPluralFormSet(One, Two, Few, Other), - PluralFormFunc: func(ops *Operands) Form { - // v = 0 and i % 100 = 1 or f % 100 = 1 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%100, 1) || - intEqualsAny(ops.F%100, 1) { - return One - } - // v = 0 and i % 100 = 2 or f % 100 = 2 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%100, 2) || - intEqualsAny(ops.F%100, 2) { - return Two - } - // v = 0 and i % 100 = 3..4 or f % 100 = 3..4 - if intEqualsAny(ops.V, 0) && intInRange(ops.I%100, 3, 4) || - intInRange(ops.F%100, 3, 4) { - return Few - } - return Other - }, - }) - addPluralRules(rules, []string{"he", "iw"}, &Rule{ - PluralForms: newPluralFormSet(One, Two, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // i = 1 and v = 0 - if intEqualsAny(ops.I, 1) && intEqualsAny(ops.V, 0) { - return One - } - // i = 2 and v = 0 - if intEqualsAny(ops.I, 2) && intEqualsAny(ops.V, 0) { - return Two - } - // v = 0 and n != 0..10 and n % 10 = 0 - if intEqualsAny(ops.V, 0) && !ops.NInRange(0, 10) && ops.NModEqualsAny(10, 0) { - return Many - } - return Other - }, - }) - addPluralRules(rules, []string{"cs", "sk"}, &Rule{ - PluralForms: newPluralFormSet(One, Few, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // i = 1 and v = 0 - if intEqualsAny(ops.I, 1) && intEqualsAny(ops.V, 0) { - return One - } - // i = 2..4 and v = 0 - if intInRange(ops.I, 2, 4) && intEqualsAny(ops.V, 0) { - return Few - } - // v != 0 - if !intEqualsAny(ops.V, 0) { - return Many - } - return Other - }, - }) - addPluralRules(rules, []string{"pl"}, &Rule{ - PluralForms: newPluralFormSet(One, Few, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // i = 1 and v = 0 - if intEqualsAny(ops.I, 1) && intEqualsAny(ops.V, 0) { - return One - } - // v = 0 and i % 10 = 2..4 and i % 100 != 12..14 - if intEqualsAny(ops.V, 0) && intInRange(ops.I%10, 2, 4) && !intInRange(ops.I%100, 12, 14) { - return Few - } - // v = 0 and i != 1 and i % 10 = 0..1 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 12..14 - if intEqualsAny(ops.V, 0) && !intEqualsAny(ops.I, 1) && intInRange(ops.I%10, 0, 1) || - intEqualsAny(ops.V, 0) && intInRange(ops.I%10, 5, 9) || - intEqualsAny(ops.V, 0) && intInRange(ops.I%100, 12, 14) { - return Many - } - return Other - }, - }) - addPluralRules(rules, []string{"be"}, &Rule{ - PluralForms: newPluralFormSet(One, Few, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // n % 10 = 1 and n % 100 != 11 - if ops.NModEqualsAny(10, 1) && !ops.NModEqualsAny(100, 11) { - return One - } - // n % 10 = 2..4 and n % 100 != 12..14 - if ops.NModInRange(10, 2, 4) && !ops.NModInRange(100, 12, 14) { - return Few - } - // n % 10 = 0 or n % 10 = 5..9 or n % 100 = 11..14 - if ops.NModEqualsAny(10, 0) || - ops.NModInRange(10, 5, 9) || - ops.NModInRange(100, 11, 14) { - return Many - } - return Other - }, - }) - addPluralRules(rules, []string{"lt"}, &Rule{ - PluralForms: newPluralFormSet(One, Few, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // n % 10 = 1 and n % 100 != 11..19 - if ops.NModEqualsAny(10, 1) && !ops.NModInRange(100, 11, 19) { - return One - } - // n % 10 = 2..9 and n % 100 != 11..19 - if ops.NModInRange(10, 2, 9) && !ops.NModInRange(100, 11, 19) { - return Few - } - // f != 0 - if !intEqualsAny(ops.F, 0) { - return Many - } - return Other - }, - }) - addPluralRules(rules, []string{"mt"}, &Rule{ - PluralForms: newPluralFormSet(One, Few, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 1 - if ops.NEqualsAny(1) { - return One - } - // n = 0 or n % 100 = 2..10 - if ops.NEqualsAny(0) || - ops.NModInRange(100, 2, 10) { - return Few - } - // n % 100 = 11..19 - if ops.NModInRange(100, 11, 19) { - return Many - } - return Other - }, - }) - addPluralRules(rules, []string{"ru", "uk"}, &Rule{ - PluralForms: newPluralFormSet(One, Few, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // v = 0 and i % 10 = 1 and i % 100 != 11 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%10, 1) && !intEqualsAny(ops.I%100, 11) { - return One - } - // v = 0 and i % 10 = 2..4 and i % 100 != 12..14 - if intEqualsAny(ops.V, 0) && intInRange(ops.I%10, 2, 4) && !intInRange(ops.I%100, 12, 14) { - return Few - } - // v = 0 and i % 10 = 0 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 11..14 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%10, 0) || - intEqualsAny(ops.V, 0) && intInRange(ops.I%10, 5, 9) || - intEqualsAny(ops.V, 0) && intInRange(ops.I%100, 11, 14) { - return Many - } - return Other - }, - }) - addPluralRules(rules, []string{"br"}, &Rule{ - PluralForms: newPluralFormSet(One, Two, Few, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // n % 10 = 1 and n % 100 != 11,71,91 - if ops.NModEqualsAny(10, 1) && !ops.NModEqualsAny(100, 11, 71, 91) { - return One - } - // n % 10 = 2 and n % 100 != 12,72,92 - if ops.NModEqualsAny(10, 2) && !ops.NModEqualsAny(100, 12, 72, 92) { - return Two - } - // n % 10 = 3..4,9 and n % 100 != 10..19,70..79,90..99 - if (ops.NModInRange(10, 3, 4) || ops.NModEqualsAny(10, 9)) && !(ops.NModInRange(100, 10, 19) || ops.NModInRange(100, 70, 79) || ops.NModInRange(100, 90, 99)) { - return Few - } - // n != 0 and n % 1000000 = 0 - if !ops.NEqualsAny(0) && ops.NModEqualsAny(1000000, 0) { - return Many - } - return Other - }, - }) - addPluralRules(rules, []string{"ga"}, &Rule{ - PluralForms: newPluralFormSet(One, Two, Few, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 1 - if ops.NEqualsAny(1) { - return One - } - // n = 2 - if ops.NEqualsAny(2) { - return Two - } - // n = 3..6 - if ops.NInRange(3, 6) { - return Few - } - // n = 7..10 - if ops.NInRange(7, 10) { - return Many - } - return Other - }, - }) - addPluralRules(rules, []string{"gv"}, &Rule{ - PluralForms: newPluralFormSet(One, Two, Few, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // v = 0 and i % 10 = 1 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%10, 1) { - return One - } - // v = 0 and i % 10 = 2 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%10, 2) { - return Two - } - // v = 0 and i % 100 = 0,20,40,60,80 - if intEqualsAny(ops.V, 0) && intEqualsAny(ops.I%100, 0, 20, 40, 60, 80) { - return Few - } - // v != 0 - if !intEqualsAny(ops.V, 0) { - return Many - } - return Other - }, - }) - addPluralRules(rules, []string{"ar", "ars"}, &Rule{ - PluralForms: newPluralFormSet(Zero, One, Two, Few, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 0 - if ops.NEqualsAny(0) { - return Zero - } - // n = 1 - if ops.NEqualsAny(1) { - return One - } - // n = 2 - if ops.NEqualsAny(2) { - return Two - } - // n % 100 = 3..10 - if ops.NModInRange(100, 3, 10) { - return Few - } - // n % 100 = 11..99 - if ops.NModInRange(100, 11, 99) { - return Many - } - return Other - }, - }) - addPluralRules(rules, []string{"cy"}, &Rule{ - PluralForms: newPluralFormSet(Zero, One, Two, Few, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 0 - if ops.NEqualsAny(0) { - return Zero - } - // n = 1 - if ops.NEqualsAny(1) { - return One - } - // n = 2 - if ops.NEqualsAny(2) { - return Two - } - // n = 3 - if ops.NEqualsAny(3) { - return Few - } - // n = 6 - if ops.NEqualsAny(6) { - return Many - } - return Other - }, - }) - addPluralRules(rules, []string{"kw"}, &Rule{ - PluralForms: newPluralFormSet(Zero, One, Two, Few, Many, Other), - PluralFormFunc: func(ops *Operands) Form { - // n = 0 - if ops.NEqualsAny(0) { - return Zero - } - // n = 1 - if ops.NEqualsAny(1) { - return One - } - // n % 100 = 2,22,42,62,82 or n%1000 = 0 and n%100000=1000..20000,40000,60000,80000 or n!=0 and n%1000000=100000 - if ops.NModEqualsAny(100, 2, 22, 42, 62, 82) || - ops.NModEqualsAny(1000, 0) && (ops.NModInRange(100000, 1000, 20000) || ops.NModEqualsAny(100000, 40000, 60000, 80000)) || - !ops.NEqualsAny(0) && ops.NModEqualsAny(1000000, 100000) { - return Two - } - // n % 100 = 3,23,43,63,83 - if ops.NModEqualsAny(100, 3, 23, 43, 63, 83) { - return Few - } - // n != 1 and n % 100 = 1,21,41,61,81 - if !ops.NEqualsAny(1) && ops.NModEqualsAny(100, 1, 21, 41, 61, 81) { - return Many - } - return Other - }, - }) - - return rules -} diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/rules.go b/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/rules.go deleted file mode 100644 index 87eb8369d..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/internal/plural/rules.go +++ /dev/null @@ -1,24 +0,0 @@ -package plural - -import "golang.org/x/text/language" - -// Rules is a set of plural rules by language tag. -type Rules map[language.Tag]*Rule - -// Rule returns the closest matching plural rule for the language tag -// or nil if no rule could be found. -func (r Rules) Rule(tag language.Tag) *Rule { - t := tag - for { - if rule := r[t]; rule != nil { - return rule - } - t = t.Parent() - if t.IsRoot() { - break - } - } - base, _ := tag.Base() - baseTag, _ := language.Parse(base.String()) - return r[baseTag] -} diff --git a/vendor/github.com/nicksnyder/go-i18n/v2/internal/template.go b/vendor/github.com/nicksnyder/go-i18n/v2/internal/template.go deleted file mode 100644 index 2fe992355..000000000 --- a/vendor/github.com/nicksnyder/go-i18n/v2/internal/template.go +++ /dev/null @@ -1,51 +0,0 @@ -package internal - -import ( - "bytes" - "strings" - "sync" - gotemplate "text/template" -) - -// Template stores the template for a string. -type Template struct { - Src string - LeftDelim string - RightDelim string - - parseOnce sync.Once - parsedTemplate *gotemplate.Template - parseError error -} - -func (t *Template) Execute(funcs gotemplate.FuncMap, data interface{}) (string, error) { - leftDelim := t.LeftDelim - if leftDelim == "" { - leftDelim = "{{" - } - if !strings.Contains(t.Src, leftDelim) { - // Fast path to avoid parsing a template that has no actions. - return t.Src, nil - } - - var gt *gotemplate.Template - var err error - if funcs == nil { - t.parseOnce.Do(func() { - // If funcs is nil, then we only need to parse this template once. - t.parsedTemplate, t.parseError = gotemplate.New("").Delims(t.LeftDelim, t.RightDelim).Parse(t.Src) - }) - gt, err = t.parsedTemplate, t.parseError - } else { - gt, err = gotemplate.New("").Delims(t.LeftDelim, t.RightDelim).Funcs(funcs).Parse(t.Src) - } - - if err != nil { - return "", err - } - var buf bytes.Buffer - if err := gt.Execute(&buf, data); err != nil { - return "", err - } - return buf.String(), nil -} diff --git a/vendor/golang.org/x/text/AUTHORS b/vendor/golang.org/x/text/AUTHORS deleted file mode 100644 index 15167cd74..000000000 --- a/vendor/golang.org/x/text/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/text/CONTRIBUTORS b/vendor/golang.org/x/text/CONTRIBUTORS deleted file mode 100644 index 1c4577e96..000000000 --- a/vendor/golang.org/x/text/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/text/LICENSE b/vendor/golang.org/x/text/LICENSE deleted file mode 100644 index 6a66aea5e..000000000 --- a/vendor/golang.org/x/text/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/text/PATENTS b/vendor/golang.org/x/text/PATENTS deleted file mode 100644 index 733099041..000000000 --- a/vendor/golang.org/x/text/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/text/internal/language/common.go b/vendor/golang.org/x/text/internal/language/common.go deleted file mode 100644 index cdfdb7497..000000000 --- a/vendor/golang.org/x/text/internal/language/common.go +++ /dev/null @@ -1,16 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -package language - -// This file contains code common to the maketables.go and the package code. - -// AliasType is the type of an alias in AliasMap. -type AliasType int8 - -const ( - Deprecated AliasType = iota - Macro - Legacy - - AliasTypeUnknown AliasType = -1 -) diff --git a/vendor/golang.org/x/text/internal/language/compact.go b/vendor/golang.org/x/text/internal/language/compact.go deleted file mode 100644 index 46a001507..000000000 --- a/vendor/golang.org/x/text/internal/language/compact.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -// CompactCoreInfo is a compact integer with the three core tags encoded. -type CompactCoreInfo uint32 - -// GetCompactCore generates a uint32 value that is guaranteed to be unique for -// different language, region, and script values. -func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) { - if t.LangID > langNoIndexOffset { - return 0, false - } - cci |= CompactCoreInfo(t.LangID) << (8 + 12) - cci |= CompactCoreInfo(t.ScriptID) << 12 - cci |= CompactCoreInfo(t.RegionID) - return cci, true -} - -// Tag generates a tag from c. -func (c CompactCoreInfo) Tag() Tag { - return Tag{ - LangID: Language(c >> 20), - RegionID: Region(c & 0x3ff), - ScriptID: Script(c>>12) & 0xff, - } -} diff --git a/vendor/golang.org/x/text/internal/language/compact/compact.go b/vendor/golang.org/x/text/internal/language/compact/compact.go deleted file mode 100644 index 1b36935ef..000000000 --- a/vendor/golang.org/x/text/internal/language/compact/compact.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package compact defines a compact representation of language tags. -// -// Common language tags (at least all for which locale information is defined -// in CLDR) are assigned a unique index. Each Tag is associated with such an -// ID for selecting language-related resources (such as translations) as well -// as one for selecting regional defaults (currency, number formatting, etc.) -// -// It may want to export this functionality at some point, but at this point -// this is only available for use within x/text. -package compact // import "golang.org/x/text/internal/language/compact" - -import ( - "sort" - "strings" - - "golang.org/x/text/internal/language" -) - -// ID is an integer identifying a single tag. -type ID uint16 - -func getCoreIndex(t language.Tag) (id ID, ok bool) { - cci, ok := language.GetCompactCore(t) - if !ok { - return 0, false - } - i := sort.Search(len(coreTags), func(i int) bool { - return cci <= coreTags[i] - }) - if i == len(coreTags) || coreTags[i] != cci { - return 0, false - } - return ID(i), true -} - -// Parent returns the ID of the parent or the root ID if id is already the root. -func (id ID) Parent() ID { - return parents[id] -} - -// Tag converts id to an internal language Tag. -func (id ID) Tag() language.Tag { - if int(id) >= len(coreTags) { - return specialTags[int(id)-len(coreTags)] - } - return coreTags[id].Tag() -} - -var specialTags []language.Tag - -func init() { - tags := strings.Split(specialTagsStr, " ") - specialTags = make([]language.Tag, len(tags)) - for i, t := range tags { - specialTags[i] = language.MustParse(t) - } -} diff --git a/vendor/golang.org/x/text/internal/language/compact/language.go b/vendor/golang.org/x/text/internal/language/compact/language.go deleted file mode 100644 index 83816a72a..000000000 --- a/vendor/golang.org/x/text/internal/language/compact/language.go +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate go run gen.go gen_index.go -output tables.go -//go:generate go run gen_parents.go - -package compact - -// TODO: Remove above NOTE after: -// - verifying that tables are dropped correctly (most notably matcher tables). - -import ( - "strings" - - "golang.org/x/text/internal/language" -) - -// Tag represents a BCP 47 language tag. It is used to specify an instance of a -// specific language or locale. All language tag values are guaranteed to be -// well-formed. -type Tag struct { - // NOTE: exported tags will become part of the public API. - language ID - locale ID - full fullTag // always a language.Tag for now. -} - -const _und = 0 - -type fullTag interface { - IsRoot() bool - Parent() language.Tag -} - -// Make a compact Tag from a fully specified internal language Tag. -func Make(t language.Tag) (tag Tag) { - if region := t.TypeForKey("rg"); len(region) == 6 && region[2:] == "zzzz" { - if r, err := language.ParseRegion(region[:2]); err == nil { - tFull := t - t, _ = t.SetTypeForKey("rg", "") - // TODO: should we not consider "va" for the language tag? - var exact1, exact2 bool - tag.language, exact1 = FromTag(t) - t.RegionID = r - tag.locale, exact2 = FromTag(t) - if !exact1 || !exact2 { - tag.full = tFull - } - return tag - } - } - lang, ok := FromTag(t) - tag.language = lang - tag.locale = lang - if !ok { - tag.full = t - } - return tag -} - -// Tag returns an internal language Tag version of this tag. -func (t Tag) Tag() language.Tag { - if t.full != nil { - return t.full.(language.Tag) - } - tag := t.language.Tag() - if t.language != t.locale { - loc := t.locale.Tag() - tag, _ = tag.SetTypeForKey("rg", strings.ToLower(loc.RegionID.String())+"zzzz") - } - return tag -} - -// IsCompact reports whether this tag is fully defined in terms of ID. -func (t *Tag) IsCompact() bool { - return t.full == nil -} - -// MayHaveVariants reports whether a tag may have variants. If it returns false -// it is guaranteed the tag does not have variants. -func (t Tag) MayHaveVariants() bool { - return t.full != nil || int(t.language) >= len(coreTags) -} - -// MayHaveExtensions reports whether a tag may have extensions. If it returns -// false it is guaranteed the tag does not have them. -func (t Tag) MayHaveExtensions() bool { - return t.full != nil || - int(t.language) >= len(coreTags) || - t.language != t.locale -} - -// IsRoot returns true if t is equal to language "und". -func (t Tag) IsRoot() bool { - if t.full != nil { - return t.full.IsRoot() - } - return t.language == _und -} - -// Parent returns the CLDR parent of t. In CLDR, missing fields in data for a -// specific language are substituted with fields from the parent language. -// The parent for a language may change for newer versions of CLDR. -func (t Tag) Parent() Tag { - if t.full != nil { - return Make(t.full.Parent()) - } - if t.language != t.locale { - // Simulate stripping -u-rg-xxxxxx - return Tag{language: t.language, locale: t.language} - } - // TODO: use parent lookup table once cycle from internal package is - // removed. Probably by internalizing the table and declaring this fast - // enough. - // lang := compactID(internal.Parent(uint16(t.language))) - lang, _ := FromTag(t.language.Tag().Parent()) - return Tag{language: lang, locale: lang} -} - -// returns token t and the rest of the string. -func nextToken(s string) (t, tail string) { - p := strings.Index(s[1:], "-") - if p == -1 { - return s[1:], "" - } - p++ - return s[1:p], s[p:] -} - -// LanguageID returns an index, where 0 <= index < NumCompactTags, for tags -// for which data exists in the text repository.The index will change over time -// and should not be stored in persistent storage. If t does not match a compact -// index, exact will be false and the compact index will be returned for the -// first match after repeatedly taking the Parent of t. -func LanguageID(t Tag) (id ID, exact bool) { - return t.language, t.full == nil -} - -// RegionalID returns the ID for the regional variant of this tag. This index is -// used to indicate region-specific overrides, such as default currency, default -// calendar and week data, default time cycle, and default measurement system -// and unit preferences. -// -// For instance, the tag en-GB-u-rg-uszzzz specifies British English with US -// settings for currency, number formatting, etc. The CompactIndex for this tag -// will be that for en-GB, while the RegionalID will be the one corresponding to -// en-US. -func RegionalID(t Tag) (id ID, exact bool) { - return t.locale, t.full == nil -} - -// LanguageTag returns t stripped of regional variant indicators. -// -// At the moment this means it is stripped of a regional and variant subtag "rg" -// and "va" in the "u" extension. -func (t Tag) LanguageTag() Tag { - if t.full == nil { - return Tag{language: t.language, locale: t.language} - } - tt := t.Tag() - tt.SetTypeForKey("rg", "") - tt.SetTypeForKey("va", "") - return Make(tt) -} - -// RegionalTag returns the regional variant of the tag. -// -// At the moment this means that the region is set from the regional subtag -// "rg" in the "u" extension. -func (t Tag) RegionalTag() Tag { - rt := Tag{language: t.locale, locale: t.locale} - if t.full == nil { - return rt - } - b := language.Builder{} - tag := t.Tag() - // tag, _ = tag.SetTypeForKey("rg", "") - b.SetTag(t.locale.Tag()) - if v := tag.Variants(); v != "" { - for _, v := range strings.Split(v, "-") { - b.AddVariant(v) - } - } - for _, e := range tag.Extensions() { - b.AddExt(e) - } - return t -} - -// FromTag reports closest matching ID for an internal language Tag. -func FromTag(t language.Tag) (id ID, exact bool) { - // TODO: perhaps give more frequent tags a lower index. - // TODO: we could make the indexes stable. This will excluded some - // possibilities for optimization, so don't do this quite yet. - exact = true - - b, s, r := t.Raw() - if t.HasString() { - if t.IsPrivateUse() { - // We have no entries for user-defined tags. - return 0, false - } - hasExtra := false - if t.HasVariants() { - if t.HasExtensions() { - build := language.Builder{} - build.SetTag(language.Tag{LangID: b, ScriptID: s, RegionID: r}) - build.AddVariant(t.Variants()) - exact = false - t = build.Make() - } - hasExtra = true - } else if _, ok := t.Extension('u'); ok { - // TODO: va may mean something else. Consider not considering it. - // Strip all but the 'va' entry. - old := t - variant := t.TypeForKey("va") - t = language.Tag{LangID: b, ScriptID: s, RegionID: r} - if variant != "" { - t, _ = t.SetTypeForKey("va", variant) - hasExtra = true - } - exact = old == t - } else { - exact = false - } - if hasExtra { - // We have some variants. - for i, s := range specialTags { - if s == t { - return ID(i + len(coreTags)), exact - } - } - exact = false - } - } - if x, ok := getCoreIndex(t); ok { - return x, exact - } - exact = false - if r != 0 && s == 0 { - // Deal with cases where an extra script is inserted for the region. - t, _ := t.Maximize() - if x, ok := getCoreIndex(t); ok { - return x, exact - } - } - for t = t.Parent(); t != root; t = t.Parent() { - // No variants specified: just compare core components. - // The key has the form lllssrrr, where l, s, and r are nibbles for - // respectively the langID, scriptID, and regionID. - if x, ok := getCoreIndex(t); ok { - return x, exact - } - } - return 0, exact -} - -var root = language.Tag{} diff --git a/vendor/golang.org/x/text/internal/language/compact/parents.go b/vendor/golang.org/x/text/internal/language/compact/parents.go deleted file mode 100644 index 8d810723c..000000000 --- a/vendor/golang.org/x/text/internal/language/compact/parents.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -package compact - -// parents maps a compact index of a tag to the compact index of the parent of -// this tag. -var parents = []ID{ // 775 elements - // Entry 0 - 3F - 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0004, 0x0000, 0x0006, - 0x0000, 0x0008, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, - 0x0000, 0x0028, 0x0000, 0x002a, 0x0000, 0x002c, 0x0000, 0x0000, - 0x002f, 0x002e, 0x002e, 0x0000, 0x0033, 0x0000, 0x0035, 0x0000, - 0x0037, 0x0000, 0x0039, 0x0000, 0x003b, 0x0000, 0x0000, 0x003e, - // Entry 40 - 7F - 0x0000, 0x0040, 0x0040, 0x0000, 0x0043, 0x0043, 0x0000, 0x0046, - 0x0000, 0x0048, 0x0000, 0x0000, 0x004b, 0x004a, 0x004a, 0x0000, - 0x004f, 0x004f, 0x004f, 0x004f, 0x0000, 0x0054, 0x0054, 0x0000, - 0x0057, 0x0000, 0x0059, 0x0000, 0x005b, 0x0000, 0x005d, 0x005d, - 0x0000, 0x0060, 0x0000, 0x0062, 0x0000, 0x0064, 0x0000, 0x0066, - 0x0066, 0x0000, 0x0069, 0x0000, 0x006b, 0x006b, 0x006b, 0x006b, - 0x006b, 0x006b, 0x006b, 0x0000, 0x0073, 0x0000, 0x0075, 0x0000, - 0x0077, 0x0000, 0x0000, 0x007a, 0x0000, 0x007c, 0x0000, 0x007e, - // Entry 80 - BF - 0x0000, 0x0080, 0x0080, 0x0000, 0x0083, 0x0083, 0x0000, 0x0086, - 0x0087, 0x0087, 0x0087, 0x0086, 0x0088, 0x0087, 0x0087, 0x0087, - 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0088, - 0x0087, 0x0087, 0x0087, 0x0087, 0x0088, 0x0087, 0x0088, 0x0087, - 0x0087, 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, - 0x0087, 0x0087, 0x0087, 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, - 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, - 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0086, 0x0087, 0x0086, - // Entry C0 - FF - 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, - 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, - 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0088, 0x0087, - 0x0087, 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, - 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0086, 0x0086, 0x0087, - 0x0087, 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0000, - 0x00ef, 0x0000, 0x00f1, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, - 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f1, 0x00f2, 0x00f1, 0x00f1, - // Entry 100 - 13F - 0x00f2, 0x00f2, 0x00f1, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f1, - 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x0000, 0x010e, - 0x0000, 0x0110, 0x0000, 0x0112, 0x0000, 0x0114, 0x0114, 0x0000, - 0x0117, 0x0117, 0x0117, 0x0117, 0x0000, 0x011c, 0x0000, 0x011e, - 0x0000, 0x0120, 0x0120, 0x0000, 0x0123, 0x0123, 0x0123, 0x0123, - 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, - 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, - 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, - // Entry 140 - 17F - 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, - 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, - 0x0123, 0x0123, 0x0000, 0x0152, 0x0000, 0x0154, 0x0000, 0x0156, - 0x0000, 0x0158, 0x0000, 0x015a, 0x0000, 0x015c, 0x015c, 0x015c, - 0x0000, 0x0160, 0x0000, 0x0000, 0x0163, 0x0000, 0x0165, 0x0000, - 0x0167, 0x0167, 0x0167, 0x0000, 0x016b, 0x0000, 0x016d, 0x0000, - 0x016f, 0x0000, 0x0171, 0x0171, 0x0000, 0x0174, 0x0000, 0x0176, - 0x0000, 0x0178, 0x0000, 0x017a, 0x0000, 0x017c, 0x0000, 0x017e, - // Entry 180 - 1BF - 0x0000, 0x0000, 0x0000, 0x0182, 0x0000, 0x0184, 0x0184, 0x0184, - 0x0184, 0x0000, 0x0000, 0x0000, 0x018b, 0x0000, 0x0000, 0x018e, - 0x0000, 0x0000, 0x0191, 0x0000, 0x0000, 0x0000, 0x0195, 0x0000, - 0x0197, 0x0000, 0x0000, 0x019a, 0x0000, 0x0000, 0x019d, 0x0000, - 0x019f, 0x0000, 0x01a1, 0x0000, 0x01a3, 0x0000, 0x01a5, 0x0000, - 0x01a7, 0x0000, 0x01a9, 0x0000, 0x01ab, 0x0000, 0x01ad, 0x0000, - 0x01af, 0x0000, 0x01b1, 0x01b1, 0x0000, 0x01b4, 0x0000, 0x01b6, - 0x0000, 0x01b8, 0x0000, 0x01ba, 0x0000, 0x01bc, 0x0000, 0x0000, - // Entry 1C0 - 1FF - 0x01bf, 0x0000, 0x01c1, 0x0000, 0x01c3, 0x0000, 0x01c5, 0x0000, - 0x01c7, 0x0000, 0x01c9, 0x0000, 0x01cb, 0x01cb, 0x01cb, 0x01cb, - 0x0000, 0x01d0, 0x0000, 0x01d2, 0x01d2, 0x0000, 0x01d5, 0x0000, - 0x01d7, 0x0000, 0x01d9, 0x0000, 0x01db, 0x0000, 0x01dd, 0x0000, - 0x01df, 0x01df, 0x0000, 0x01e2, 0x0000, 0x01e4, 0x0000, 0x01e6, - 0x0000, 0x01e8, 0x0000, 0x01ea, 0x0000, 0x01ec, 0x0000, 0x01ee, - 0x0000, 0x01f0, 0x0000, 0x0000, 0x01f3, 0x0000, 0x01f5, 0x01f5, - 0x01f5, 0x0000, 0x01f9, 0x0000, 0x01fb, 0x0000, 0x01fd, 0x0000, - // Entry 200 - 23F - 0x01ff, 0x0000, 0x0000, 0x0202, 0x0000, 0x0204, 0x0204, 0x0000, - 0x0207, 0x0000, 0x0209, 0x0209, 0x0000, 0x020c, 0x020c, 0x0000, - 0x020f, 0x020f, 0x020f, 0x020f, 0x020f, 0x020f, 0x020f, 0x0000, - 0x0217, 0x0000, 0x0219, 0x0000, 0x021b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0221, 0x0000, 0x0000, 0x0224, 0x0000, 0x0226, - 0x0226, 0x0000, 0x0229, 0x0000, 0x022b, 0x022b, 0x0000, 0x0000, - 0x022f, 0x022e, 0x022e, 0x0000, 0x0000, 0x0234, 0x0000, 0x0236, - 0x0000, 0x0238, 0x0000, 0x0244, 0x023a, 0x0244, 0x0244, 0x0244, - // Entry 240 - 27F - 0x0244, 0x0244, 0x0244, 0x0244, 0x023a, 0x0244, 0x0244, 0x0000, - 0x0247, 0x0247, 0x0247, 0x0000, 0x024b, 0x0000, 0x024d, 0x0000, - 0x024f, 0x024f, 0x0000, 0x0252, 0x0000, 0x0254, 0x0254, 0x0254, - 0x0254, 0x0254, 0x0254, 0x0000, 0x025b, 0x0000, 0x025d, 0x0000, - 0x025f, 0x0000, 0x0261, 0x0000, 0x0263, 0x0000, 0x0265, 0x0000, - 0x0000, 0x0268, 0x0268, 0x0268, 0x0000, 0x026c, 0x0000, 0x026e, - 0x0000, 0x0270, 0x0000, 0x0000, 0x0000, 0x0274, 0x0273, 0x0273, - 0x0000, 0x0278, 0x0000, 0x027a, 0x0000, 0x027c, 0x0000, 0x0000, - // Entry 280 - 2BF - 0x0000, 0x0000, 0x0281, 0x0000, 0x0000, 0x0284, 0x0000, 0x0286, - 0x0286, 0x0286, 0x0286, 0x0000, 0x028b, 0x028b, 0x028b, 0x0000, - 0x028f, 0x028f, 0x028f, 0x028f, 0x028f, 0x0000, 0x0295, 0x0295, - 0x0295, 0x0295, 0x0000, 0x0000, 0x0000, 0x0000, 0x029d, 0x029d, - 0x029d, 0x0000, 0x02a1, 0x02a1, 0x02a1, 0x02a1, 0x0000, 0x0000, - 0x02a7, 0x02a7, 0x02a7, 0x02a7, 0x0000, 0x02ac, 0x0000, 0x02ae, - 0x02ae, 0x0000, 0x02b1, 0x0000, 0x02b3, 0x0000, 0x02b5, 0x02b5, - 0x0000, 0x0000, 0x02b9, 0x0000, 0x0000, 0x0000, 0x02bd, 0x0000, - // Entry 2C0 - 2FF - 0x02bf, 0x02bf, 0x0000, 0x0000, 0x02c3, 0x0000, 0x02c5, 0x0000, - 0x02c7, 0x0000, 0x02c9, 0x0000, 0x02cb, 0x0000, 0x02cd, 0x02cd, - 0x0000, 0x0000, 0x02d1, 0x0000, 0x02d3, 0x02d0, 0x02d0, 0x0000, - 0x0000, 0x02d8, 0x02d7, 0x02d7, 0x0000, 0x0000, 0x02dd, 0x0000, - 0x02df, 0x0000, 0x02e1, 0x0000, 0x0000, 0x02e4, 0x0000, 0x02e6, - 0x0000, 0x0000, 0x02e9, 0x0000, 0x02eb, 0x0000, 0x02ed, 0x0000, - 0x02ef, 0x02ef, 0x0000, 0x0000, 0x02f3, 0x02f2, 0x02f2, 0x0000, - 0x02f7, 0x0000, 0x02f9, 0x02f9, 0x02f9, 0x02f9, 0x02f9, 0x0000, - // Entry 300 - 33F - 0x02ff, 0x0300, 0x02ff, 0x0000, 0x0303, 0x0051, 0x00e6, -} // Size: 1574 bytes - -// Total table size 1574 bytes (1KiB); checksum: 895AAF0B diff --git a/vendor/golang.org/x/text/internal/language/compact/tables.go b/vendor/golang.org/x/text/internal/language/compact/tables.go deleted file mode 100644 index 554ca354b..000000000 --- a/vendor/golang.org/x/text/internal/language/compact/tables.go +++ /dev/null @@ -1,1015 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -package compact - -import "golang.org/x/text/internal/language" - -// CLDRVersion is the CLDR version from which the tables in this package are derived. -const CLDRVersion = "32" - -// NumCompactTags is the number of common tags. The maximum tag is -// NumCompactTags-1. -const NumCompactTags = 775 -const ( - undIndex ID = 0 - afIndex ID = 1 - afNAIndex ID = 2 - afZAIndex ID = 3 - agqIndex ID = 4 - agqCMIndex ID = 5 - akIndex ID = 6 - akGHIndex ID = 7 - amIndex ID = 8 - amETIndex ID = 9 - arIndex ID = 10 - ar001Index ID = 11 - arAEIndex ID = 12 - arBHIndex ID = 13 - arDJIndex ID = 14 - arDZIndex ID = 15 - arEGIndex ID = 16 - arEHIndex ID = 17 - arERIndex ID = 18 - arILIndex ID = 19 - arIQIndex ID = 20 - arJOIndex ID = 21 - arKMIndex ID = 22 - arKWIndex ID = 23 - arLBIndex ID = 24 - arLYIndex ID = 25 - arMAIndex ID = 26 - arMRIndex ID = 27 - arOMIndex ID = 28 - arPSIndex ID = 29 - arQAIndex ID = 30 - arSAIndex ID = 31 - arSDIndex ID = 32 - arSOIndex ID = 33 - arSSIndex ID = 34 - arSYIndex ID = 35 - arTDIndex ID = 36 - arTNIndex ID = 37 - arYEIndex ID = 38 - arsIndex ID = 39 - asIndex ID = 40 - asINIndex ID = 41 - asaIndex ID = 42 - asaTZIndex ID = 43 - astIndex ID = 44 - astESIndex ID = 45 - azIndex ID = 46 - azCyrlIndex ID = 47 - azCyrlAZIndex ID = 48 - azLatnIndex ID = 49 - azLatnAZIndex ID = 50 - basIndex ID = 51 - basCMIndex ID = 52 - beIndex ID = 53 - beBYIndex ID = 54 - bemIndex ID = 55 - bemZMIndex ID = 56 - bezIndex ID = 57 - bezTZIndex ID = 58 - bgIndex ID = 59 - bgBGIndex ID = 60 - bhIndex ID = 61 - bmIndex ID = 62 - bmMLIndex ID = 63 - bnIndex ID = 64 - bnBDIndex ID = 65 - bnINIndex ID = 66 - boIndex ID = 67 - boCNIndex ID = 68 - boINIndex ID = 69 - brIndex ID = 70 - brFRIndex ID = 71 - brxIndex ID = 72 - brxINIndex ID = 73 - bsIndex ID = 74 - bsCyrlIndex ID = 75 - bsCyrlBAIndex ID = 76 - bsLatnIndex ID = 77 - bsLatnBAIndex ID = 78 - caIndex ID = 79 - caADIndex ID = 80 - caESIndex ID = 81 - caFRIndex ID = 82 - caITIndex ID = 83 - ccpIndex ID = 84 - ccpBDIndex ID = 85 - ccpINIndex ID = 86 - ceIndex ID = 87 - ceRUIndex ID = 88 - cggIndex ID = 89 - cggUGIndex ID = 90 - chrIndex ID = 91 - chrUSIndex ID = 92 - ckbIndex ID = 93 - ckbIQIndex ID = 94 - ckbIRIndex ID = 95 - csIndex ID = 96 - csCZIndex ID = 97 - cuIndex ID = 98 - cuRUIndex ID = 99 - cyIndex ID = 100 - cyGBIndex ID = 101 - daIndex ID = 102 - daDKIndex ID = 103 - daGLIndex ID = 104 - davIndex ID = 105 - davKEIndex ID = 106 - deIndex ID = 107 - deATIndex ID = 108 - deBEIndex ID = 109 - deCHIndex ID = 110 - deDEIndex ID = 111 - deITIndex ID = 112 - deLIIndex ID = 113 - deLUIndex ID = 114 - djeIndex ID = 115 - djeNEIndex ID = 116 - dsbIndex ID = 117 - dsbDEIndex ID = 118 - duaIndex ID = 119 - duaCMIndex ID = 120 - dvIndex ID = 121 - dyoIndex ID = 122 - dyoSNIndex ID = 123 - dzIndex ID = 124 - dzBTIndex ID = 125 - ebuIndex ID = 126 - ebuKEIndex ID = 127 - eeIndex ID = 128 - eeGHIndex ID = 129 - eeTGIndex ID = 130 - elIndex ID = 131 - elCYIndex ID = 132 - elGRIndex ID = 133 - enIndex ID = 134 - en001Index ID = 135 - en150Index ID = 136 - enAGIndex ID = 137 - enAIIndex ID = 138 - enASIndex ID = 139 - enATIndex ID = 140 - enAUIndex ID = 141 - enBBIndex ID = 142 - enBEIndex ID = 143 - enBIIndex ID = 144 - enBMIndex ID = 145 - enBSIndex ID = 146 - enBWIndex ID = 147 - enBZIndex ID = 148 - enCAIndex ID = 149 - enCCIndex ID = 150 - enCHIndex ID = 151 - enCKIndex ID = 152 - enCMIndex ID = 153 - enCXIndex ID = 154 - enCYIndex ID = 155 - enDEIndex ID = 156 - enDGIndex ID = 157 - enDKIndex ID = 158 - enDMIndex ID = 159 - enERIndex ID = 160 - enFIIndex ID = 161 - enFJIndex ID = 162 - enFKIndex ID = 163 - enFMIndex ID = 164 - enGBIndex ID = 165 - enGDIndex ID = 166 - enGGIndex ID = 167 - enGHIndex ID = 168 - enGIIndex ID = 169 - enGMIndex ID = 170 - enGUIndex ID = 171 - enGYIndex ID = 172 - enHKIndex ID = 173 - enIEIndex ID = 174 - enILIndex ID = 175 - enIMIndex ID = 176 - enINIndex ID = 177 - enIOIndex ID = 178 - enJEIndex ID = 179 - enJMIndex ID = 180 - enKEIndex ID = 181 - enKIIndex ID = 182 - enKNIndex ID = 183 - enKYIndex ID = 184 - enLCIndex ID = 185 - enLRIndex ID = 186 - enLSIndex ID = 187 - enMGIndex ID = 188 - enMHIndex ID = 189 - enMOIndex ID = 190 - enMPIndex ID = 191 - enMSIndex ID = 192 - enMTIndex ID = 193 - enMUIndex ID = 194 - enMWIndex ID = 195 - enMYIndex ID = 196 - enNAIndex ID = 197 - enNFIndex ID = 198 - enNGIndex ID = 199 - enNLIndex ID = 200 - enNRIndex ID = 201 - enNUIndex ID = 202 - enNZIndex ID = 203 - enPGIndex ID = 204 - enPHIndex ID = 205 - enPKIndex ID = 206 - enPNIndex ID = 207 - enPRIndex ID = 208 - enPWIndex ID = 209 - enRWIndex ID = 210 - enSBIndex ID = 211 - enSCIndex ID = 212 - enSDIndex ID = 213 - enSEIndex ID = 214 - enSGIndex ID = 215 - enSHIndex ID = 216 - enSIIndex ID = 217 - enSLIndex ID = 218 - enSSIndex ID = 219 - enSXIndex ID = 220 - enSZIndex ID = 221 - enTCIndex ID = 222 - enTKIndex ID = 223 - enTOIndex ID = 224 - enTTIndex ID = 225 - enTVIndex ID = 226 - enTZIndex ID = 227 - enUGIndex ID = 228 - enUMIndex ID = 229 - enUSIndex ID = 230 - enVCIndex ID = 231 - enVGIndex ID = 232 - enVIIndex ID = 233 - enVUIndex ID = 234 - enWSIndex ID = 235 - enZAIndex ID = 236 - enZMIndex ID = 237 - enZWIndex ID = 238 - eoIndex ID = 239 - eo001Index ID = 240 - esIndex ID = 241 - es419Index ID = 242 - esARIndex ID = 243 - esBOIndex ID = 244 - esBRIndex ID = 245 - esBZIndex ID = 246 - esCLIndex ID = 247 - esCOIndex ID = 248 - esCRIndex ID = 249 - esCUIndex ID = 250 - esDOIndex ID = 251 - esEAIndex ID = 252 - esECIndex ID = 253 - esESIndex ID = 254 - esGQIndex ID = 255 - esGTIndex ID = 256 - esHNIndex ID = 257 - esICIndex ID = 258 - esMXIndex ID = 259 - esNIIndex ID = 260 - esPAIndex ID = 261 - esPEIndex ID = 262 - esPHIndex ID = 263 - esPRIndex ID = 264 - esPYIndex ID = 265 - esSVIndex ID = 266 - esUSIndex ID = 267 - esUYIndex ID = 268 - esVEIndex ID = 269 - etIndex ID = 270 - etEEIndex ID = 271 - euIndex ID = 272 - euESIndex ID = 273 - ewoIndex ID = 274 - ewoCMIndex ID = 275 - faIndex ID = 276 - faAFIndex ID = 277 - faIRIndex ID = 278 - ffIndex ID = 279 - ffCMIndex ID = 280 - ffGNIndex ID = 281 - ffMRIndex ID = 282 - ffSNIndex ID = 283 - fiIndex ID = 284 - fiFIIndex ID = 285 - filIndex ID = 286 - filPHIndex ID = 287 - foIndex ID = 288 - foDKIndex ID = 289 - foFOIndex ID = 290 - frIndex ID = 291 - frBEIndex ID = 292 - frBFIndex ID = 293 - frBIIndex ID = 294 - frBJIndex ID = 295 - frBLIndex ID = 296 - frCAIndex ID = 297 - frCDIndex ID = 298 - frCFIndex ID = 299 - frCGIndex ID = 300 - frCHIndex ID = 301 - frCIIndex ID = 302 - frCMIndex ID = 303 - frDJIndex ID = 304 - frDZIndex ID = 305 - frFRIndex ID = 306 - frGAIndex ID = 307 - frGFIndex ID = 308 - frGNIndex ID = 309 - frGPIndex ID = 310 - frGQIndex ID = 311 - frHTIndex ID = 312 - frKMIndex ID = 313 - frLUIndex ID = 314 - frMAIndex ID = 315 - frMCIndex ID = 316 - frMFIndex ID = 317 - frMGIndex ID = 318 - frMLIndex ID = 319 - frMQIndex ID = 320 - frMRIndex ID = 321 - frMUIndex ID = 322 - frNCIndex ID = 323 - frNEIndex ID = 324 - frPFIndex ID = 325 - frPMIndex ID = 326 - frREIndex ID = 327 - frRWIndex ID = 328 - frSCIndex ID = 329 - frSNIndex ID = 330 - frSYIndex ID = 331 - frTDIndex ID = 332 - frTGIndex ID = 333 - frTNIndex ID = 334 - frVUIndex ID = 335 - frWFIndex ID = 336 - frYTIndex ID = 337 - furIndex ID = 338 - furITIndex ID = 339 - fyIndex ID = 340 - fyNLIndex ID = 341 - gaIndex ID = 342 - gaIEIndex ID = 343 - gdIndex ID = 344 - gdGBIndex ID = 345 - glIndex ID = 346 - glESIndex ID = 347 - gswIndex ID = 348 - gswCHIndex ID = 349 - gswFRIndex ID = 350 - gswLIIndex ID = 351 - guIndex ID = 352 - guINIndex ID = 353 - guwIndex ID = 354 - guzIndex ID = 355 - guzKEIndex ID = 356 - gvIndex ID = 357 - gvIMIndex ID = 358 - haIndex ID = 359 - haGHIndex ID = 360 - haNEIndex ID = 361 - haNGIndex ID = 362 - hawIndex ID = 363 - hawUSIndex ID = 364 - heIndex ID = 365 - heILIndex ID = 366 - hiIndex ID = 367 - hiINIndex ID = 368 - hrIndex ID = 369 - hrBAIndex ID = 370 - hrHRIndex ID = 371 - hsbIndex ID = 372 - hsbDEIndex ID = 373 - huIndex ID = 374 - huHUIndex ID = 375 - hyIndex ID = 376 - hyAMIndex ID = 377 - idIndex ID = 378 - idIDIndex ID = 379 - igIndex ID = 380 - igNGIndex ID = 381 - iiIndex ID = 382 - iiCNIndex ID = 383 - inIndex ID = 384 - ioIndex ID = 385 - isIndex ID = 386 - isISIndex ID = 387 - itIndex ID = 388 - itCHIndex ID = 389 - itITIndex ID = 390 - itSMIndex ID = 391 - itVAIndex ID = 392 - iuIndex ID = 393 - iwIndex ID = 394 - jaIndex ID = 395 - jaJPIndex ID = 396 - jboIndex ID = 397 - jgoIndex ID = 398 - jgoCMIndex ID = 399 - jiIndex ID = 400 - jmcIndex ID = 401 - jmcTZIndex ID = 402 - jvIndex ID = 403 - jwIndex ID = 404 - kaIndex ID = 405 - kaGEIndex ID = 406 - kabIndex ID = 407 - kabDZIndex ID = 408 - kajIndex ID = 409 - kamIndex ID = 410 - kamKEIndex ID = 411 - kcgIndex ID = 412 - kdeIndex ID = 413 - kdeTZIndex ID = 414 - keaIndex ID = 415 - keaCVIndex ID = 416 - khqIndex ID = 417 - khqMLIndex ID = 418 - kiIndex ID = 419 - kiKEIndex ID = 420 - kkIndex ID = 421 - kkKZIndex ID = 422 - kkjIndex ID = 423 - kkjCMIndex ID = 424 - klIndex ID = 425 - klGLIndex ID = 426 - klnIndex ID = 427 - klnKEIndex ID = 428 - kmIndex ID = 429 - kmKHIndex ID = 430 - knIndex ID = 431 - knINIndex ID = 432 - koIndex ID = 433 - koKPIndex ID = 434 - koKRIndex ID = 435 - kokIndex ID = 436 - kokINIndex ID = 437 - ksIndex ID = 438 - ksINIndex ID = 439 - ksbIndex ID = 440 - ksbTZIndex ID = 441 - ksfIndex ID = 442 - ksfCMIndex ID = 443 - kshIndex ID = 444 - kshDEIndex ID = 445 - kuIndex ID = 446 - kwIndex ID = 447 - kwGBIndex ID = 448 - kyIndex ID = 449 - kyKGIndex ID = 450 - lagIndex ID = 451 - lagTZIndex ID = 452 - lbIndex ID = 453 - lbLUIndex ID = 454 - lgIndex ID = 455 - lgUGIndex ID = 456 - lktIndex ID = 457 - lktUSIndex ID = 458 - lnIndex ID = 459 - lnAOIndex ID = 460 - lnCDIndex ID = 461 - lnCFIndex ID = 462 - lnCGIndex ID = 463 - loIndex ID = 464 - loLAIndex ID = 465 - lrcIndex ID = 466 - lrcIQIndex ID = 467 - lrcIRIndex ID = 468 - ltIndex ID = 469 - ltLTIndex ID = 470 - luIndex ID = 471 - luCDIndex ID = 472 - luoIndex ID = 473 - luoKEIndex ID = 474 - luyIndex ID = 475 - luyKEIndex ID = 476 - lvIndex ID = 477 - lvLVIndex ID = 478 - masIndex ID = 479 - masKEIndex ID = 480 - masTZIndex ID = 481 - merIndex ID = 482 - merKEIndex ID = 483 - mfeIndex ID = 484 - mfeMUIndex ID = 485 - mgIndex ID = 486 - mgMGIndex ID = 487 - mghIndex ID = 488 - mghMZIndex ID = 489 - mgoIndex ID = 490 - mgoCMIndex ID = 491 - mkIndex ID = 492 - mkMKIndex ID = 493 - mlIndex ID = 494 - mlINIndex ID = 495 - mnIndex ID = 496 - mnMNIndex ID = 497 - moIndex ID = 498 - mrIndex ID = 499 - mrINIndex ID = 500 - msIndex ID = 501 - msBNIndex ID = 502 - msMYIndex ID = 503 - msSGIndex ID = 504 - mtIndex ID = 505 - mtMTIndex ID = 506 - muaIndex ID = 507 - muaCMIndex ID = 508 - myIndex ID = 509 - myMMIndex ID = 510 - mznIndex ID = 511 - mznIRIndex ID = 512 - nahIndex ID = 513 - naqIndex ID = 514 - naqNAIndex ID = 515 - nbIndex ID = 516 - nbNOIndex ID = 517 - nbSJIndex ID = 518 - ndIndex ID = 519 - ndZWIndex ID = 520 - ndsIndex ID = 521 - ndsDEIndex ID = 522 - ndsNLIndex ID = 523 - neIndex ID = 524 - neINIndex ID = 525 - neNPIndex ID = 526 - nlIndex ID = 527 - nlAWIndex ID = 528 - nlBEIndex ID = 529 - nlBQIndex ID = 530 - nlCWIndex ID = 531 - nlNLIndex ID = 532 - nlSRIndex ID = 533 - nlSXIndex ID = 534 - nmgIndex ID = 535 - nmgCMIndex ID = 536 - nnIndex ID = 537 - nnNOIndex ID = 538 - nnhIndex ID = 539 - nnhCMIndex ID = 540 - noIndex ID = 541 - nqoIndex ID = 542 - nrIndex ID = 543 - nsoIndex ID = 544 - nusIndex ID = 545 - nusSSIndex ID = 546 - nyIndex ID = 547 - nynIndex ID = 548 - nynUGIndex ID = 549 - omIndex ID = 550 - omETIndex ID = 551 - omKEIndex ID = 552 - orIndex ID = 553 - orINIndex ID = 554 - osIndex ID = 555 - osGEIndex ID = 556 - osRUIndex ID = 557 - paIndex ID = 558 - paArabIndex ID = 559 - paArabPKIndex ID = 560 - paGuruIndex ID = 561 - paGuruINIndex ID = 562 - papIndex ID = 563 - plIndex ID = 564 - plPLIndex ID = 565 - prgIndex ID = 566 - prg001Index ID = 567 - psIndex ID = 568 - psAFIndex ID = 569 - ptIndex ID = 570 - ptAOIndex ID = 571 - ptBRIndex ID = 572 - ptCHIndex ID = 573 - ptCVIndex ID = 574 - ptGQIndex ID = 575 - ptGWIndex ID = 576 - ptLUIndex ID = 577 - ptMOIndex ID = 578 - ptMZIndex ID = 579 - ptPTIndex ID = 580 - ptSTIndex ID = 581 - ptTLIndex ID = 582 - quIndex ID = 583 - quBOIndex ID = 584 - quECIndex ID = 585 - quPEIndex ID = 586 - rmIndex ID = 587 - rmCHIndex ID = 588 - rnIndex ID = 589 - rnBIIndex ID = 590 - roIndex ID = 591 - roMDIndex ID = 592 - roROIndex ID = 593 - rofIndex ID = 594 - rofTZIndex ID = 595 - ruIndex ID = 596 - ruBYIndex ID = 597 - ruKGIndex ID = 598 - ruKZIndex ID = 599 - ruMDIndex ID = 600 - ruRUIndex ID = 601 - ruUAIndex ID = 602 - rwIndex ID = 603 - rwRWIndex ID = 604 - rwkIndex ID = 605 - rwkTZIndex ID = 606 - sahIndex ID = 607 - sahRUIndex ID = 608 - saqIndex ID = 609 - saqKEIndex ID = 610 - sbpIndex ID = 611 - sbpTZIndex ID = 612 - sdIndex ID = 613 - sdPKIndex ID = 614 - sdhIndex ID = 615 - seIndex ID = 616 - seFIIndex ID = 617 - seNOIndex ID = 618 - seSEIndex ID = 619 - sehIndex ID = 620 - sehMZIndex ID = 621 - sesIndex ID = 622 - sesMLIndex ID = 623 - sgIndex ID = 624 - sgCFIndex ID = 625 - shIndex ID = 626 - shiIndex ID = 627 - shiLatnIndex ID = 628 - shiLatnMAIndex ID = 629 - shiTfngIndex ID = 630 - shiTfngMAIndex ID = 631 - siIndex ID = 632 - siLKIndex ID = 633 - skIndex ID = 634 - skSKIndex ID = 635 - slIndex ID = 636 - slSIIndex ID = 637 - smaIndex ID = 638 - smiIndex ID = 639 - smjIndex ID = 640 - smnIndex ID = 641 - smnFIIndex ID = 642 - smsIndex ID = 643 - snIndex ID = 644 - snZWIndex ID = 645 - soIndex ID = 646 - soDJIndex ID = 647 - soETIndex ID = 648 - soKEIndex ID = 649 - soSOIndex ID = 650 - sqIndex ID = 651 - sqALIndex ID = 652 - sqMKIndex ID = 653 - sqXKIndex ID = 654 - srIndex ID = 655 - srCyrlIndex ID = 656 - srCyrlBAIndex ID = 657 - srCyrlMEIndex ID = 658 - srCyrlRSIndex ID = 659 - srCyrlXKIndex ID = 660 - srLatnIndex ID = 661 - srLatnBAIndex ID = 662 - srLatnMEIndex ID = 663 - srLatnRSIndex ID = 664 - srLatnXKIndex ID = 665 - ssIndex ID = 666 - ssyIndex ID = 667 - stIndex ID = 668 - svIndex ID = 669 - svAXIndex ID = 670 - svFIIndex ID = 671 - svSEIndex ID = 672 - swIndex ID = 673 - swCDIndex ID = 674 - swKEIndex ID = 675 - swTZIndex ID = 676 - swUGIndex ID = 677 - syrIndex ID = 678 - taIndex ID = 679 - taINIndex ID = 680 - taLKIndex ID = 681 - taMYIndex ID = 682 - taSGIndex ID = 683 - teIndex ID = 684 - teINIndex ID = 685 - teoIndex ID = 686 - teoKEIndex ID = 687 - teoUGIndex ID = 688 - tgIndex ID = 689 - tgTJIndex ID = 690 - thIndex ID = 691 - thTHIndex ID = 692 - tiIndex ID = 693 - tiERIndex ID = 694 - tiETIndex ID = 695 - tigIndex ID = 696 - tkIndex ID = 697 - tkTMIndex ID = 698 - tlIndex ID = 699 - tnIndex ID = 700 - toIndex ID = 701 - toTOIndex ID = 702 - trIndex ID = 703 - trCYIndex ID = 704 - trTRIndex ID = 705 - tsIndex ID = 706 - ttIndex ID = 707 - ttRUIndex ID = 708 - twqIndex ID = 709 - twqNEIndex ID = 710 - tzmIndex ID = 711 - tzmMAIndex ID = 712 - ugIndex ID = 713 - ugCNIndex ID = 714 - ukIndex ID = 715 - ukUAIndex ID = 716 - urIndex ID = 717 - urINIndex ID = 718 - urPKIndex ID = 719 - uzIndex ID = 720 - uzArabIndex ID = 721 - uzArabAFIndex ID = 722 - uzCyrlIndex ID = 723 - uzCyrlUZIndex ID = 724 - uzLatnIndex ID = 725 - uzLatnUZIndex ID = 726 - vaiIndex ID = 727 - vaiLatnIndex ID = 728 - vaiLatnLRIndex ID = 729 - vaiVaiiIndex ID = 730 - vaiVaiiLRIndex ID = 731 - veIndex ID = 732 - viIndex ID = 733 - viVNIndex ID = 734 - voIndex ID = 735 - vo001Index ID = 736 - vunIndex ID = 737 - vunTZIndex ID = 738 - waIndex ID = 739 - waeIndex ID = 740 - waeCHIndex ID = 741 - woIndex ID = 742 - woSNIndex ID = 743 - xhIndex ID = 744 - xogIndex ID = 745 - xogUGIndex ID = 746 - yavIndex ID = 747 - yavCMIndex ID = 748 - yiIndex ID = 749 - yi001Index ID = 750 - yoIndex ID = 751 - yoBJIndex ID = 752 - yoNGIndex ID = 753 - yueIndex ID = 754 - yueHansIndex ID = 755 - yueHansCNIndex ID = 756 - yueHantIndex ID = 757 - yueHantHKIndex ID = 758 - zghIndex ID = 759 - zghMAIndex ID = 760 - zhIndex ID = 761 - zhHansIndex ID = 762 - zhHansCNIndex ID = 763 - zhHansHKIndex ID = 764 - zhHansMOIndex ID = 765 - zhHansSGIndex ID = 766 - zhHantIndex ID = 767 - zhHantHKIndex ID = 768 - zhHantMOIndex ID = 769 - zhHantTWIndex ID = 770 - zuIndex ID = 771 - zuZAIndex ID = 772 - caESvalenciaIndex ID = 773 - enUSuvaposixIndex ID = 774 -) - -var coreTags = []language.CompactCoreInfo{ // 773 elements - // Entry 0 - 1F - 0x00000000, 0x01600000, 0x016000d2, 0x01600161, - 0x01c00000, 0x01c00052, 0x02100000, 0x02100080, - 0x02700000, 0x0270006f, 0x03a00000, 0x03a00001, - 0x03a00023, 0x03a00039, 0x03a00062, 0x03a00067, - 0x03a0006b, 0x03a0006c, 0x03a0006d, 0x03a00097, - 0x03a0009b, 0x03a000a1, 0x03a000a8, 0x03a000ac, - 0x03a000b0, 0x03a000b9, 0x03a000ba, 0x03a000c9, - 0x03a000e1, 0x03a000ed, 0x03a000f3, 0x03a00108, - // Entry 20 - 3F - 0x03a0010b, 0x03a00115, 0x03a00117, 0x03a0011c, - 0x03a00120, 0x03a00128, 0x03a0015e, 0x04000000, - 0x04300000, 0x04300099, 0x04400000, 0x0440012f, - 0x04800000, 0x0480006e, 0x05800000, 0x0581f000, - 0x0581f032, 0x05857000, 0x05857032, 0x05e00000, - 0x05e00052, 0x07100000, 0x07100047, 0x07500000, - 0x07500162, 0x07900000, 0x0790012f, 0x07e00000, - 0x07e00038, 0x08200000, 0x0a000000, 0x0a0000c3, - // Entry 40 - 5F - 0x0a500000, 0x0a500035, 0x0a500099, 0x0a900000, - 0x0a900053, 0x0a900099, 0x0b200000, 0x0b200078, - 0x0b500000, 0x0b500099, 0x0b700000, 0x0b71f000, - 0x0b71f033, 0x0b757000, 0x0b757033, 0x0d700000, - 0x0d700022, 0x0d70006e, 0x0d700078, 0x0d70009e, - 0x0db00000, 0x0db00035, 0x0db00099, 0x0dc00000, - 0x0dc00106, 0x0df00000, 0x0df00131, 0x0e500000, - 0x0e500135, 0x0e900000, 0x0e90009b, 0x0e90009c, - // Entry 60 - 7F - 0x0fa00000, 0x0fa0005e, 0x0fe00000, 0x0fe00106, - 0x10000000, 0x1000007b, 0x10100000, 0x10100063, - 0x10100082, 0x10800000, 0x108000a4, 0x10d00000, - 0x10d0002e, 0x10d00036, 0x10d0004e, 0x10d00060, - 0x10d0009e, 0x10d000b2, 0x10d000b7, 0x11700000, - 0x117000d4, 0x11f00000, 0x11f00060, 0x12400000, - 0x12400052, 0x12800000, 0x12b00000, 0x12b00114, - 0x12d00000, 0x12d00043, 0x12f00000, 0x12f000a4, - // Entry 80 - 9F - 0x13000000, 0x13000080, 0x13000122, 0x13600000, - 0x1360005d, 0x13600087, 0x13900000, 0x13900001, - 0x1390001a, 0x13900025, 0x13900026, 0x1390002d, - 0x1390002e, 0x1390002f, 0x13900034, 0x13900036, - 0x1390003a, 0x1390003d, 0x13900042, 0x13900046, - 0x13900048, 0x13900049, 0x1390004a, 0x1390004e, - 0x13900050, 0x13900052, 0x1390005c, 0x1390005d, - 0x13900060, 0x13900061, 0x13900063, 0x13900064, - // Entry A0 - BF - 0x1390006d, 0x13900072, 0x13900073, 0x13900074, - 0x13900075, 0x1390007b, 0x1390007c, 0x1390007f, - 0x13900080, 0x13900081, 0x13900083, 0x1390008a, - 0x1390008c, 0x1390008d, 0x13900096, 0x13900097, - 0x13900098, 0x13900099, 0x1390009a, 0x1390009f, - 0x139000a0, 0x139000a4, 0x139000a7, 0x139000a9, - 0x139000ad, 0x139000b1, 0x139000b4, 0x139000b5, - 0x139000bf, 0x139000c0, 0x139000c6, 0x139000c7, - // Entry C0 - DF - 0x139000ca, 0x139000cb, 0x139000cc, 0x139000ce, - 0x139000d0, 0x139000d2, 0x139000d5, 0x139000d6, - 0x139000d9, 0x139000dd, 0x139000df, 0x139000e0, - 0x139000e6, 0x139000e7, 0x139000e8, 0x139000eb, - 0x139000ec, 0x139000f0, 0x13900107, 0x13900109, - 0x1390010a, 0x1390010b, 0x1390010c, 0x1390010d, - 0x1390010e, 0x1390010f, 0x13900112, 0x13900117, - 0x1390011b, 0x1390011d, 0x1390011f, 0x13900125, - // Entry E0 - FF - 0x13900129, 0x1390012c, 0x1390012d, 0x1390012f, - 0x13900131, 0x13900133, 0x13900135, 0x13900139, - 0x1390013c, 0x1390013d, 0x1390013f, 0x13900142, - 0x13900161, 0x13900162, 0x13900164, 0x13c00000, - 0x13c00001, 0x13e00000, 0x13e0001f, 0x13e0002c, - 0x13e0003f, 0x13e00041, 0x13e00048, 0x13e00051, - 0x13e00054, 0x13e00056, 0x13e00059, 0x13e00065, - 0x13e00068, 0x13e00069, 0x13e0006e, 0x13e00086, - // Entry 100 - 11F - 0x13e00089, 0x13e0008f, 0x13e00094, 0x13e000cf, - 0x13e000d8, 0x13e000e2, 0x13e000e4, 0x13e000e7, - 0x13e000ec, 0x13e000f1, 0x13e0011a, 0x13e00135, - 0x13e00136, 0x13e0013b, 0x14000000, 0x1400006a, - 0x14500000, 0x1450006e, 0x14600000, 0x14600052, - 0x14800000, 0x14800024, 0x1480009c, 0x14e00000, - 0x14e00052, 0x14e00084, 0x14e000c9, 0x14e00114, - 0x15100000, 0x15100072, 0x15300000, 0x153000e7, - // Entry 120 - 13F - 0x15800000, 0x15800063, 0x15800076, 0x15e00000, - 0x15e00036, 0x15e00037, 0x15e0003a, 0x15e0003b, - 0x15e0003c, 0x15e00049, 0x15e0004b, 0x15e0004c, - 0x15e0004d, 0x15e0004e, 0x15e0004f, 0x15e00052, - 0x15e00062, 0x15e00067, 0x15e00078, 0x15e0007a, - 0x15e0007e, 0x15e00084, 0x15e00085, 0x15e00086, - 0x15e00091, 0x15e000a8, 0x15e000b7, 0x15e000ba, - 0x15e000bb, 0x15e000be, 0x15e000bf, 0x15e000c3, - // Entry 140 - 15F - 0x15e000c8, 0x15e000c9, 0x15e000cc, 0x15e000d3, - 0x15e000d4, 0x15e000e5, 0x15e000ea, 0x15e00102, - 0x15e00107, 0x15e0010a, 0x15e00114, 0x15e0011c, - 0x15e00120, 0x15e00122, 0x15e00128, 0x15e0013f, - 0x15e00140, 0x15e0015f, 0x16900000, 0x1690009e, - 0x16d00000, 0x16d000d9, 0x16e00000, 0x16e00096, - 0x17e00000, 0x17e0007b, 0x19000000, 0x1900006e, - 0x1a300000, 0x1a30004e, 0x1a300078, 0x1a3000b2, - // Entry 160 - 17F - 0x1a400000, 0x1a400099, 0x1a900000, 0x1ab00000, - 0x1ab000a4, 0x1ac00000, 0x1ac00098, 0x1b400000, - 0x1b400080, 0x1b4000d4, 0x1b4000d6, 0x1b800000, - 0x1b800135, 0x1bc00000, 0x1bc00097, 0x1be00000, - 0x1be00099, 0x1d100000, 0x1d100033, 0x1d100090, - 0x1d200000, 0x1d200060, 0x1d500000, 0x1d500092, - 0x1d700000, 0x1d700028, 0x1e100000, 0x1e100095, - 0x1e700000, 0x1e7000d6, 0x1ea00000, 0x1ea00053, - // Entry 180 - 19F - 0x1f300000, 0x1f500000, 0x1f800000, 0x1f80009d, - 0x1f900000, 0x1f90004e, 0x1f90009e, 0x1f900113, - 0x1f900138, 0x1fa00000, 0x1fb00000, 0x20000000, - 0x200000a2, 0x20300000, 0x20700000, 0x20700052, - 0x20800000, 0x20a00000, 0x20a0012f, 0x20e00000, - 0x20f00000, 0x21000000, 0x2100007d, 0x21200000, - 0x21200067, 0x21600000, 0x21700000, 0x217000a4, - 0x21f00000, 0x22300000, 0x2230012f, 0x22700000, - // Entry 1A0 - 1BF - 0x2270005a, 0x23400000, 0x234000c3, 0x23900000, - 0x239000a4, 0x24200000, 0x242000ae, 0x24400000, - 0x24400052, 0x24500000, 0x24500082, 0x24600000, - 0x246000a4, 0x24a00000, 0x24a000a6, 0x25100000, - 0x25100099, 0x25400000, 0x254000aa, 0x254000ab, - 0x25600000, 0x25600099, 0x26a00000, 0x26a00099, - 0x26b00000, 0x26b0012f, 0x26d00000, 0x26d00052, - 0x26e00000, 0x26e00060, 0x27400000, 0x28100000, - // Entry 1C0 - 1DF - 0x2810007b, 0x28a00000, 0x28a000a5, 0x29100000, - 0x2910012f, 0x29500000, 0x295000b7, 0x2a300000, - 0x2a300131, 0x2af00000, 0x2af00135, 0x2b500000, - 0x2b50002a, 0x2b50004b, 0x2b50004c, 0x2b50004d, - 0x2b800000, 0x2b8000af, 0x2bf00000, 0x2bf0009b, - 0x2bf0009c, 0x2c000000, 0x2c0000b6, 0x2c200000, - 0x2c20004b, 0x2c400000, 0x2c4000a4, 0x2c500000, - 0x2c5000a4, 0x2c700000, 0x2c7000b8, 0x2d100000, - // Entry 1E0 - 1FF - 0x2d1000a4, 0x2d10012f, 0x2e900000, 0x2e9000a4, - 0x2ed00000, 0x2ed000cc, 0x2f100000, 0x2f1000bf, - 0x2f200000, 0x2f2000d1, 0x2f400000, 0x2f400052, - 0x2ff00000, 0x2ff000c2, 0x30400000, 0x30400099, - 0x30b00000, 0x30b000c5, 0x31000000, 0x31b00000, - 0x31b00099, 0x31f00000, 0x31f0003e, 0x31f000d0, - 0x31f0010d, 0x32000000, 0x320000cb, 0x32500000, - 0x32500052, 0x33100000, 0x331000c4, 0x33a00000, - // Entry 200 - 21F - 0x33a0009c, 0x34100000, 0x34500000, 0x345000d2, - 0x34700000, 0x347000da, 0x34700110, 0x34e00000, - 0x34e00164, 0x35000000, 0x35000060, 0x350000d9, - 0x35100000, 0x35100099, 0x351000db, 0x36700000, - 0x36700030, 0x36700036, 0x36700040, 0x3670005b, - 0x367000d9, 0x36700116, 0x3670011b, 0x36800000, - 0x36800052, 0x36a00000, 0x36a000da, 0x36c00000, - 0x36c00052, 0x36f00000, 0x37500000, 0x37600000, - // Entry 220 - 23F - 0x37a00000, 0x38000000, 0x38000117, 0x38700000, - 0x38900000, 0x38900131, 0x39000000, 0x3900006f, - 0x390000a4, 0x39500000, 0x39500099, 0x39800000, - 0x3980007d, 0x39800106, 0x39d00000, 0x39d05000, - 0x39d050e8, 0x39d33000, 0x39d33099, 0x3a100000, - 0x3b300000, 0x3b3000e9, 0x3bd00000, 0x3bd00001, - 0x3be00000, 0x3be00024, 0x3c000000, 0x3c00002a, - 0x3c000041, 0x3c00004e, 0x3c00005a, 0x3c000086, - // Entry 240 - 25F - 0x3c00008b, 0x3c0000b7, 0x3c0000c6, 0x3c0000d1, - 0x3c0000ee, 0x3c000118, 0x3c000126, 0x3c400000, - 0x3c40003f, 0x3c400069, 0x3c4000e4, 0x3d400000, - 0x3d40004e, 0x3d900000, 0x3d90003a, 0x3dc00000, - 0x3dc000bc, 0x3dc00104, 0x3de00000, 0x3de0012f, - 0x3e200000, 0x3e200047, 0x3e2000a5, 0x3e2000ae, - 0x3e2000bc, 0x3e200106, 0x3e200130, 0x3e500000, - 0x3e500107, 0x3e600000, 0x3e60012f, 0x3eb00000, - // Entry 260 - 27F - 0x3eb00106, 0x3ec00000, 0x3ec000a4, 0x3f300000, - 0x3f30012f, 0x3fa00000, 0x3fa000e8, 0x3fc00000, - 0x3fd00000, 0x3fd00072, 0x3fd000da, 0x3fd0010c, - 0x3ff00000, 0x3ff000d1, 0x40100000, 0x401000c3, - 0x40200000, 0x4020004c, 0x40700000, 0x40800000, - 0x40857000, 0x408570ba, 0x408dc000, 0x408dc0ba, - 0x40c00000, 0x40c000b3, 0x41200000, 0x41200111, - 0x41600000, 0x4160010f, 0x41c00000, 0x41d00000, - // Entry 280 - 29F - 0x41e00000, 0x41f00000, 0x41f00072, 0x42200000, - 0x42300000, 0x42300164, 0x42900000, 0x42900062, - 0x4290006f, 0x429000a4, 0x42900115, 0x43100000, - 0x43100027, 0x431000c2, 0x4310014d, 0x43200000, - 0x4321f000, 0x4321f033, 0x4321f0bd, 0x4321f105, - 0x4321f14d, 0x43257000, 0x43257033, 0x432570bd, - 0x43257105, 0x4325714d, 0x43700000, 0x43a00000, - 0x43b00000, 0x44400000, 0x44400031, 0x44400072, - // Entry 2A0 - 2BF - 0x4440010c, 0x44500000, 0x4450004b, 0x445000a4, - 0x4450012f, 0x44500131, 0x44e00000, 0x45000000, - 0x45000099, 0x450000b3, 0x450000d0, 0x4500010d, - 0x46100000, 0x46100099, 0x46400000, 0x464000a4, - 0x46400131, 0x46700000, 0x46700124, 0x46b00000, - 0x46b00123, 0x46f00000, 0x46f0006d, 0x46f0006f, - 0x47100000, 0x47600000, 0x47600127, 0x47a00000, - 0x48000000, 0x48200000, 0x48200129, 0x48a00000, - // Entry 2C0 - 2DF - 0x48a0005d, 0x48a0012b, 0x48e00000, 0x49400000, - 0x49400106, 0x4a400000, 0x4a4000d4, 0x4a900000, - 0x4a9000ba, 0x4ac00000, 0x4ac00053, 0x4ae00000, - 0x4ae00130, 0x4b400000, 0x4b400099, 0x4b4000e8, - 0x4bc00000, 0x4bc05000, 0x4bc05024, 0x4bc1f000, - 0x4bc1f137, 0x4bc57000, 0x4bc57137, 0x4be00000, - 0x4be57000, 0x4be570b4, 0x4bee3000, 0x4bee30b4, - 0x4c000000, 0x4c300000, 0x4c30013e, 0x4c900000, - // Entry 2E0 - 2FF - 0x4c900001, 0x4cc00000, 0x4cc0012f, 0x4ce00000, - 0x4cf00000, 0x4cf0004e, 0x4e500000, 0x4e500114, - 0x4f200000, 0x4fb00000, 0x4fb00131, 0x50900000, - 0x50900052, 0x51200000, 0x51200001, 0x51800000, - 0x5180003b, 0x518000d6, 0x51f00000, 0x51f38000, - 0x51f38053, 0x51f39000, 0x51f3908d, 0x52800000, - 0x528000ba, 0x52900000, 0x52938000, 0x52938053, - 0x5293808d, 0x529380c6, 0x5293810d, 0x52939000, - // Entry 300 - 31F - 0x5293908d, 0x529390c6, 0x5293912e, 0x52f00000, - 0x52f00161, -} // Size: 3116 bytes - -const specialTagsStr string = "ca-ES-valencia en-US-u-va-posix" - -// Total table size 3147 bytes (3KiB); checksum: F4E57D15 diff --git a/vendor/golang.org/x/text/internal/language/compact/tags.go b/vendor/golang.org/x/text/internal/language/compact/tags.go deleted file mode 100644 index ca135d295..000000000 --- a/vendor/golang.org/x/text/internal/language/compact/tags.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package compact - -var ( - und = Tag{} - - Und Tag = Tag{} - - Afrikaans Tag = Tag{language: afIndex, locale: afIndex} - Amharic Tag = Tag{language: amIndex, locale: amIndex} - Arabic Tag = Tag{language: arIndex, locale: arIndex} - ModernStandardArabic Tag = Tag{language: ar001Index, locale: ar001Index} - Azerbaijani Tag = Tag{language: azIndex, locale: azIndex} - Bulgarian Tag = Tag{language: bgIndex, locale: bgIndex} - Bengali Tag = Tag{language: bnIndex, locale: bnIndex} - Catalan Tag = Tag{language: caIndex, locale: caIndex} - Czech Tag = Tag{language: csIndex, locale: csIndex} - Danish Tag = Tag{language: daIndex, locale: daIndex} - German Tag = Tag{language: deIndex, locale: deIndex} - Greek Tag = Tag{language: elIndex, locale: elIndex} - English Tag = Tag{language: enIndex, locale: enIndex} - AmericanEnglish Tag = Tag{language: enUSIndex, locale: enUSIndex} - BritishEnglish Tag = Tag{language: enGBIndex, locale: enGBIndex} - Spanish Tag = Tag{language: esIndex, locale: esIndex} - EuropeanSpanish Tag = Tag{language: esESIndex, locale: esESIndex} - LatinAmericanSpanish Tag = Tag{language: es419Index, locale: es419Index} - Estonian Tag = Tag{language: etIndex, locale: etIndex} - Persian Tag = Tag{language: faIndex, locale: faIndex} - Finnish Tag = Tag{language: fiIndex, locale: fiIndex} - Filipino Tag = Tag{language: filIndex, locale: filIndex} - French Tag = Tag{language: frIndex, locale: frIndex} - CanadianFrench Tag = Tag{language: frCAIndex, locale: frCAIndex} - Gujarati Tag = Tag{language: guIndex, locale: guIndex} - Hebrew Tag = Tag{language: heIndex, locale: heIndex} - Hindi Tag = Tag{language: hiIndex, locale: hiIndex} - Croatian Tag = Tag{language: hrIndex, locale: hrIndex} - Hungarian Tag = Tag{language: huIndex, locale: huIndex} - Armenian Tag = Tag{language: hyIndex, locale: hyIndex} - Indonesian Tag = Tag{language: idIndex, locale: idIndex} - Icelandic Tag = Tag{language: isIndex, locale: isIndex} - Italian Tag = Tag{language: itIndex, locale: itIndex} - Japanese Tag = Tag{language: jaIndex, locale: jaIndex} - Georgian Tag = Tag{language: kaIndex, locale: kaIndex} - Kazakh Tag = Tag{language: kkIndex, locale: kkIndex} - Khmer Tag = Tag{language: kmIndex, locale: kmIndex} - Kannada Tag = Tag{language: knIndex, locale: knIndex} - Korean Tag = Tag{language: koIndex, locale: koIndex} - Kirghiz Tag = Tag{language: kyIndex, locale: kyIndex} - Lao Tag = Tag{language: loIndex, locale: loIndex} - Lithuanian Tag = Tag{language: ltIndex, locale: ltIndex} - Latvian Tag = Tag{language: lvIndex, locale: lvIndex} - Macedonian Tag = Tag{language: mkIndex, locale: mkIndex} - Malayalam Tag = Tag{language: mlIndex, locale: mlIndex} - Mongolian Tag = Tag{language: mnIndex, locale: mnIndex} - Marathi Tag = Tag{language: mrIndex, locale: mrIndex} - Malay Tag = Tag{language: msIndex, locale: msIndex} - Burmese Tag = Tag{language: myIndex, locale: myIndex} - Nepali Tag = Tag{language: neIndex, locale: neIndex} - Dutch Tag = Tag{language: nlIndex, locale: nlIndex} - Norwegian Tag = Tag{language: noIndex, locale: noIndex} - Punjabi Tag = Tag{language: paIndex, locale: paIndex} - Polish Tag = Tag{language: plIndex, locale: plIndex} - Portuguese Tag = Tag{language: ptIndex, locale: ptIndex} - BrazilianPortuguese Tag = Tag{language: ptBRIndex, locale: ptBRIndex} - EuropeanPortuguese Tag = Tag{language: ptPTIndex, locale: ptPTIndex} - Romanian Tag = Tag{language: roIndex, locale: roIndex} - Russian Tag = Tag{language: ruIndex, locale: ruIndex} - Sinhala Tag = Tag{language: siIndex, locale: siIndex} - Slovak Tag = Tag{language: skIndex, locale: skIndex} - Slovenian Tag = Tag{language: slIndex, locale: slIndex} - Albanian Tag = Tag{language: sqIndex, locale: sqIndex} - Serbian Tag = Tag{language: srIndex, locale: srIndex} - SerbianLatin Tag = Tag{language: srLatnIndex, locale: srLatnIndex} - Swedish Tag = Tag{language: svIndex, locale: svIndex} - Swahili Tag = Tag{language: swIndex, locale: swIndex} - Tamil Tag = Tag{language: taIndex, locale: taIndex} - Telugu Tag = Tag{language: teIndex, locale: teIndex} - Thai Tag = Tag{language: thIndex, locale: thIndex} - Turkish Tag = Tag{language: trIndex, locale: trIndex} - Ukrainian Tag = Tag{language: ukIndex, locale: ukIndex} - Urdu Tag = Tag{language: urIndex, locale: urIndex} - Uzbek Tag = Tag{language: uzIndex, locale: uzIndex} - Vietnamese Tag = Tag{language: viIndex, locale: viIndex} - Chinese Tag = Tag{language: zhIndex, locale: zhIndex} - SimplifiedChinese Tag = Tag{language: zhHansIndex, locale: zhHansIndex} - TraditionalChinese Tag = Tag{language: zhHantIndex, locale: zhHantIndex} - Zulu Tag = Tag{language: zuIndex, locale: zuIndex} -) diff --git a/vendor/golang.org/x/text/internal/language/compose.go b/vendor/golang.org/x/text/internal/language/compose.go deleted file mode 100644 index 4ae78e0fa..000000000 --- a/vendor/golang.org/x/text/internal/language/compose.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -import ( - "sort" - "strings" -) - -// A Builder allows constructing a Tag from individual components. -// Its main user is Compose in the top-level language package. -type Builder struct { - Tag Tag - - private string // the x extension - variants []string - extensions []string -} - -// Make returns a new Tag from the current settings. -func (b *Builder) Make() Tag { - t := b.Tag - - if len(b.extensions) > 0 || len(b.variants) > 0 { - sort.Sort(sortVariants(b.variants)) - sort.Strings(b.extensions) - - if b.private != "" { - b.extensions = append(b.extensions, b.private) - } - n := maxCoreSize + tokenLen(b.variants...) + tokenLen(b.extensions...) - buf := make([]byte, n) - p := t.genCoreBytes(buf) - t.pVariant = byte(p) - p += appendTokens(buf[p:], b.variants...) - t.pExt = uint16(p) - p += appendTokens(buf[p:], b.extensions...) - t.str = string(buf[:p]) - // We may not always need to remake the string, but when or when not - // to do so is rather tricky. - scan := makeScanner(buf[:p]) - t, _ = parse(&scan, "") - return t - - } else if b.private != "" { - t.str = b.private - t.RemakeString() - } - return t -} - -// SetTag copies all the settings from a given Tag. Any previously set values -// are discarded. -func (b *Builder) SetTag(t Tag) { - b.Tag.LangID = t.LangID - b.Tag.RegionID = t.RegionID - b.Tag.ScriptID = t.ScriptID - // TODO: optimize - b.variants = b.variants[:0] - if variants := t.Variants(); variants != "" { - for _, vr := range strings.Split(variants[1:], "-") { - b.variants = append(b.variants, vr) - } - } - b.extensions, b.private = b.extensions[:0], "" - for _, e := range t.Extensions() { - b.AddExt(e) - } -} - -// AddExt adds extension e to the tag. e must be a valid extension as returned -// by Tag.Extension. If the extension already exists, it will be discarded, -// except for a -u extension, where non-existing key-type pairs will added. -func (b *Builder) AddExt(e string) { - if e[0] == 'x' { - if b.private == "" { - b.private = e - } - return - } - for i, s := range b.extensions { - if s[0] == e[0] { - if e[0] == 'u' { - b.extensions[i] += e[1:] - } - return - } - } - b.extensions = append(b.extensions, e) -} - -// SetExt sets the extension e to the tag. e must be a valid extension as -// returned by Tag.Extension. If the extension already exists, it will be -// overwritten, except for a -u extension, where the individual key-type pairs -// will be set. -func (b *Builder) SetExt(e string) { - if e[0] == 'x' { - b.private = e - return - } - for i, s := range b.extensions { - if s[0] == e[0] { - if e[0] == 'u' { - b.extensions[i] = e + s[1:] - } else { - b.extensions[i] = e - } - return - } - } - b.extensions = append(b.extensions, e) -} - -// AddVariant adds any number of variants. -func (b *Builder) AddVariant(v ...string) { - for _, v := range v { - if v != "" { - b.variants = append(b.variants, v) - } - } -} - -// ClearVariants removes any variants previously added, including those -// copied from a Tag in SetTag. -func (b *Builder) ClearVariants() { - b.variants = b.variants[:0] -} - -// ClearExtensions removes any extensions previously added, including those -// copied from a Tag in SetTag. -func (b *Builder) ClearExtensions() { - b.private = "" - b.extensions = b.extensions[:0] -} - -func tokenLen(token ...string) (n int) { - for _, t := range token { - n += len(t) + 1 - } - return -} - -func appendTokens(b []byte, token ...string) int { - p := 0 - for _, t := range token { - b[p] = '-' - copy(b[p+1:], t) - p += 1 + len(t) - } - return p -} - -type sortVariants []string - -func (s sortVariants) Len() int { - return len(s) -} - -func (s sortVariants) Swap(i, j int) { - s[j], s[i] = s[i], s[j] -} - -func (s sortVariants) Less(i, j int) bool { - return variantIndex[s[i]] < variantIndex[s[j]] -} diff --git a/vendor/golang.org/x/text/internal/language/coverage.go b/vendor/golang.org/x/text/internal/language/coverage.go deleted file mode 100644 index 9b20b88fe..000000000 --- a/vendor/golang.org/x/text/internal/language/coverage.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -// BaseLanguages returns the list of all supported base languages. It generates -// the list by traversing the internal structures. -func BaseLanguages() []Language { - base := make([]Language, 0, NumLanguages) - for i := 0; i < langNoIndexOffset; i++ { - // We included "und" already for the value 0. - if i != nonCanonicalUnd { - base = append(base, Language(i)) - } - } - i := langNoIndexOffset - for _, v := range langNoIndex { - for k := 0; k < 8; k++ { - if v&1 == 1 { - base = append(base, Language(i)) - } - v >>= 1 - i++ - } - } - return base -} diff --git a/vendor/golang.org/x/text/internal/language/language.go b/vendor/golang.org/x/text/internal/language/language.go deleted file mode 100644 index 1e74d1aff..000000000 --- a/vendor/golang.org/x/text/internal/language/language.go +++ /dev/null @@ -1,596 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate go run gen.go gen_common.go -output tables.go - -package language // import "golang.org/x/text/internal/language" - -// TODO: Remove above NOTE after: -// - verifying that tables are dropped correctly (most notably matcher tables). - -import ( - "errors" - "fmt" - "strings" -) - -const ( - // maxCoreSize is the maximum size of a BCP 47 tag without variants and - // extensions. Equals max lang (3) + script (4) + max reg (3) + 2 dashes. - maxCoreSize = 12 - - // max99thPercentileSize is a somewhat arbitrary buffer size that presumably - // is large enough to hold at least 99% of the BCP 47 tags. - max99thPercentileSize = 32 - - // maxSimpleUExtensionSize is the maximum size of a -u extension with one - // key-type pair. Equals len("-u-") + key (2) + dash + max value (8). - maxSimpleUExtensionSize = 14 -) - -// Tag represents a BCP 47 language tag. It is used to specify an instance of a -// specific language or locale. All language tag values are guaranteed to be -// well-formed. The zero value of Tag is Und. -type Tag struct { - // TODO: the following fields have the form TagTypeID. This name is chosen - // to allow refactoring the public package without conflicting with its - // Base, Script, and Region methods. Once the transition is fully completed - // the ID can be stripped from the name. - - LangID Language - RegionID Region - // TODO: we will soon run out of positions for ScriptID. Idea: instead of - // storing lang, region, and ScriptID codes, store only the compact index and - // have a lookup table from this code to its expansion. This greatly speeds - // up table lookup, speed up common variant cases. - // This will also immediately free up 3 extra bytes. Also, the pVariant - // field can now be moved to the lookup table, as the compact index uniquely - // determines the offset of a possible variant. - ScriptID Script - pVariant byte // offset in str, includes preceding '-' - pExt uint16 // offset of first extension, includes preceding '-' - - // str is the string representation of the Tag. It will only be used if the - // tag has variants or extensions. - str string -} - -// Make is a convenience wrapper for Parse that omits the error. -// In case of an error, a sensible default is returned. -func Make(s string) Tag { - t, _ := Parse(s) - return t -} - -// Raw returns the raw base language, script and region, without making an -// attempt to infer their values. -// TODO: consider removing -func (t Tag) Raw() (b Language, s Script, r Region) { - return t.LangID, t.ScriptID, t.RegionID -} - -// equalTags compares language, script and region subtags only. -func (t Tag) equalTags(a Tag) bool { - return t.LangID == a.LangID && t.ScriptID == a.ScriptID && t.RegionID == a.RegionID -} - -// IsRoot returns true if t is equal to language "und". -func (t Tag) IsRoot() bool { - if int(t.pVariant) < len(t.str) { - return false - } - return t.equalTags(Und) -} - -// IsPrivateUse reports whether the Tag consists solely of an IsPrivateUse use -// tag. -func (t Tag) IsPrivateUse() bool { - return t.str != "" && t.pVariant == 0 -} - -// RemakeString is used to update t.str in case lang, script or region changed. -// It is assumed that pExt and pVariant still point to the start of the -// respective parts. -func (t *Tag) RemakeString() { - if t.str == "" { - return - } - extra := t.str[t.pVariant:] - if t.pVariant > 0 { - extra = extra[1:] - } - if t.equalTags(Und) && strings.HasPrefix(extra, "x-") { - t.str = extra - t.pVariant = 0 - t.pExt = 0 - return - } - var buf [max99thPercentileSize]byte // avoid extra memory allocation in most cases. - b := buf[:t.genCoreBytes(buf[:])] - if extra != "" { - diff := len(b) - int(t.pVariant) - b = append(b, '-') - b = append(b, extra...) - t.pVariant = uint8(int(t.pVariant) + diff) - t.pExt = uint16(int(t.pExt) + diff) - } else { - t.pVariant = uint8(len(b)) - t.pExt = uint16(len(b)) - } - t.str = string(b) -} - -// genCoreBytes writes a string for the base languages, script and region tags -// to the given buffer and returns the number of bytes written. It will never -// write more than maxCoreSize bytes. -func (t *Tag) genCoreBytes(buf []byte) int { - n := t.LangID.StringToBuf(buf[:]) - if t.ScriptID != 0 { - n += copy(buf[n:], "-") - n += copy(buf[n:], t.ScriptID.String()) - } - if t.RegionID != 0 { - n += copy(buf[n:], "-") - n += copy(buf[n:], t.RegionID.String()) - } - return n -} - -// String returns the canonical string representation of the language tag. -func (t Tag) String() string { - if t.str != "" { - return t.str - } - if t.ScriptID == 0 && t.RegionID == 0 { - return t.LangID.String() - } - buf := [maxCoreSize]byte{} - return string(buf[:t.genCoreBytes(buf[:])]) -} - -// MarshalText implements encoding.TextMarshaler. -func (t Tag) MarshalText() (text []byte, err error) { - if t.str != "" { - text = append(text, t.str...) - } else if t.ScriptID == 0 && t.RegionID == 0 { - text = append(text, t.LangID.String()...) - } else { - buf := [maxCoreSize]byte{} - text = buf[:t.genCoreBytes(buf[:])] - } - return text, nil -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (t *Tag) UnmarshalText(text []byte) error { - tag, err := Parse(string(text)) - *t = tag - return err -} - -// Variants returns the part of the tag holding all variants or the empty string -// if there are no variants defined. -func (t Tag) Variants() string { - if t.pVariant == 0 { - return "" - } - return t.str[t.pVariant:t.pExt] -} - -// VariantOrPrivateUseTags returns variants or private use tags. -func (t Tag) VariantOrPrivateUseTags() string { - if t.pExt > 0 { - return t.str[t.pVariant:t.pExt] - } - return t.str[t.pVariant:] -} - -// HasString reports whether this tag defines more than just the raw -// components. -func (t Tag) HasString() bool { - return t.str != "" -} - -// Parent returns the CLDR parent of t. In CLDR, missing fields in data for a -// specific language are substituted with fields from the parent language. -// The parent for a language may change for newer versions of CLDR. -func (t Tag) Parent() Tag { - if t.str != "" { - // Strip the variants and extensions. - b, s, r := t.Raw() - t = Tag{LangID: b, ScriptID: s, RegionID: r} - if t.RegionID == 0 && t.ScriptID != 0 && t.LangID != 0 { - base, _ := addTags(Tag{LangID: t.LangID}) - if base.ScriptID == t.ScriptID { - return Tag{LangID: t.LangID} - } - } - return t - } - if t.LangID != 0 { - if t.RegionID != 0 { - maxScript := t.ScriptID - if maxScript == 0 { - max, _ := addTags(t) - maxScript = max.ScriptID - } - - for i := range parents { - if Language(parents[i].lang) == t.LangID && Script(parents[i].maxScript) == maxScript { - for _, r := range parents[i].fromRegion { - if Region(r) == t.RegionID { - return Tag{ - LangID: t.LangID, - ScriptID: Script(parents[i].script), - RegionID: Region(parents[i].toRegion), - } - } - } - } - } - - // Strip the script if it is the default one. - base, _ := addTags(Tag{LangID: t.LangID}) - if base.ScriptID != maxScript { - return Tag{LangID: t.LangID, ScriptID: maxScript} - } - return Tag{LangID: t.LangID} - } else if t.ScriptID != 0 { - // The parent for an base-script pair with a non-default script is - // "und" instead of the base language. - base, _ := addTags(Tag{LangID: t.LangID}) - if base.ScriptID != t.ScriptID { - return Und - } - return Tag{LangID: t.LangID} - } - } - return Und -} - -// ParseExtension parses s as an extension and returns it on success. -func ParseExtension(s string) (ext string, err error) { - scan := makeScannerString(s) - var end int - if n := len(scan.token); n != 1 { - return "", ErrSyntax - } - scan.toLower(0, len(scan.b)) - end = parseExtension(&scan) - if end != len(s) { - return "", ErrSyntax - } - return string(scan.b), nil -} - -// HasVariants reports whether t has variants. -func (t Tag) HasVariants() bool { - return uint16(t.pVariant) < t.pExt -} - -// HasExtensions reports whether t has extensions. -func (t Tag) HasExtensions() bool { - return int(t.pExt) < len(t.str) -} - -// Extension returns the extension of type x for tag t. It will return -// false for ok if t does not have the requested extension. The returned -// extension will be invalid in this case. -func (t Tag) Extension(x byte) (ext string, ok bool) { - for i := int(t.pExt); i < len(t.str)-1; { - var ext string - i, ext = getExtension(t.str, i) - if ext[0] == x { - return ext, true - } - } - return "", false -} - -// Extensions returns all extensions of t. -func (t Tag) Extensions() []string { - e := []string{} - for i := int(t.pExt); i < len(t.str)-1; { - var ext string - i, ext = getExtension(t.str, i) - e = append(e, ext) - } - return e -} - -// TypeForKey returns the type associated with the given key, where key and type -// are of the allowed values defined for the Unicode locale extension ('u') in -// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. -// TypeForKey will traverse the inheritance chain to get the correct value. -func (t Tag) TypeForKey(key string) string { - if start, end, _ := t.findTypeForKey(key); end != start { - return t.str[start:end] - } - return "" -} - -var ( - errPrivateUse = errors.New("cannot set a key on a private use tag") - errInvalidArguments = errors.New("invalid key or type") -) - -// SetTypeForKey returns a new Tag with the key set to type, where key and type -// are of the allowed values defined for the Unicode locale extension ('u') in -// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. -// An empty value removes an existing pair with the same key. -func (t Tag) SetTypeForKey(key, value string) (Tag, error) { - if t.IsPrivateUse() { - return t, errPrivateUse - } - if len(key) != 2 { - return t, errInvalidArguments - } - - // Remove the setting if value is "". - if value == "" { - start, end, _ := t.findTypeForKey(key) - if start != end { - // Remove key tag and leading '-'. - start -= 4 - - // Remove a possible empty extension. - if (end == len(t.str) || t.str[end+2] == '-') && t.str[start-2] == '-' { - start -= 2 - } - if start == int(t.pVariant) && end == len(t.str) { - t.str = "" - t.pVariant, t.pExt = 0, 0 - } else { - t.str = fmt.Sprintf("%s%s", t.str[:start], t.str[end:]) - } - } - return t, nil - } - - if len(value) < 3 || len(value) > 8 { - return t, errInvalidArguments - } - - var ( - buf [maxCoreSize + maxSimpleUExtensionSize]byte - uStart int // start of the -u extension. - ) - - // Generate the tag string if needed. - if t.str == "" { - uStart = t.genCoreBytes(buf[:]) - buf[uStart] = '-' - uStart++ - } - - // Create new key-type pair and parse it to verify. - b := buf[uStart:] - copy(b, "u-") - copy(b[2:], key) - b[4] = '-' - b = b[:5+copy(b[5:], value)] - scan := makeScanner(b) - if parseExtensions(&scan); scan.err != nil { - return t, scan.err - } - - // Assemble the replacement string. - if t.str == "" { - t.pVariant, t.pExt = byte(uStart-1), uint16(uStart-1) - t.str = string(buf[:uStart+len(b)]) - } else { - s := t.str - start, end, hasExt := t.findTypeForKey(key) - if start == end { - if hasExt { - b = b[2:] - } - t.str = fmt.Sprintf("%s-%s%s", s[:start], b, s[end:]) - } else { - t.str = fmt.Sprintf("%s%s%s", s[:start], value, s[end:]) - } - } - return t, nil -} - -// findKeyAndType returns the start and end position for the type corresponding -// to key or the point at which to insert the key-value pair if the type -// wasn't found. The hasExt return value reports whether an -u extension was present. -// Note: the extensions are typically very small and are likely to contain -// only one key-type pair. -func (t Tag) findTypeForKey(key string) (start, end int, hasExt bool) { - p := int(t.pExt) - if len(key) != 2 || p == len(t.str) || p == 0 { - return p, p, false - } - s := t.str - - // Find the correct extension. - for p++; s[p] != 'u'; p++ { - if s[p] > 'u' { - p-- - return p, p, false - } - if p = nextExtension(s, p); p == len(s) { - return len(s), len(s), false - } - } - // Proceed to the hyphen following the extension name. - p++ - - // curKey is the key currently being processed. - curKey := "" - - // Iterate over keys until we get the end of a section. - for { - // p points to the hyphen preceding the current token. - if p3 := p + 3; s[p3] == '-' { - // Found a key. - // Check whether we just processed the key that was requested. - if curKey == key { - return start, p, true - } - // Set to the next key and continue scanning type tokens. - curKey = s[p+1 : p3] - if curKey > key { - return p, p, true - } - // Start of the type token sequence. - start = p + 4 - // A type is at least 3 characters long. - p += 7 // 4 + 3 - } else { - // Attribute or type, which is at least 3 characters long. - p += 4 - } - // p points past the third character of a type or attribute. - max := p + 5 // maximum length of token plus hyphen. - if len(s) < max { - max = len(s) - } - for ; p < max && s[p] != '-'; p++ { - } - // Bail if we have exhausted all tokens or if the next token starts - // a new extension. - if p == len(s) || s[p+2] == '-' { - if curKey == key { - return start, p, true - } - return p, p, true - } - } -} - -// ParseBase parses a 2- or 3-letter ISO 639 code. -// It returns a ValueError if s is a well-formed but unknown language identifier -// or another error if another error occurred. -func ParseBase(s string) (Language, error) { - if n := len(s); n < 2 || 3 < n { - return 0, ErrSyntax - } - var buf [3]byte - return getLangID(buf[:copy(buf[:], s)]) -} - -// ParseScript parses a 4-letter ISO 15924 code. -// It returns a ValueError if s is a well-formed but unknown script identifier -// or another error if another error occurred. -func ParseScript(s string) (Script, error) { - if len(s) != 4 { - return 0, ErrSyntax - } - var buf [4]byte - return getScriptID(script, buf[:copy(buf[:], s)]) -} - -// EncodeM49 returns the Region for the given UN M.49 code. -// It returns an error if r is not a valid code. -func EncodeM49(r int) (Region, error) { - return getRegionM49(r) -} - -// ParseRegion parses a 2- or 3-letter ISO 3166-1 or a UN M.49 code. -// It returns a ValueError if s is a well-formed but unknown region identifier -// or another error if another error occurred. -func ParseRegion(s string) (Region, error) { - if n := len(s); n < 2 || 3 < n { - return 0, ErrSyntax - } - var buf [3]byte - return getRegionID(buf[:copy(buf[:], s)]) -} - -// IsCountry returns whether this region is a country or autonomous area. This -// includes non-standard definitions from CLDR. -func (r Region) IsCountry() bool { - if r == 0 || r.IsGroup() || r.IsPrivateUse() && r != _XK { - return false - } - return true -} - -// IsGroup returns whether this region defines a collection of regions. This -// includes non-standard definitions from CLDR. -func (r Region) IsGroup() bool { - if r == 0 { - return false - } - return int(regionInclusion[r]) < len(regionContainment) -} - -// Contains returns whether Region c is contained by Region r. It returns true -// if c == r. -func (r Region) Contains(c Region) bool { - if r == c { - return true - } - g := regionInclusion[r] - if g >= nRegionGroups { - return false - } - m := regionContainment[g] - - d := regionInclusion[c] - b := regionInclusionBits[d] - - // A contained country may belong to multiple disjoint groups. Matching any - // of these indicates containment. If the contained region is a group, it - // must strictly be a subset. - if d >= nRegionGroups { - return b&m != 0 - } - return b&^m == 0 -} - -var errNoTLD = errors.New("language: region is not a valid ccTLD") - -// TLD returns the country code top-level domain (ccTLD). UK is returned for GB. -// In all other cases it returns either the region itself or an error. -// -// This method may return an error for a region for which there exists a -// canonical form with a ccTLD. To get that ccTLD canonicalize r first. The -// region will already be canonicalized it was obtained from a Tag that was -// obtained using any of the default methods. -func (r Region) TLD() (Region, error) { - // See http://en.wikipedia.org/wiki/Country_code_top-level_domain for the - // difference between ISO 3166-1 and IANA ccTLD. - if r == _GB { - r = _UK - } - if (r.typ() & ccTLD) == 0 { - return 0, errNoTLD - } - return r, nil -} - -// Canonicalize returns the region or a possible replacement if the region is -// deprecated. It will not return a replacement for deprecated regions that -// are split into multiple regions. -func (r Region) Canonicalize() Region { - if cr := normRegion(r); cr != 0 { - return cr - } - return r -} - -// Variant represents a registered variant of a language as defined by BCP 47. -type Variant struct { - ID uint8 - str string -} - -// ParseVariant parses and returns a Variant. An error is returned if s is not -// a valid variant. -func ParseVariant(s string) (Variant, error) { - s = strings.ToLower(s) - if id, ok := variantIndex[s]; ok { - return Variant{id, s}, nil - } - return Variant{}, NewValueError([]byte(s)) -} - -// String returns the string representation of the variant. -func (v Variant) String() string { - return v.str -} diff --git a/vendor/golang.org/x/text/internal/language/lookup.go b/vendor/golang.org/x/text/internal/language/lookup.go deleted file mode 100644 index 6294b8152..000000000 --- a/vendor/golang.org/x/text/internal/language/lookup.go +++ /dev/null @@ -1,412 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -import ( - "bytes" - "fmt" - "sort" - "strconv" - - "golang.org/x/text/internal/tag" -) - -// findIndex tries to find the given tag in idx and returns a standardized error -// if it could not be found. -func findIndex(idx tag.Index, key []byte, form string) (index int, err error) { - if !tag.FixCase(form, key) { - return 0, ErrSyntax - } - i := idx.Index(key) - if i == -1 { - return 0, NewValueError(key) - } - return i, nil -} - -func searchUint(imap []uint16, key uint16) int { - return sort.Search(len(imap), func(i int) bool { - return imap[i] >= key - }) -} - -type Language uint16 - -// getLangID returns the langID of s if s is a canonical subtag -// or langUnknown if s is not a canonical subtag. -func getLangID(s []byte) (Language, error) { - if len(s) == 2 { - return getLangISO2(s) - } - return getLangISO3(s) -} - -// TODO language normalization as well as the AliasMaps could be moved to the -// higher level package, but it is a bit tricky to separate the generation. - -func (id Language) Canonicalize() (Language, AliasType) { - return normLang(id) -} - -// mapLang returns the mapped langID of id according to mapping m. -func normLang(id Language) (Language, AliasType) { - k := sort.Search(len(AliasMap), func(i int) bool { - return AliasMap[i].From >= uint16(id) - }) - if k < len(AliasMap) && AliasMap[k].From == uint16(id) { - return Language(AliasMap[k].To), AliasTypes[k] - } - return id, AliasTypeUnknown -} - -// getLangISO2 returns the langID for the given 2-letter ISO language code -// or unknownLang if this does not exist. -func getLangISO2(s []byte) (Language, error) { - if !tag.FixCase("zz", s) { - return 0, ErrSyntax - } - if i := lang.Index(s); i != -1 && lang.Elem(i)[3] != 0 { - return Language(i), nil - } - return 0, NewValueError(s) -} - -const base = 'z' - 'a' + 1 - -func strToInt(s []byte) uint { - v := uint(0) - for i := 0; i < len(s); i++ { - v *= base - v += uint(s[i] - 'a') - } - return v -} - -// converts the given integer to the original ASCII string passed to strToInt. -// len(s) must match the number of characters obtained. -func intToStr(v uint, s []byte) { - for i := len(s) - 1; i >= 0; i-- { - s[i] = byte(v%base) + 'a' - v /= base - } -} - -// getLangISO3 returns the langID for the given 3-letter ISO language code -// or unknownLang if this does not exist. -func getLangISO3(s []byte) (Language, error) { - if tag.FixCase("und", s) { - // first try to match canonical 3-letter entries - for i := lang.Index(s[:2]); i != -1; i = lang.Next(s[:2], i) { - if e := lang.Elem(i); e[3] == 0 && e[2] == s[2] { - // We treat "und" as special and always translate it to "unspecified". - // Note that ZZ and Zzzz are private use and are not treated as - // unspecified by default. - id := Language(i) - if id == nonCanonicalUnd { - return 0, nil - } - return id, nil - } - } - if i := altLangISO3.Index(s); i != -1 { - return Language(altLangIndex[altLangISO3.Elem(i)[3]]), nil - } - n := strToInt(s) - if langNoIndex[n/8]&(1<<(n%8)) != 0 { - return Language(n) + langNoIndexOffset, nil - } - // Check for non-canonical uses of ISO3. - for i := lang.Index(s[:1]); i != -1; i = lang.Next(s[:1], i) { - if e := lang.Elem(i); e[2] == s[1] && e[3] == s[2] { - return Language(i), nil - } - } - return 0, NewValueError(s) - } - return 0, ErrSyntax -} - -// StringToBuf writes the string to b and returns the number of bytes -// written. cap(b) must be >= 3. -func (id Language) StringToBuf(b []byte) int { - if id >= langNoIndexOffset { - intToStr(uint(id)-langNoIndexOffset, b[:3]) - return 3 - } else if id == 0 { - return copy(b, "und") - } - l := lang[id<<2:] - if l[3] == 0 { - return copy(b, l[:3]) - } - return copy(b, l[:2]) -} - -// String returns the BCP 47 representation of the langID. -// Use b as variable name, instead of id, to ensure the variable -// used is consistent with that of Base in which this type is embedded. -func (b Language) String() string { - if b == 0 { - return "und" - } else if b >= langNoIndexOffset { - b -= langNoIndexOffset - buf := [3]byte{} - intToStr(uint(b), buf[:]) - return string(buf[:]) - } - l := lang.Elem(int(b)) - if l[3] == 0 { - return l[:3] - } - return l[:2] -} - -// ISO3 returns the ISO 639-3 language code. -func (b Language) ISO3() string { - if b == 0 || b >= langNoIndexOffset { - return b.String() - } - l := lang.Elem(int(b)) - if l[3] == 0 { - return l[:3] - } else if l[2] == 0 { - return altLangISO3.Elem(int(l[3]))[:3] - } - // This allocation will only happen for 3-letter ISO codes - // that are non-canonical BCP 47 language identifiers. - return l[0:1] + l[2:4] -} - -// IsPrivateUse reports whether this language code is reserved for private use. -func (b Language) IsPrivateUse() bool { - return langPrivateStart <= b && b <= langPrivateEnd -} - -// SuppressScript returns the script marked as SuppressScript in the IANA -// language tag repository, or 0 if there is no such script. -func (b Language) SuppressScript() Script { - if b < langNoIndexOffset { - return Script(suppressScript[b]) - } - return 0 -} - -type Region uint16 - -// getRegionID returns the region id for s if s is a valid 2-letter region code -// or unknownRegion. -func getRegionID(s []byte) (Region, error) { - if len(s) == 3 { - if isAlpha(s[0]) { - return getRegionISO3(s) - } - if i, err := strconv.ParseUint(string(s), 10, 10); err == nil { - return getRegionM49(int(i)) - } - } - return getRegionISO2(s) -} - -// getRegionISO2 returns the regionID for the given 2-letter ISO country code -// or unknownRegion if this does not exist. -func getRegionISO2(s []byte) (Region, error) { - i, err := findIndex(regionISO, s, "ZZ") - if err != nil { - return 0, err - } - return Region(i) + isoRegionOffset, nil -} - -// getRegionISO3 returns the regionID for the given 3-letter ISO country code -// or unknownRegion if this does not exist. -func getRegionISO3(s []byte) (Region, error) { - if tag.FixCase("ZZZ", s) { - for i := regionISO.Index(s[:1]); i != -1; i = regionISO.Next(s[:1], i) { - if e := regionISO.Elem(i); e[2] == s[1] && e[3] == s[2] { - return Region(i) + isoRegionOffset, nil - } - } - for i := 0; i < len(altRegionISO3); i += 3 { - if tag.Compare(altRegionISO3[i:i+3], s) == 0 { - return Region(altRegionIDs[i/3]), nil - } - } - return 0, NewValueError(s) - } - return 0, ErrSyntax -} - -func getRegionM49(n int) (Region, error) { - if 0 < n && n <= 999 { - const ( - searchBits = 7 - regionBits = 9 - regionMask = 1<> searchBits - buf := fromM49[m49Index[idx]:m49Index[idx+1]] - val := uint16(n) << regionBits // we rely on bits shifting out - i := sort.Search(len(buf), func(i int) bool { - return buf[i] >= val - }) - if r := fromM49[int(m49Index[idx])+i]; r&^regionMask == val { - return Region(r & regionMask), nil - } - } - var e ValueError - fmt.Fprint(bytes.NewBuffer([]byte(e.v[:])), n) - return 0, e -} - -// normRegion returns a region if r is deprecated or 0 otherwise. -// TODO: consider supporting BYS (-> BLR), CSK (-> 200 or CZ), PHI (-> PHL) and AFI (-> DJ). -// TODO: consider mapping split up regions to new most populous one (like CLDR). -func normRegion(r Region) Region { - m := regionOldMap - k := sort.Search(len(m), func(i int) bool { - return m[i].From >= uint16(r) - }) - if k < len(m) && m[k].From == uint16(r) { - return Region(m[k].To) - } - return 0 -} - -const ( - iso3166UserAssigned = 1 << iota - ccTLD - bcp47Region -) - -func (r Region) typ() byte { - return regionTypes[r] -} - -// String returns the BCP 47 representation for the region. -// It returns "ZZ" for an unspecified region. -func (r Region) String() string { - if r < isoRegionOffset { - if r == 0 { - return "ZZ" - } - return fmt.Sprintf("%03d", r.M49()) - } - r -= isoRegionOffset - return regionISO.Elem(int(r))[:2] -} - -// ISO3 returns the 3-letter ISO code of r. -// Note that not all regions have a 3-letter ISO code. -// In such cases this method returns "ZZZ". -func (r Region) ISO3() string { - if r < isoRegionOffset { - return "ZZZ" - } - r -= isoRegionOffset - reg := regionISO.Elem(int(r)) - switch reg[2] { - case 0: - return altRegionISO3[reg[3]:][:3] - case ' ': - return "ZZZ" - } - return reg[0:1] + reg[2:4] -} - -// M49 returns the UN M.49 encoding of r, or 0 if this encoding -// is not defined for r. -func (r Region) M49() int { - return int(m49[r]) -} - -// IsPrivateUse reports whether r has the ISO 3166 User-assigned status. This -// may include private-use tags that are assigned by CLDR and used in this -// implementation. So IsPrivateUse and IsCountry can be simultaneously true. -func (r Region) IsPrivateUse() bool { - return r.typ()&iso3166UserAssigned != 0 -} - -type Script uint8 - -// getScriptID returns the script id for string s. It assumes that s -// is of the format [A-Z][a-z]{3}. -func getScriptID(idx tag.Index, s []byte) (Script, error) { - i, err := findIndex(idx, s, "Zzzz") - return Script(i), err -} - -// String returns the script code in title case. -// It returns "Zzzz" for an unspecified script. -func (s Script) String() string { - if s == 0 { - return "Zzzz" - } - return script.Elem(int(s)) -} - -// IsPrivateUse reports whether this script code is reserved for private use. -func (s Script) IsPrivateUse() bool { - return _Qaaa <= s && s <= _Qabx -} - -const ( - maxAltTaglen = len("en-US-POSIX") - maxLen = maxAltTaglen -) - -var ( - // grandfatheredMap holds a mapping from legacy and grandfathered tags to - // their base language or index to more elaborate tag. - grandfatheredMap = map[[maxLen]byte]int16{ - [maxLen]byte{'a', 'r', 't', '-', 'l', 'o', 'j', 'b', 'a', 'n'}: _jbo, // art-lojban - [maxLen]byte{'i', '-', 'a', 'm', 'i'}: _ami, // i-ami - [maxLen]byte{'i', '-', 'b', 'n', 'n'}: _bnn, // i-bnn - [maxLen]byte{'i', '-', 'h', 'a', 'k'}: _hak, // i-hak - [maxLen]byte{'i', '-', 'k', 'l', 'i', 'n', 'g', 'o', 'n'}: _tlh, // i-klingon - [maxLen]byte{'i', '-', 'l', 'u', 'x'}: _lb, // i-lux - [maxLen]byte{'i', '-', 'n', 'a', 'v', 'a', 'j', 'o'}: _nv, // i-navajo - [maxLen]byte{'i', '-', 'p', 'w', 'n'}: _pwn, // i-pwn - [maxLen]byte{'i', '-', 't', 'a', 'o'}: _tao, // i-tao - [maxLen]byte{'i', '-', 't', 'a', 'y'}: _tay, // i-tay - [maxLen]byte{'i', '-', 't', 's', 'u'}: _tsu, // i-tsu - [maxLen]byte{'n', 'o', '-', 'b', 'o', 'k'}: _nb, // no-bok - [maxLen]byte{'n', 'o', '-', 'n', 'y', 'n'}: _nn, // no-nyn - [maxLen]byte{'s', 'g', 'n', '-', 'b', 'e', '-', 'f', 'r'}: _sfb, // sgn-BE-FR - [maxLen]byte{'s', 'g', 'n', '-', 'b', 'e', '-', 'n', 'l'}: _vgt, // sgn-BE-NL - [maxLen]byte{'s', 'g', 'n', '-', 'c', 'h', '-', 'd', 'e'}: _sgg, // sgn-CH-DE - [maxLen]byte{'z', 'h', '-', 'g', 'u', 'o', 'y', 'u'}: _cmn, // zh-guoyu - [maxLen]byte{'z', 'h', '-', 'h', 'a', 'k', 'k', 'a'}: _hak, // zh-hakka - [maxLen]byte{'z', 'h', '-', 'm', 'i', 'n', '-', 'n', 'a', 'n'}: _nan, // zh-min-nan - [maxLen]byte{'z', 'h', '-', 'x', 'i', 'a', 'n', 'g'}: _hsn, // zh-xiang - - // Grandfathered tags with no modern replacement will be converted as - // follows: - [maxLen]byte{'c', 'e', 'l', '-', 'g', 'a', 'u', 'l', 'i', 's', 'h'}: -1, // cel-gaulish - [maxLen]byte{'e', 'n', '-', 'g', 'b', '-', 'o', 'e', 'd'}: -2, // en-GB-oed - [maxLen]byte{'i', '-', 'd', 'e', 'f', 'a', 'u', 'l', 't'}: -3, // i-default - [maxLen]byte{'i', '-', 'e', 'n', 'o', 'c', 'h', 'i', 'a', 'n'}: -4, // i-enochian - [maxLen]byte{'i', '-', 'm', 'i', 'n', 'g', 'o'}: -5, // i-mingo - [maxLen]byte{'z', 'h', '-', 'm', 'i', 'n'}: -6, // zh-min - - // CLDR-specific tag. - [maxLen]byte{'r', 'o', 'o', 't'}: 0, // root - [maxLen]byte{'e', 'n', '-', 'u', 's', '-', 'p', 'o', 's', 'i', 'x'}: -7, // en_US_POSIX" - } - - altTagIndex = [...]uint8{0, 17, 31, 45, 61, 74, 86, 102} - - altTags = "xtg-x-cel-gaulishen-GB-oxendicten-x-i-defaultund-x-i-enochiansee-x-i-mingonan-x-zh-minen-US-u-va-posix" -) - -func grandfathered(s [maxAltTaglen]byte) (t Tag, ok bool) { - if v, ok := grandfatheredMap[s]; ok { - if v < 0 { - return Make(altTags[altTagIndex[-v-1]:altTagIndex[-v]]), true - } - t.LangID = Language(v) - return t, true - } - return t, false -} diff --git a/vendor/golang.org/x/text/internal/language/match.go b/vendor/golang.org/x/text/internal/language/match.go deleted file mode 100644 index 75a2dbca7..000000000 --- a/vendor/golang.org/x/text/internal/language/match.go +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -import "errors" - -type scriptRegionFlags uint8 - -const ( - isList = 1 << iota - scriptInFrom - regionInFrom -) - -func (t *Tag) setUndefinedLang(id Language) { - if t.LangID == 0 { - t.LangID = id - } -} - -func (t *Tag) setUndefinedScript(id Script) { - if t.ScriptID == 0 { - t.ScriptID = id - } -} - -func (t *Tag) setUndefinedRegion(id Region) { - if t.RegionID == 0 || t.RegionID.Contains(id) { - t.RegionID = id - } -} - -// ErrMissingLikelyTagsData indicates no information was available -// to compute likely values of missing tags. -var ErrMissingLikelyTagsData = errors.New("missing likely tags data") - -// addLikelySubtags sets subtags to their most likely value, given the locale. -// In most cases this means setting fields for unknown values, but in some -// cases it may alter a value. It returns an ErrMissingLikelyTagsData error -// if the given locale cannot be expanded. -func (t Tag) addLikelySubtags() (Tag, error) { - id, err := addTags(t) - if err != nil { - return t, err - } else if id.equalTags(t) { - return t, nil - } - id.RemakeString() - return id, nil -} - -// specializeRegion attempts to specialize a group region. -func specializeRegion(t *Tag) bool { - if i := regionInclusion[t.RegionID]; i < nRegionGroups { - x := likelyRegionGroup[i] - if Language(x.lang) == t.LangID && Script(x.script) == t.ScriptID { - t.RegionID = Region(x.region) - } - return true - } - return false -} - -// Maximize returns a new tag with missing tags filled in. -func (t Tag) Maximize() (Tag, error) { - return addTags(t) -} - -func addTags(t Tag) (Tag, error) { - // We leave private use identifiers alone. - if t.IsPrivateUse() { - return t, nil - } - if t.ScriptID != 0 && t.RegionID != 0 { - if t.LangID != 0 { - // already fully specified - specializeRegion(&t) - return t, nil - } - // Search matches for und-script-region. Note that for these cases - // region will never be a group so there is no need to check for this. - list := likelyRegion[t.RegionID : t.RegionID+1] - if x := list[0]; x.flags&isList != 0 { - list = likelyRegionList[x.lang : x.lang+uint16(x.script)] - } - for _, x := range list { - // Deviating from the spec. See match_test.go for details. - if Script(x.script) == t.ScriptID { - t.setUndefinedLang(Language(x.lang)) - return t, nil - } - } - } - if t.LangID != 0 { - // Search matches for lang-script and lang-region, where lang != und. - if t.LangID < langNoIndexOffset { - x := likelyLang[t.LangID] - if x.flags&isList != 0 { - list := likelyLangList[x.region : x.region+uint16(x.script)] - if t.ScriptID != 0 { - for _, x := range list { - if Script(x.script) == t.ScriptID && x.flags&scriptInFrom != 0 { - t.setUndefinedRegion(Region(x.region)) - return t, nil - } - } - } else if t.RegionID != 0 { - count := 0 - goodScript := true - tt := t - for _, x := range list { - // We visit all entries for which the script was not - // defined, including the ones where the region was not - // defined. This allows for proper disambiguation within - // regions. - if x.flags&scriptInFrom == 0 && t.RegionID.Contains(Region(x.region)) { - tt.RegionID = Region(x.region) - tt.setUndefinedScript(Script(x.script)) - goodScript = goodScript && tt.ScriptID == Script(x.script) - count++ - } - } - if count == 1 { - return tt, nil - } - // Even if we fail to find a unique Region, we might have - // an unambiguous script. - if goodScript { - t.ScriptID = tt.ScriptID - } - } - } - } - } else { - // Search matches for und-script. - if t.ScriptID != 0 { - x := likelyScript[t.ScriptID] - if x.region != 0 { - t.setUndefinedRegion(Region(x.region)) - t.setUndefinedLang(Language(x.lang)) - return t, nil - } - } - // Search matches for und-region. If und-script-region exists, it would - // have been found earlier. - if t.RegionID != 0 { - if i := regionInclusion[t.RegionID]; i < nRegionGroups { - x := likelyRegionGroup[i] - if x.region != 0 { - t.setUndefinedLang(Language(x.lang)) - t.setUndefinedScript(Script(x.script)) - t.RegionID = Region(x.region) - } - } else { - x := likelyRegion[t.RegionID] - if x.flags&isList != 0 { - x = likelyRegionList[x.lang] - } - if x.script != 0 && x.flags != scriptInFrom { - t.setUndefinedLang(Language(x.lang)) - t.setUndefinedScript(Script(x.script)) - return t, nil - } - } - } - } - - // Search matches for lang. - if t.LangID < langNoIndexOffset { - x := likelyLang[t.LangID] - if x.flags&isList != 0 { - x = likelyLangList[x.region] - } - if x.region != 0 { - t.setUndefinedScript(Script(x.script)) - t.setUndefinedRegion(Region(x.region)) - } - specializeRegion(&t) - if t.LangID == 0 { - t.LangID = _en // default language - } - return t, nil - } - return t, ErrMissingLikelyTagsData -} - -func (t *Tag) setTagsFrom(id Tag) { - t.LangID = id.LangID - t.ScriptID = id.ScriptID - t.RegionID = id.RegionID -} - -// minimize removes the region or script subtags from t such that -// t.addLikelySubtags() == t.minimize().addLikelySubtags(). -func (t Tag) minimize() (Tag, error) { - t, err := minimizeTags(t) - if err != nil { - return t, err - } - t.RemakeString() - return t, nil -} - -// minimizeTags mimics the behavior of the ICU 51 C implementation. -func minimizeTags(t Tag) (Tag, error) { - if t.equalTags(Und) { - return t, nil - } - max, err := addTags(t) - if err != nil { - return t, err - } - for _, id := range [...]Tag{ - {LangID: t.LangID}, - {LangID: t.LangID, RegionID: t.RegionID}, - {LangID: t.LangID, ScriptID: t.ScriptID}, - } { - if x, err := addTags(id); err == nil && max.equalTags(x) { - t.setTagsFrom(id) - break - } - } - return t, nil -} diff --git a/vendor/golang.org/x/text/internal/language/parse.go b/vendor/golang.org/x/text/internal/language/parse.go deleted file mode 100644 index 2be83e1da..000000000 --- a/vendor/golang.org/x/text/internal/language/parse.go +++ /dev/null @@ -1,594 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -import ( - "bytes" - "errors" - "fmt" - "sort" - - "golang.org/x/text/internal/tag" -) - -// isAlpha returns true if the byte is not a digit. -// b must be an ASCII letter or digit. -func isAlpha(b byte) bool { - return b > '9' -} - -// isAlphaNum returns true if the string contains only ASCII letters or digits. -func isAlphaNum(s []byte) bool { - for _, c := range s { - if !('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9') { - return false - } - } - return true -} - -// ErrSyntax is returned by any of the parsing functions when the -// input is not well-formed, according to BCP 47. -// TODO: return the position at which the syntax error occurred? -var ErrSyntax = errors.New("language: tag is not well-formed") - -// ErrDuplicateKey is returned when a tag contains the same key twice with -// different values in the -u section. -var ErrDuplicateKey = errors.New("language: different values for same key in -u extension") - -// ValueError is returned by any of the parsing functions when the -// input is well-formed but the respective subtag is not recognized -// as a valid value. -type ValueError struct { - v [8]byte -} - -// NewValueError creates a new ValueError. -func NewValueError(tag []byte) ValueError { - var e ValueError - copy(e.v[:], tag) - return e -} - -func (e ValueError) tag() []byte { - n := bytes.IndexByte(e.v[:], 0) - if n == -1 { - n = 8 - } - return e.v[:n] -} - -// Error implements the error interface. -func (e ValueError) Error() string { - return fmt.Sprintf("language: subtag %q is well-formed but unknown", e.tag()) -} - -// Subtag returns the subtag for which the error occurred. -func (e ValueError) Subtag() string { - return string(e.tag()) -} - -// scanner is used to scan BCP 47 tokens, which are separated by _ or -. -type scanner struct { - b []byte - bytes [max99thPercentileSize]byte - token []byte - start int // start position of the current token - end int // end position of the current token - next int // next point for scan - err error - done bool -} - -func makeScannerString(s string) scanner { - scan := scanner{} - if len(s) <= len(scan.bytes) { - scan.b = scan.bytes[:copy(scan.bytes[:], s)] - } else { - scan.b = []byte(s) - } - scan.init() - return scan -} - -// makeScanner returns a scanner using b as the input buffer. -// b is not copied and may be modified by the scanner routines. -func makeScanner(b []byte) scanner { - scan := scanner{b: b} - scan.init() - return scan -} - -func (s *scanner) init() { - for i, c := range s.b { - if c == '_' { - s.b[i] = '-' - } - } - s.scan() -} - -// restToLower converts the string between start and end to lower case. -func (s *scanner) toLower(start, end int) { - for i := start; i < end; i++ { - c := s.b[i] - if 'A' <= c && c <= 'Z' { - s.b[i] += 'a' - 'A' - } - } -} - -func (s *scanner) setError(e error) { - if s.err == nil || (e == ErrSyntax && s.err != ErrSyntax) { - s.err = e - } -} - -// resizeRange shrinks or grows the array at position oldStart such that -// a new string of size newSize can fit between oldStart and oldEnd. -// Sets the scan point to after the resized range. -func (s *scanner) resizeRange(oldStart, oldEnd, newSize int) { - s.start = oldStart - if end := oldStart + newSize; end != oldEnd { - diff := end - oldEnd - if end < cap(s.b) { - b := make([]byte, len(s.b)+diff) - copy(b, s.b[:oldStart]) - copy(b[end:], s.b[oldEnd:]) - s.b = b - } else { - s.b = append(s.b[end:], s.b[oldEnd:]...) - } - s.next = end + (s.next - s.end) - s.end = end - } -} - -// replace replaces the current token with repl. -func (s *scanner) replace(repl string) { - s.resizeRange(s.start, s.end, len(repl)) - copy(s.b[s.start:], repl) -} - -// gobble removes the current token from the input. -// Caller must call scan after calling gobble. -func (s *scanner) gobble(e error) { - s.setError(e) - if s.start == 0 { - s.b = s.b[:+copy(s.b, s.b[s.next:])] - s.end = 0 - } else { - s.b = s.b[:s.start-1+copy(s.b[s.start-1:], s.b[s.end:])] - s.end = s.start - 1 - } - s.next = s.start -} - -// deleteRange removes the given range from s.b before the current token. -func (s *scanner) deleteRange(start, end int) { - s.b = s.b[:start+copy(s.b[start:], s.b[end:])] - diff := end - start - s.next -= diff - s.start -= diff - s.end -= diff -} - -// scan parses the next token of a BCP 47 string. Tokens that are larger -// than 8 characters or include non-alphanumeric characters result in an error -// and are gobbled and removed from the output. -// It returns the end position of the last token consumed. -func (s *scanner) scan() (end int) { - end = s.end - s.token = nil - for s.start = s.next; s.next < len(s.b); { - i := bytes.IndexByte(s.b[s.next:], '-') - if i == -1 { - s.end = len(s.b) - s.next = len(s.b) - i = s.end - s.start - } else { - s.end = s.next + i - s.next = s.end + 1 - } - token := s.b[s.start:s.end] - if i < 1 || i > 8 || !isAlphaNum(token) { - s.gobble(ErrSyntax) - continue - } - s.token = token - return end - } - if n := len(s.b); n > 0 && s.b[n-1] == '-' { - s.setError(ErrSyntax) - s.b = s.b[:len(s.b)-1] - } - s.done = true - return end -} - -// acceptMinSize parses multiple tokens of the given size or greater. -// It returns the end position of the last token consumed. -func (s *scanner) acceptMinSize(min int) (end int) { - end = s.end - s.scan() - for ; len(s.token) >= min; s.scan() { - end = s.end - } - return end -} - -// Parse parses the given BCP 47 string and returns a valid Tag. If parsing -// failed it returns an error and any part of the tag that could be parsed. -// If parsing succeeded but an unknown value was found, it returns -// ValueError. The Tag returned in this case is just stripped of the unknown -// value. All other values are preserved. It accepts tags in the BCP 47 format -// and extensions to this standard defined in -// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. -func Parse(s string) (t Tag, err error) { - // TODO: consider supporting old-style locale key-value pairs. - if s == "" { - return Und, ErrSyntax - } - if len(s) <= maxAltTaglen { - b := [maxAltTaglen]byte{} - for i, c := range s { - // Generating invalid UTF-8 is okay as it won't match. - if 'A' <= c && c <= 'Z' { - c += 'a' - 'A' - } else if c == '_' { - c = '-' - } - b[i] = byte(c) - } - if t, ok := grandfathered(b); ok { - return t, nil - } - } - scan := makeScannerString(s) - return parse(&scan, s) -} - -func parse(scan *scanner, s string) (t Tag, err error) { - t = Und - var end int - if n := len(scan.token); n <= 1 { - scan.toLower(0, len(scan.b)) - if n == 0 || scan.token[0] != 'x' { - return t, ErrSyntax - } - end = parseExtensions(scan) - } else if n >= 4 { - return Und, ErrSyntax - } else { // the usual case - t, end = parseTag(scan) - if n := len(scan.token); n == 1 { - t.pExt = uint16(end) - end = parseExtensions(scan) - } else if end < len(scan.b) { - scan.setError(ErrSyntax) - scan.b = scan.b[:end] - } - } - if int(t.pVariant) < len(scan.b) { - if end < len(s) { - s = s[:end] - } - if len(s) > 0 && tag.Compare(s, scan.b) == 0 { - t.str = s - } else { - t.str = string(scan.b) - } - } else { - t.pVariant, t.pExt = 0, 0 - } - return t, scan.err -} - -// parseTag parses language, script, region and variants. -// It returns a Tag and the end position in the input that was parsed. -func parseTag(scan *scanner) (t Tag, end int) { - var e error - // TODO: set an error if an unknown lang, script or region is encountered. - t.LangID, e = getLangID(scan.token) - scan.setError(e) - scan.replace(t.LangID.String()) - langStart := scan.start - end = scan.scan() - for len(scan.token) == 3 && isAlpha(scan.token[0]) { - // From http://tools.ietf.org/html/bcp47, - tags are equivalent - // to a tag of the form . - lang, e := getLangID(scan.token) - if lang != 0 { - t.LangID = lang - copy(scan.b[langStart:], lang.String()) - scan.b[langStart+3] = '-' - scan.start = langStart + 4 - } - scan.gobble(e) - end = scan.scan() - } - if len(scan.token) == 4 && isAlpha(scan.token[0]) { - t.ScriptID, e = getScriptID(script, scan.token) - if t.ScriptID == 0 { - scan.gobble(e) - } - end = scan.scan() - } - if n := len(scan.token); n >= 2 && n <= 3 { - t.RegionID, e = getRegionID(scan.token) - if t.RegionID == 0 { - scan.gobble(e) - } else { - scan.replace(t.RegionID.String()) - } - end = scan.scan() - } - scan.toLower(scan.start, len(scan.b)) - t.pVariant = byte(end) - end = parseVariants(scan, end, t) - t.pExt = uint16(end) - return t, end -} - -var separator = []byte{'-'} - -// parseVariants scans tokens as long as each token is a valid variant string. -// Duplicate variants are removed. -func parseVariants(scan *scanner, end int, t Tag) int { - start := scan.start - varIDBuf := [4]uint8{} - variantBuf := [4][]byte{} - varID := varIDBuf[:0] - variant := variantBuf[:0] - last := -1 - needSort := false - for ; len(scan.token) >= 4; scan.scan() { - // TODO: measure the impact of needing this conversion and redesign - // the data structure if there is an issue. - v, ok := variantIndex[string(scan.token)] - if !ok { - // unknown variant - // TODO: allow user-defined variants? - scan.gobble(NewValueError(scan.token)) - continue - } - varID = append(varID, v) - variant = append(variant, scan.token) - if !needSort { - if last < int(v) { - last = int(v) - } else { - needSort = true - // There is no legal combinations of more than 7 variants - // (and this is by no means a useful sequence). - const maxVariants = 8 - if len(varID) > maxVariants { - break - } - } - } - end = scan.end - } - if needSort { - sort.Sort(variantsSort{varID, variant}) - k, l := 0, -1 - for i, v := range varID { - w := int(v) - if l == w { - // Remove duplicates. - continue - } - varID[k] = varID[i] - variant[k] = variant[i] - k++ - l = w - } - if str := bytes.Join(variant[:k], separator); len(str) == 0 { - end = start - 1 - } else { - scan.resizeRange(start, end, len(str)) - copy(scan.b[scan.start:], str) - end = scan.end - } - } - return end -} - -type variantsSort struct { - i []uint8 - v [][]byte -} - -func (s variantsSort) Len() int { - return len(s.i) -} - -func (s variantsSort) Swap(i, j int) { - s.i[i], s.i[j] = s.i[j], s.i[i] - s.v[i], s.v[j] = s.v[j], s.v[i] -} - -func (s variantsSort) Less(i, j int) bool { - return s.i[i] < s.i[j] -} - -type bytesSort struct { - b [][]byte - n int // first n bytes to compare -} - -func (b bytesSort) Len() int { - return len(b.b) -} - -func (b bytesSort) Swap(i, j int) { - b.b[i], b.b[j] = b.b[j], b.b[i] -} - -func (b bytesSort) Less(i, j int) bool { - for k := 0; k < b.n; k++ { - if b.b[i][k] == b.b[j][k] { - continue - } - return b.b[i][k] < b.b[j][k] - } - return false -} - -// parseExtensions parses and normalizes the extensions in the buffer. -// It returns the last position of scan.b that is part of any extension. -// It also trims scan.b to remove excess parts accordingly. -func parseExtensions(scan *scanner) int { - start := scan.start - exts := [][]byte{} - private := []byte{} - end := scan.end - for len(scan.token) == 1 { - extStart := scan.start - ext := scan.token[0] - end = parseExtension(scan) - extension := scan.b[extStart:end] - if len(extension) < 3 || (ext != 'x' && len(extension) < 4) { - scan.setError(ErrSyntax) - end = extStart - continue - } else if start == extStart && (ext == 'x' || scan.start == len(scan.b)) { - scan.b = scan.b[:end] - return end - } else if ext == 'x' { - private = extension - break - } - exts = append(exts, extension) - } - sort.Sort(bytesSort{exts, 1}) - if len(private) > 0 { - exts = append(exts, private) - } - scan.b = scan.b[:start] - if len(exts) > 0 { - scan.b = append(scan.b, bytes.Join(exts, separator)...) - } else if start > 0 { - // Strip trailing '-'. - scan.b = scan.b[:start-1] - } - return end -} - -// parseExtension parses a single extension and returns the position of -// the extension end. -func parseExtension(scan *scanner) int { - start, end := scan.start, scan.end - switch scan.token[0] { - case 'u': - attrStart := end - scan.scan() - for last := []byte{}; len(scan.token) > 2; scan.scan() { - if bytes.Compare(scan.token, last) != -1 { - // Attributes are unsorted. Start over from scratch. - p := attrStart + 1 - scan.next = p - attrs := [][]byte{} - for scan.scan(); len(scan.token) > 2; scan.scan() { - attrs = append(attrs, scan.token) - end = scan.end - } - sort.Sort(bytesSort{attrs, 3}) - copy(scan.b[p:], bytes.Join(attrs, separator)) - break - } - last = scan.token - end = scan.end - } - var last, key []byte - for attrEnd := end; len(scan.token) == 2; last = key { - key = scan.token - keyEnd := scan.end - end = scan.acceptMinSize(3) - // TODO: check key value validity - if keyEnd == end || bytes.Compare(key, last) != 1 { - // We have an invalid key or the keys are not sorted. - // Start scanning keys from scratch and reorder. - p := attrEnd + 1 - scan.next = p - keys := [][]byte{} - for scan.scan(); len(scan.token) == 2; { - keyStart, keyEnd := scan.start, scan.end - end = scan.acceptMinSize(3) - if keyEnd != end { - keys = append(keys, scan.b[keyStart:end]) - } else { - scan.setError(ErrSyntax) - end = keyStart - } - } - sort.Stable(bytesSort{keys, 2}) - if n := len(keys); n > 0 { - k := 0 - for i := 1; i < n; i++ { - if !bytes.Equal(keys[k][:2], keys[i][:2]) { - k++ - keys[k] = keys[i] - } else if !bytes.Equal(keys[k], keys[i]) { - scan.setError(ErrDuplicateKey) - } - } - keys = keys[:k+1] - } - reordered := bytes.Join(keys, separator) - if e := p + len(reordered); e < end { - scan.deleteRange(e, end) - end = e - } - copy(scan.b[p:], reordered) - break - } - } - case 't': - scan.scan() - if n := len(scan.token); n >= 2 && n <= 3 && isAlpha(scan.token[1]) { - _, end = parseTag(scan) - scan.toLower(start, end) - } - for len(scan.token) == 2 && !isAlpha(scan.token[1]) { - end = scan.acceptMinSize(3) - } - case 'x': - end = scan.acceptMinSize(1) - default: - end = scan.acceptMinSize(2) - } - return end -} - -// getExtension returns the name, body and end position of the extension. -func getExtension(s string, p int) (end int, ext string) { - if s[p] == '-' { - p++ - } - if s[p] == 'x' { - return len(s), s[p:] - } - end = nextExtension(s, p) - return end, s[p:end] -} - -// nextExtension finds the next extension within the string, searching -// for the -- pattern from position p. -// In the fast majority of cases, language tags will have at most -// one extension and extensions tend to be small. -func nextExtension(s string, p int) int { - for n := len(s) - 3; p < n; { - if s[p] == '-' { - if s[p+2] == '-' { - return p - } - p += 3 - } else { - p++ - } - } - return len(s) -} diff --git a/vendor/golang.org/x/text/internal/language/tables.go b/vendor/golang.org/x/text/internal/language/tables.go deleted file mode 100644 index 239e2d29e..000000000 --- a/vendor/golang.org/x/text/internal/language/tables.go +++ /dev/null @@ -1,3431 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -package language - -import "golang.org/x/text/internal/tag" - -// CLDRVersion is the CLDR version from which the tables in this package are derived. -const CLDRVersion = "32" - -const NumLanguages = 8665 - -const NumScripts = 242 - -const NumRegions = 357 - -type FromTo struct { - From uint16 - To uint16 -} - -const nonCanonicalUnd = 1201 -const ( - _af = 22 - _am = 39 - _ar = 58 - _az = 88 - _bg = 126 - _bn = 165 - _ca = 215 - _cs = 250 - _da = 257 - _de = 269 - _el = 310 - _en = 313 - _es = 318 - _et = 320 - _fa = 328 - _fi = 337 - _fil = 339 - _fr = 350 - _gu = 420 - _he = 444 - _hi = 446 - _hr = 465 - _hu = 469 - _hy = 471 - _id = 481 - _is = 504 - _it = 505 - _ja = 512 - _ka = 528 - _kk = 578 - _km = 586 - _kn = 593 - _ko = 596 - _ky = 650 - _lo = 696 - _lt = 704 - _lv = 711 - _mk = 767 - _ml = 772 - _mn = 779 - _mo = 784 - _mr = 795 - _ms = 799 - _mul = 806 - _my = 817 - _nb = 839 - _ne = 849 - _nl = 871 - _no = 879 - _pa = 925 - _pl = 947 - _pt = 960 - _ro = 988 - _ru = 994 - _sh = 1031 - _si = 1036 - _sk = 1042 - _sl = 1046 - _sq = 1073 - _sr = 1074 - _sv = 1092 - _sw = 1093 - _ta = 1104 - _te = 1121 - _th = 1131 - _tl = 1146 - _tn = 1152 - _tr = 1162 - _uk = 1198 - _ur = 1204 - _uz = 1212 - _vi = 1219 - _zh = 1321 - _zu = 1327 - _jbo = 515 - _ami = 1650 - _bnn = 2357 - _hak = 438 - _tlh = 14467 - _lb = 661 - _nv = 899 - _pwn = 12055 - _tao = 14188 - _tay = 14198 - _tsu = 14662 - _nn = 874 - _sfb = 13629 - _vgt = 15701 - _sgg = 13660 - _cmn = 3007 - _nan = 835 - _hsn = 467 -) - -const langPrivateStart = 0x2f72 - -const langPrivateEnd = 0x3179 - -// lang holds an alphabetically sorted list of ISO-639 language identifiers. -// All entries are 4 bytes. The index of the identifier (divided by 4) is the language tag. -// For 2-byte language identifiers, the two successive bytes have the following meaning: -// - if the first letter of the 2- and 3-letter ISO codes are the same: -// the second and third letter of the 3-letter ISO code. -// - otherwise: a 0 and a by 2 bits right-shifted index into altLangISO3. -// For 3-byte language identifiers the 4th byte is 0. -const lang tag.Index = "" + // Size: 5324 bytes - "---\x00aaaraai\x00aak\x00aau\x00abbkabi\x00abq\x00abr\x00abt\x00aby\x00a" + - "cd\x00ace\x00ach\x00ada\x00ade\x00adj\x00ady\x00adz\x00aeveaeb\x00aey" + - "\x00affragc\x00agd\x00agg\x00agm\x00ago\x00agq\x00aha\x00ahl\x00aho\x00a" + - "jg\x00akkaakk\x00ala\x00ali\x00aln\x00alt\x00ammhamm\x00amn\x00amo\x00am" + - "p\x00anrganc\x00ank\x00ann\x00any\x00aoj\x00aom\x00aoz\x00apc\x00apd\x00" + - "ape\x00apr\x00aps\x00apz\x00arraarc\x00arh\x00arn\x00aro\x00arq\x00ars" + - "\x00ary\x00arz\x00assmasa\x00ase\x00asg\x00aso\x00ast\x00ata\x00atg\x00a" + - "tj\x00auy\x00avvaavl\x00avn\x00avt\x00avu\x00awa\x00awb\x00awo\x00awx" + - "\x00ayymayb\x00azzebaakbal\x00ban\x00bap\x00bar\x00bas\x00bav\x00bax\x00" + - "bba\x00bbb\x00bbc\x00bbd\x00bbj\x00bbp\x00bbr\x00bcf\x00bch\x00bci\x00bc" + - "m\x00bcn\x00bco\x00bcq\x00bcu\x00bdd\x00beelbef\x00beh\x00bej\x00bem\x00" + - "bet\x00bew\x00bex\x00bez\x00bfd\x00bfq\x00bft\x00bfy\x00bgulbgc\x00bgn" + - "\x00bgx\x00bhihbhb\x00bhg\x00bhi\x00bhk\x00bhl\x00bho\x00bhy\x00biisbib" + - "\x00big\x00bik\x00bim\x00bin\x00bio\x00biq\x00bjh\x00bji\x00bjj\x00bjn" + - "\x00bjo\x00bjr\x00bjt\x00bjz\x00bkc\x00bkm\x00bkq\x00bku\x00bkv\x00blt" + - "\x00bmambmh\x00bmk\x00bmq\x00bmu\x00bnenbng\x00bnm\x00bnp\x00boodboj\x00" + - "bom\x00bon\x00bpy\x00bqc\x00bqi\x00bqp\x00bqv\x00brrebra\x00brh\x00brx" + - "\x00brz\x00bsosbsj\x00bsq\x00bss\x00bst\x00bto\x00btt\x00btv\x00bua\x00b" + - "uc\x00bud\x00bug\x00buk\x00bum\x00buo\x00bus\x00buu\x00bvb\x00bwd\x00bwr" + - "\x00bxh\x00bye\x00byn\x00byr\x00bys\x00byv\x00byx\x00bza\x00bze\x00bzf" + - "\x00bzh\x00bzw\x00caatcan\x00cbj\x00cch\x00ccp\x00ceheceb\x00cfa\x00cgg" + - "\x00chhachk\x00chm\x00cho\x00chp\x00chr\x00cja\x00cjm\x00cjv\x00ckb\x00c" + - "kl\x00cko\x00cky\x00cla\x00cme\x00cmg\x00cooscop\x00cps\x00crrecrh\x00cr" + - "j\x00crk\x00crl\x00crm\x00crs\x00csescsb\x00csw\x00ctd\x00cuhucvhvcyymda" + - "andad\x00daf\x00dag\x00dah\x00dak\x00dar\x00dav\x00dbd\x00dbq\x00dcc\x00" + - "ddn\x00deeuded\x00den\x00dga\x00dgh\x00dgi\x00dgl\x00dgr\x00dgz\x00dia" + - "\x00dje\x00dnj\x00dob\x00doi\x00dop\x00dow\x00dri\x00drs\x00dsb\x00dtm" + - "\x00dtp\x00dts\x00dty\x00dua\x00duc\x00dud\x00dug\x00dvivdva\x00dww\x00d" + - "yo\x00dyu\x00dzzodzg\x00ebu\x00eeweefi\x00egl\x00egy\x00eka\x00eky\x00el" + - "llema\x00emi\x00enngenn\x00enq\x00eopoeri\x00es\x00\x05esu\x00etstetr" + - "\x00ett\x00etu\x00etx\x00euusewo\x00ext\x00faasfaa\x00fab\x00fag\x00fai" + - "\x00fan\x00ffulffi\x00ffm\x00fiinfia\x00fil\x00fit\x00fjijflr\x00fmp\x00" + - "foaofod\x00fon\x00for\x00fpe\x00fqs\x00frrafrc\x00frp\x00frr\x00frs\x00f" + - "ub\x00fud\x00fue\x00fuf\x00fuh\x00fuq\x00fur\x00fuv\x00fuy\x00fvr\x00fyr" + - "ygalegaa\x00gaf\x00gag\x00gah\x00gaj\x00gam\x00gan\x00gaw\x00gay\x00gba" + - "\x00gbf\x00gbm\x00gby\x00gbz\x00gcr\x00gdlagde\x00gdn\x00gdr\x00geb\x00g" + - "ej\x00gel\x00gez\x00gfk\x00ggn\x00ghs\x00gil\x00gim\x00gjk\x00gjn\x00gju" + - "\x00gkn\x00gkp\x00gllgglk\x00gmm\x00gmv\x00gnrngnd\x00gng\x00god\x00gof" + - "\x00goi\x00gom\x00gon\x00gor\x00gos\x00got\x00grb\x00grc\x00grt\x00grw" + - "\x00gsw\x00guujgub\x00guc\x00gud\x00gur\x00guw\x00gux\x00guz\x00gvlvgvf" + - "\x00gvr\x00gvs\x00gwc\x00gwi\x00gwt\x00gyi\x00haauhag\x00hak\x00ham\x00h" + - "aw\x00haz\x00hbb\x00hdy\x00heebhhy\x00hiinhia\x00hif\x00hig\x00hih\x00hi" + - "l\x00hla\x00hlu\x00hmd\x00hmt\x00hnd\x00hne\x00hnj\x00hnn\x00hno\x00homo" + - "hoc\x00hoj\x00hot\x00hrrvhsb\x00hsn\x00htathuunhui\x00hyyehzerianaian" + - "\x00iar\x00iba\x00ibb\x00iby\x00ica\x00ich\x00idndidd\x00idi\x00idu\x00i" + - "eleife\x00igboigb\x00ige\x00iiiiijj\x00ikpkikk\x00ikt\x00ikw\x00ikx\x00i" + - "lo\x00imo\x00inndinh\x00iodoiou\x00iri\x00isslittaiukuiw\x00\x03iwm\x00i" + - "ws\x00izh\x00izi\x00japnjab\x00jam\x00jbo\x00jbu\x00jen\x00jgk\x00jgo" + - "\x00ji\x00\x06jib\x00jmc\x00jml\x00jra\x00jut\x00jvavjwavkaatkaa\x00kab" + - "\x00kac\x00kad\x00kai\x00kaj\x00kam\x00kao\x00kbd\x00kbm\x00kbp\x00kbq" + - "\x00kbx\x00kby\x00kcg\x00kck\x00kcl\x00kct\x00kde\x00kdh\x00kdl\x00kdt" + - "\x00kea\x00ken\x00kez\x00kfo\x00kfr\x00kfy\x00kgonkge\x00kgf\x00kgp\x00k" + - "ha\x00khb\x00khn\x00khq\x00khs\x00kht\x00khw\x00khz\x00kiikkij\x00kiu" + - "\x00kiw\x00kjuakjd\x00kjg\x00kjs\x00kjy\x00kkazkkc\x00kkj\x00klalkln\x00" + - "klq\x00klt\x00klx\x00kmhmkmb\x00kmh\x00kmo\x00kms\x00kmu\x00kmw\x00knank" + - "nf\x00knp\x00koorkoi\x00kok\x00kol\x00kos\x00koz\x00kpe\x00kpf\x00kpo" + - "\x00kpr\x00kpx\x00kqb\x00kqf\x00kqs\x00kqy\x00kraukrc\x00kri\x00krj\x00k" + - "rl\x00krs\x00kru\x00ksasksb\x00ksd\x00ksf\x00ksh\x00ksj\x00ksr\x00ktb" + - "\x00ktm\x00kto\x00kuurkub\x00kud\x00kue\x00kuj\x00kum\x00kun\x00kup\x00k" + - "us\x00kvomkvg\x00kvr\x00kvx\x00kw\x00\x01kwj\x00kwo\x00kxa\x00kxc\x00kxm" + - "\x00kxp\x00kxw\x00kxz\x00kyirkye\x00kyx\x00kzr\x00laatlab\x00lad\x00lag" + - "\x00lah\x00laj\x00las\x00lbtzlbe\x00lbu\x00lbw\x00lcm\x00lcp\x00ldb\x00l" + - "ed\x00lee\x00lem\x00lep\x00leq\x00leu\x00lez\x00lguglgg\x00liimlia\x00li" + - "d\x00lif\x00lig\x00lih\x00lij\x00lis\x00ljp\x00lki\x00lkt\x00lle\x00lln" + - "\x00lmn\x00lmo\x00lmp\x00lninlns\x00lnu\x00loaoloj\x00lok\x00lol\x00lor" + - "\x00los\x00loz\x00lrc\x00ltitltg\x00luublua\x00luo\x00luy\x00luz\x00lvav" + - "lwl\x00lzh\x00lzz\x00mad\x00maf\x00mag\x00mai\x00mak\x00man\x00mas\x00ma" + - "w\x00maz\x00mbh\x00mbo\x00mbq\x00mbu\x00mbw\x00mci\x00mcp\x00mcq\x00mcr" + - "\x00mcu\x00mda\x00mde\x00mdf\x00mdh\x00mdj\x00mdr\x00mdx\x00med\x00mee" + - "\x00mek\x00men\x00mer\x00met\x00meu\x00mfa\x00mfe\x00mfn\x00mfo\x00mfq" + - "\x00mglgmgh\x00mgl\x00mgo\x00mgp\x00mgy\x00mhahmhi\x00mhl\x00mirimif\x00" + - "min\x00mis\x00miw\x00mkkdmki\x00mkl\x00mkp\x00mkw\x00mlalmle\x00mlp\x00m" + - "ls\x00mmo\x00mmu\x00mmx\x00mnonmna\x00mnf\x00mni\x00mnw\x00moolmoa\x00mo" + - "e\x00moh\x00mos\x00mox\x00mpp\x00mps\x00mpt\x00mpx\x00mql\x00mrarmrd\x00" + - "mrj\x00mro\x00mssamtltmtc\x00mtf\x00mti\x00mtr\x00mua\x00mul\x00mur\x00m" + - "us\x00mva\x00mvn\x00mvy\x00mwk\x00mwr\x00mwv\x00mxc\x00mxm\x00myyamyk" + - "\x00mym\x00myv\x00myw\x00myx\x00myz\x00mzk\x00mzm\x00mzn\x00mzp\x00mzw" + - "\x00mzz\x00naaunac\x00naf\x00nah\x00nak\x00nan\x00nap\x00naq\x00nas\x00n" + - "bobnca\x00nce\x00ncf\x00nch\x00nco\x00ncu\x00nddendc\x00nds\x00neepneb" + - "\x00new\x00nex\x00nfr\x00ngdonga\x00ngb\x00ngl\x00nhb\x00nhe\x00nhw\x00n" + - "if\x00nii\x00nij\x00nin\x00niu\x00niy\x00niz\x00njo\x00nkg\x00nko\x00nll" + - "dnmg\x00nmz\x00nnnonnf\x00nnh\x00nnk\x00nnm\x00noornod\x00noe\x00non\x00" + - "nop\x00nou\x00nqo\x00nrblnrb\x00nsk\x00nsn\x00nso\x00nss\x00ntm\x00ntr" + - "\x00nui\x00nup\x00nus\x00nuv\x00nux\x00nvavnwb\x00nxq\x00nxr\x00nyyanym" + - "\x00nyn\x00nzi\x00occiogc\x00ojjiokr\x00okv\x00omrmong\x00onn\x00ons\x00" + - "opm\x00orrioro\x00oru\x00osssosa\x00ota\x00otk\x00ozm\x00paanpag\x00pal" + - "\x00pam\x00pap\x00pau\x00pbi\x00pcd\x00pcm\x00pdc\x00pdt\x00ped\x00peo" + - "\x00pex\x00pfl\x00phl\x00phn\x00pilipil\x00pip\x00pka\x00pko\x00plolpla" + - "\x00pms\x00png\x00pnn\x00pnt\x00pon\x00ppo\x00pra\x00prd\x00prg\x00psusp" + - "ss\x00ptorptp\x00puu\x00pwa\x00quuequc\x00qug\x00rai\x00raj\x00rao\x00rc" + - "f\x00rej\x00rel\x00res\x00rgn\x00rhg\x00ria\x00rif\x00rjs\x00rkt\x00rmoh" + - "rmf\x00rmo\x00rmt\x00rmu\x00rnunrna\x00rng\x00roonrob\x00rof\x00roo\x00r" + - "ro\x00rtm\x00ruusrue\x00rug\x00rw\x00\x04rwk\x00rwo\x00ryu\x00saansaf" + - "\x00sah\x00saq\x00sas\x00sat\x00sav\x00saz\x00sba\x00sbe\x00sbp\x00scrds" + - "ck\x00scl\x00scn\x00sco\x00scs\x00sdndsdc\x00sdh\x00semesef\x00seh\x00se" + - "i\x00ses\x00sgagsga\x00sgs\x00sgw\x00sgz\x00sh\x00\x02shi\x00shk\x00shn" + - "\x00shu\x00siinsid\x00sig\x00sil\x00sim\x00sjr\x00sklkskc\x00skr\x00sks" + - "\x00sllvsld\x00sli\x00sll\x00sly\x00smmosma\x00smi\x00smj\x00smn\x00smp" + - "\x00smq\x00sms\x00snnasnc\x00snk\x00snp\x00snx\x00sny\x00soomsok\x00soq" + - "\x00sou\x00soy\x00spd\x00spl\x00sps\x00sqqisrrpsrb\x00srn\x00srr\x00srx" + - "\x00ssswssd\x00ssg\x00ssy\x00stotstk\x00stq\x00suunsua\x00sue\x00suk\x00" + - "sur\x00sus\x00svweswwaswb\x00swc\x00swg\x00swp\x00swv\x00sxn\x00sxw\x00s" + - "yl\x00syr\x00szl\x00taamtaj\x00tal\x00tan\x00taq\x00tbc\x00tbd\x00tbf" + - "\x00tbg\x00tbo\x00tbw\x00tbz\x00tci\x00tcy\x00tdd\x00tdg\x00tdh\x00teelt" + - "ed\x00tem\x00teo\x00tet\x00tfi\x00tggktgc\x00tgo\x00tgu\x00thhathl\x00th" + - "q\x00thr\x00tiirtif\x00tig\x00tik\x00tim\x00tio\x00tiv\x00tkuktkl\x00tkr" + - "\x00tkt\x00tlgltlf\x00tlx\x00tly\x00tmh\x00tmy\x00tnsntnh\x00toontof\x00" + - "tog\x00toq\x00tpi\x00tpm\x00tpz\x00tqo\x00trurtru\x00trv\x00trw\x00tssot" + - "sd\x00tsf\x00tsg\x00tsj\x00tsw\x00ttatttd\x00tte\x00ttj\x00ttr\x00tts" + - "\x00ttt\x00tuh\x00tul\x00tum\x00tuq\x00tvd\x00tvl\x00tvu\x00twwitwh\x00t" + - "wq\x00txg\x00tyahtya\x00tyv\x00tzm\x00ubu\x00udm\x00ugiguga\x00ukkruli" + - "\x00umb\x00und\x00unr\x00unx\x00urrduri\x00urt\x00urw\x00usa\x00utr\x00u" + - "vh\x00uvl\x00uzzbvag\x00vai\x00van\x00veenvec\x00vep\x00viievic\x00viv" + - "\x00vls\x00vmf\x00vmw\x00voolvot\x00vro\x00vun\x00vut\x00walnwae\x00waj" + - "\x00wal\x00wan\x00war\x00wbp\x00wbq\x00wbr\x00wci\x00wer\x00wgi\x00whg" + - "\x00wib\x00wiu\x00wiv\x00wja\x00wji\x00wls\x00wmo\x00wnc\x00wni\x00wnu" + - "\x00woolwob\x00wos\x00wrs\x00wsk\x00wtm\x00wuu\x00wuv\x00wwa\x00xav\x00x" + - "bi\x00xcr\x00xes\x00xhhoxla\x00xlc\x00xld\x00xmf\x00xmn\x00xmr\x00xna" + - "\x00xnr\x00xog\x00xon\x00xpr\x00xrb\x00xsa\x00xsi\x00xsm\x00xsr\x00xwe" + - "\x00yam\x00yao\x00yap\x00yas\x00yat\x00yav\x00yay\x00yaz\x00yba\x00ybb" + - "\x00yby\x00yer\x00ygr\x00ygw\x00yiidyko\x00yle\x00ylg\x00yll\x00yml\x00y" + - "ooryon\x00yrb\x00yre\x00yrl\x00yss\x00yua\x00yue\x00yuj\x00yut\x00yuw" + - "\x00zahazag\x00zbl\x00zdj\x00zea\x00zgh\x00zhhozhx\x00zia\x00zlm\x00zmi" + - "\x00zne\x00zuulzxx\x00zza\x00\xff\xff\xff\xff" - -const langNoIndexOffset = 1330 - -// langNoIndex is a bit vector of all 3-letter language codes that are not used as an index -// in lookup tables. The language ids for these language codes are derived directly -// from the letters and are not consecutive. -// Size: 2197 bytes, 2197 elements -var langNoIndex = [2197]uint8{ - // Entry 0 - 3F - 0xff, 0xf8, 0xed, 0xfe, 0xeb, 0xd3, 0x3b, 0xd2, - 0xfb, 0xbf, 0x7a, 0xfa, 0x37, 0x1d, 0x3c, 0x57, - 0x6e, 0x97, 0x73, 0x38, 0xfb, 0xea, 0xbf, 0x70, - 0xad, 0x03, 0xff, 0xff, 0xcf, 0x05, 0x84, 0x62, - 0xe9, 0xbf, 0xfd, 0xbf, 0xbf, 0xf7, 0xfd, 0x77, - 0x0f, 0xff, 0xef, 0x6f, 0xff, 0xfb, 0xdf, 0xe2, - 0xc9, 0xf8, 0x7f, 0x7e, 0x4d, 0xb8, 0x0a, 0x6a, - 0x7c, 0xea, 0xe3, 0xfa, 0x7a, 0xbf, 0x67, 0xff, - // Entry 40 - 7F - 0xff, 0xff, 0xff, 0xdf, 0x2a, 0x54, 0x91, 0xc0, - 0x5d, 0xe3, 0x97, 0x14, 0x07, 0x20, 0xdd, 0xed, - 0x9f, 0x3f, 0xc9, 0x21, 0xf8, 0x3f, 0x94, 0x35, - 0x7c, 0x5f, 0xff, 0x5f, 0x8e, 0x6e, 0xdf, 0xff, - 0xff, 0xff, 0x55, 0x7c, 0xd3, 0xfd, 0xbf, 0xb5, - 0x7b, 0xdf, 0x7f, 0xf7, 0xca, 0xfe, 0xdb, 0xa3, - 0xa8, 0xff, 0x1f, 0x67, 0x7d, 0xeb, 0xef, 0xce, - 0xff, 0xff, 0x9f, 0xff, 0xb7, 0xef, 0xfe, 0xcf, - // Entry 80 - BF - 0xdb, 0xff, 0xf3, 0xcd, 0xfb, 0x2f, 0xff, 0xff, - 0xbb, 0xee, 0xf7, 0xbd, 0xdb, 0xff, 0x5f, 0xf7, - 0xfd, 0xf2, 0xfd, 0xff, 0x5e, 0x2f, 0x3b, 0xba, - 0x7e, 0xff, 0xff, 0xfe, 0xf7, 0xff, 0xdd, 0xff, - 0xfd, 0xdf, 0xfb, 0xfe, 0x9d, 0xb4, 0xd3, 0xff, - 0xef, 0xff, 0xdf, 0xf7, 0x7f, 0xb7, 0xfd, 0xd5, - 0xa5, 0x77, 0x40, 0xff, 0x9c, 0xc1, 0x41, 0x2c, - 0x08, 0x20, 0x41, 0x00, 0x50, 0x40, 0x00, 0x80, - // Entry C0 - FF - 0xfb, 0x4a, 0xf2, 0x9f, 0xb4, 0x42, 0x41, 0x96, - 0x1b, 0x14, 0x08, 0xf2, 0x2b, 0xe7, 0x17, 0x56, - 0x05, 0x7d, 0x0e, 0x1c, 0x37, 0x71, 0xf3, 0xef, - 0x97, 0xff, 0x5d, 0x38, 0x64, 0x08, 0x00, 0x10, - 0xbc, 0x85, 0xaf, 0xdf, 0xff, 0xf7, 0x73, 0x35, - 0x3e, 0x87, 0xc7, 0xdf, 0xff, 0x00, 0x81, 0x00, - 0xb0, 0x05, 0x80, 0x00, 0x00, 0x00, 0x00, 0x03, - 0x40, 0x00, 0x40, 0x92, 0x21, 0x50, 0xb1, 0x5d, - // Entry 100 - 13F - 0xfd, 0xdc, 0xbe, 0x5e, 0x00, 0x00, 0x02, 0x64, - 0x0d, 0x19, 0x41, 0xdf, 0x79, 0x22, 0x00, 0x00, - 0x00, 0x5e, 0x64, 0xdc, 0x24, 0xe5, 0xd9, 0xe3, - 0xfe, 0xff, 0xfd, 0xcb, 0x9f, 0x14, 0x01, 0x0c, - 0x86, 0x00, 0xd1, 0x00, 0xf0, 0xc5, 0x67, 0x5f, - 0x56, 0x89, 0x5e, 0xb5, 0x6c, 0xaf, 0x03, 0x00, - 0x02, 0x00, 0x00, 0x00, 0xc0, 0x37, 0xda, 0x56, - 0x90, 0x69, 0x01, 0x2c, 0x96, 0x69, 0x20, 0xfb, - // Entry 140 - 17F - 0xff, 0x3f, 0x00, 0x00, 0x00, 0x01, 0x08, 0x16, - 0x01, 0x00, 0x00, 0xb0, 0x14, 0x03, 0x50, 0x06, - 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x11, 0x09, - 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x10, - 0x00, 0x00, 0x44, 0x00, 0x00, 0x10, 0x00, 0x04, - 0x08, 0x00, 0x00, 0x04, 0x00, 0x80, 0x28, 0x04, - 0x00, 0x00, 0x40, 0xd5, 0x2d, 0x00, 0x64, 0x35, - 0x24, 0x52, 0xf4, 0xd4, 0xbd, 0x62, 0xc9, 0x03, - // Entry 180 - 1BF - 0x00, 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x13, 0x39, 0x01, 0xdd, 0x57, 0x98, - 0x21, 0x18, 0x81, 0x00, 0x00, 0x01, 0x40, 0x82, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x40, 0x00, 0x44, 0x00, 0x00, 0x80, 0xea, - 0xa9, 0x39, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - // Entry 1C0 - 1FF - 0x00, 0x01, 0x28, 0x05, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x20, 0x04, 0xa6, 0x00, 0x04, 0x00, 0x00, - 0x81, 0x50, 0x00, 0x00, 0x00, 0x11, 0x84, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x55, - 0x02, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x40, - 0x30, 0x83, 0x01, 0x00, 0x00, 0x00, 0x11, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x1e, 0xcd, 0xbf, 0x7a, 0xbf, - // Entry 200 - 23F - 0xdf, 0xc3, 0x83, 0x82, 0xc0, 0xfb, 0x57, 0x27, - 0xcd, 0x55, 0xe7, 0x01, 0x00, 0x20, 0xb2, 0xc5, - 0xa4, 0x45, 0x25, 0x9b, 0x02, 0xdf, 0xe0, 0xdf, - 0x03, 0x44, 0x08, 0x10, 0x01, 0x04, 0x01, 0xe3, - 0x92, 0x54, 0xdb, 0x28, 0xd1, 0x5f, 0xf6, 0x6d, - 0x79, 0xed, 0x1c, 0x7d, 0x04, 0x08, 0x00, 0x01, - 0x21, 0x12, 0x64, 0x5f, 0xdd, 0x0e, 0x85, 0x4f, - 0x40, 0x40, 0x00, 0x04, 0xf1, 0xfd, 0x3d, 0x54, - // Entry 240 - 27F - 0xe8, 0x03, 0xb4, 0x27, 0x23, 0x0d, 0x00, 0x00, - 0x20, 0x7b, 0x38, 0x02, 0x05, 0x84, 0x00, 0xf0, - 0xbb, 0x7e, 0x5a, 0x00, 0x18, 0x04, 0x81, 0x00, - 0x00, 0x00, 0x80, 0x10, 0x90, 0x1c, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, 0x00, 0x04, - 0x08, 0xa0, 0x70, 0xa5, 0x0c, 0x40, 0x00, 0x00, - 0x11, 0x04, 0x04, 0x68, 0x00, 0x20, 0x70, 0xff, - 0x7b, 0x7f, 0x60, 0x00, 0x05, 0x9b, 0xdd, 0x66, - // Entry 280 - 2BF - 0x03, 0x00, 0x11, 0x00, 0x00, 0x00, 0x40, 0x05, - 0xb5, 0xb6, 0x80, 0x08, 0x04, 0x00, 0x04, 0x51, - 0xe2, 0xef, 0xfd, 0x3f, 0x05, 0x09, 0x08, 0x05, - 0x40, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x60, - 0xe7, 0x48, 0x00, 0x81, 0x20, 0xc0, 0x05, 0x80, - 0x03, 0x00, 0x00, 0x00, 0x8c, 0x50, 0x40, 0x04, - 0x84, 0x47, 0x84, 0x40, 0x20, 0x10, 0x00, 0x20, - // Entry 2C0 - 2FF - 0x02, 0x50, 0x80, 0x11, 0x00, 0x91, 0x6c, 0xe2, - 0x50, 0x27, 0x1d, 0x11, 0x29, 0x06, 0x59, 0xe9, - 0x33, 0x08, 0x00, 0x20, 0x04, 0x40, 0x10, 0x00, - 0x00, 0x00, 0x50, 0x44, 0x92, 0x49, 0xd6, 0x5d, - 0xa7, 0x81, 0x47, 0x97, 0xfb, 0x00, 0x10, 0x00, - 0x08, 0x00, 0x80, 0x00, 0x40, 0x04, 0x00, 0x01, - 0x02, 0x00, 0x01, 0x40, 0x80, 0x00, 0x00, 0x08, - 0xd8, 0xeb, 0xf6, 0x39, 0xc4, 0x89, 0x12, 0x00, - // Entry 300 - 33F - 0x00, 0x0c, 0x04, 0x01, 0x20, 0x20, 0xdd, 0xa0, - 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, - 0x04, 0x10, 0xd0, 0x9d, 0x95, 0x13, 0x04, 0x80, - 0x00, 0x01, 0xd0, 0x12, 0x40, 0x00, 0x10, 0xb0, - 0x10, 0x62, 0x4c, 0xd2, 0x02, 0x01, 0x4a, 0x00, - 0x46, 0x04, 0x00, 0x08, 0x02, 0x00, 0x20, 0x80, - 0x00, 0x80, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x00, 0xf0, 0xd8, 0x6f, 0x15, 0x02, 0x08, 0x00, - // Entry 340 - 37F - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, - 0x00, 0x10, 0x00, 0x00, 0x00, 0xf0, 0x84, 0xe3, - 0xdd, 0xbf, 0xf9, 0xf9, 0x3b, 0x7f, 0x7f, 0xdb, - 0xfd, 0xfc, 0xfe, 0xdf, 0xff, 0xfd, 0xff, 0xf6, - 0xfb, 0xfc, 0xf7, 0x1f, 0xff, 0xb3, 0x6c, 0xff, - 0xd9, 0xad, 0xdf, 0xfe, 0xef, 0xba, 0xdf, 0xff, - 0xff, 0xff, 0xb7, 0xdd, 0x7d, 0xbf, 0xab, 0x7f, - 0xfd, 0xfd, 0xdf, 0x2f, 0x9c, 0xdf, 0xf3, 0x6f, - // Entry 380 - 3BF - 0xdf, 0xdd, 0xff, 0xfb, 0xee, 0xd2, 0xab, 0x5f, - 0xd5, 0xdf, 0x7f, 0xff, 0xeb, 0xff, 0xe4, 0x4d, - 0xf9, 0xff, 0xfe, 0xf7, 0xfd, 0xdf, 0xfb, 0xbf, - 0xee, 0xdb, 0x6f, 0xef, 0xff, 0x7f, 0xff, 0xff, - 0xf7, 0x5f, 0xd3, 0x3b, 0xfd, 0xd9, 0xdf, 0xeb, - 0xbc, 0x08, 0x05, 0x24, 0xff, 0x07, 0x70, 0xfe, - 0xe6, 0x5e, 0x00, 0x08, 0x00, 0x83, 0x3d, 0x1b, - 0x06, 0xe6, 0x72, 0x60, 0xd1, 0x3c, 0x7f, 0x44, - // Entry 3C0 - 3FF - 0x02, 0x30, 0x9f, 0x7a, 0x16, 0xbd, 0x7f, 0x57, - 0xf2, 0xff, 0x31, 0xff, 0xf2, 0x1e, 0x90, 0xf7, - 0xf1, 0xf9, 0x45, 0x80, 0x01, 0x02, 0x00, 0x00, - 0x40, 0x54, 0x9f, 0x8a, 0xd9, 0xd9, 0x0e, 0x11, - 0x86, 0x51, 0xc0, 0xf3, 0xfb, 0x47, 0x00, 0x01, - 0x05, 0xd1, 0x50, 0x58, 0x00, 0x00, 0x00, 0x10, - 0x04, 0x02, 0x00, 0x00, 0x0a, 0x00, 0x17, 0xd2, - 0xb9, 0xfd, 0xfc, 0xba, 0xfe, 0xef, 0xc7, 0xbe, - // Entry 400 - 43F - 0x53, 0x6f, 0xdf, 0xe7, 0xdb, 0x65, 0xbb, 0x7f, - 0xfa, 0xff, 0x77, 0xf3, 0xef, 0xbf, 0xfd, 0xf7, - 0xdf, 0xdf, 0x9b, 0x7f, 0xff, 0xff, 0x7f, 0x6f, - 0xf7, 0xfb, 0xeb, 0xdf, 0xbc, 0xff, 0xbf, 0x6b, - 0x7b, 0xfb, 0xff, 0xce, 0x76, 0xbd, 0xf7, 0xf7, - 0xdf, 0xdc, 0xf7, 0xf7, 0xff, 0xdf, 0xf3, 0xfe, - 0xef, 0xff, 0xff, 0xff, 0xb6, 0x7f, 0x7f, 0xde, - 0xf7, 0xb9, 0xeb, 0x77, 0xff, 0xfb, 0xbf, 0xdf, - // Entry 440 - 47F - 0xfd, 0xfe, 0xfb, 0xff, 0xfe, 0xeb, 0x1f, 0x7d, - 0x2f, 0xfd, 0xb6, 0xb5, 0xa5, 0xfc, 0xff, 0xfd, - 0x7f, 0x4e, 0xbf, 0x8f, 0xae, 0xff, 0xee, 0xdf, - 0x7f, 0xf7, 0x73, 0x02, 0x02, 0x04, 0xfc, 0xf7, - 0xff, 0xb7, 0xd7, 0xef, 0xfe, 0xcd, 0xf5, 0xce, - 0xe2, 0x8e, 0xe7, 0xbf, 0xb7, 0xff, 0x56, 0xbd, - 0xcd, 0xff, 0xfb, 0xff, 0xdf, 0xd7, 0xea, 0xff, - 0xe5, 0x5f, 0x6d, 0x0f, 0xa7, 0x51, 0x06, 0xc4, - // Entry 480 - 4BF - 0x13, 0x50, 0x5d, 0xaf, 0xa6, 0xfd, 0x99, 0xfb, - 0x63, 0x1d, 0x53, 0xff, 0xef, 0xb7, 0x35, 0x20, - 0x14, 0x00, 0x55, 0x51, 0x82, 0x65, 0xf5, 0x41, - 0xe2, 0xff, 0xfc, 0xdf, 0x00, 0x05, 0xc5, 0x05, - 0x00, 0x22, 0x00, 0x74, 0x69, 0x10, 0x08, 0x04, - 0x41, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x51, 0x20, 0x05, 0x04, 0x01, 0x00, 0x00, - 0x06, 0x01, 0x20, 0x00, 0x18, 0x01, 0x92, 0xb1, - // Entry 4C0 - 4FF - 0xfd, 0x47, 0x49, 0x06, 0x95, 0x06, 0x57, 0xed, - 0xfb, 0x4c, 0x1c, 0x6b, 0x83, 0x04, 0x62, 0x40, - 0x00, 0x11, 0x42, 0x00, 0x00, 0x00, 0x54, 0x83, - 0xb8, 0x4f, 0x10, 0x8c, 0x89, 0x46, 0xde, 0xf7, - 0x13, 0x31, 0x00, 0x20, 0x00, 0x00, 0x00, 0x90, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x10, 0x00, - 0x01, 0x00, 0x00, 0xf0, 0x5b, 0xf4, 0xbe, 0x3d, - 0xba, 0xcf, 0xf7, 0xaf, 0x42, 0x04, 0x84, 0x41, - // Entry 500 - 53F - 0x30, 0xff, 0x79, 0x72, 0x04, 0x00, 0x00, 0x49, - 0x2d, 0x14, 0x27, 0x57, 0xed, 0xf1, 0x3f, 0xe7, - 0x3f, 0x00, 0x00, 0x02, 0xc6, 0xa0, 0x1e, 0xf8, - 0xbb, 0xff, 0xfd, 0xfb, 0xb7, 0xfd, 0xe5, 0xf7, - 0xfd, 0xfc, 0xd5, 0xed, 0x47, 0xf4, 0x7e, 0x10, - 0x01, 0x01, 0x84, 0x6d, 0xff, 0xf7, 0xdd, 0xf9, - 0x5b, 0x05, 0x86, 0xed, 0xf5, 0x77, 0xbd, 0x3c, - 0x00, 0x00, 0x00, 0x42, 0x71, 0x42, 0x00, 0x40, - // Entry 540 - 57F - 0x00, 0x00, 0x01, 0x43, 0x19, 0x00, 0x08, 0x00, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - // Entry 580 - 5BF - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xab, 0xbd, 0xe7, 0x57, 0xee, 0x13, 0x5d, - 0x09, 0xc1, 0x40, 0x21, 0xfa, 0x17, 0x01, 0x80, - 0x00, 0x00, 0x00, 0x00, 0xf0, 0xce, 0xfb, 0xbf, - 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, - 0x00, 0x30, 0x15, 0xa3, 0x10, 0x00, 0x00, 0x00, - 0x11, 0x04, 0x16, 0x00, 0x00, 0x02, 0x00, 0x81, - 0xa3, 0x01, 0x50, 0x00, 0x00, 0x83, 0x11, 0x40, - // Entry 5C0 - 5FF - 0x00, 0x00, 0x00, 0xf0, 0xdd, 0x7b, 0x3e, 0x02, - 0xaa, 0x10, 0x5d, 0x98, 0x52, 0x00, 0x80, 0x20, - 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x02, - 0x19, 0x00, 0x10, 0x02, 0x10, 0x61, 0x5a, 0x9d, - 0x31, 0x00, 0x00, 0x00, 0x01, 0x10, 0x02, 0x20, - 0x00, 0x00, 0x01, 0x00, 0x42, 0x00, 0x20, 0x00, - 0x00, 0x1f, 0xdf, 0xd2, 0xb9, 0xff, 0xfd, 0x3f, - 0x1f, 0x98, 0xcf, 0x9c, 0xbf, 0xaf, 0x5f, 0xfe, - // Entry 600 - 63F - 0x7b, 0x4b, 0x40, 0x10, 0xe1, 0xfd, 0xaf, 0xd9, - 0xb7, 0xf6, 0xfb, 0xb3, 0xc7, 0xff, 0x6f, 0xf1, - 0x73, 0xb1, 0x7f, 0x9f, 0x7f, 0xbd, 0xfc, 0xb7, - 0xee, 0x1c, 0xfa, 0xcb, 0xef, 0xdd, 0xf9, 0xbd, - 0x6e, 0xae, 0x55, 0xfd, 0x6e, 0x81, 0x76, 0x1f, - 0xd4, 0x77, 0xf5, 0x7d, 0xfb, 0xff, 0xeb, 0xfe, - 0xbe, 0x5f, 0x46, 0x1b, 0xe9, 0x5f, 0x50, 0x18, - 0x02, 0xfa, 0xf7, 0x9d, 0x15, 0x97, 0x05, 0x0f, - // Entry 640 - 67F - 0x75, 0xc4, 0x7d, 0x81, 0x92, 0xf1, 0x57, 0x6c, - 0xff, 0xe4, 0xef, 0x6f, 0xff, 0xfc, 0xdd, 0xde, - 0xfc, 0xfd, 0x76, 0x5f, 0x7a, 0x1f, 0x00, 0x98, - 0x02, 0xfb, 0xa3, 0xef, 0xf3, 0xd6, 0xf2, 0xff, - 0xb9, 0xda, 0x7d, 0x50, 0x1e, 0x15, 0x7b, 0xb4, - 0xf5, 0x3e, 0xff, 0xff, 0xf1, 0xf7, 0xff, 0xe7, - 0x5f, 0xff, 0xff, 0x9e, 0xdb, 0xf6, 0xd7, 0xb9, - 0xef, 0x27, 0x80, 0xbb, 0xc5, 0xff, 0xff, 0xe3, - // Entry 680 - 6BF - 0x97, 0x9d, 0xbf, 0x9f, 0xf7, 0xc7, 0xfd, 0x37, - 0xce, 0x7f, 0x04, 0x1d, 0x53, 0x7f, 0xf8, 0xda, - 0x5d, 0xce, 0x7d, 0x06, 0xb9, 0xea, 0x69, 0xa0, - 0x1a, 0x20, 0x00, 0x30, 0x02, 0x04, 0x24, 0x08, - 0x04, 0x00, 0x00, 0x40, 0xd4, 0x02, 0x04, 0x00, - 0x00, 0x04, 0x00, 0x04, 0x00, 0x20, 0x01, 0x06, - 0x50, 0x00, 0x08, 0x00, 0x00, 0x00, 0x24, 0x00, - 0x04, 0x00, 0x10, 0xcc, 0x58, 0xd5, 0x0d, 0x0f, - // Entry 6C0 - 6FF - 0x14, 0x4d, 0xf1, 0x16, 0x44, 0xd1, 0x42, 0x08, - 0x40, 0x00, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00, - 0x00, 0xdc, 0xfb, 0xcb, 0x0e, 0x58, 0x08, 0x41, - 0x04, 0x20, 0x04, 0x00, 0x30, 0x12, 0x40, 0x00, - 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x80, 0x10, 0x10, 0xab, - 0x6d, 0x93, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x80, 0x25, 0x00, 0x00, - // Entry 700 - 73F - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, - 0x80, 0x86, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x01, - 0xdf, 0x18, 0x00, 0x00, 0x02, 0xf0, 0xfd, 0x79, - 0x3b, 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, - 0x03, 0x00, 0x09, 0x20, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry 740 - 77F - 0x00, 0x00, 0x00, 0xef, 0xd5, 0xfd, 0xcf, 0x7e, - 0xb0, 0x11, 0x00, 0x00, 0x00, 0x92, 0x01, 0x44, - 0xcd, 0xf9, 0x5c, 0x00, 0x01, 0x00, 0x30, 0x04, - 0x04, 0x55, 0x00, 0x01, 0x04, 0xf4, 0x3f, 0x4a, - 0x01, 0x00, 0x00, 0xb0, 0x80, 0x00, 0x55, 0x55, - 0x97, 0x7c, 0x9f, 0x31, 0xcc, 0x68, 0xd1, 0x03, - 0xd5, 0x57, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x2c, 0xf7, 0xcb, 0x1f, 0x14, 0x60, - // Entry 780 - 7BF - 0x03, 0x68, 0x01, 0x10, 0x8b, 0x38, 0x8a, 0x01, - 0x00, 0x00, 0x20, 0x00, 0x24, 0x44, 0x00, 0x00, - 0x10, 0x03, 0x11, 0x02, 0x01, 0x00, 0x00, 0xf0, - 0xf5, 0xff, 0xd5, 0x97, 0xbc, 0x70, 0xd6, 0x78, - 0x78, 0x15, 0x50, 0x01, 0xa4, 0x84, 0xa9, 0x41, - 0x00, 0x00, 0x00, 0x6b, 0x39, 0x52, 0x74, 0x00, - 0xe8, 0x30, 0x90, 0x6a, 0x92, 0x00, 0x00, 0x02, - 0xff, 0xef, 0xff, 0x4b, 0x85, 0x53, 0xf4, 0xed, - // Entry 7C0 - 7FF - 0xdd, 0xbf, 0x72, 0x19, 0xc7, 0x0c, 0xd5, 0x42, - 0x54, 0xdd, 0x77, 0x14, 0x00, 0x80, 0x40, 0x56, - 0xcc, 0x16, 0x9e, 0xea, 0x35, 0x7d, 0xef, 0xff, - 0xbd, 0xa4, 0xaf, 0x01, 0x44, 0x18, 0x01, 0x4d, - 0x4e, 0x4a, 0x08, 0x50, 0x28, 0x30, 0xe0, 0x80, - 0x10, 0x20, 0x24, 0x00, 0xff, 0x2f, 0xd3, 0x60, - 0xfe, 0x01, 0x02, 0x88, 0x0a, 0x40, 0x16, 0x01, - 0x01, 0x15, 0x2b, 0x3c, 0x01, 0x00, 0x00, 0x10, - // Entry 800 - 83F - 0x90, 0x49, 0x41, 0x02, 0x02, 0x01, 0xe1, 0xbf, - 0xbf, 0x03, 0x00, 0x00, 0x10, 0xd4, 0xa3, 0xd1, - 0x40, 0x9c, 0x44, 0xdf, 0xf5, 0x8f, 0x66, 0xb3, - 0x55, 0x20, 0xd4, 0xc1, 0xd8, 0x30, 0x3d, 0x80, - 0x00, 0x00, 0x00, 0x04, 0xd4, 0x11, 0xc5, 0x84, - 0x2e, 0x50, 0x00, 0x22, 0x50, 0x6e, 0xbd, 0x93, - 0x07, 0x00, 0x20, 0x10, 0x84, 0xb2, 0x45, 0x10, - 0x06, 0x44, 0x00, 0x00, 0x12, 0x02, 0x11, 0x00, - // Entry 840 - 87F - 0xf0, 0xfb, 0xfd, 0x3f, 0x05, 0x00, 0x12, 0x81, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x03, 0x30, 0x02, 0x28, - 0x84, 0x00, 0x21, 0xc0, 0x23, 0x24, 0x00, 0x00, - 0x00, 0xcb, 0xe4, 0x3a, 0x42, 0x88, 0x14, 0xf1, - 0xef, 0xff, 0x7f, 0x12, 0x01, 0x01, 0x84, 0x50, - 0x07, 0xfc, 0xff, 0xff, 0x0f, 0x01, 0x00, 0x40, - 0x10, 0x38, 0x01, 0x01, 0x1c, 0x12, 0x40, 0xe1, - // Entry 880 - 8BF - 0x76, 0x16, 0x08, 0x03, 0x10, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x24, - 0x0a, 0x00, 0x80, 0x00, 0x00, -} - -// altLangISO3 holds an alphabetically sorted list of 3-letter language code alternatives -// to 2-letter language codes that cannot be derived using the method described above. -// Each 3-letter code is followed by its 1-byte langID. -const altLangISO3 tag.Index = "---\x00cor\x00hbs\x01heb\x02kin\x03spa\x04yid\x05\xff\xff\xff\xff" - -// altLangIndex is used to convert indexes in altLangISO3 to langIDs. -// Size: 12 bytes, 6 elements -var altLangIndex = [6]uint16{ - 0x0281, 0x0407, 0x01fb, 0x03e5, 0x013e, 0x0208, -} - -// AliasMap maps langIDs to their suggested replacements. -// Size: 656 bytes, 164 elements -var AliasMap = [164]FromTo{ - 0: {From: 0x82, To: 0x88}, - 1: {From: 0x187, To: 0x1ae}, - 2: {From: 0x1f3, To: 0x1e1}, - 3: {From: 0x1fb, To: 0x1bc}, - 4: {From: 0x208, To: 0x512}, - 5: {From: 0x20f, To: 0x20e}, - 6: {From: 0x310, To: 0x3dc}, - 7: {From: 0x347, To: 0x36f}, - 8: {From: 0x407, To: 0x432}, - 9: {From: 0x47a, To: 0x153}, - 10: {From: 0x490, To: 0x451}, - 11: {From: 0x4a2, To: 0x21}, - 12: {From: 0x53e, To: 0x544}, - 13: {From: 0x58f, To: 0x12d}, - 14: {From: 0x630, To: 0x1eb1}, - 15: {From: 0x651, To: 0x431}, - 16: {From: 0x662, To: 0x431}, - 17: {From: 0x6ed, To: 0x3a}, - 18: {From: 0x6f8, To: 0x1d7}, - 19: {From: 0x73e, To: 0x21a1}, - 20: {From: 0x7b3, To: 0x56}, - 21: {From: 0x7b9, To: 0x299b}, - 22: {From: 0x7c5, To: 0x58}, - 23: {From: 0x7e6, To: 0x145}, - 24: {From: 0x80c, To: 0x5a}, - 25: {From: 0x815, To: 0x8d}, - 26: {From: 0x87e, To: 0x810}, - 27: {From: 0x8c3, To: 0xee3}, - 28: {From: 0x9ef, To: 0x331}, - 29: {From: 0xa36, To: 0x2c5}, - 30: {From: 0xa3d, To: 0xbf}, - 31: {From: 0xabe, To: 0x3322}, - 32: {From: 0xb38, To: 0x529}, - 33: {From: 0xb75, To: 0x265a}, - 34: {From: 0xb7e, To: 0xbc3}, - 35: {From: 0xb9b, To: 0x44e}, - 36: {From: 0xbbc, To: 0x4229}, - 37: {From: 0xbbf, To: 0x529}, - 38: {From: 0xbfe, To: 0x2da7}, - 39: {From: 0xc2e, To: 0x3181}, - 40: {From: 0xcb9, To: 0xf3}, - 41: {From: 0xd08, To: 0xfa}, - 42: {From: 0xdc8, To: 0x11a}, - 43: {From: 0xdd7, To: 0x32d}, - 44: {From: 0xdf8, To: 0xdfb}, - 45: {From: 0xdfe, To: 0x531}, - 46: {From: 0xedf, To: 0x205a}, - 47: {From: 0xeee, To: 0x2e9a}, - 48: {From: 0xf39, To: 0x367}, - 49: {From: 0x10d0, To: 0x140}, - 50: {From: 0x1104, To: 0x2d0}, - 51: {From: 0x11a0, To: 0x1ec}, - 52: {From: 0x1279, To: 0x21}, - 53: {From: 0x1424, To: 0x15e}, - 54: {From: 0x1470, To: 0x14e}, - 55: {From: 0x151f, To: 0xd9b}, - 56: {From: 0x1523, To: 0x390}, - 57: {From: 0x1532, To: 0x19f}, - 58: {From: 0x1580, To: 0x210}, - 59: {From: 0x1583, To: 0x10d}, - 60: {From: 0x15a3, To: 0x3caf}, - 61: {From: 0x166a, To: 0x19b}, - 62: {From: 0x16c8, To: 0x136}, - 63: {From: 0x1700, To: 0x29f8}, - 64: {From: 0x1718, To: 0x194}, - 65: {From: 0x1727, To: 0xf3f}, - 66: {From: 0x177a, To: 0x178}, - 67: {From: 0x1809, To: 0x17b6}, - 68: {From: 0x1816, To: 0x18f3}, - 69: {From: 0x188a, To: 0x436}, - 70: {From: 0x1979, To: 0x1d01}, - 71: {From: 0x1a74, To: 0x2bb0}, - 72: {From: 0x1a8a, To: 0x1f8}, - 73: {From: 0x1b5a, To: 0x1fa}, - 74: {From: 0x1b86, To: 0x1515}, - 75: {From: 0x1d64, To: 0x2c9b}, - 76: {From: 0x2038, To: 0x37b1}, - 77: {From: 0x203d, To: 0x20dd}, - 78: {From: 0x205a, To: 0x30b}, - 79: {From: 0x20e3, To: 0x274}, - 80: {From: 0x20ee, To: 0x263}, - 81: {From: 0x20f2, To: 0x22d}, - 82: {From: 0x20f9, To: 0x256}, - 83: {From: 0x210f, To: 0x21eb}, - 84: {From: 0x2135, To: 0x27d}, - 85: {From: 0x2160, To: 0x913}, - 86: {From: 0x2199, To: 0x121}, - 87: {From: 0x21ce, To: 0x1561}, - 88: {From: 0x21e6, To: 0x504}, - 89: {From: 0x21f4, To: 0x49f}, - 90: {From: 0x222d, To: 0x121}, - 91: {From: 0x2237, To: 0x121}, - 92: {From: 0x2262, To: 0x92a}, - 93: {From: 0x2316, To: 0x3226}, - 94: {From: 0x2382, To: 0x3365}, - 95: {From: 0x2472, To: 0x2c7}, - 96: {From: 0x24e4, To: 0x2ff}, - 97: {From: 0x24f0, To: 0x2fa}, - 98: {From: 0x24fa, To: 0x31f}, - 99: {From: 0x2550, To: 0xb5b}, - 100: {From: 0x25a9, To: 0xe2}, - 101: {From: 0x263e, To: 0x2d0}, - 102: {From: 0x26c9, To: 0x26b4}, - 103: {From: 0x26f9, To: 0x3c8}, - 104: {From: 0x2727, To: 0x3caf}, - 105: {From: 0x2765, To: 0x26b4}, - 106: {From: 0x2789, To: 0x4358}, - 107: {From: 0x28ef, To: 0x2837}, - 108: {From: 0x2914, To: 0x351}, - 109: {From: 0x2986, To: 0x2da7}, - 110: {From: 0x2b1a, To: 0x38d}, - 111: {From: 0x2bfc, To: 0x395}, - 112: {From: 0x2c3f, To: 0x3caf}, - 113: {From: 0x2cfc, To: 0x3be}, - 114: {From: 0x2d13, To: 0x597}, - 115: {From: 0x2d47, To: 0x148}, - 116: {From: 0x2d48, To: 0x148}, - 117: {From: 0x2dff, To: 0x2f1}, - 118: {From: 0x2e08, To: 0x19cc}, - 119: {From: 0x2e1a, To: 0x2d95}, - 120: {From: 0x2e21, To: 0x292}, - 121: {From: 0x2e54, To: 0x7d}, - 122: {From: 0x2e65, To: 0x2282}, - 123: {From: 0x2ea0, To: 0x2e9b}, - 124: {From: 0x2eef, To: 0x2ed7}, - 125: {From: 0x3193, To: 0x3c4}, - 126: {From: 0x3366, To: 0x338e}, - 127: {From: 0x342a, To: 0x3dc}, - 128: {From: 0x34ee, To: 0x18d0}, - 129: {From: 0x35c8, To: 0x2c9b}, - 130: {From: 0x35e6, To: 0x412}, - 131: {From: 0x3658, To: 0x246}, - 132: {From: 0x3676, To: 0x3f4}, - 133: {From: 0x36fd, To: 0x445}, - 134: {From: 0x37c0, To: 0x121}, - 135: {From: 0x3816, To: 0x38f2}, - 136: {From: 0x382b, To: 0x2c9b}, - 137: {From: 0x382f, To: 0xa9}, - 138: {From: 0x3832, To: 0x3228}, - 139: {From: 0x386c, To: 0x39a6}, - 140: {From: 0x3892, To: 0x3fc0}, - 141: {From: 0x38a5, To: 0x39d7}, - 142: {From: 0x38b4, To: 0x1fa4}, - 143: {From: 0x38b5, To: 0x2e9a}, - 144: {From: 0x395c, To: 0x47e}, - 145: {From: 0x3b4e, To: 0xd91}, - 146: {From: 0x3b78, To: 0x137}, - 147: {From: 0x3c99, To: 0x4bc}, - 148: {From: 0x3fbd, To: 0x100}, - 149: {From: 0x4208, To: 0xa91}, - 150: {From: 0x42be, To: 0x573}, - 151: {From: 0x42f9, To: 0x3f60}, - 152: {From: 0x4378, To: 0x25a}, - 153: {From: 0x43cb, To: 0x36cb}, - 154: {From: 0x43cd, To: 0x10f}, - 155: {From: 0x44af, To: 0x3322}, - 156: {From: 0x44e3, To: 0x512}, - 157: {From: 0x45ca, To: 0x2409}, - 158: {From: 0x45dd, To: 0x26dc}, - 159: {From: 0x4610, To: 0x48ae}, - 160: {From: 0x46ae, To: 0x46a0}, - 161: {From: 0x473e, To: 0x4745}, - 162: {From: 0x4916, To: 0x31f}, - 163: {From: 0x49a7, To: 0x523}, -} - -// Size: 164 bytes, 164 elements -var AliasTypes = [164]AliasType{ - // Entry 0 - 3F - 1, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 1, 0, 0, 1, 2, - 1, 1, 2, 0, 1, 0, 1, 2, 1, 1, 0, 0, 2, 1, 1, 0, - 2, 0, 0, 1, 0, 1, 0, 0, 1, 2, 1, 1, 1, 1, 0, 0, - 2, 1, 1, 1, 1, 2, 1, 0, 1, 1, 2, 2, 0, 1, 2, 0, - // Entry 40 - 7F - 1, 0, 1, 1, 1, 1, 0, 0, 2, 1, 0, 0, 0, 0, 1, 1, - 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, - 2, 2, 2, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, - 0, 1, 0, 2, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 2, - // Entry 80 - BF - 0, 0, 2, 1, 1, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 2, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, - 0, 1, 1, 1, -} - -const ( - _Latn = 87 - _Hani = 54 - _Hans = 56 - _Hant = 57 - _Qaaa = 139 - _Qaai = 147 - _Qabx = 188 - _Zinh = 236 - _Zyyy = 241 - _Zzzz = 242 -) - -// script is an alphabetically sorted list of ISO 15924 codes. The index -// of the script in the string, divided by 4, is the internal scriptID. -const script tag.Index = "" + // Size: 976 bytes - "----AdlmAfakAghbAhomArabAranArmiArmnAvstBaliBamuBassBatkBengBhksBlisBopo" + - "BrahBraiBugiBuhdCakmCansCariChamCherCirtCoptCpmnCprtCyrlCyrsDevaDogrDsrt" + - "DuplEgydEgyhEgypElbaEthiGeokGeorGlagGongGonmGothGranGrekGujrGuruHanbHang" + - "HaniHanoHansHantHatrHebrHiraHluwHmngHmnpHrktHungIndsItalJamoJavaJpanJurc" + - "KaliKanaKharKhmrKhojKitlKitsKndaKoreKpelKthiLanaLaooLatfLatgLatnLekeLepc" + - "LimbLinaLinbLisuLomaLyciLydiMahjMakaMandManiMarcMayaMedfMendMercMeroMlym" + - "ModiMongMoonMrooMteiMultMymrNarbNbatNewaNkdbNkgbNkooNshuOgamOlckOrkhOrya" + - "OsgeOsmaPalmPaucPermPhagPhliPhlpPhlvPhnxPiqdPlrdPrtiQaaaQaabQaacQaadQaae" + - "QaafQaagQaahQaaiQaajQaakQaalQaamQaanQaaoQaapQaaqQaarQaasQaatQaauQaavQaaw" + - "QaaxQaayQaazQabaQabbQabcQabdQabeQabfQabgQabhQabiQabjQabkQablQabmQabnQabo" + - "QabpQabqQabrQabsQabtQabuQabvQabwQabxRjngRoroRunrSamrSaraSarbSaurSgnwShaw" + - "ShrdShuiSiddSindSinhSoraSoyoSundSyloSyrcSyreSyrjSyrnTagbTakrTaleTaluTaml" + - "TangTavtTeluTengTfngTglgThaaThaiTibtTirhUgarVaiiVispWaraWchoWoleXpeoXsux" + - "YiiiZanbZinhZmthZsyeZsymZxxxZyyyZzzz\xff\xff\xff\xff" - -// suppressScript is an index from langID to the dominant script for that language, -// if it exists. If a script is given, it should be suppressed from the language tag. -// Size: 1330 bytes, 1330 elements -var suppressScript = [1330]uint8{ - // Entry 0 - 3F - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry 40 - 7F - 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, - // Entry 80 - BF - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry C0 - FF - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry 100 - 13F - 0x57, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xde, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, - 0x00, 0x57, 0x00, 0x00, 0x57, 0x00, 0x57, 0x00, - // Entry 140 - 17F - 0x57, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x57, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, - 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, - 0x00, 0x57, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x57, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry 180 - 1BF - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x57, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x57, 0x32, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x21, 0x00, - // Entry 1C0 - 1FF - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x57, 0x57, 0x00, 0x57, 0x57, 0x00, 0x08, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, - 0x57, 0x57, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, - // Entry 200 - 23F - 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry 240 - 27F - 0x00, 0x00, 0x1f, 0x00, 0x00, 0x57, 0x00, 0x00, - 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x4f, 0x00, 0x00, 0x50, 0x00, 0x21, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry 280 - 2BF - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, - 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry 2C0 - 2FF - 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, - // Entry 300 - 33F - 0x00, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x57, - 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, - // Entry 340 - 37F - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, - 0x57, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x57, 0x00, - 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry 380 - 3BF - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x57, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, - // Entry 3C0 - 3FF - 0x57, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, - 0x00, 0x57, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1f, 0x00, 0x00, 0x57, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry 400 - 43F - 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x57, 0x00, - 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, - // Entry 440 - 47F - 0x00, 0x00, 0x00, 0x00, 0x57, 0x57, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xda, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x29, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x57, 0x00, - // Entry 480 - 4BF - 0x57, 0x00, 0x57, 0x00, 0x00, 0x00, 0x57, 0x00, - 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x57, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry 4C0 - 4FF - 0x57, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry 500 - 53F - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, - 0x00, 0x00, -} - -const ( - _001 = 1 - _419 = 31 - _BR = 65 - _CA = 73 - _ES = 110 - _GB = 123 - _MD = 188 - _PT = 238 - _UK = 306 - _US = 309 - _ZZ = 357 - _XA = 323 - _XC = 325 - _XK = 333 -) - -// isoRegionOffset needs to be added to the index of regionISO to obtain the regionID -// for 2-letter ISO codes. (The first isoRegionOffset regionIDs are reserved for -// the UN.M49 codes used for groups.) -const isoRegionOffset = 32 - -// regionTypes defines the status of a region for various standards. -// Size: 358 bytes, 358 elements -var regionTypes = [358]uint8{ - // Entry 0 - 3F - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - // Entry 40 - 7F - 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x04, - 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, - 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, - 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, - 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - // Entry 80 - BF - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x00, 0x04, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - // Entry C0 - FF - 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, - 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x04, 0x06, - 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, - 0x06, 0x06, 0x00, 0x06, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - // Entry 100 - 13F - 0x05, 0x05, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x02, 0x06, 0x04, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, - // Entry 140 - 17F - 0x06, 0x00, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x06, 0x06, - 0x04, 0x06, 0x06, 0x04, 0x06, 0x05, -} - -// regionISO holds a list of alphabetically sorted 2-letter ISO region codes. -// Each 2-letter codes is followed by two bytes with the following meaning: -// - [A-Z}{2}: the first letter of the 2-letter code plus these two -// letters form the 3-letter ISO code. -// - 0, n: index into altRegionISO3. -const regionISO tag.Index = "" + // Size: 1308 bytes - "AAAAACSCADNDAEREAFFGAGTGAIIAALLBAMRMANNTAOGOAQTAARRGASSMATUTAUUSAWBWAXLA" + - "AZZEBAIHBBRBBDGDBEELBFFABGGRBHHRBIDIBJENBLLMBMMUBNRNBOOLBQESBRRABSHSBTTN" + - "BUURBVVTBWWABYLRBZLZCAANCCCKCDODCFAFCGOGCHHECIIVCKOKCLHLCMMRCNHNCOOLCPPT" + - "CRRICS\x00\x00CTTECUUBCVPVCWUWCXXRCYYPCZZEDDDRDEEUDGGADJJIDKNKDMMADOOMDY" + - "HYDZZAEA ECCUEESTEGGYEHSHERRIESSPETTHEU\x00\x03EZ FIINFJJIFKLKFMSMFORO" + - "FQ\x00\x18FRRAFXXXGAABGBBRGDRDGEEOGFUFGGGYGHHAGIIBGLRLGMMBGNINGPLPGQNQGR" + - "RCGS\x00\x06GTTMGUUMGWNBGYUYHKKGHMMDHNNDHRRVHTTIHUUNHVVOIC IDDNIERLILSR" + - "IMMNINNDIOOTIQRQIRRNISSLITTAJEEYJMAMJOORJPPNJTTNKEENKGGZKHHMKIIRKM\x00" + - "\x09KNNAKP\x00\x0cKRORKWWTKY\x00\x0fKZAZLAAOLBBNLCCALIIELKKALRBRLSSOLTTU" + - "LUUXLVVALYBYMAARMCCOMDDAMENEMFAFMGDGMHHLMIIDMKKDMLLIMMMRMNNGMOACMPNPMQTQ" + - "MRRTMSSRMTLTMUUSMVDVMWWIMXEXMYYSMZOZNAAMNCCLNEERNFFKNGGANHHBNIICNLLDNOOR" + - "NPPLNQ\x00\x1eNRRUNTTZNUIUNZZLOMMNPAANPCCIPEERPFYFPGNGPHHLPKAKPLOLPM\x00" + - "\x12PNCNPRRIPSSEPTRTPUUSPWLWPYRYPZCZQAATQMMMQNNNQOOOQPPPQQQQQRRRQSSSQTTT" + - "QU\x00\x03QVVVQWWWQXXXQYYYQZZZREEURHHOROOURS\x00\x15RUUSRWWASAAUSBLBSCYC" + - "SDDNSEWESGGPSHHNSIVNSJJMSKVKSLLESMMRSNENSOOMSRURSSSDSTTPSUUNSVLVSXXMSYYR" + - "SZWZTAAATCCATDCDTF\x00\x18TGGOTHHATJJKTKKLTLLSTMKMTNUNTOONTPMPTRURTTTOTV" + - "UVTWWNTZZAUAKRUGGAUK UMMIUN USSAUYRYUZZBVAATVCCTVDDRVEENVGGBVIIRVNNMVU" + - "UTWFLFWKAKWSSMXAAAXBBBXCCCXDDDXEEEXFFFXGGGXHHHXIIIXJJJXKKKXLLLXMMMXNNNXO" + - "OOXPPPXQQQXRRRXSSSXTTTXUUUXVVVXWWWXXXXXYYYXZZZYDMDYEEMYT\x00\x1bYUUGZAAF" + - "ZMMBZRARZWWEZZZZ\xff\xff\xff\xff" - -// altRegionISO3 holds a list of 3-letter region codes that cannot be -// mapped to 2-letter codes using the default algorithm. This is a short list. -const altRegionISO3 string = "SCGQUUSGSCOMPRKCYMSPMSRBATFMYTATN" - -// altRegionIDs holds a list of regionIDs the positions of which match those -// of the 3-letter ISO codes in altRegionISO3. -// Size: 22 bytes, 11 elements -var altRegionIDs = [11]uint16{ - 0x0057, 0x0070, 0x0088, 0x00a8, 0x00aa, 0x00ad, 0x00ea, 0x0105, - 0x0121, 0x015f, 0x00dc, -} - -// Size: 80 bytes, 20 elements -var regionOldMap = [20]FromTo{ - 0: {From: 0x44, To: 0xc4}, - 1: {From: 0x58, To: 0xa7}, - 2: {From: 0x5f, To: 0x60}, - 3: {From: 0x66, To: 0x3b}, - 4: {From: 0x79, To: 0x78}, - 5: {From: 0x93, To: 0x37}, - 6: {From: 0xa3, To: 0x133}, - 7: {From: 0xc1, To: 0x133}, - 8: {From: 0xd7, To: 0x13f}, - 9: {From: 0xdc, To: 0x2b}, - 10: {From: 0xef, To: 0x133}, - 11: {From: 0xf2, To: 0xe2}, - 12: {From: 0xfc, To: 0x70}, - 13: {From: 0x103, To: 0x164}, - 14: {From: 0x12a, To: 0x126}, - 15: {From: 0x132, To: 0x7b}, - 16: {From: 0x13a, To: 0x13e}, - 17: {From: 0x141, To: 0x133}, - 18: {From: 0x15d, To: 0x15e}, - 19: {From: 0x163, To: 0x4b}, -} - -// m49 maps regionIDs to UN.M49 codes. The first isoRegionOffset entries are -// codes indicating collections of regions. -// Size: 716 bytes, 358 elements -var m49 = [358]int16{ - // Entry 0 - 3F - 0, 1, 2, 3, 5, 9, 11, 13, - 14, 15, 17, 18, 19, 21, 29, 30, - 34, 35, 39, 53, 54, 57, 61, 142, - 143, 145, 150, 151, 154, 155, 202, 419, - 958, 0, 20, 784, 4, 28, 660, 8, - 51, 530, 24, 10, 32, 16, 40, 36, - 533, 248, 31, 70, 52, 50, 56, 854, - 100, 48, 108, 204, 652, 60, 96, 68, - // Entry 40 - 7F - 535, 76, 44, 64, 104, 74, 72, 112, - 84, 124, 166, 180, 140, 178, 756, 384, - 184, 152, 120, 156, 170, 0, 188, 891, - 296, 192, 132, 531, 162, 196, 203, 278, - 276, 0, 262, 208, 212, 214, 204, 12, - 0, 218, 233, 818, 732, 232, 724, 231, - 967, 0, 246, 242, 238, 583, 234, 0, - 250, 249, 266, 826, 308, 268, 254, 831, - // Entry 80 - BF - 288, 292, 304, 270, 324, 312, 226, 300, - 239, 320, 316, 624, 328, 344, 334, 340, - 191, 332, 348, 854, 0, 360, 372, 376, - 833, 356, 86, 368, 364, 352, 380, 832, - 388, 400, 392, 581, 404, 417, 116, 296, - 174, 659, 408, 410, 414, 136, 398, 418, - 422, 662, 438, 144, 430, 426, 440, 442, - 428, 434, 504, 492, 498, 499, 663, 450, - // Entry C0 - FF - 584, 581, 807, 466, 104, 496, 446, 580, - 474, 478, 500, 470, 480, 462, 454, 484, - 458, 508, 516, 540, 562, 574, 566, 548, - 558, 528, 578, 524, 10, 520, 536, 570, - 554, 512, 591, 0, 604, 258, 598, 608, - 586, 616, 666, 612, 630, 275, 620, 581, - 585, 600, 591, 634, 959, 960, 961, 962, - 963, 964, 965, 966, 967, 968, 969, 970, - // Entry 100 - 13F - 971, 972, 638, 716, 642, 688, 643, 646, - 682, 90, 690, 729, 752, 702, 654, 705, - 744, 703, 694, 674, 686, 706, 740, 728, - 678, 810, 222, 534, 760, 748, 0, 796, - 148, 260, 768, 764, 762, 772, 626, 795, - 788, 776, 626, 792, 780, 798, 158, 834, - 804, 800, 826, 581, 0, 840, 858, 860, - 336, 670, 704, 862, 92, 850, 704, 548, - // Entry 140 - 17F - 876, 581, 882, 973, 974, 975, 976, 977, - 978, 979, 980, 981, 982, 983, 984, 985, - 986, 987, 988, 989, 990, 991, 992, 993, - 994, 995, 996, 997, 998, 720, 887, 175, - 891, 710, 894, 180, 716, 999, -} - -// m49Index gives indexes into fromM49 based on the three most significant bits -// of a 10-bit UN.M49 code. To search an UN.M49 code in fromM49, search in -// fromM49[m49Index[msb39(code)]:m49Index[msb3(code)+1]] -// for an entry where the first 7 bits match the 7 lsb of the UN.M49 code. -// The region code is stored in the 9 lsb of the indexed value. -// Size: 18 bytes, 9 elements -var m49Index = [9]int16{ - 0, 59, 108, 143, 181, 220, 259, 291, - 333, -} - -// fromM49 contains entries to map UN.M49 codes to regions. See m49Index for details. -// Size: 666 bytes, 333 elements -var fromM49 = [333]uint16{ - // Entry 0 - 3F - 0x0201, 0x0402, 0x0603, 0x0824, 0x0a04, 0x1027, 0x1205, 0x142b, - 0x1606, 0x1867, 0x1a07, 0x1c08, 0x1e09, 0x202d, 0x220a, 0x240b, - 0x260c, 0x2822, 0x2a0d, 0x302a, 0x3825, 0x3a0e, 0x3c0f, 0x3e32, - 0x402c, 0x4410, 0x4611, 0x482f, 0x4e12, 0x502e, 0x5842, 0x6039, - 0x6435, 0x6628, 0x6834, 0x6a13, 0x6c14, 0x7036, 0x7215, 0x783d, - 0x7a16, 0x8043, 0x883f, 0x8c33, 0x9046, 0x9445, 0x9841, 0xa848, - 0xac9a, 0xb509, 0xb93c, 0xc03e, 0xc838, 0xd0c4, 0xd83a, 0xe047, - 0xe8a6, 0xf052, 0xf849, 0x085a, 0x10ad, 0x184c, 0x1c17, 0x1e18, - // Entry 40 - 7F - 0x20b3, 0x2219, 0x2920, 0x2c1a, 0x2e1b, 0x3051, 0x341c, 0x361d, - 0x3853, 0x3d2e, 0x445c, 0x4c4a, 0x5454, 0x5ca8, 0x5f5f, 0x644d, - 0x684b, 0x7050, 0x7856, 0x7e90, 0x8059, 0x885d, 0x941e, 0x965e, - 0x983b, 0xa063, 0xa864, 0xac65, 0xb469, 0xbd1a, 0xc486, 0xcc6f, - 0xce6f, 0xd06d, 0xd26a, 0xd476, 0xdc74, 0xde88, 0xe473, 0xec72, - 0xf031, 0xf279, 0xf478, 0xfc7e, 0x04e5, 0x0921, 0x0c62, 0x147a, - 0x187d, 0x1c83, 0x26ed, 0x2860, 0x2c5f, 0x3060, 0x4080, 0x4881, - 0x50a7, 0x5887, 0x6082, 0x687c, 0x7085, 0x788a, 0x8089, 0x8884, - // Entry 80 - BF - 0x908c, 0x9891, 0x9c8e, 0xa138, 0xa88f, 0xb08d, 0xb892, 0xc09d, - 0xc899, 0xd095, 0xd89c, 0xe09b, 0xe896, 0xf097, 0xf89e, 0x004f, - 0x08a0, 0x10a2, 0x1cae, 0x20a1, 0x28a4, 0x30aa, 0x34ab, 0x3cac, - 0x42a5, 0x44af, 0x461f, 0x4cb0, 0x54b5, 0x58b8, 0x5cb4, 0x64b9, - 0x6cb2, 0x70b6, 0x74b7, 0x7cc6, 0x84bf, 0x8cce, 0x94d0, 0x9ccd, - 0xa4c3, 0xaccb, 0xb4c8, 0xbcc9, 0xc0cc, 0xc8cf, 0xd8bb, 0xe0c5, - 0xe4bc, 0xe6bd, 0xe8ca, 0xf0ba, 0xf8d1, 0x00e1, 0x08d2, 0x10dd, - 0x18db, 0x20d9, 0x2429, 0x265b, 0x2a30, 0x2d1b, 0x2e40, 0x30de, - // Entry C0 - FF - 0x38d3, 0x493f, 0x54e0, 0x5cd8, 0x64d4, 0x6cd6, 0x74df, 0x7cd5, - 0x84da, 0x88c7, 0x8b33, 0x8e75, 0x90c0, 0x92f0, 0x94e8, 0x9ee2, - 0xace6, 0xb0f1, 0xb8e4, 0xc0e7, 0xc8eb, 0xd0e9, 0xd8ee, 0xe08b, - 0xe526, 0xecec, 0xf4f3, 0xfd02, 0x0504, 0x0706, 0x0d07, 0x183c, - 0x1d0e, 0x26a9, 0x2826, 0x2cb1, 0x2ebe, 0x34ea, 0x3d39, 0x4513, - 0x4d18, 0x5508, 0x5d14, 0x6105, 0x650a, 0x6d12, 0x7d0d, 0x7f11, - 0x813e, 0x830f, 0x8515, 0x8d61, 0x9964, 0xa15d, 0xa86e, 0xb117, - 0xb30b, 0xb86c, 0xc10b, 0xc916, 0xd110, 0xd91d, 0xe10c, 0xe84e, - // Entry 100 - 13F - 0xf11c, 0xf524, 0xf923, 0x0122, 0x0925, 0x1129, 0x192c, 0x2023, - 0x2928, 0x312b, 0x3727, 0x391f, 0x3d2d, 0x4131, 0x4930, 0x4ec2, - 0x5519, 0x646b, 0x747b, 0x7e7f, 0x809f, 0x8298, 0x852f, 0x9135, - 0xa53d, 0xac37, 0xb536, 0xb937, 0xbd3b, 0xd940, 0xe542, 0xed5e, - 0xef5e, 0xf657, 0xfd62, 0x7c20, 0x7ef4, 0x80f5, 0x82f6, 0x84f7, - 0x86f8, 0x88f9, 0x8afa, 0x8cfb, 0x8e70, 0x90fd, 0x92fe, 0x94ff, - 0x9700, 0x9901, 0x9b43, 0x9d44, 0x9f45, 0xa146, 0xa347, 0xa548, - 0xa749, 0xa94a, 0xab4b, 0xad4c, 0xaf4d, 0xb14e, 0xb34f, 0xb550, - // Entry 140 - 17F - 0xb751, 0xb952, 0xbb53, 0xbd54, 0xbf55, 0xc156, 0xc357, 0xc558, - 0xc759, 0xc95a, 0xcb5b, 0xcd5c, 0xcf65, -} - -// Size: 1615 bytes -var variantIndex = map[string]uint8{ - "1606nict": 0x0, - "1694acad": 0x1, - "1901": 0x2, - "1959acad": 0x3, - "1994": 0x4d, - "1996": 0x4, - "abl1943": 0x5, - "akuapem": 0x6, - "alalc97": 0x4f, - "aluku": 0x7, - "ao1990": 0x8, - "arevela": 0x9, - "arevmda": 0xa, - "asante": 0xb, - "baku1926": 0xc, - "balanka": 0xd, - "barla": 0xe, - "basiceng": 0xf, - "bauddha": 0x10, - "biscayan": 0x11, - "biske": 0x48, - "bohoric": 0x12, - "boont": 0x13, - "colb1945": 0x14, - "cornu": 0x15, - "dajnko": 0x16, - "ekavsk": 0x17, - "emodeng": 0x18, - "fonipa": 0x50, - "fonnapa": 0x51, - "fonupa": 0x52, - "fonxsamp": 0x53, - "hepburn": 0x19, - "heploc": 0x4e, - "hognorsk": 0x1a, - "hsistemo": 0x1b, - "ijekavsk": 0x1c, - "itihasa": 0x1d, - "jauer": 0x1e, - "jyutping": 0x1f, - "kkcor": 0x20, - "kociewie": 0x21, - "kscor": 0x22, - "laukika": 0x23, - "lipaw": 0x49, - "luna1918": 0x24, - "metelko": 0x25, - "monoton": 0x26, - "ndyuka": 0x27, - "nedis": 0x28, - "newfound": 0x29, - "njiva": 0x4a, - "nulik": 0x2a, - "osojs": 0x4b, - "oxendict": 0x2b, - "pahawh2": 0x2c, - "pahawh3": 0x2d, - "pahawh4": 0x2e, - "pamaka": 0x2f, - "petr1708": 0x30, - "pinyin": 0x31, - "polyton": 0x32, - "puter": 0x33, - "rigik": 0x34, - "rozaj": 0x35, - "rumgr": 0x36, - "scotland": 0x37, - "scouse": 0x38, - "simple": 0x54, - "solba": 0x4c, - "sotav": 0x39, - "spanglis": 0x3a, - "surmiran": 0x3b, - "sursilv": 0x3c, - "sutsilv": 0x3d, - "tarask": 0x3e, - "uccor": 0x3f, - "ucrcor": 0x40, - "ulster": 0x41, - "unifon": 0x42, - "vaidika": 0x43, - "valencia": 0x44, - "vallader": 0x45, - "wadegile": 0x46, - "xsistemo": 0x47, -} - -// variantNumSpecialized is the number of specialized variants in variants. -const variantNumSpecialized = 79 - -// nRegionGroups is the number of region groups. -const nRegionGroups = 33 - -type likelyLangRegion struct { - lang uint16 - region uint16 -} - -// likelyScript is a lookup table, indexed by scriptID, for the most likely -// languages and regions given a script. -// Size: 976 bytes, 244 elements -var likelyScript = [244]likelyLangRegion{ - 1: {lang: 0x14e, region: 0x84}, - 3: {lang: 0x2a2, region: 0x106}, - 4: {lang: 0x1f, region: 0x99}, - 5: {lang: 0x3a, region: 0x6b}, - 7: {lang: 0x3b, region: 0x9c}, - 8: {lang: 0x1d7, region: 0x28}, - 9: {lang: 0x13, region: 0x9c}, - 10: {lang: 0x5b, region: 0x95}, - 11: {lang: 0x60, region: 0x52}, - 12: {lang: 0xb9, region: 0xb4}, - 13: {lang: 0x63, region: 0x95}, - 14: {lang: 0xa5, region: 0x35}, - 15: {lang: 0x3e9, region: 0x99}, - 17: {lang: 0x529, region: 0x12e}, - 18: {lang: 0x3b1, region: 0x99}, - 19: {lang: 0x15e, region: 0x78}, - 20: {lang: 0xc2, region: 0x95}, - 21: {lang: 0x9d, region: 0xe7}, - 22: {lang: 0xdb, region: 0x35}, - 23: {lang: 0xf3, region: 0x49}, - 24: {lang: 0x4f0, region: 0x12b}, - 25: {lang: 0xe7, region: 0x13e}, - 26: {lang: 0xe5, region: 0x135}, - 28: {lang: 0xf1, region: 0x6b}, - 30: {lang: 0x1a0, region: 0x5d}, - 31: {lang: 0x3e2, region: 0x106}, - 33: {lang: 0x1be, region: 0x99}, - 36: {lang: 0x15e, region: 0x78}, - 39: {lang: 0x133, region: 0x6b}, - 40: {lang: 0x431, region: 0x27}, - 41: {lang: 0x27, region: 0x6f}, - 43: {lang: 0x210, region: 0x7d}, - 44: {lang: 0xfe, region: 0x38}, - 46: {lang: 0x19b, region: 0x99}, - 47: {lang: 0x19e, region: 0x130}, - 48: {lang: 0x3e9, region: 0x99}, - 49: {lang: 0x136, region: 0x87}, - 50: {lang: 0x1a4, region: 0x99}, - 51: {lang: 0x39d, region: 0x99}, - 52: {lang: 0x529, region: 0x12e}, - 53: {lang: 0x254, region: 0xab}, - 54: {lang: 0x529, region: 0x53}, - 55: {lang: 0x1cb, region: 0xe7}, - 56: {lang: 0x529, region: 0x53}, - 57: {lang: 0x529, region: 0x12e}, - 58: {lang: 0x2fd, region: 0x9b}, - 59: {lang: 0x1bc, region: 0x97}, - 60: {lang: 0x200, region: 0xa2}, - 61: {lang: 0x1c5, region: 0x12b}, - 62: {lang: 0x1ca, region: 0xaf}, - 65: {lang: 0x1d5, region: 0x92}, - 67: {lang: 0x142, region: 0x9e}, - 68: {lang: 0x254, region: 0xab}, - 69: {lang: 0x20e, region: 0x95}, - 70: {lang: 0x200, region: 0xa2}, - 72: {lang: 0x135, region: 0xc4}, - 73: {lang: 0x200, region: 0xa2}, - 74: {lang: 0x3bb, region: 0xe8}, - 75: {lang: 0x24a, region: 0xa6}, - 76: {lang: 0x3fa, region: 0x99}, - 79: {lang: 0x251, region: 0x99}, - 80: {lang: 0x254, region: 0xab}, - 82: {lang: 0x88, region: 0x99}, - 83: {lang: 0x370, region: 0x123}, - 84: {lang: 0x2b8, region: 0xaf}, - 89: {lang: 0x29f, region: 0x99}, - 90: {lang: 0x2a8, region: 0x99}, - 91: {lang: 0x28f, region: 0x87}, - 92: {lang: 0x1a0, region: 0x87}, - 93: {lang: 0x2ac, region: 0x53}, - 95: {lang: 0x4f4, region: 0x12b}, - 96: {lang: 0x4f5, region: 0x12b}, - 97: {lang: 0x1be, region: 0x99}, - 99: {lang: 0x337, region: 0x9c}, - 100: {lang: 0x4f7, region: 0x53}, - 101: {lang: 0xa9, region: 0x53}, - 104: {lang: 0x2e8, region: 0x112}, - 105: {lang: 0x4f8, region: 0x10b}, - 106: {lang: 0x4f8, region: 0x10b}, - 107: {lang: 0x304, region: 0x99}, - 108: {lang: 0x31b, region: 0x99}, - 109: {lang: 0x30b, region: 0x53}, - 111: {lang: 0x31e, region: 0x35}, - 112: {lang: 0x30e, region: 0x99}, - 113: {lang: 0x414, region: 0xe8}, - 114: {lang: 0x331, region: 0xc4}, - 115: {lang: 0x4f9, region: 0x108}, - 116: {lang: 0x3b, region: 0xa1}, - 117: {lang: 0x353, region: 0xdb}, - 120: {lang: 0x2d0, region: 0x84}, - 121: {lang: 0x52a, region: 0x53}, - 122: {lang: 0x403, region: 0x96}, - 123: {lang: 0x3ee, region: 0x99}, - 124: {lang: 0x39b, region: 0xc5}, - 125: {lang: 0x395, region: 0x99}, - 126: {lang: 0x399, region: 0x135}, - 127: {lang: 0x429, region: 0x115}, - 128: {lang: 0x3b, region: 0x11c}, - 129: {lang: 0xfd, region: 0xc4}, - 130: {lang: 0x27d, region: 0x106}, - 131: {lang: 0x2c9, region: 0x53}, - 132: {lang: 0x39f, region: 0x9c}, - 133: {lang: 0x39f, region: 0x53}, - 135: {lang: 0x3ad, region: 0xb0}, - 137: {lang: 0x1c6, region: 0x53}, - 138: {lang: 0x4fd, region: 0x9c}, - 189: {lang: 0x3cb, region: 0x95}, - 191: {lang: 0x372, region: 0x10c}, - 192: {lang: 0x420, region: 0x97}, - 194: {lang: 0x4ff, region: 0x15e}, - 195: {lang: 0x3f0, region: 0x99}, - 196: {lang: 0x45, region: 0x135}, - 197: {lang: 0x139, region: 0x7b}, - 198: {lang: 0x3e9, region: 0x99}, - 200: {lang: 0x3e9, region: 0x99}, - 201: {lang: 0x3fa, region: 0x99}, - 202: {lang: 0x40c, region: 0xb3}, - 203: {lang: 0x433, region: 0x99}, - 204: {lang: 0xef, region: 0xc5}, - 205: {lang: 0x43e, region: 0x95}, - 206: {lang: 0x44d, region: 0x35}, - 207: {lang: 0x44e, region: 0x9b}, - 211: {lang: 0x45a, region: 0xe7}, - 212: {lang: 0x11a, region: 0x99}, - 213: {lang: 0x45e, region: 0x53}, - 214: {lang: 0x232, region: 0x53}, - 215: {lang: 0x450, region: 0x99}, - 216: {lang: 0x4a5, region: 0x53}, - 217: {lang: 0x9f, region: 0x13e}, - 218: {lang: 0x461, region: 0x99}, - 220: {lang: 0x528, region: 0xba}, - 221: {lang: 0x153, region: 0xe7}, - 222: {lang: 0x128, region: 0xcd}, - 223: {lang: 0x46b, region: 0x123}, - 224: {lang: 0xa9, region: 0x53}, - 225: {lang: 0x2ce, region: 0x99}, - 226: {lang: 0x4ad, region: 0x11c}, - 227: {lang: 0x4be, region: 0xb4}, - 229: {lang: 0x1ce, region: 0x99}, - 232: {lang: 0x3a9, region: 0x9c}, - 233: {lang: 0x22, region: 0x9b}, - 234: {lang: 0x1ea, region: 0x53}, - 235: {lang: 0xef, region: 0xc5}, -} - -type likelyScriptRegion struct { - region uint16 - script uint8 - flags uint8 -} - -// likelyLang is a lookup table, indexed by langID, for the most likely -// scripts and regions given incomplete information. If more entries exist for a -// given language, region and script are the index and size respectively -// of the list in likelyLangList. -// Size: 5320 bytes, 1330 elements -var likelyLang = [1330]likelyScriptRegion{ - 0: {region: 0x135, script: 0x57, flags: 0x0}, - 1: {region: 0x6f, script: 0x57, flags: 0x0}, - 2: {region: 0x165, script: 0x57, flags: 0x0}, - 3: {region: 0x165, script: 0x57, flags: 0x0}, - 4: {region: 0x165, script: 0x57, flags: 0x0}, - 5: {region: 0x7d, script: 0x1f, flags: 0x0}, - 6: {region: 0x165, script: 0x57, flags: 0x0}, - 7: {region: 0x165, script: 0x1f, flags: 0x0}, - 8: {region: 0x80, script: 0x57, flags: 0x0}, - 9: {region: 0x165, script: 0x57, flags: 0x0}, - 10: {region: 0x165, script: 0x57, flags: 0x0}, - 11: {region: 0x165, script: 0x57, flags: 0x0}, - 12: {region: 0x95, script: 0x57, flags: 0x0}, - 13: {region: 0x131, script: 0x57, flags: 0x0}, - 14: {region: 0x80, script: 0x57, flags: 0x0}, - 15: {region: 0x165, script: 0x57, flags: 0x0}, - 16: {region: 0x165, script: 0x57, flags: 0x0}, - 17: {region: 0x106, script: 0x1f, flags: 0x0}, - 18: {region: 0x165, script: 0x57, flags: 0x0}, - 19: {region: 0x9c, script: 0x9, flags: 0x0}, - 20: {region: 0x128, script: 0x5, flags: 0x0}, - 21: {region: 0x165, script: 0x57, flags: 0x0}, - 22: {region: 0x161, script: 0x57, flags: 0x0}, - 23: {region: 0x165, script: 0x57, flags: 0x0}, - 24: {region: 0x165, script: 0x57, flags: 0x0}, - 25: {region: 0x165, script: 0x57, flags: 0x0}, - 26: {region: 0x165, script: 0x57, flags: 0x0}, - 27: {region: 0x165, script: 0x57, flags: 0x0}, - 28: {region: 0x52, script: 0x57, flags: 0x0}, - 29: {region: 0x165, script: 0x57, flags: 0x0}, - 30: {region: 0x165, script: 0x57, flags: 0x0}, - 31: {region: 0x99, script: 0x4, flags: 0x0}, - 32: {region: 0x165, script: 0x57, flags: 0x0}, - 33: {region: 0x80, script: 0x57, flags: 0x0}, - 34: {region: 0x9b, script: 0xe9, flags: 0x0}, - 35: {region: 0x165, script: 0x57, flags: 0x0}, - 36: {region: 0x165, script: 0x57, flags: 0x0}, - 37: {region: 0x14d, script: 0x57, flags: 0x0}, - 38: {region: 0x106, script: 0x1f, flags: 0x0}, - 39: {region: 0x6f, script: 0x29, flags: 0x0}, - 40: {region: 0x165, script: 0x57, flags: 0x0}, - 41: {region: 0x165, script: 0x57, flags: 0x0}, - 42: {region: 0xd6, script: 0x57, flags: 0x0}, - 43: {region: 0x165, script: 0x57, flags: 0x0}, - 45: {region: 0x165, script: 0x57, flags: 0x0}, - 46: {region: 0x165, script: 0x57, flags: 0x0}, - 47: {region: 0x165, script: 0x57, flags: 0x0}, - 48: {region: 0x165, script: 0x57, flags: 0x0}, - 49: {region: 0x165, script: 0x57, flags: 0x0}, - 50: {region: 0x165, script: 0x57, flags: 0x0}, - 51: {region: 0x95, script: 0x57, flags: 0x0}, - 52: {region: 0x165, script: 0x5, flags: 0x0}, - 53: {region: 0x122, script: 0x5, flags: 0x0}, - 54: {region: 0x165, script: 0x57, flags: 0x0}, - 55: {region: 0x165, script: 0x57, flags: 0x0}, - 56: {region: 0x165, script: 0x57, flags: 0x0}, - 57: {region: 0x165, script: 0x57, flags: 0x0}, - 58: {region: 0x6b, script: 0x5, flags: 0x0}, - 59: {region: 0x0, script: 0x3, flags: 0x1}, - 60: {region: 0x165, script: 0x57, flags: 0x0}, - 61: {region: 0x51, script: 0x57, flags: 0x0}, - 62: {region: 0x3f, script: 0x57, flags: 0x0}, - 63: {region: 0x67, script: 0x5, flags: 0x0}, - 65: {region: 0xba, script: 0x5, flags: 0x0}, - 66: {region: 0x6b, script: 0x5, flags: 0x0}, - 67: {region: 0x99, script: 0xe, flags: 0x0}, - 68: {region: 0x12f, script: 0x57, flags: 0x0}, - 69: {region: 0x135, script: 0xc4, flags: 0x0}, - 70: {region: 0x165, script: 0x57, flags: 0x0}, - 71: {region: 0x165, script: 0x57, flags: 0x0}, - 72: {region: 0x6e, script: 0x57, flags: 0x0}, - 73: {region: 0x165, script: 0x57, flags: 0x0}, - 74: {region: 0x165, script: 0x57, flags: 0x0}, - 75: {region: 0x49, script: 0x57, flags: 0x0}, - 76: {region: 0x165, script: 0x57, flags: 0x0}, - 77: {region: 0x106, script: 0x1f, flags: 0x0}, - 78: {region: 0x165, script: 0x5, flags: 0x0}, - 79: {region: 0x165, script: 0x57, flags: 0x0}, - 80: {region: 0x165, script: 0x57, flags: 0x0}, - 81: {region: 0x165, script: 0x57, flags: 0x0}, - 82: {region: 0x99, script: 0x21, flags: 0x0}, - 83: {region: 0x165, script: 0x57, flags: 0x0}, - 84: {region: 0x165, script: 0x57, flags: 0x0}, - 85: {region: 0x165, script: 0x57, flags: 0x0}, - 86: {region: 0x3f, script: 0x57, flags: 0x0}, - 87: {region: 0x165, script: 0x57, flags: 0x0}, - 88: {region: 0x3, script: 0x5, flags: 0x1}, - 89: {region: 0x106, script: 0x1f, flags: 0x0}, - 90: {region: 0xe8, script: 0x5, flags: 0x0}, - 91: {region: 0x95, script: 0x57, flags: 0x0}, - 92: {region: 0xdb, script: 0x21, flags: 0x0}, - 93: {region: 0x2e, script: 0x57, flags: 0x0}, - 94: {region: 0x52, script: 0x57, flags: 0x0}, - 95: {region: 0x165, script: 0x57, flags: 0x0}, - 96: {region: 0x52, script: 0xb, flags: 0x0}, - 97: {region: 0x165, script: 0x57, flags: 0x0}, - 98: {region: 0x165, script: 0x57, flags: 0x0}, - 99: {region: 0x95, script: 0x57, flags: 0x0}, - 100: {region: 0x165, script: 0x57, flags: 0x0}, - 101: {region: 0x52, script: 0x57, flags: 0x0}, - 102: {region: 0x165, script: 0x57, flags: 0x0}, - 103: {region: 0x165, script: 0x57, flags: 0x0}, - 104: {region: 0x165, script: 0x57, flags: 0x0}, - 105: {region: 0x165, script: 0x57, flags: 0x0}, - 106: {region: 0x4f, script: 0x57, flags: 0x0}, - 107: {region: 0x165, script: 0x57, flags: 0x0}, - 108: {region: 0x165, script: 0x57, flags: 0x0}, - 109: {region: 0x165, script: 0x57, flags: 0x0}, - 110: {region: 0x165, script: 0x29, flags: 0x0}, - 111: {region: 0x165, script: 0x57, flags: 0x0}, - 112: {region: 0x165, script: 0x57, flags: 0x0}, - 113: {region: 0x47, script: 0x1f, flags: 0x0}, - 114: {region: 0x165, script: 0x57, flags: 0x0}, - 115: {region: 0x165, script: 0x57, flags: 0x0}, - 116: {region: 0x10b, script: 0x5, flags: 0x0}, - 117: {region: 0x162, script: 0x57, flags: 0x0}, - 118: {region: 0x165, script: 0x57, flags: 0x0}, - 119: {region: 0x95, script: 0x57, flags: 0x0}, - 120: {region: 0x165, script: 0x57, flags: 0x0}, - 121: {region: 0x12f, script: 0x57, flags: 0x0}, - 122: {region: 0x52, script: 0x57, flags: 0x0}, - 123: {region: 0x99, script: 0xd7, flags: 0x0}, - 124: {region: 0xe8, script: 0x5, flags: 0x0}, - 125: {region: 0x99, script: 0x21, flags: 0x0}, - 126: {region: 0x38, script: 0x1f, flags: 0x0}, - 127: {region: 0x99, script: 0x21, flags: 0x0}, - 128: {region: 0xe8, script: 0x5, flags: 0x0}, - 129: {region: 0x12b, script: 0x31, flags: 0x0}, - 131: {region: 0x99, script: 0x21, flags: 0x0}, - 132: {region: 0x165, script: 0x57, flags: 0x0}, - 133: {region: 0x99, script: 0x21, flags: 0x0}, - 134: {region: 0xe7, script: 0x57, flags: 0x0}, - 135: {region: 0x165, script: 0x57, flags: 0x0}, - 136: {region: 0x99, script: 0x21, flags: 0x0}, - 137: {region: 0x165, script: 0x57, flags: 0x0}, - 138: {region: 0x13f, script: 0x57, flags: 0x0}, - 139: {region: 0x165, script: 0x57, flags: 0x0}, - 140: {region: 0x165, script: 0x57, flags: 0x0}, - 141: {region: 0xe7, script: 0x57, flags: 0x0}, - 142: {region: 0x165, script: 0x57, flags: 0x0}, - 143: {region: 0xd6, script: 0x57, flags: 0x0}, - 144: {region: 0x165, script: 0x57, flags: 0x0}, - 145: {region: 0x165, script: 0x57, flags: 0x0}, - 146: {region: 0x165, script: 0x57, flags: 0x0}, - 147: {region: 0x165, script: 0x29, flags: 0x0}, - 148: {region: 0x99, script: 0x21, flags: 0x0}, - 149: {region: 0x95, script: 0x57, flags: 0x0}, - 150: {region: 0x165, script: 0x57, flags: 0x0}, - 151: {region: 0x165, script: 0x57, flags: 0x0}, - 152: {region: 0x114, script: 0x57, flags: 0x0}, - 153: {region: 0x165, script: 0x57, flags: 0x0}, - 154: {region: 0x165, script: 0x57, flags: 0x0}, - 155: {region: 0x52, script: 0x57, flags: 0x0}, - 156: {region: 0x165, script: 0x57, flags: 0x0}, - 157: {region: 0xe7, script: 0x57, flags: 0x0}, - 158: {region: 0x165, script: 0x57, flags: 0x0}, - 159: {region: 0x13e, script: 0xd9, flags: 0x0}, - 160: {region: 0xc3, script: 0x57, flags: 0x0}, - 161: {region: 0x165, script: 0x57, flags: 0x0}, - 162: {region: 0x165, script: 0x57, flags: 0x0}, - 163: {region: 0xc3, script: 0x57, flags: 0x0}, - 164: {region: 0x165, script: 0x57, flags: 0x0}, - 165: {region: 0x35, script: 0xe, flags: 0x0}, - 166: {region: 0x165, script: 0x57, flags: 0x0}, - 167: {region: 0x165, script: 0x57, flags: 0x0}, - 168: {region: 0x165, script: 0x57, flags: 0x0}, - 169: {region: 0x53, script: 0xe0, flags: 0x0}, - 170: {region: 0x165, script: 0x57, flags: 0x0}, - 171: {region: 0x165, script: 0x57, flags: 0x0}, - 172: {region: 0x165, script: 0x57, flags: 0x0}, - 173: {region: 0x99, script: 0xe, flags: 0x0}, - 174: {region: 0x165, script: 0x57, flags: 0x0}, - 175: {region: 0x9c, script: 0x5, flags: 0x0}, - 176: {region: 0x165, script: 0x57, flags: 0x0}, - 177: {region: 0x4f, script: 0x57, flags: 0x0}, - 178: {region: 0x78, script: 0x57, flags: 0x0}, - 179: {region: 0x99, script: 0x21, flags: 0x0}, - 180: {region: 0xe8, script: 0x5, flags: 0x0}, - 181: {region: 0x99, script: 0x21, flags: 0x0}, - 182: {region: 0x165, script: 0x57, flags: 0x0}, - 183: {region: 0x33, script: 0x57, flags: 0x0}, - 184: {region: 0x165, script: 0x57, flags: 0x0}, - 185: {region: 0xb4, script: 0xc, flags: 0x0}, - 186: {region: 0x52, script: 0x57, flags: 0x0}, - 187: {region: 0x165, script: 0x29, flags: 0x0}, - 188: {region: 0xe7, script: 0x57, flags: 0x0}, - 189: {region: 0x165, script: 0x57, flags: 0x0}, - 190: {region: 0xe8, script: 0x21, flags: 0x0}, - 191: {region: 0x106, script: 0x1f, flags: 0x0}, - 192: {region: 0x15f, script: 0x57, flags: 0x0}, - 193: {region: 0x165, script: 0x57, flags: 0x0}, - 194: {region: 0x95, script: 0x57, flags: 0x0}, - 195: {region: 0x165, script: 0x57, flags: 0x0}, - 196: {region: 0x52, script: 0x57, flags: 0x0}, - 197: {region: 0x165, script: 0x57, flags: 0x0}, - 198: {region: 0x165, script: 0x57, flags: 0x0}, - 199: {region: 0x165, script: 0x57, flags: 0x0}, - 200: {region: 0x86, script: 0x57, flags: 0x0}, - 201: {region: 0x165, script: 0x57, flags: 0x0}, - 202: {region: 0x165, script: 0x57, flags: 0x0}, - 203: {region: 0x165, script: 0x57, flags: 0x0}, - 204: {region: 0x165, script: 0x57, flags: 0x0}, - 205: {region: 0x6d, script: 0x29, flags: 0x0}, - 206: {region: 0x165, script: 0x57, flags: 0x0}, - 207: {region: 0x165, script: 0x57, flags: 0x0}, - 208: {region: 0x52, script: 0x57, flags: 0x0}, - 209: {region: 0x165, script: 0x57, flags: 0x0}, - 210: {region: 0x165, script: 0x57, flags: 0x0}, - 211: {region: 0xc3, script: 0x57, flags: 0x0}, - 212: {region: 0x165, script: 0x57, flags: 0x0}, - 213: {region: 0x165, script: 0x57, flags: 0x0}, - 214: {region: 0x165, script: 0x57, flags: 0x0}, - 215: {region: 0x6e, script: 0x57, flags: 0x0}, - 216: {region: 0x165, script: 0x57, flags: 0x0}, - 217: {region: 0x165, script: 0x57, flags: 0x0}, - 218: {region: 0xd6, script: 0x57, flags: 0x0}, - 219: {region: 0x35, script: 0x16, flags: 0x0}, - 220: {region: 0x106, script: 0x1f, flags: 0x0}, - 221: {region: 0xe7, script: 0x57, flags: 0x0}, - 222: {region: 0x165, script: 0x57, flags: 0x0}, - 223: {region: 0x131, script: 0x57, flags: 0x0}, - 224: {region: 0x8a, script: 0x57, flags: 0x0}, - 225: {region: 0x75, script: 0x57, flags: 0x0}, - 226: {region: 0x106, script: 0x1f, flags: 0x0}, - 227: {region: 0x135, script: 0x57, flags: 0x0}, - 228: {region: 0x49, script: 0x57, flags: 0x0}, - 229: {region: 0x135, script: 0x1a, flags: 0x0}, - 230: {region: 0xa6, script: 0x5, flags: 0x0}, - 231: {region: 0x13e, script: 0x19, flags: 0x0}, - 232: {region: 0x165, script: 0x57, flags: 0x0}, - 233: {region: 0x9b, script: 0x5, flags: 0x0}, - 234: {region: 0x165, script: 0x57, flags: 0x0}, - 235: {region: 0x165, script: 0x57, flags: 0x0}, - 236: {region: 0x165, script: 0x57, flags: 0x0}, - 237: {region: 0x165, script: 0x57, flags: 0x0}, - 238: {region: 0x165, script: 0x57, flags: 0x0}, - 239: {region: 0xc5, script: 0xcc, flags: 0x0}, - 240: {region: 0x78, script: 0x57, flags: 0x0}, - 241: {region: 0x6b, script: 0x1c, flags: 0x0}, - 242: {region: 0xe7, script: 0x57, flags: 0x0}, - 243: {region: 0x49, script: 0x17, flags: 0x0}, - 244: {region: 0x130, script: 0x1f, flags: 0x0}, - 245: {region: 0x49, script: 0x17, flags: 0x0}, - 246: {region: 0x49, script: 0x17, flags: 0x0}, - 247: {region: 0x49, script: 0x17, flags: 0x0}, - 248: {region: 0x49, script: 0x17, flags: 0x0}, - 249: {region: 0x10a, script: 0x57, flags: 0x0}, - 250: {region: 0x5e, script: 0x57, flags: 0x0}, - 251: {region: 0xe9, script: 0x57, flags: 0x0}, - 252: {region: 0x49, script: 0x17, flags: 0x0}, - 253: {region: 0xc4, script: 0x81, flags: 0x0}, - 254: {region: 0x8, script: 0x2, flags: 0x1}, - 255: {region: 0x106, script: 0x1f, flags: 0x0}, - 256: {region: 0x7b, script: 0x57, flags: 0x0}, - 257: {region: 0x63, script: 0x57, flags: 0x0}, - 258: {region: 0x165, script: 0x57, flags: 0x0}, - 259: {region: 0x165, script: 0x57, flags: 0x0}, - 260: {region: 0x165, script: 0x57, flags: 0x0}, - 261: {region: 0x165, script: 0x57, flags: 0x0}, - 262: {region: 0x135, script: 0x57, flags: 0x0}, - 263: {region: 0x106, script: 0x1f, flags: 0x0}, - 264: {region: 0xa4, script: 0x57, flags: 0x0}, - 265: {region: 0x165, script: 0x57, flags: 0x0}, - 266: {region: 0x165, script: 0x57, flags: 0x0}, - 267: {region: 0x99, script: 0x5, flags: 0x0}, - 268: {region: 0x165, script: 0x57, flags: 0x0}, - 269: {region: 0x60, script: 0x57, flags: 0x0}, - 270: {region: 0x165, script: 0x57, flags: 0x0}, - 271: {region: 0x49, script: 0x57, flags: 0x0}, - 272: {region: 0x165, script: 0x57, flags: 0x0}, - 273: {region: 0x165, script: 0x57, flags: 0x0}, - 274: {region: 0x165, script: 0x57, flags: 0x0}, - 275: {region: 0x165, script: 0x5, flags: 0x0}, - 276: {region: 0x49, script: 0x57, flags: 0x0}, - 277: {region: 0x165, script: 0x57, flags: 0x0}, - 278: {region: 0x165, script: 0x57, flags: 0x0}, - 279: {region: 0xd4, script: 0x57, flags: 0x0}, - 280: {region: 0x4f, script: 0x57, flags: 0x0}, - 281: {region: 0x165, script: 0x57, flags: 0x0}, - 282: {region: 0x99, script: 0x5, flags: 0x0}, - 283: {region: 0x165, script: 0x57, flags: 0x0}, - 284: {region: 0x165, script: 0x57, flags: 0x0}, - 285: {region: 0x165, script: 0x57, flags: 0x0}, - 286: {region: 0x165, script: 0x29, flags: 0x0}, - 287: {region: 0x60, script: 0x57, flags: 0x0}, - 288: {region: 0xc3, script: 0x57, flags: 0x0}, - 289: {region: 0xd0, script: 0x57, flags: 0x0}, - 290: {region: 0x165, script: 0x57, flags: 0x0}, - 291: {region: 0xdb, script: 0x21, flags: 0x0}, - 292: {region: 0x52, script: 0x57, flags: 0x0}, - 293: {region: 0x165, script: 0x57, flags: 0x0}, - 294: {region: 0x165, script: 0x57, flags: 0x0}, - 295: {region: 0x165, script: 0x57, flags: 0x0}, - 296: {region: 0xcd, script: 0xde, flags: 0x0}, - 297: {region: 0x165, script: 0x57, flags: 0x0}, - 298: {region: 0x165, script: 0x57, flags: 0x0}, - 299: {region: 0x114, script: 0x57, flags: 0x0}, - 300: {region: 0x37, script: 0x57, flags: 0x0}, - 301: {region: 0x43, script: 0xe0, flags: 0x0}, - 302: {region: 0x165, script: 0x57, flags: 0x0}, - 303: {region: 0xa4, script: 0x57, flags: 0x0}, - 304: {region: 0x80, script: 0x57, flags: 0x0}, - 305: {region: 0xd6, script: 0x57, flags: 0x0}, - 306: {region: 0x9e, script: 0x57, flags: 0x0}, - 307: {region: 0x6b, script: 0x27, flags: 0x0}, - 308: {region: 0x165, script: 0x57, flags: 0x0}, - 309: {region: 0xc4, script: 0x48, flags: 0x0}, - 310: {region: 0x87, script: 0x31, flags: 0x0}, - 311: {region: 0x165, script: 0x57, flags: 0x0}, - 312: {region: 0x165, script: 0x57, flags: 0x0}, - 313: {region: 0xa, script: 0x2, flags: 0x1}, - 314: {region: 0x165, script: 0x57, flags: 0x0}, - 315: {region: 0x165, script: 0x57, flags: 0x0}, - 316: {region: 0x1, script: 0x57, flags: 0x0}, - 317: {region: 0x165, script: 0x57, flags: 0x0}, - 318: {region: 0x6e, script: 0x57, flags: 0x0}, - 319: {region: 0x135, script: 0x57, flags: 0x0}, - 320: {region: 0x6a, script: 0x57, flags: 0x0}, - 321: {region: 0x165, script: 0x57, flags: 0x0}, - 322: {region: 0x9e, script: 0x43, flags: 0x0}, - 323: {region: 0x165, script: 0x57, flags: 0x0}, - 324: {region: 0x165, script: 0x57, flags: 0x0}, - 325: {region: 0x6e, script: 0x57, flags: 0x0}, - 326: {region: 0x52, script: 0x57, flags: 0x0}, - 327: {region: 0x6e, script: 0x57, flags: 0x0}, - 328: {region: 0x9c, script: 0x5, flags: 0x0}, - 329: {region: 0x165, script: 0x57, flags: 0x0}, - 330: {region: 0x165, script: 0x57, flags: 0x0}, - 331: {region: 0x165, script: 0x57, flags: 0x0}, - 332: {region: 0x165, script: 0x57, flags: 0x0}, - 333: {region: 0x86, script: 0x57, flags: 0x0}, - 334: {region: 0xc, script: 0x2, flags: 0x1}, - 335: {region: 0x165, script: 0x57, flags: 0x0}, - 336: {region: 0xc3, script: 0x57, flags: 0x0}, - 337: {region: 0x72, script: 0x57, flags: 0x0}, - 338: {region: 0x10b, script: 0x5, flags: 0x0}, - 339: {region: 0xe7, script: 0x57, flags: 0x0}, - 340: {region: 0x10c, script: 0x57, flags: 0x0}, - 341: {region: 0x73, script: 0x57, flags: 0x0}, - 342: {region: 0x165, script: 0x57, flags: 0x0}, - 343: {region: 0x165, script: 0x57, flags: 0x0}, - 344: {region: 0x76, script: 0x57, flags: 0x0}, - 345: {region: 0x165, script: 0x57, flags: 0x0}, - 346: {region: 0x3b, script: 0x57, flags: 0x0}, - 347: {region: 0x165, script: 0x57, flags: 0x0}, - 348: {region: 0x165, script: 0x57, flags: 0x0}, - 349: {region: 0x165, script: 0x57, flags: 0x0}, - 350: {region: 0x78, script: 0x57, flags: 0x0}, - 351: {region: 0x135, script: 0x57, flags: 0x0}, - 352: {region: 0x78, script: 0x57, flags: 0x0}, - 353: {region: 0x60, script: 0x57, flags: 0x0}, - 354: {region: 0x60, script: 0x57, flags: 0x0}, - 355: {region: 0x52, script: 0x5, flags: 0x0}, - 356: {region: 0x140, script: 0x57, flags: 0x0}, - 357: {region: 0x165, script: 0x57, flags: 0x0}, - 358: {region: 0x84, script: 0x57, flags: 0x0}, - 359: {region: 0x165, script: 0x57, flags: 0x0}, - 360: {region: 0xd4, script: 0x57, flags: 0x0}, - 361: {region: 0x9e, script: 0x57, flags: 0x0}, - 362: {region: 0xd6, script: 0x57, flags: 0x0}, - 363: {region: 0x165, script: 0x57, flags: 0x0}, - 364: {region: 0x10b, script: 0x57, flags: 0x0}, - 365: {region: 0xd9, script: 0x57, flags: 0x0}, - 366: {region: 0x96, script: 0x57, flags: 0x0}, - 367: {region: 0x80, script: 0x57, flags: 0x0}, - 368: {region: 0x165, script: 0x57, flags: 0x0}, - 369: {region: 0xbc, script: 0x57, flags: 0x0}, - 370: {region: 0x165, script: 0x57, flags: 0x0}, - 371: {region: 0x165, script: 0x57, flags: 0x0}, - 372: {region: 0x165, script: 0x57, flags: 0x0}, - 373: {region: 0x53, script: 0x38, flags: 0x0}, - 374: {region: 0x165, script: 0x57, flags: 0x0}, - 375: {region: 0x95, script: 0x57, flags: 0x0}, - 376: {region: 0x165, script: 0x57, flags: 0x0}, - 377: {region: 0x165, script: 0x57, flags: 0x0}, - 378: {region: 0x99, script: 0x21, flags: 0x0}, - 379: {region: 0x165, script: 0x57, flags: 0x0}, - 380: {region: 0x9c, script: 0x5, flags: 0x0}, - 381: {region: 0x7e, script: 0x57, flags: 0x0}, - 382: {region: 0x7b, script: 0x57, flags: 0x0}, - 383: {region: 0x165, script: 0x57, flags: 0x0}, - 384: {region: 0x165, script: 0x57, flags: 0x0}, - 385: {region: 0x165, script: 0x57, flags: 0x0}, - 386: {region: 0x165, script: 0x57, flags: 0x0}, - 387: {region: 0x165, script: 0x57, flags: 0x0}, - 388: {region: 0x165, script: 0x57, flags: 0x0}, - 389: {region: 0x6f, script: 0x29, flags: 0x0}, - 390: {region: 0x165, script: 0x57, flags: 0x0}, - 391: {region: 0xdb, script: 0x21, flags: 0x0}, - 392: {region: 0x165, script: 0x57, flags: 0x0}, - 393: {region: 0xa7, script: 0x57, flags: 0x0}, - 394: {region: 0x165, script: 0x57, flags: 0x0}, - 395: {region: 0xe8, script: 0x5, flags: 0x0}, - 396: {region: 0x165, script: 0x57, flags: 0x0}, - 397: {region: 0xe8, script: 0x5, flags: 0x0}, - 398: {region: 0x165, script: 0x57, flags: 0x0}, - 399: {region: 0x165, script: 0x57, flags: 0x0}, - 400: {region: 0x6e, script: 0x57, flags: 0x0}, - 401: {region: 0x9c, script: 0x5, flags: 0x0}, - 402: {region: 0x165, script: 0x57, flags: 0x0}, - 403: {region: 0x165, script: 0x29, flags: 0x0}, - 404: {region: 0xf1, script: 0x57, flags: 0x0}, - 405: {region: 0x165, script: 0x57, flags: 0x0}, - 406: {region: 0x165, script: 0x57, flags: 0x0}, - 407: {region: 0x165, script: 0x57, flags: 0x0}, - 408: {region: 0x165, script: 0x29, flags: 0x0}, - 409: {region: 0x165, script: 0x57, flags: 0x0}, - 410: {region: 0x99, script: 0x21, flags: 0x0}, - 411: {region: 0x99, script: 0xda, flags: 0x0}, - 412: {region: 0x95, script: 0x57, flags: 0x0}, - 413: {region: 0xd9, script: 0x57, flags: 0x0}, - 414: {region: 0x130, script: 0x2f, flags: 0x0}, - 415: {region: 0x165, script: 0x57, flags: 0x0}, - 416: {region: 0xe, script: 0x2, flags: 0x1}, - 417: {region: 0x99, script: 0xe, flags: 0x0}, - 418: {region: 0x165, script: 0x57, flags: 0x0}, - 419: {region: 0x4e, script: 0x57, flags: 0x0}, - 420: {region: 0x99, script: 0x32, flags: 0x0}, - 421: {region: 0x41, script: 0x57, flags: 0x0}, - 422: {region: 0x54, script: 0x57, flags: 0x0}, - 423: {region: 0x165, script: 0x57, flags: 0x0}, - 424: {region: 0x80, script: 0x57, flags: 0x0}, - 425: {region: 0x165, script: 0x57, flags: 0x0}, - 426: {region: 0x165, script: 0x57, flags: 0x0}, - 427: {region: 0xa4, script: 0x57, flags: 0x0}, - 428: {region: 0x98, script: 0x57, flags: 0x0}, - 429: {region: 0x165, script: 0x57, flags: 0x0}, - 430: {region: 0xdb, script: 0x21, flags: 0x0}, - 431: {region: 0x165, script: 0x57, flags: 0x0}, - 432: {region: 0x165, script: 0x5, flags: 0x0}, - 433: {region: 0x49, script: 0x57, flags: 0x0}, - 434: {region: 0x165, script: 0x5, flags: 0x0}, - 435: {region: 0x165, script: 0x57, flags: 0x0}, - 436: {region: 0x10, script: 0x3, flags: 0x1}, - 437: {region: 0x165, script: 0x57, flags: 0x0}, - 438: {region: 0x53, script: 0x38, flags: 0x0}, - 439: {region: 0x165, script: 0x57, flags: 0x0}, - 440: {region: 0x135, script: 0x57, flags: 0x0}, - 441: {region: 0x24, script: 0x5, flags: 0x0}, - 442: {region: 0x165, script: 0x57, flags: 0x0}, - 443: {region: 0x165, script: 0x29, flags: 0x0}, - 444: {region: 0x97, script: 0x3b, flags: 0x0}, - 445: {region: 0x165, script: 0x57, flags: 0x0}, - 446: {region: 0x99, script: 0x21, flags: 0x0}, - 447: {region: 0x165, script: 0x57, flags: 0x0}, - 448: {region: 0x73, script: 0x57, flags: 0x0}, - 449: {region: 0x165, script: 0x57, flags: 0x0}, - 450: {region: 0x165, script: 0x57, flags: 0x0}, - 451: {region: 0xe7, script: 0x57, flags: 0x0}, - 452: {region: 0x165, script: 0x57, flags: 0x0}, - 453: {region: 0x12b, script: 0x3d, flags: 0x0}, - 454: {region: 0x53, script: 0x89, flags: 0x0}, - 455: {region: 0x165, script: 0x57, flags: 0x0}, - 456: {region: 0xe8, script: 0x5, flags: 0x0}, - 457: {region: 0x99, script: 0x21, flags: 0x0}, - 458: {region: 0xaf, script: 0x3e, flags: 0x0}, - 459: {region: 0xe7, script: 0x57, flags: 0x0}, - 460: {region: 0xe8, script: 0x5, flags: 0x0}, - 461: {region: 0xe6, script: 0x57, flags: 0x0}, - 462: {region: 0x99, script: 0x21, flags: 0x0}, - 463: {region: 0x99, script: 0x21, flags: 0x0}, - 464: {region: 0x165, script: 0x57, flags: 0x0}, - 465: {region: 0x90, script: 0x57, flags: 0x0}, - 466: {region: 0x60, script: 0x57, flags: 0x0}, - 467: {region: 0x53, script: 0x38, flags: 0x0}, - 468: {region: 0x91, script: 0x57, flags: 0x0}, - 469: {region: 0x92, script: 0x57, flags: 0x0}, - 470: {region: 0x165, script: 0x57, flags: 0x0}, - 471: {region: 0x28, script: 0x8, flags: 0x0}, - 472: {region: 0xd2, script: 0x57, flags: 0x0}, - 473: {region: 0x78, script: 0x57, flags: 0x0}, - 474: {region: 0x165, script: 0x57, flags: 0x0}, - 475: {region: 0x165, script: 0x57, flags: 0x0}, - 476: {region: 0xd0, script: 0x57, flags: 0x0}, - 477: {region: 0xd6, script: 0x57, flags: 0x0}, - 478: {region: 0x165, script: 0x57, flags: 0x0}, - 479: {region: 0x165, script: 0x57, flags: 0x0}, - 480: {region: 0x165, script: 0x57, flags: 0x0}, - 481: {region: 0x95, script: 0x57, flags: 0x0}, - 482: {region: 0x165, script: 0x57, flags: 0x0}, - 483: {region: 0x165, script: 0x57, flags: 0x0}, - 484: {region: 0x165, script: 0x57, flags: 0x0}, - 486: {region: 0x122, script: 0x57, flags: 0x0}, - 487: {region: 0xd6, script: 0x57, flags: 0x0}, - 488: {region: 0x165, script: 0x57, flags: 0x0}, - 489: {region: 0x165, script: 0x57, flags: 0x0}, - 490: {region: 0x53, script: 0xea, flags: 0x0}, - 491: {region: 0x165, script: 0x57, flags: 0x0}, - 492: {region: 0x135, script: 0x57, flags: 0x0}, - 493: {region: 0x165, script: 0x57, flags: 0x0}, - 494: {region: 0x49, script: 0x57, flags: 0x0}, - 495: {region: 0x165, script: 0x57, flags: 0x0}, - 496: {region: 0x165, script: 0x57, flags: 0x0}, - 497: {region: 0xe7, script: 0x57, flags: 0x0}, - 498: {region: 0x165, script: 0x57, flags: 0x0}, - 499: {region: 0x95, script: 0x57, flags: 0x0}, - 500: {region: 0x106, script: 0x1f, flags: 0x0}, - 501: {region: 0x1, script: 0x57, flags: 0x0}, - 502: {region: 0x165, script: 0x57, flags: 0x0}, - 503: {region: 0x165, script: 0x57, flags: 0x0}, - 504: {region: 0x9d, script: 0x57, flags: 0x0}, - 505: {region: 0x9e, script: 0x57, flags: 0x0}, - 506: {region: 0x49, script: 0x17, flags: 0x0}, - 507: {region: 0x97, script: 0x3b, flags: 0x0}, - 508: {region: 0x165, script: 0x57, flags: 0x0}, - 509: {region: 0x165, script: 0x57, flags: 0x0}, - 510: {region: 0x106, script: 0x57, flags: 0x0}, - 511: {region: 0x165, script: 0x57, flags: 0x0}, - 512: {region: 0xa2, script: 0x46, flags: 0x0}, - 513: {region: 0x165, script: 0x57, flags: 0x0}, - 514: {region: 0xa0, script: 0x57, flags: 0x0}, - 515: {region: 0x1, script: 0x57, flags: 0x0}, - 516: {region: 0x165, script: 0x57, flags: 0x0}, - 517: {region: 0x165, script: 0x57, flags: 0x0}, - 518: {region: 0x165, script: 0x57, flags: 0x0}, - 519: {region: 0x52, script: 0x57, flags: 0x0}, - 520: {region: 0x130, script: 0x3b, flags: 0x0}, - 521: {region: 0x165, script: 0x57, flags: 0x0}, - 522: {region: 0x12f, script: 0x57, flags: 0x0}, - 523: {region: 0xdb, script: 0x21, flags: 0x0}, - 524: {region: 0x165, script: 0x57, flags: 0x0}, - 525: {region: 0x63, script: 0x57, flags: 0x0}, - 526: {region: 0x95, script: 0x57, flags: 0x0}, - 527: {region: 0x95, script: 0x57, flags: 0x0}, - 528: {region: 0x7d, script: 0x2b, flags: 0x0}, - 529: {region: 0x137, script: 0x1f, flags: 0x0}, - 530: {region: 0x67, script: 0x57, flags: 0x0}, - 531: {region: 0xc4, script: 0x57, flags: 0x0}, - 532: {region: 0x165, script: 0x57, flags: 0x0}, - 533: {region: 0x165, script: 0x57, flags: 0x0}, - 534: {region: 0xd6, script: 0x57, flags: 0x0}, - 535: {region: 0xa4, script: 0x57, flags: 0x0}, - 536: {region: 0xc3, script: 0x57, flags: 0x0}, - 537: {region: 0x106, script: 0x1f, flags: 0x0}, - 538: {region: 0x165, script: 0x57, flags: 0x0}, - 539: {region: 0x165, script: 0x57, flags: 0x0}, - 540: {region: 0x165, script: 0x57, flags: 0x0}, - 541: {region: 0x165, script: 0x57, flags: 0x0}, - 542: {region: 0xd4, script: 0x5, flags: 0x0}, - 543: {region: 0xd6, script: 0x57, flags: 0x0}, - 544: {region: 0x164, script: 0x57, flags: 0x0}, - 545: {region: 0x165, script: 0x57, flags: 0x0}, - 546: {region: 0x165, script: 0x57, flags: 0x0}, - 547: {region: 0x12f, script: 0x57, flags: 0x0}, - 548: {region: 0x122, script: 0x5, flags: 0x0}, - 549: {region: 0x165, script: 0x57, flags: 0x0}, - 550: {region: 0x123, script: 0xdf, flags: 0x0}, - 551: {region: 0x5a, script: 0x57, flags: 0x0}, - 552: {region: 0x52, script: 0x57, flags: 0x0}, - 553: {region: 0x165, script: 0x57, flags: 0x0}, - 554: {region: 0x4f, script: 0x57, flags: 0x0}, - 555: {region: 0x99, script: 0x21, flags: 0x0}, - 556: {region: 0x99, script: 0x21, flags: 0x0}, - 557: {region: 0x4b, script: 0x57, flags: 0x0}, - 558: {region: 0x95, script: 0x57, flags: 0x0}, - 559: {region: 0x165, script: 0x57, flags: 0x0}, - 560: {region: 0x41, script: 0x57, flags: 0x0}, - 561: {region: 0x99, script: 0x57, flags: 0x0}, - 562: {region: 0x53, script: 0xd6, flags: 0x0}, - 563: {region: 0x99, script: 0x21, flags: 0x0}, - 564: {region: 0xc3, script: 0x57, flags: 0x0}, - 565: {region: 0x165, script: 0x57, flags: 0x0}, - 566: {region: 0x99, script: 0x72, flags: 0x0}, - 567: {region: 0xe8, script: 0x5, flags: 0x0}, - 568: {region: 0x165, script: 0x57, flags: 0x0}, - 569: {region: 0xa4, script: 0x57, flags: 0x0}, - 570: {region: 0x165, script: 0x57, flags: 0x0}, - 571: {region: 0x12b, script: 0x57, flags: 0x0}, - 572: {region: 0x165, script: 0x57, flags: 0x0}, - 573: {region: 0xd2, script: 0x57, flags: 0x0}, - 574: {region: 0x165, script: 0x57, flags: 0x0}, - 575: {region: 0xaf, script: 0x54, flags: 0x0}, - 576: {region: 0x165, script: 0x57, flags: 0x0}, - 577: {region: 0x165, script: 0x57, flags: 0x0}, - 578: {region: 0x13, script: 0x6, flags: 0x1}, - 579: {region: 0x165, script: 0x57, flags: 0x0}, - 580: {region: 0x52, script: 0x57, flags: 0x0}, - 581: {region: 0x82, script: 0x57, flags: 0x0}, - 582: {region: 0xa4, script: 0x57, flags: 0x0}, - 583: {region: 0x165, script: 0x57, flags: 0x0}, - 584: {region: 0x165, script: 0x57, flags: 0x0}, - 585: {region: 0x165, script: 0x57, flags: 0x0}, - 586: {region: 0xa6, script: 0x4b, flags: 0x0}, - 587: {region: 0x2a, script: 0x57, flags: 0x0}, - 588: {region: 0x165, script: 0x57, flags: 0x0}, - 589: {region: 0x165, script: 0x57, flags: 0x0}, - 590: {region: 0x165, script: 0x57, flags: 0x0}, - 591: {region: 0x165, script: 0x57, flags: 0x0}, - 592: {region: 0x165, script: 0x57, flags: 0x0}, - 593: {region: 0x99, script: 0x4f, flags: 0x0}, - 594: {region: 0x8b, script: 0x57, flags: 0x0}, - 595: {region: 0x165, script: 0x57, flags: 0x0}, - 596: {region: 0xab, script: 0x50, flags: 0x0}, - 597: {region: 0x106, script: 0x1f, flags: 0x0}, - 598: {region: 0x99, script: 0x21, flags: 0x0}, - 599: {region: 0x165, script: 0x57, flags: 0x0}, - 600: {region: 0x75, script: 0x57, flags: 0x0}, - 601: {region: 0x165, script: 0x57, flags: 0x0}, - 602: {region: 0xb4, script: 0x57, flags: 0x0}, - 603: {region: 0x165, script: 0x57, flags: 0x0}, - 604: {region: 0x165, script: 0x57, flags: 0x0}, - 605: {region: 0x165, script: 0x57, flags: 0x0}, - 606: {region: 0x165, script: 0x57, flags: 0x0}, - 607: {region: 0x165, script: 0x57, flags: 0x0}, - 608: {region: 0x165, script: 0x57, flags: 0x0}, - 609: {region: 0x165, script: 0x57, flags: 0x0}, - 610: {region: 0x165, script: 0x29, flags: 0x0}, - 611: {region: 0x165, script: 0x57, flags: 0x0}, - 612: {region: 0x106, script: 0x1f, flags: 0x0}, - 613: {region: 0x112, script: 0x57, flags: 0x0}, - 614: {region: 0xe7, script: 0x57, flags: 0x0}, - 615: {region: 0x106, script: 0x57, flags: 0x0}, - 616: {region: 0x165, script: 0x57, flags: 0x0}, - 617: {region: 0x99, script: 0x21, flags: 0x0}, - 618: {region: 0x99, script: 0x5, flags: 0x0}, - 619: {region: 0x12f, script: 0x57, flags: 0x0}, - 620: {region: 0x165, script: 0x57, flags: 0x0}, - 621: {region: 0x52, script: 0x57, flags: 0x0}, - 622: {region: 0x60, script: 0x57, flags: 0x0}, - 623: {region: 0x165, script: 0x57, flags: 0x0}, - 624: {region: 0x165, script: 0x57, flags: 0x0}, - 625: {region: 0x165, script: 0x29, flags: 0x0}, - 626: {region: 0x165, script: 0x57, flags: 0x0}, - 627: {region: 0x165, script: 0x57, flags: 0x0}, - 628: {region: 0x19, script: 0x3, flags: 0x1}, - 629: {region: 0x165, script: 0x57, flags: 0x0}, - 630: {region: 0x165, script: 0x57, flags: 0x0}, - 631: {region: 0x165, script: 0x57, flags: 0x0}, - 632: {region: 0x165, script: 0x57, flags: 0x0}, - 633: {region: 0x106, script: 0x1f, flags: 0x0}, - 634: {region: 0x165, script: 0x57, flags: 0x0}, - 635: {region: 0x165, script: 0x57, flags: 0x0}, - 636: {region: 0x165, script: 0x57, flags: 0x0}, - 637: {region: 0x106, script: 0x1f, flags: 0x0}, - 638: {region: 0x165, script: 0x57, flags: 0x0}, - 639: {region: 0x95, script: 0x57, flags: 0x0}, - 640: {region: 0xe8, script: 0x5, flags: 0x0}, - 641: {region: 0x7b, script: 0x57, flags: 0x0}, - 642: {region: 0x165, script: 0x57, flags: 0x0}, - 643: {region: 0x165, script: 0x57, flags: 0x0}, - 644: {region: 0x165, script: 0x57, flags: 0x0}, - 645: {region: 0x165, script: 0x29, flags: 0x0}, - 646: {region: 0x123, script: 0xdf, flags: 0x0}, - 647: {region: 0xe8, script: 0x5, flags: 0x0}, - 648: {region: 0x165, script: 0x57, flags: 0x0}, - 649: {region: 0x165, script: 0x57, flags: 0x0}, - 650: {region: 0x1c, script: 0x5, flags: 0x1}, - 651: {region: 0x165, script: 0x57, flags: 0x0}, - 652: {region: 0x165, script: 0x57, flags: 0x0}, - 653: {region: 0x165, script: 0x57, flags: 0x0}, - 654: {region: 0x138, script: 0x57, flags: 0x0}, - 655: {region: 0x87, script: 0x5b, flags: 0x0}, - 656: {region: 0x97, script: 0x3b, flags: 0x0}, - 657: {region: 0x12f, script: 0x57, flags: 0x0}, - 658: {region: 0xe8, script: 0x5, flags: 0x0}, - 659: {region: 0x131, script: 0x57, flags: 0x0}, - 660: {region: 0x165, script: 0x57, flags: 0x0}, - 661: {region: 0xb7, script: 0x57, flags: 0x0}, - 662: {region: 0x106, script: 0x1f, flags: 0x0}, - 663: {region: 0x165, script: 0x57, flags: 0x0}, - 664: {region: 0x95, script: 0x57, flags: 0x0}, - 665: {region: 0x165, script: 0x57, flags: 0x0}, - 666: {region: 0x53, script: 0xdf, flags: 0x0}, - 667: {region: 0x165, script: 0x57, flags: 0x0}, - 668: {region: 0x165, script: 0x57, flags: 0x0}, - 669: {region: 0x165, script: 0x57, flags: 0x0}, - 670: {region: 0x165, script: 0x57, flags: 0x0}, - 671: {region: 0x99, script: 0x59, flags: 0x0}, - 672: {region: 0x165, script: 0x57, flags: 0x0}, - 673: {region: 0x165, script: 0x57, flags: 0x0}, - 674: {region: 0x106, script: 0x1f, flags: 0x0}, - 675: {region: 0x131, script: 0x57, flags: 0x0}, - 676: {region: 0x165, script: 0x57, flags: 0x0}, - 677: {region: 0xd9, script: 0x57, flags: 0x0}, - 678: {region: 0x165, script: 0x57, flags: 0x0}, - 679: {region: 0x165, script: 0x57, flags: 0x0}, - 680: {region: 0x21, script: 0x2, flags: 0x1}, - 681: {region: 0x165, script: 0x57, flags: 0x0}, - 682: {region: 0x165, script: 0x57, flags: 0x0}, - 683: {region: 0x9e, script: 0x57, flags: 0x0}, - 684: {region: 0x53, script: 0x5d, flags: 0x0}, - 685: {region: 0x95, script: 0x57, flags: 0x0}, - 686: {region: 0x9c, script: 0x5, flags: 0x0}, - 687: {region: 0x135, script: 0x57, flags: 0x0}, - 688: {region: 0x165, script: 0x57, flags: 0x0}, - 689: {region: 0x165, script: 0x57, flags: 0x0}, - 690: {region: 0x99, script: 0xda, flags: 0x0}, - 691: {region: 0x9e, script: 0x57, flags: 0x0}, - 692: {region: 0x165, script: 0x57, flags: 0x0}, - 693: {region: 0x4b, script: 0x57, flags: 0x0}, - 694: {region: 0x165, script: 0x57, flags: 0x0}, - 695: {region: 0x165, script: 0x57, flags: 0x0}, - 696: {region: 0xaf, script: 0x54, flags: 0x0}, - 697: {region: 0x165, script: 0x57, flags: 0x0}, - 698: {region: 0x165, script: 0x57, flags: 0x0}, - 699: {region: 0x4b, script: 0x57, flags: 0x0}, - 700: {region: 0x165, script: 0x57, flags: 0x0}, - 701: {region: 0x165, script: 0x57, flags: 0x0}, - 702: {region: 0x162, script: 0x57, flags: 0x0}, - 703: {region: 0x9c, script: 0x5, flags: 0x0}, - 704: {region: 0xb6, script: 0x57, flags: 0x0}, - 705: {region: 0xb8, script: 0x57, flags: 0x0}, - 706: {region: 0x4b, script: 0x57, flags: 0x0}, - 707: {region: 0x4b, script: 0x57, flags: 0x0}, - 708: {region: 0xa4, script: 0x57, flags: 0x0}, - 709: {region: 0xa4, script: 0x57, flags: 0x0}, - 710: {region: 0x9c, script: 0x5, flags: 0x0}, - 711: {region: 0xb8, script: 0x57, flags: 0x0}, - 712: {region: 0x123, script: 0xdf, flags: 0x0}, - 713: {region: 0x53, script: 0x38, flags: 0x0}, - 714: {region: 0x12b, script: 0x57, flags: 0x0}, - 715: {region: 0x95, script: 0x57, flags: 0x0}, - 716: {region: 0x52, script: 0x57, flags: 0x0}, - 717: {region: 0x99, script: 0x21, flags: 0x0}, - 718: {region: 0x99, script: 0x21, flags: 0x0}, - 719: {region: 0x95, script: 0x57, flags: 0x0}, - 720: {region: 0x23, script: 0x3, flags: 0x1}, - 721: {region: 0xa4, script: 0x57, flags: 0x0}, - 722: {region: 0x165, script: 0x57, flags: 0x0}, - 723: {region: 0xcf, script: 0x57, flags: 0x0}, - 724: {region: 0x165, script: 0x57, flags: 0x0}, - 725: {region: 0x165, script: 0x57, flags: 0x0}, - 726: {region: 0x165, script: 0x57, flags: 0x0}, - 727: {region: 0x165, script: 0x57, flags: 0x0}, - 728: {region: 0x165, script: 0x57, flags: 0x0}, - 729: {region: 0x165, script: 0x57, flags: 0x0}, - 730: {region: 0x165, script: 0x57, flags: 0x0}, - 731: {region: 0x165, script: 0x57, flags: 0x0}, - 732: {region: 0x165, script: 0x57, flags: 0x0}, - 733: {region: 0x165, script: 0x57, flags: 0x0}, - 734: {region: 0x165, script: 0x57, flags: 0x0}, - 735: {region: 0x165, script: 0x5, flags: 0x0}, - 736: {region: 0x106, script: 0x1f, flags: 0x0}, - 737: {region: 0xe7, script: 0x57, flags: 0x0}, - 738: {region: 0x165, script: 0x57, flags: 0x0}, - 739: {region: 0x95, script: 0x57, flags: 0x0}, - 740: {region: 0x165, script: 0x29, flags: 0x0}, - 741: {region: 0x165, script: 0x57, flags: 0x0}, - 742: {region: 0x165, script: 0x57, flags: 0x0}, - 743: {region: 0x165, script: 0x57, flags: 0x0}, - 744: {region: 0x112, script: 0x57, flags: 0x0}, - 745: {region: 0xa4, script: 0x57, flags: 0x0}, - 746: {region: 0x165, script: 0x57, flags: 0x0}, - 747: {region: 0x165, script: 0x57, flags: 0x0}, - 748: {region: 0x123, script: 0x5, flags: 0x0}, - 749: {region: 0xcc, script: 0x57, flags: 0x0}, - 750: {region: 0x165, script: 0x57, flags: 0x0}, - 751: {region: 0x165, script: 0x57, flags: 0x0}, - 752: {region: 0x165, script: 0x57, flags: 0x0}, - 753: {region: 0xbf, script: 0x57, flags: 0x0}, - 754: {region: 0xd1, script: 0x57, flags: 0x0}, - 755: {region: 0x165, script: 0x57, flags: 0x0}, - 756: {region: 0x52, script: 0x57, flags: 0x0}, - 757: {region: 0xdb, script: 0x21, flags: 0x0}, - 758: {region: 0x12f, script: 0x57, flags: 0x0}, - 759: {region: 0xc0, script: 0x57, flags: 0x0}, - 760: {region: 0x165, script: 0x57, flags: 0x0}, - 761: {region: 0x165, script: 0x57, flags: 0x0}, - 762: {region: 0xe0, script: 0x57, flags: 0x0}, - 763: {region: 0x165, script: 0x57, flags: 0x0}, - 764: {region: 0x95, script: 0x57, flags: 0x0}, - 765: {region: 0x9b, script: 0x3a, flags: 0x0}, - 766: {region: 0x165, script: 0x57, flags: 0x0}, - 767: {region: 0xc2, script: 0x1f, flags: 0x0}, - 768: {region: 0x165, script: 0x5, flags: 0x0}, - 769: {region: 0x165, script: 0x57, flags: 0x0}, - 770: {region: 0x165, script: 0x57, flags: 0x0}, - 771: {region: 0x165, script: 0x57, flags: 0x0}, - 772: {region: 0x99, script: 0x6b, flags: 0x0}, - 773: {region: 0x165, script: 0x57, flags: 0x0}, - 774: {region: 0x165, script: 0x57, flags: 0x0}, - 775: {region: 0x10b, script: 0x57, flags: 0x0}, - 776: {region: 0x165, script: 0x57, flags: 0x0}, - 777: {region: 0x165, script: 0x57, flags: 0x0}, - 778: {region: 0x165, script: 0x57, flags: 0x0}, - 779: {region: 0x26, script: 0x3, flags: 0x1}, - 780: {region: 0x165, script: 0x57, flags: 0x0}, - 781: {region: 0x165, script: 0x57, flags: 0x0}, - 782: {region: 0x99, script: 0xe, flags: 0x0}, - 783: {region: 0xc4, script: 0x72, flags: 0x0}, - 785: {region: 0x165, script: 0x57, flags: 0x0}, - 786: {region: 0x49, script: 0x57, flags: 0x0}, - 787: {region: 0x49, script: 0x57, flags: 0x0}, - 788: {region: 0x37, script: 0x57, flags: 0x0}, - 789: {region: 0x165, script: 0x57, flags: 0x0}, - 790: {region: 0x165, script: 0x57, flags: 0x0}, - 791: {region: 0x165, script: 0x57, flags: 0x0}, - 792: {region: 0x165, script: 0x57, flags: 0x0}, - 793: {region: 0x165, script: 0x57, flags: 0x0}, - 794: {region: 0x165, script: 0x57, flags: 0x0}, - 795: {region: 0x99, script: 0x21, flags: 0x0}, - 796: {region: 0xdb, script: 0x21, flags: 0x0}, - 797: {region: 0x106, script: 0x1f, flags: 0x0}, - 798: {region: 0x35, script: 0x6f, flags: 0x0}, - 799: {region: 0x29, script: 0x3, flags: 0x1}, - 800: {region: 0xcb, script: 0x57, flags: 0x0}, - 801: {region: 0x165, script: 0x57, flags: 0x0}, - 802: {region: 0x165, script: 0x57, flags: 0x0}, - 803: {region: 0x165, script: 0x57, flags: 0x0}, - 804: {region: 0x99, script: 0x21, flags: 0x0}, - 805: {region: 0x52, script: 0x57, flags: 0x0}, - 807: {region: 0x165, script: 0x57, flags: 0x0}, - 808: {region: 0x135, script: 0x57, flags: 0x0}, - 809: {region: 0x165, script: 0x57, flags: 0x0}, - 810: {region: 0x165, script: 0x57, flags: 0x0}, - 811: {region: 0xe8, script: 0x5, flags: 0x0}, - 812: {region: 0xc3, script: 0x57, flags: 0x0}, - 813: {region: 0x99, script: 0x21, flags: 0x0}, - 814: {region: 0x95, script: 0x57, flags: 0x0}, - 815: {region: 0x164, script: 0x57, flags: 0x0}, - 816: {region: 0x165, script: 0x57, flags: 0x0}, - 817: {region: 0xc4, script: 0x72, flags: 0x0}, - 818: {region: 0x165, script: 0x57, flags: 0x0}, - 819: {region: 0x165, script: 0x29, flags: 0x0}, - 820: {region: 0x106, script: 0x1f, flags: 0x0}, - 821: {region: 0x165, script: 0x57, flags: 0x0}, - 822: {region: 0x131, script: 0x57, flags: 0x0}, - 823: {region: 0x9c, script: 0x63, flags: 0x0}, - 824: {region: 0x165, script: 0x57, flags: 0x0}, - 825: {region: 0x165, script: 0x57, flags: 0x0}, - 826: {region: 0x9c, script: 0x5, flags: 0x0}, - 827: {region: 0x165, script: 0x57, flags: 0x0}, - 828: {region: 0x165, script: 0x57, flags: 0x0}, - 829: {region: 0x165, script: 0x57, flags: 0x0}, - 830: {region: 0xdd, script: 0x57, flags: 0x0}, - 831: {region: 0x165, script: 0x57, flags: 0x0}, - 832: {region: 0x165, script: 0x57, flags: 0x0}, - 834: {region: 0x165, script: 0x57, flags: 0x0}, - 835: {region: 0x53, script: 0x38, flags: 0x0}, - 836: {region: 0x9e, script: 0x57, flags: 0x0}, - 837: {region: 0xd2, script: 0x57, flags: 0x0}, - 838: {region: 0x165, script: 0x57, flags: 0x0}, - 839: {region: 0xda, script: 0x57, flags: 0x0}, - 840: {region: 0x165, script: 0x57, flags: 0x0}, - 841: {region: 0x165, script: 0x57, flags: 0x0}, - 842: {region: 0x165, script: 0x57, flags: 0x0}, - 843: {region: 0xcf, script: 0x57, flags: 0x0}, - 844: {region: 0x165, script: 0x57, flags: 0x0}, - 845: {region: 0x165, script: 0x57, flags: 0x0}, - 846: {region: 0x164, script: 0x57, flags: 0x0}, - 847: {region: 0xd1, script: 0x57, flags: 0x0}, - 848: {region: 0x60, script: 0x57, flags: 0x0}, - 849: {region: 0xdb, script: 0x21, flags: 0x0}, - 850: {region: 0x165, script: 0x57, flags: 0x0}, - 851: {region: 0xdb, script: 0x21, flags: 0x0}, - 852: {region: 0x165, script: 0x57, flags: 0x0}, - 853: {region: 0x165, script: 0x57, flags: 0x0}, - 854: {region: 0xd2, script: 0x57, flags: 0x0}, - 855: {region: 0x165, script: 0x57, flags: 0x0}, - 856: {region: 0x165, script: 0x57, flags: 0x0}, - 857: {region: 0xd1, script: 0x57, flags: 0x0}, - 858: {region: 0x165, script: 0x57, flags: 0x0}, - 859: {region: 0xcf, script: 0x57, flags: 0x0}, - 860: {region: 0xcf, script: 0x57, flags: 0x0}, - 861: {region: 0x165, script: 0x57, flags: 0x0}, - 862: {region: 0x165, script: 0x57, flags: 0x0}, - 863: {region: 0x95, script: 0x57, flags: 0x0}, - 864: {region: 0x165, script: 0x57, flags: 0x0}, - 865: {region: 0xdf, script: 0x57, flags: 0x0}, - 866: {region: 0x165, script: 0x57, flags: 0x0}, - 867: {region: 0x165, script: 0x57, flags: 0x0}, - 868: {region: 0x99, script: 0x57, flags: 0x0}, - 869: {region: 0x165, script: 0x57, flags: 0x0}, - 870: {region: 0x165, script: 0x57, flags: 0x0}, - 871: {region: 0xd9, script: 0x57, flags: 0x0}, - 872: {region: 0x52, script: 0x57, flags: 0x0}, - 873: {region: 0x165, script: 0x57, flags: 0x0}, - 874: {region: 0xda, script: 0x57, flags: 0x0}, - 875: {region: 0x165, script: 0x57, flags: 0x0}, - 876: {region: 0x52, script: 0x57, flags: 0x0}, - 877: {region: 0x165, script: 0x57, flags: 0x0}, - 878: {region: 0x165, script: 0x57, flags: 0x0}, - 879: {region: 0xda, script: 0x57, flags: 0x0}, - 880: {region: 0x123, script: 0x53, flags: 0x0}, - 881: {region: 0x99, script: 0x21, flags: 0x0}, - 882: {region: 0x10c, script: 0xbf, flags: 0x0}, - 883: {region: 0x165, script: 0x57, flags: 0x0}, - 884: {region: 0x165, script: 0x57, flags: 0x0}, - 885: {region: 0x84, script: 0x78, flags: 0x0}, - 886: {region: 0x161, script: 0x57, flags: 0x0}, - 887: {region: 0x165, script: 0x57, flags: 0x0}, - 888: {region: 0x49, script: 0x17, flags: 0x0}, - 889: {region: 0x165, script: 0x57, flags: 0x0}, - 890: {region: 0x161, script: 0x57, flags: 0x0}, - 891: {region: 0x165, script: 0x57, flags: 0x0}, - 892: {region: 0x165, script: 0x57, flags: 0x0}, - 893: {region: 0x165, script: 0x57, flags: 0x0}, - 894: {region: 0x165, script: 0x57, flags: 0x0}, - 895: {region: 0x165, script: 0x57, flags: 0x0}, - 896: {region: 0x117, script: 0x57, flags: 0x0}, - 897: {region: 0x165, script: 0x57, flags: 0x0}, - 898: {region: 0x165, script: 0x57, flags: 0x0}, - 899: {region: 0x135, script: 0x57, flags: 0x0}, - 900: {region: 0x165, script: 0x57, flags: 0x0}, - 901: {region: 0x53, script: 0x57, flags: 0x0}, - 902: {region: 0x165, script: 0x57, flags: 0x0}, - 903: {region: 0xce, script: 0x57, flags: 0x0}, - 904: {region: 0x12f, script: 0x57, flags: 0x0}, - 905: {region: 0x131, script: 0x57, flags: 0x0}, - 906: {region: 0x80, script: 0x57, flags: 0x0}, - 907: {region: 0x78, script: 0x57, flags: 0x0}, - 908: {region: 0x165, script: 0x57, flags: 0x0}, - 910: {region: 0x165, script: 0x57, flags: 0x0}, - 911: {region: 0x165, script: 0x57, flags: 0x0}, - 912: {region: 0x6f, script: 0x57, flags: 0x0}, - 913: {region: 0x165, script: 0x57, flags: 0x0}, - 914: {region: 0x165, script: 0x57, flags: 0x0}, - 915: {region: 0x165, script: 0x57, flags: 0x0}, - 916: {region: 0x165, script: 0x57, flags: 0x0}, - 917: {region: 0x99, script: 0x7d, flags: 0x0}, - 918: {region: 0x165, script: 0x57, flags: 0x0}, - 919: {region: 0x165, script: 0x5, flags: 0x0}, - 920: {region: 0x7d, script: 0x1f, flags: 0x0}, - 921: {region: 0x135, script: 0x7e, flags: 0x0}, - 922: {region: 0x165, script: 0x5, flags: 0x0}, - 923: {region: 0xc5, script: 0x7c, flags: 0x0}, - 924: {region: 0x165, script: 0x57, flags: 0x0}, - 925: {region: 0x2c, script: 0x3, flags: 0x1}, - 926: {region: 0xe7, script: 0x57, flags: 0x0}, - 927: {region: 0x2f, script: 0x2, flags: 0x1}, - 928: {region: 0xe7, script: 0x57, flags: 0x0}, - 929: {region: 0x30, script: 0x57, flags: 0x0}, - 930: {region: 0xf0, script: 0x57, flags: 0x0}, - 931: {region: 0x165, script: 0x57, flags: 0x0}, - 932: {region: 0x78, script: 0x57, flags: 0x0}, - 933: {region: 0xd6, script: 0x57, flags: 0x0}, - 934: {region: 0x135, script: 0x57, flags: 0x0}, - 935: {region: 0x49, script: 0x57, flags: 0x0}, - 936: {region: 0x165, script: 0x57, flags: 0x0}, - 937: {region: 0x9c, script: 0xe8, flags: 0x0}, - 938: {region: 0x165, script: 0x57, flags: 0x0}, - 939: {region: 0x60, script: 0x57, flags: 0x0}, - 940: {region: 0x165, script: 0x5, flags: 0x0}, - 941: {region: 0xb0, script: 0x87, flags: 0x0}, - 943: {region: 0x165, script: 0x57, flags: 0x0}, - 944: {region: 0x165, script: 0x57, flags: 0x0}, - 945: {region: 0x99, script: 0x12, flags: 0x0}, - 946: {region: 0xa4, script: 0x57, flags: 0x0}, - 947: {region: 0xe9, script: 0x57, flags: 0x0}, - 948: {region: 0x165, script: 0x57, flags: 0x0}, - 949: {region: 0x9e, script: 0x57, flags: 0x0}, - 950: {region: 0x165, script: 0x57, flags: 0x0}, - 951: {region: 0x165, script: 0x57, flags: 0x0}, - 952: {region: 0x87, script: 0x31, flags: 0x0}, - 953: {region: 0x75, script: 0x57, flags: 0x0}, - 954: {region: 0x165, script: 0x57, flags: 0x0}, - 955: {region: 0xe8, script: 0x4a, flags: 0x0}, - 956: {region: 0x9c, script: 0x5, flags: 0x0}, - 957: {region: 0x1, script: 0x57, flags: 0x0}, - 958: {region: 0x24, script: 0x5, flags: 0x0}, - 959: {region: 0x165, script: 0x57, flags: 0x0}, - 960: {region: 0x41, script: 0x57, flags: 0x0}, - 961: {region: 0x165, script: 0x57, flags: 0x0}, - 962: {region: 0x7a, script: 0x57, flags: 0x0}, - 963: {region: 0x165, script: 0x57, flags: 0x0}, - 964: {region: 0xe4, script: 0x57, flags: 0x0}, - 965: {region: 0x89, script: 0x57, flags: 0x0}, - 966: {region: 0x69, script: 0x57, flags: 0x0}, - 967: {region: 0x165, script: 0x57, flags: 0x0}, - 968: {region: 0x99, script: 0x21, flags: 0x0}, - 969: {region: 0x165, script: 0x57, flags: 0x0}, - 970: {region: 0x102, script: 0x57, flags: 0x0}, - 971: {region: 0x95, script: 0x57, flags: 0x0}, - 972: {region: 0x165, script: 0x57, flags: 0x0}, - 973: {region: 0x165, script: 0x57, flags: 0x0}, - 974: {region: 0x9e, script: 0x57, flags: 0x0}, - 975: {region: 0x165, script: 0x5, flags: 0x0}, - 976: {region: 0x99, script: 0x57, flags: 0x0}, - 977: {region: 0x31, script: 0x2, flags: 0x1}, - 978: {region: 0xdb, script: 0x21, flags: 0x0}, - 979: {region: 0x35, script: 0xe, flags: 0x0}, - 980: {region: 0x4e, script: 0x57, flags: 0x0}, - 981: {region: 0x72, script: 0x57, flags: 0x0}, - 982: {region: 0x4e, script: 0x57, flags: 0x0}, - 983: {region: 0x9c, script: 0x5, flags: 0x0}, - 984: {region: 0x10c, script: 0x57, flags: 0x0}, - 985: {region: 0x3a, script: 0x57, flags: 0x0}, - 986: {region: 0x165, script: 0x57, flags: 0x0}, - 987: {region: 0xd1, script: 0x57, flags: 0x0}, - 988: {region: 0x104, script: 0x57, flags: 0x0}, - 989: {region: 0x95, script: 0x57, flags: 0x0}, - 990: {region: 0x12f, script: 0x57, flags: 0x0}, - 991: {region: 0x165, script: 0x57, flags: 0x0}, - 992: {region: 0x165, script: 0x57, flags: 0x0}, - 993: {region: 0x73, script: 0x57, flags: 0x0}, - 994: {region: 0x106, script: 0x1f, flags: 0x0}, - 995: {region: 0x130, script: 0x1f, flags: 0x0}, - 996: {region: 0x109, script: 0x57, flags: 0x0}, - 997: {region: 0x107, script: 0x57, flags: 0x0}, - 998: {region: 0x12f, script: 0x57, flags: 0x0}, - 999: {region: 0x165, script: 0x57, flags: 0x0}, - 1000: {region: 0xa2, script: 0x49, flags: 0x0}, - 1001: {region: 0x99, script: 0x21, flags: 0x0}, - 1002: {region: 0x80, script: 0x57, flags: 0x0}, - 1003: {region: 0x106, script: 0x1f, flags: 0x0}, - 1004: {region: 0xa4, script: 0x57, flags: 0x0}, - 1005: {region: 0x95, script: 0x57, flags: 0x0}, - 1006: {region: 0x99, script: 0x57, flags: 0x0}, - 1007: {region: 0x114, script: 0x57, flags: 0x0}, - 1008: {region: 0x99, script: 0xc3, flags: 0x0}, - 1009: {region: 0x165, script: 0x57, flags: 0x0}, - 1010: {region: 0x165, script: 0x57, flags: 0x0}, - 1011: {region: 0x12f, script: 0x57, flags: 0x0}, - 1012: {region: 0x9e, script: 0x57, flags: 0x0}, - 1013: {region: 0x99, script: 0x21, flags: 0x0}, - 1014: {region: 0x165, script: 0x5, flags: 0x0}, - 1015: {region: 0x9e, script: 0x57, flags: 0x0}, - 1016: {region: 0x7b, script: 0x57, flags: 0x0}, - 1017: {region: 0x49, script: 0x57, flags: 0x0}, - 1018: {region: 0x33, script: 0x4, flags: 0x1}, - 1019: {region: 0x9e, script: 0x57, flags: 0x0}, - 1020: {region: 0x9c, script: 0x5, flags: 0x0}, - 1021: {region: 0xda, script: 0x57, flags: 0x0}, - 1022: {region: 0x4f, script: 0x57, flags: 0x0}, - 1023: {region: 0xd1, script: 0x57, flags: 0x0}, - 1024: {region: 0xcf, script: 0x57, flags: 0x0}, - 1025: {region: 0xc3, script: 0x57, flags: 0x0}, - 1026: {region: 0x4c, script: 0x57, flags: 0x0}, - 1027: {region: 0x96, script: 0x7a, flags: 0x0}, - 1028: {region: 0xb6, script: 0x57, flags: 0x0}, - 1029: {region: 0x165, script: 0x29, flags: 0x0}, - 1030: {region: 0x165, script: 0x57, flags: 0x0}, - 1032: {region: 0xba, script: 0xdc, flags: 0x0}, - 1033: {region: 0x165, script: 0x57, flags: 0x0}, - 1034: {region: 0xc4, script: 0x72, flags: 0x0}, - 1035: {region: 0x165, script: 0x5, flags: 0x0}, - 1036: {region: 0xb3, script: 0xca, flags: 0x0}, - 1037: {region: 0x6f, script: 0x57, flags: 0x0}, - 1038: {region: 0x165, script: 0x57, flags: 0x0}, - 1039: {region: 0x165, script: 0x57, flags: 0x0}, - 1040: {region: 0x165, script: 0x57, flags: 0x0}, - 1041: {region: 0x165, script: 0x57, flags: 0x0}, - 1042: {region: 0x111, script: 0x57, flags: 0x0}, - 1043: {region: 0x165, script: 0x57, flags: 0x0}, - 1044: {region: 0xe8, script: 0x5, flags: 0x0}, - 1045: {region: 0x165, script: 0x57, flags: 0x0}, - 1046: {region: 0x10f, script: 0x57, flags: 0x0}, - 1047: {region: 0x165, script: 0x57, flags: 0x0}, - 1048: {region: 0xe9, script: 0x57, flags: 0x0}, - 1049: {region: 0x165, script: 0x57, flags: 0x0}, - 1050: {region: 0x95, script: 0x57, flags: 0x0}, - 1051: {region: 0x142, script: 0x57, flags: 0x0}, - 1052: {region: 0x10c, script: 0x57, flags: 0x0}, - 1054: {region: 0x10c, script: 0x57, flags: 0x0}, - 1055: {region: 0x72, script: 0x57, flags: 0x0}, - 1056: {region: 0x97, script: 0xc0, flags: 0x0}, - 1057: {region: 0x165, script: 0x57, flags: 0x0}, - 1058: {region: 0x72, script: 0x57, flags: 0x0}, - 1059: {region: 0x164, script: 0x57, flags: 0x0}, - 1060: {region: 0x165, script: 0x57, flags: 0x0}, - 1061: {region: 0xc3, script: 0x57, flags: 0x0}, - 1062: {region: 0x165, script: 0x57, flags: 0x0}, - 1063: {region: 0x165, script: 0x57, flags: 0x0}, - 1064: {region: 0x165, script: 0x57, flags: 0x0}, - 1065: {region: 0x115, script: 0x57, flags: 0x0}, - 1066: {region: 0x165, script: 0x57, flags: 0x0}, - 1067: {region: 0x165, script: 0x57, flags: 0x0}, - 1068: {region: 0x123, script: 0xdf, flags: 0x0}, - 1069: {region: 0x165, script: 0x57, flags: 0x0}, - 1070: {region: 0x165, script: 0x57, flags: 0x0}, - 1071: {region: 0x165, script: 0x57, flags: 0x0}, - 1072: {region: 0x165, script: 0x57, flags: 0x0}, - 1073: {region: 0x27, script: 0x57, flags: 0x0}, - 1074: {region: 0x37, script: 0x5, flags: 0x1}, - 1075: {region: 0x99, script: 0xcb, flags: 0x0}, - 1076: {region: 0x116, script: 0x57, flags: 0x0}, - 1077: {region: 0x114, script: 0x57, flags: 0x0}, - 1078: {region: 0x99, script: 0x21, flags: 0x0}, - 1079: {region: 0x161, script: 0x57, flags: 0x0}, - 1080: {region: 0x165, script: 0x57, flags: 0x0}, - 1081: {region: 0x165, script: 0x57, flags: 0x0}, - 1082: {region: 0x6d, script: 0x57, flags: 0x0}, - 1083: {region: 0x161, script: 0x57, flags: 0x0}, - 1084: {region: 0x165, script: 0x57, flags: 0x0}, - 1085: {region: 0x60, script: 0x57, flags: 0x0}, - 1086: {region: 0x95, script: 0x57, flags: 0x0}, - 1087: {region: 0x165, script: 0x57, flags: 0x0}, - 1088: {region: 0x165, script: 0x57, flags: 0x0}, - 1089: {region: 0x12f, script: 0x57, flags: 0x0}, - 1090: {region: 0x165, script: 0x57, flags: 0x0}, - 1091: {region: 0x84, script: 0x57, flags: 0x0}, - 1092: {region: 0x10c, script: 0x57, flags: 0x0}, - 1093: {region: 0x12f, script: 0x57, flags: 0x0}, - 1094: {region: 0x15f, script: 0x5, flags: 0x0}, - 1095: {region: 0x4b, script: 0x57, flags: 0x0}, - 1096: {region: 0x60, script: 0x57, flags: 0x0}, - 1097: {region: 0x165, script: 0x57, flags: 0x0}, - 1098: {region: 0x99, script: 0x21, flags: 0x0}, - 1099: {region: 0x95, script: 0x57, flags: 0x0}, - 1100: {region: 0x165, script: 0x57, flags: 0x0}, - 1101: {region: 0x35, script: 0xe, flags: 0x0}, - 1102: {region: 0x9b, script: 0xcf, flags: 0x0}, - 1103: {region: 0xe9, script: 0x57, flags: 0x0}, - 1104: {region: 0x99, script: 0xd7, flags: 0x0}, - 1105: {region: 0xdb, script: 0x21, flags: 0x0}, - 1106: {region: 0x165, script: 0x57, flags: 0x0}, - 1107: {region: 0x165, script: 0x57, flags: 0x0}, - 1108: {region: 0x165, script: 0x57, flags: 0x0}, - 1109: {region: 0x165, script: 0x57, flags: 0x0}, - 1110: {region: 0x165, script: 0x57, flags: 0x0}, - 1111: {region: 0x165, script: 0x57, flags: 0x0}, - 1112: {region: 0x165, script: 0x57, flags: 0x0}, - 1113: {region: 0x165, script: 0x57, flags: 0x0}, - 1114: {region: 0xe7, script: 0x57, flags: 0x0}, - 1115: {region: 0x165, script: 0x57, flags: 0x0}, - 1116: {region: 0x165, script: 0x57, flags: 0x0}, - 1117: {region: 0x99, script: 0x4f, flags: 0x0}, - 1118: {region: 0x53, script: 0xd5, flags: 0x0}, - 1119: {region: 0xdb, script: 0x21, flags: 0x0}, - 1120: {region: 0xdb, script: 0x21, flags: 0x0}, - 1121: {region: 0x99, script: 0xda, flags: 0x0}, - 1122: {region: 0x165, script: 0x57, flags: 0x0}, - 1123: {region: 0x112, script: 0x57, flags: 0x0}, - 1124: {region: 0x131, script: 0x57, flags: 0x0}, - 1125: {region: 0x126, script: 0x57, flags: 0x0}, - 1126: {region: 0x165, script: 0x57, flags: 0x0}, - 1127: {region: 0x3c, script: 0x3, flags: 0x1}, - 1128: {region: 0x165, script: 0x57, flags: 0x0}, - 1129: {region: 0x165, script: 0x57, flags: 0x0}, - 1130: {region: 0x165, script: 0x57, flags: 0x0}, - 1131: {region: 0x123, script: 0xdf, flags: 0x0}, - 1132: {region: 0xdb, script: 0x21, flags: 0x0}, - 1133: {region: 0xdb, script: 0x21, flags: 0x0}, - 1134: {region: 0xdb, script: 0x21, flags: 0x0}, - 1135: {region: 0x6f, script: 0x29, flags: 0x0}, - 1136: {region: 0x165, script: 0x57, flags: 0x0}, - 1137: {region: 0x6d, script: 0x29, flags: 0x0}, - 1138: {region: 0x165, script: 0x57, flags: 0x0}, - 1139: {region: 0x165, script: 0x57, flags: 0x0}, - 1140: {region: 0x165, script: 0x57, flags: 0x0}, - 1141: {region: 0xd6, script: 0x57, flags: 0x0}, - 1142: {region: 0x127, script: 0x57, flags: 0x0}, - 1143: {region: 0x125, script: 0x57, flags: 0x0}, - 1144: {region: 0x32, script: 0x57, flags: 0x0}, - 1145: {region: 0xdb, script: 0x21, flags: 0x0}, - 1146: {region: 0xe7, script: 0x57, flags: 0x0}, - 1147: {region: 0x165, script: 0x57, flags: 0x0}, - 1148: {region: 0x165, script: 0x57, flags: 0x0}, - 1149: {region: 0x32, script: 0x57, flags: 0x0}, - 1150: {region: 0xd4, script: 0x57, flags: 0x0}, - 1151: {region: 0x165, script: 0x57, flags: 0x0}, - 1152: {region: 0x161, script: 0x57, flags: 0x0}, - 1153: {region: 0x165, script: 0x57, flags: 0x0}, - 1154: {region: 0x129, script: 0x57, flags: 0x0}, - 1155: {region: 0x165, script: 0x57, flags: 0x0}, - 1156: {region: 0xce, script: 0x57, flags: 0x0}, - 1157: {region: 0x165, script: 0x57, flags: 0x0}, - 1158: {region: 0xe6, script: 0x57, flags: 0x0}, - 1159: {region: 0x165, script: 0x57, flags: 0x0}, - 1160: {region: 0x165, script: 0x57, flags: 0x0}, - 1161: {region: 0x165, script: 0x57, flags: 0x0}, - 1162: {region: 0x12b, script: 0x57, flags: 0x0}, - 1163: {region: 0x12b, script: 0x57, flags: 0x0}, - 1164: {region: 0x12e, script: 0x57, flags: 0x0}, - 1165: {region: 0x165, script: 0x5, flags: 0x0}, - 1166: {region: 0x161, script: 0x57, flags: 0x0}, - 1167: {region: 0x87, script: 0x31, flags: 0x0}, - 1168: {region: 0xdb, script: 0x21, flags: 0x0}, - 1169: {region: 0xe7, script: 0x57, flags: 0x0}, - 1170: {region: 0x43, script: 0xe0, flags: 0x0}, - 1171: {region: 0x165, script: 0x57, flags: 0x0}, - 1172: {region: 0x106, script: 0x1f, flags: 0x0}, - 1173: {region: 0x165, script: 0x57, flags: 0x0}, - 1174: {region: 0x165, script: 0x57, flags: 0x0}, - 1175: {region: 0x131, script: 0x57, flags: 0x0}, - 1176: {region: 0x165, script: 0x57, flags: 0x0}, - 1177: {region: 0x123, script: 0xdf, flags: 0x0}, - 1178: {region: 0x32, script: 0x57, flags: 0x0}, - 1179: {region: 0x165, script: 0x57, flags: 0x0}, - 1180: {region: 0x165, script: 0x57, flags: 0x0}, - 1181: {region: 0xce, script: 0x57, flags: 0x0}, - 1182: {region: 0x165, script: 0x57, flags: 0x0}, - 1183: {region: 0x165, script: 0x57, flags: 0x0}, - 1184: {region: 0x12d, script: 0x57, flags: 0x0}, - 1185: {region: 0x165, script: 0x57, flags: 0x0}, - 1187: {region: 0x165, script: 0x57, flags: 0x0}, - 1188: {region: 0xd4, script: 0x57, flags: 0x0}, - 1189: {region: 0x53, script: 0xd8, flags: 0x0}, - 1190: {region: 0xe5, script: 0x57, flags: 0x0}, - 1191: {region: 0x165, script: 0x57, flags: 0x0}, - 1192: {region: 0x106, script: 0x1f, flags: 0x0}, - 1193: {region: 0xba, script: 0x57, flags: 0x0}, - 1194: {region: 0x165, script: 0x57, flags: 0x0}, - 1195: {region: 0x106, script: 0x1f, flags: 0x0}, - 1196: {region: 0x3f, script: 0x4, flags: 0x1}, - 1197: {region: 0x11c, script: 0xe2, flags: 0x0}, - 1198: {region: 0x130, script: 0x1f, flags: 0x0}, - 1199: {region: 0x75, script: 0x57, flags: 0x0}, - 1200: {region: 0x2a, script: 0x57, flags: 0x0}, - 1202: {region: 0x43, script: 0x3, flags: 0x1}, - 1203: {region: 0x99, script: 0xe, flags: 0x0}, - 1204: {region: 0xe8, script: 0x5, flags: 0x0}, - 1205: {region: 0x165, script: 0x57, flags: 0x0}, - 1206: {region: 0x165, script: 0x57, flags: 0x0}, - 1207: {region: 0x165, script: 0x57, flags: 0x0}, - 1208: {region: 0x165, script: 0x57, flags: 0x0}, - 1209: {region: 0x165, script: 0x57, flags: 0x0}, - 1210: {region: 0x165, script: 0x57, flags: 0x0}, - 1211: {region: 0x165, script: 0x57, flags: 0x0}, - 1212: {region: 0x46, script: 0x4, flags: 0x1}, - 1213: {region: 0x165, script: 0x57, flags: 0x0}, - 1214: {region: 0xb4, script: 0xe3, flags: 0x0}, - 1215: {region: 0x165, script: 0x57, flags: 0x0}, - 1216: {region: 0x161, script: 0x57, flags: 0x0}, - 1217: {region: 0x9e, script: 0x57, flags: 0x0}, - 1218: {region: 0x106, script: 0x57, flags: 0x0}, - 1219: {region: 0x13e, script: 0x57, flags: 0x0}, - 1220: {region: 0x11b, script: 0x57, flags: 0x0}, - 1221: {region: 0x165, script: 0x57, flags: 0x0}, - 1222: {region: 0x36, script: 0x57, flags: 0x0}, - 1223: {region: 0x60, script: 0x57, flags: 0x0}, - 1224: {region: 0xd1, script: 0x57, flags: 0x0}, - 1225: {region: 0x1, script: 0x57, flags: 0x0}, - 1226: {region: 0x106, script: 0x57, flags: 0x0}, - 1227: {region: 0x6a, script: 0x57, flags: 0x0}, - 1228: {region: 0x12f, script: 0x57, flags: 0x0}, - 1229: {region: 0x165, script: 0x57, flags: 0x0}, - 1230: {region: 0x36, script: 0x57, flags: 0x0}, - 1231: {region: 0x4e, script: 0x57, flags: 0x0}, - 1232: {region: 0x165, script: 0x57, flags: 0x0}, - 1233: {region: 0x6f, script: 0x29, flags: 0x0}, - 1234: {region: 0x165, script: 0x57, flags: 0x0}, - 1235: {region: 0xe7, script: 0x57, flags: 0x0}, - 1236: {region: 0x2f, script: 0x57, flags: 0x0}, - 1237: {region: 0x99, script: 0xda, flags: 0x0}, - 1238: {region: 0x99, script: 0x21, flags: 0x0}, - 1239: {region: 0x165, script: 0x57, flags: 0x0}, - 1240: {region: 0x165, script: 0x57, flags: 0x0}, - 1241: {region: 0x165, script: 0x57, flags: 0x0}, - 1242: {region: 0x165, script: 0x57, flags: 0x0}, - 1243: {region: 0x165, script: 0x57, flags: 0x0}, - 1244: {region: 0x165, script: 0x57, flags: 0x0}, - 1245: {region: 0x165, script: 0x57, flags: 0x0}, - 1246: {region: 0x165, script: 0x57, flags: 0x0}, - 1247: {region: 0x165, script: 0x57, flags: 0x0}, - 1248: {region: 0x140, script: 0x57, flags: 0x0}, - 1249: {region: 0x165, script: 0x57, flags: 0x0}, - 1250: {region: 0x165, script: 0x57, flags: 0x0}, - 1251: {region: 0xa8, script: 0x5, flags: 0x0}, - 1252: {region: 0x165, script: 0x57, flags: 0x0}, - 1253: {region: 0x114, script: 0x57, flags: 0x0}, - 1254: {region: 0x165, script: 0x57, flags: 0x0}, - 1255: {region: 0x165, script: 0x57, flags: 0x0}, - 1256: {region: 0x165, script: 0x57, flags: 0x0}, - 1257: {region: 0x165, script: 0x57, flags: 0x0}, - 1258: {region: 0x99, script: 0x21, flags: 0x0}, - 1259: {region: 0x53, script: 0x38, flags: 0x0}, - 1260: {region: 0x165, script: 0x57, flags: 0x0}, - 1261: {region: 0x165, script: 0x57, flags: 0x0}, - 1262: {region: 0x41, script: 0x57, flags: 0x0}, - 1263: {region: 0x165, script: 0x57, flags: 0x0}, - 1264: {region: 0x12b, script: 0x18, flags: 0x0}, - 1265: {region: 0x165, script: 0x57, flags: 0x0}, - 1266: {region: 0x161, script: 0x57, flags: 0x0}, - 1267: {region: 0x165, script: 0x57, flags: 0x0}, - 1268: {region: 0x12b, script: 0x5f, flags: 0x0}, - 1269: {region: 0x12b, script: 0x60, flags: 0x0}, - 1270: {region: 0x7d, script: 0x2b, flags: 0x0}, - 1271: {region: 0x53, script: 0x64, flags: 0x0}, - 1272: {region: 0x10b, script: 0x69, flags: 0x0}, - 1273: {region: 0x108, script: 0x73, flags: 0x0}, - 1274: {region: 0x99, script: 0x21, flags: 0x0}, - 1275: {region: 0x131, script: 0x57, flags: 0x0}, - 1276: {region: 0x165, script: 0x57, flags: 0x0}, - 1277: {region: 0x9c, script: 0x8a, flags: 0x0}, - 1278: {region: 0x165, script: 0x57, flags: 0x0}, - 1279: {region: 0x15e, script: 0xc2, flags: 0x0}, - 1280: {region: 0x165, script: 0x57, flags: 0x0}, - 1281: {region: 0x165, script: 0x57, flags: 0x0}, - 1282: {region: 0xdb, script: 0x21, flags: 0x0}, - 1283: {region: 0x165, script: 0x57, flags: 0x0}, - 1284: {region: 0x165, script: 0x57, flags: 0x0}, - 1285: {region: 0xd1, script: 0x57, flags: 0x0}, - 1286: {region: 0x75, script: 0x57, flags: 0x0}, - 1287: {region: 0x165, script: 0x57, flags: 0x0}, - 1288: {region: 0x165, script: 0x57, flags: 0x0}, - 1289: {region: 0x52, script: 0x57, flags: 0x0}, - 1290: {region: 0x165, script: 0x57, flags: 0x0}, - 1291: {region: 0x165, script: 0x57, flags: 0x0}, - 1292: {region: 0x165, script: 0x57, flags: 0x0}, - 1293: {region: 0x52, script: 0x57, flags: 0x0}, - 1294: {region: 0x165, script: 0x57, flags: 0x0}, - 1295: {region: 0x165, script: 0x57, flags: 0x0}, - 1296: {region: 0x165, script: 0x57, flags: 0x0}, - 1297: {region: 0x165, script: 0x57, flags: 0x0}, - 1298: {region: 0x1, script: 0x3b, flags: 0x0}, - 1299: {region: 0x165, script: 0x57, flags: 0x0}, - 1300: {region: 0x165, script: 0x57, flags: 0x0}, - 1301: {region: 0x165, script: 0x57, flags: 0x0}, - 1302: {region: 0x165, script: 0x57, flags: 0x0}, - 1303: {region: 0x165, script: 0x57, flags: 0x0}, - 1304: {region: 0xd6, script: 0x57, flags: 0x0}, - 1305: {region: 0x165, script: 0x57, flags: 0x0}, - 1306: {region: 0x165, script: 0x57, flags: 0x0}, - 1307: {region: 0x165, script: 0x57, flags: 0x0}, - 1308: {region: 0x41, script: 0x57, flags: 0x0}, - 1309: {region: 0x165, script: 0x57, flags: 0x0}, - 1310: {region: 0xcf, script: 0x57, flags: 0x0}, - 1311: {region: 0x4a, script: 0x3, flags: 0x1}, - 1312: {region: 0x165, script: 0x57, flags: 0x0}, - 1313: {region: 0x165, script: 0x57, flags: 0x0}, - 1314: {region: 0x165, script: 0x57, flags: 0x0}, - 1315: {region: 0x53, script: 0x57, flags: 0x0}, - 1316: {region: 0x10b, script: 0x57, flags: 0x0}, - 1318: {region: 0xa8, script: 0x5, flags: 0x0}, - 1319: {region: 0xd9, script: 0x57, flags: 0x0}, - 1320: {region: 0xba, script: 0xdc, flags: 0x0}, - 1321: {region: 0x4d, script: 0x14, flags: 0x1}, - 1322: {region: 0x53, script: 0x79, flags: 0x0}, - 1323: {region: 0x165, script: 0x57, flags: 0x0}, - 1324: {region: 0x122, script: 0x57, flags: 0x0}, - 1325: {region: 0xd0, script: 0x57, flags: 0x0}, - 1326: {region: 0x165, script: 0x57, flags: 0x0}, - 1327: {region: 0x161, script: 0x57, flags: 0x0}, - 1329: {region: 0x12b, script: 0x57, flags: 0x0}, -} - -// likelyLangList holds lists info associated with likelyLang. -// Size: 388 bytes, 97 elements -var likelyLangList = [97]likelyScriptRegion{ - 0: {region: 0x9c, script: 0x7, flags: 0x0}, - 1: {region: 0xa1, script: 0x74, flags: 0x2}, - 2: {region: 0x11c, script: 0x80, flags: 0x2}, - 3: {region: 0x32, script: 0x57, flags: 0x0}, - 4: {region: 0x9b, script: 0x5, flags: 0x4}, - 5: {region: 0x9c, script: 0x5, flags: 0x4}, - 6: {region: 0x106, script: 0x1f, flags: 0x4}, - 7: {region: 0x9c, script: 0x5, flags: 0x2}, - 8: {region: 0x106, script: 0x1f, flags: 0x0}, - 9: {region: 0x38, script: 0x2c, flags: 0x2}, - 10: {region: 0x135, script: 0x57, flags: 0x0}, - 11: {region: 0x7b, script: 0xc5, flags: 0x2}, - 12: {region: 0x114, script: 0x57, flags: 0x0}, - 13: {region: 0x84, script: 0x1, flags: 0x2}, - 14: {region: 0x5d, script: 0x1e, flags: 0x0}, - 15: {region: 0x87, script: 0x5c, flags: 0x2}, - 16: {region: 0xd6, script: 0x57, flags: 0x0}, - 17: {region: 0x52, script: 0x5, flags: 0x4}, - 18: {region: 0x10b, script: 0x5, flags: 0x4}, - 19: {region: 0xae, script: 0x1f, flags: 0x0}, - 20: {region: 0x24, script: 0x5, flags: 0x4}, - 21: {region: 0x53, script: 0x5, flags: 0x4}, - 22: {region: 0x9c, script: 0x5, flags: 0x4}, - 23: {region: 0xc5, script: 0x5, flags: 0x4}, - 24: {region: 0x53, script: 0x5, flags: 0x2}, - 25: {region: 0x12b, script: 0x57, flags: 0x0}, - 26: {region: 0xb0, script: 0x5, flags: 0x4}, - 27: {region: 0x9b, script: 0x5, flags: 0x2}, - 28: {region: 0xa5, script: 0x1f, flags: 0x0}, - 29: {region: 0x53, script: 0x5, flags: 0x4}, - 30: {region: 0x12b, script: 0x57, flags: 0x4}, - 31: {region: 0x53, script: 0x5, flags: 0x2}, - 32: {region: 0x12b, script: 0x57, flags: 0x2}, - 33: {region: 0xdb, script: 0x21, flags: 0x0}, - 34: {region: 0x99, script: 0x5a, flags: 0x2}, - 35: {region: 0x83, script: 0x57, flags: 0x0}, - 36: {region: 0x84, script: 0x78, flags: 0x4}, - 37: {region: 0x84, script: 0x78, flags: 0x2}, - 38: {region: 0xc5, script: 0x1f, flags: 0x0}, - 39: {region: 0x53, script: 0x6d, flags: 0x4}, - 40: {region: 0x53, script: 0x6d, flags: 0x2}, - 41: {region: 0xd0, script: 0x57, flags: 0x0}, - 42: {region: 0x4a, script: 0x5, flags: 0x4}, - 43: {region: 0x95, script: 0x5, flags: 0x4}, - 44: {region: 0x99, script: 0x33, flags: 0x0}, - 45: {region: 0xe8, script: 0x5, flags: 0x4}, - 46: {region: 0xe8, script: 0x5, flags: 0x2}, - 47: {region: 0x9c, script: 0x84, flags: 0x0}, - 48: {region: 0x53, script: 0x85, flags: 0x2}, - 49: {region: 0xba, script: 0xdc, flags: 0x0}, - 50: {region: 0xd9, script: 0x57, flags: 0x4}, - 51: {region: 0xe8, script: 0x5, flags: 0x0}, - 52: {region: 0x99, script: 0x21, flags: 0x2}, - 53: {region: 0x99, script: 0x4c, flags: 0x2}, - 54: {region: 0x99, script: 0xc9, flags: 0x2}, - 55: {region: 0x105, script: 0x1f, flags: 0x0}, - 56: {region: 0xbd, script: 0x57, flags: 0x4}, - 57: {region: 0x104, script: 0x57, flags: 0x4}, - 58: {region: 0x106, script: 0x57, flags: 0x4}, - 59: {region: 0x12b, script: 0x57, flags: 0x4}, - 60: {region: 0x124, script: 0x1f, flags: 0x0}, - 61: {region: 0xe8, script: 0x5, flags: 0x4}, - 62: {region: 0xe8, script: 0x5, flags: 0x2}, - 63: {region: 0x53, script: 0x5, flags: 0x0}, - 64: {region: 0xae, script: 0x1f, flags: 0x4}, - 65: {region: 0xc5, script: 0x1f, flags: 0x4}, - 66: {region: 0xae, script: 0x1f, flags: 0x2}, - 67: {region: 0x99, script: 0xe, flags: 0x0}, - 68: {region: 0xdb, script: 0x21, flags: 0x4}, - 69: {region: 0xdb, script: 0x21, flags: 0x2}, - 70: {region: 0x137, script: 0x57, flags: 0x0}, - 71: {region: 0x24, script: 0x5, flags: 0x4}, - 72: {region: 0x53, script: 0x1f, flags: 0x4}, - 73: {region: 0x24, script: 0x5, flags: 0x2}, - 74: {region: 0x8d, script: 0x39, flags: 0x0}, - 75: {region: 0x53, script: 0x38, flags: 0x4}, - 76: {region: 0x53, script: 0x38, flags: 0x2}, - 77: {region: 0x53, script: 0x38, flags: 0x0}, - 78: {region: 0x2f, script: 0x39, flags: 0x4}, - 79: {region: 0x3e, script: 0x39, flags: 0x4}, - 80: {region: 0x7b, script: 0x39, flags: 0x4}, - 81: {region: 0x7e, script: 0x39, flags: 0x4}, - 82: {region: 0x8d, script: 0x39, flags: 0x4}, - 83: {region: 0x95, script: 0x39, flags: 0x4}, - 84: {region: 0xc6, script: 0x39, flags: 0x4}, - 85: {region: 0xd0, script: 0x39, flags: 0x4}, - 86: {region: 0xe2, script: 0x39, flags: 0x4}, - 87: {region: 0xe5, script: 0x39, flags: 0x4}, - 88: {region: 0xe7, script: 0x39, flags: 0x4}, - 89: {region: 0x116, script: 0x39, flags: 0x4}, - 90: {region: 0x123, script: 0x39, flags: 0x4}, - 91: {region: 0x12e, script: 0x39, flags: 0x4}, - 92: {region: 0x135, script: 0x39, flags: 0x4}, - 93: {region: 0x13e, script: 0x39, flags: 0x4}, - 94: {region: 0x12e, script: 0x11, flags: 0x2}, - 95: {region: 0x12e, script: 0x34, flags: 0x2}, - 96: {region: 0x12e, script: 0x39, flags: 0x2}, -} - -type likelyLangScript struct { - lang uint16 - script uint8 - flags uint8 -} - -// likelyRegion is a lookup table, indexed by regionID, for the most likely -// languages and scripts given incomplete information. If more entries exist -// for a given regionID, lang and script are the index and size respectively -// of the list in likelyRegionList. -// TODO: exclude containers and user-definable regions from the list. -// Size: 1432 bytes, 358 elements -var likelyRegion = [358]likelyLangScript{ - 34: {lang: 0xd7, script: 0x57, flags: 0x0}, - 35: {lang: 0x3a, script: 0x5, flags: 0x0}, - 36: {lang: 0x0, script: 0x2, flags: 0x1}, - 39: {lang: 0x2, script: 0x2, flags: 0x1}, - 40: {lang: 0x4, script: 0x2, flags: 0x1}, - 42: {lang: 0x3c0, script: 0x57, flags: 0x0}, - 43: {lang: 0x0, script: 0x57, flags: 0x0}, - 44: {lang: 0x13e, script: 0x57, flags: 0x0}, - 45: {lang: 0x41b, script: 0x57, flags: 0x0}, - 46: {lang: 0x10d, script: 0x57, flags: 0x0}, - 48: {lang: 0x367, script: 0x57, flags: 0x0}, - 49: {lang: 0x444, script: 0x57, flags: 0x0}, - 50: {lang: 0x58, script: 0x57, flags: 0x0}, - 51: {lang: 0x6, script: 0x2, flags: 0x1}, - 53: {lang: 0xa5, script: 0xe, flags: 0x0}, - 54: {lang: 0x367, script: 0x57, flags: 0x0}, - 55: {lang: 0x15e, script: 0x57, flags: 0x0}, - 56: {lang: 0x7e, script: 0x1f, flags: 0x0}, - 57: {lang: 0x3a, script: 0x5, flags: 0x0}, - 58: {lang: 0x3d9, script: 0x57, flags: 0x0}, - 59: {lang: 0x15e, script: 0x57, flags: 0x0}, - 60: {lang: 0x15e, script: 0x57, flags: 0x0}, - 62: {lang: 0x31f, script: 0x57, flags: 0x0}, - 63: {lang: 0x13e, script: 0x57, flags: 0x0}, - 64: {lang: 0x3a1, script: 0x57, flags: 0x0}, - 65: {lang: 0x3c0, script: 0x57, flags: 0x0}, - 67: {lang: 0x8, script: 0x2, flags: 0x1}, - 69: {lang: 0x0, script: 0x57, flags: 0x0}, - 71: {lang: 0x71, script: 0x1f, flags: 0x0}, - 73: {lang: 0x512, script: 0x3b, flags: 0x2}, - 74: {lang: 0x31f, script: 0x5, flags: 0x2}, - 75: {lang: 0x445, script: 0x57, flags: 0x0}, - 76: {lang: 0x15e, script: 0x57, flags: 0x0}, - 77: {lang: 0x15e, script: 0x57, flags: 0x0}, - 78: {lang: 0x10d, script: 0x57, flags: 0x0}, - 79: {lang: 0x15e, script: 0x57, flags: 0x0}, - 81: {lang: 0x13e, script: 0x57, flags: 0x0}, - 82: {lang: 0x15e, script: 0x57, flags: 0x0}, - 83: {lang: 0xa, script: 0x4, flags: 0x1}, - 84: {lang: 0x13e, script: 0x57, flags: 0x0}, - 85: {lang: 0x0, script: 0x57, flags: 0x0}, - 86: {lang: 0x13e, script: 0x57, flags: 0x0}, - 89: {lang: 0x13e, script: 0x57, flags: 0x0}, - 90: {lang: 0x3c0, script: 0x57, flags: 0x0}, - 91: {lang: 0x3a1, script: 0x57, flags: 0x0}, - 93: {lang: 0xe, script: 0x2, flags: 0x1}, - 94: {lang: 0xfa, script: 0x57, flags: 0x0}, - 96: {lang: 0x10d, script: 0x57, flags: 0x0}, - 98: {lang: 0x1, script: 0x57, flags: 0x0}, - 99: {lang: 0x101, script: 0x57, flags: 0x0}, - 101: {lang: 0x13e, script: 0x57, flags: 0x0}, - 103: {lang: 0x10, script: 0x2, flags: 0x1}, - 104: {lang: 0x13e, script: 0x57, flags: 0x0}, - 105: {lang: 0x13e, script: 0x57, flags: 0x0}, - 106: {lang: 0x140, script: 0x57, flags: 0x0}, - 107: {lang: 0x3a, script: 0x5, flags: 0x0}, - 108: {lang: 0x3a, script: 0x5, flags: 0x0}, - 109: {lang: 0x46f, script: 0x29, flags: 0x0}, - 110: {lang: 0x13e, script: 0x57, flags: 0x0}, - 111: {lang: 0x12, script: 0x2, flags: 0x1}, - 113: {lang: 0x10d, script: 0x57, flags: 0x0}, - 114: {lang: 0x151, script: 0x57, flags: 0x0}, - 115: {lang: 0x1c0, script: 0x21, flags: 0x2}, - 118: {lang: 0x158, script: 0x57, flags: 0x0}, - 120: {lang: 0x15e, script: 0x57, flags: 0x0}, - 122: {lang: 0x15e, script: 0x57, flags: 0x0}, - 123: {lang: 0x14, script: 0x2, flags: 0x1}, - 125: {lang: 0x16, script: 0x3, flags: 0x1}, - 126: {lang: 0x15e, script: 0x57, flags: 0x0}, - 128: {lang: 0x21, script: 0x57, flags: 0x0}, - 130: {lang: 0x245, script: 0x57, flags: 0x0}, - 132: {lang: 0x15e, script: 0x57, flags: 0x0}, - 133: {lang: 0x15e, script: 0x57, flags: 0x0}, - 134: {lang: 0x13e, script: 0x57, flags: 0x0}, - 135: {lang: 0x19, script: 0x2, flags: 0x1}, - 136: {lang: 0x0, script: 0x57, flags: 0x0}, - 137: {lang: 0x13e, script: 0x57, flags: 0x0}, - 139: {lang: 0x3c0, script: 0x57, flags: 0x0}, - 141: {lang: 0x529, script: 0x39, flags: 0x0}, - 142: {lang: 0x0, script: 0x57, flags: 0x0}, - 143: {lang: 0x13e, script: 0x57, flags: 0x0}, - 144: {lang: 0x1d1, script: 0x57, flags: 0x0}, - 145: {lang: 0x1d4, script: 0x57, flags: 0x0}, - 146: {lang: 0x1d5, script: 0x57, flags: 0x0}, - 148: {lang: 0x13e, script: 0x57, flags: 0x0}, - 149: {lang: 0x1b, script: 0x2, flags: 0x1}, - 151: {lang: 0x1bc, script: 0x3b, flags: 0x0}, - 153: {lang: 0x1d, script: 0x3, flags: 0x1}, - 155: {lang: 0x3a, script: 0x5, flags: 0x0}, - 156: {lang: 0x20, script: 0x2, flags: 0x1}, - 157: {lang: 0x1f8, script: 0x57, flags: 0x0}, - 158: {lang: 0x1f9, script: 0x57, flags: 0x0}, - 161: {lang: 0x3a, script: 0x5, flags: 0x0}, - 162: {lang: 0x200, script: 0x46, flags: 0x0}, - 164: {lang: 0x445, script: 0x57, flags: 0x0}, - 165: {lang: 0x28a, script: 0x1f, flags: 0x0}, - 166: {lang: 0x22, script: 0x3, flags: 0x1}, - 168: {lang: 0x25, script: 0x2, flags: 0x1}, - 170: {lang: 0x254, script: 0x50, flags: 0x0}, - 171: {lang: 0x254, script: 0x50, flags: 0x0}, - 172: {lang: 0x3a, script: 0x5, flags: 0x0}, - 174: {lang: 0x3e2, script: 0x1f, flags: 0x0}, - 175: {lang: 0x27, script: 0x2, flags: 0x1}, - 176: {lang: 0x3a, script: 0x5, flags: 0x0}, - 178: {lang: 0x10d, script: 0x57, flags: 0x0}, - 179: {lang: 0x40c, script: 0xca, flags: 0x0}, - 181: {lang: 0x43b, script: 0x57, flags: 0x0}, - 182: {lang: 0x2c0, script: 0x57, flags: 0x0}, - 183: {lang: 0x15e, script: 0x57, flags: 0x0}, - 184: {lang: 0x2c7, script: 0x57, flags: 0x0}, - 185: {lang: 0x3a, script: 0x5, flags: 0x0}, - 186: {lang: 0x29, script: 0x2, flags: 0x1}, - 187: {lang: 0x15e, script: 0x57, flags: 0x0}, - 188: {lang: 0x2b, script: 0x2, flags: 0x1}, - 189: {lang: 0x432, script: 0x57, flags: 0x0}, - 190: {lang: 0x15e, script: 0x57, flags: 0x0}, - 191: {lang: 0x2f1, script: 0x57, flags: 0x0}, - 194: {lang: 0x2d, script: 0x2, flags: 0x1}, - 195: {lang: 0xa0, script: 0x57, flags: 0x0}, - 196: {lang: 0x2f, script: 0x2, flags: 0x1}, - 197: {lang: 0x31, script: 0x2, flags: 0x1}, - 198: {lang: 0x33, script: 0x2, flags: 0x1}, - 200: {lang: 0x15e, script: 0x57, flags: 0x0}, - 201: {lang: 0x35, script: 0x2, flags: 0x1}, - 203: {lang: 0x320, script: 0x57, flags: 0x0}, - 204: {lang: 0x37, script: 0x3, flags: 0x1}, - 205: {lang: 0x128, script: 0xde, flags: 0x0}, - 207: {lang: 0x13e, script: 0x57, flags: 0x0}, - 208: {lang: 0x31f, script: 0x57, flags: 0x0}, - 209: {lang: 0x3c0, script: 0x57, flags: 0x0}, - 210: {lang: 0x16, script: 0x57, flags: 0x0}, - 211: {lang: 0x15e, script: 0x57, flags: 0x0}, - 212: {lang: 0x1b4, script: 0x57, flags: 0x0}, - 214: {lang: 0x1b4, script: 0x5, flags: 0x2}, - 216: {lang: 0x13e, script: 0x57, flags: 0x0}, - 217: {lang: 0x367, script: 0x57, flags: 0x0}, - 218: {lang: 0x347, script: 0x57, flags: 0x0}, - 219: {lang: 0x351, script: 0x21, flags: 0x0}, - 225: {lang: 0x3a, script: 0x5, flags: 0x0}, - 226: {lang: 0x13e, script: 0x57, flags: 0x0}, - 228: {lang: 0x13e, script: 0x57, flags: 0x0}, - 229: {lang: 0x15e, script: 0x57, flags: 0x0}, - 230: {lang: 0x486, script: 0x57, flags: 0x0}, - 231: {lang: 0x153, script: 0x57, flags: 0x0}, - 232: {lang: 0x3a, script: 0x3, flags: 0x1}, - 233: {lang: 0x3b3, script: 0x57, flags: 0x0}, - 234: {lang: 0x15e, script: 0x57, flags: 0x0}, - 236: {lang: 0x13e, script: 0x57, flags: 0x0}, - 237: {lang: 0x3a, script: 0x5, flags: 0x0}, - 238: {lang: 0x3c0, script: 0x57, flags: 0x0}, - 240: {lang: 0x3a2, script: 0x57, flags: 0x0}, - 241: {lang: 0x194, script: 0x57, flags: 0x0}, - 243: {lang: 0x3a, script: 0x5, flags: 0x0}, - 258: {lang: 0x15e, script: 0x57, flags: 0x0}, - 260: {lang: 0x3d, script: 0x2, flags: 0x1}, - 261: {lang: 0x432, script: 0x1f, flags: 0x0}, - 262: {lang: 0x3f, script: 0x2, flags: 0x1}, - 263: {lang: 0x3e5, script: 0x57, flags: 0x0}, - 264: {lang: 0x3a, script: 0x5, flags: 0x0}, - 266: {lang: 0x15e, script: 0x57, flags: 0x0}, - 267: {lang: 0x3a, script: 0x5, flags: 0x0}, - 268: {lang: 0x41, script: 0x2, flags: 0x1}, - 271: {lang: 0x416, script: 0x57, flags: 0x0}, - 272: {lang: 0x347, script: 0x57, flags: 0x0}, - 273: {lang: 0x43, script: 0x2, flags: 0x1}, - 275: {lang: 0x1f9, script: 0x57, flags: 0x0}, - 276: {lang: 0x15e, script: 0x57, flags: 0x0}, - 277: {lang: 0x429, script: 0x57, flags: 0x0}, - 278: {lang: 0x367, script: 0x57, flags: 0x0}, - 280: {lang: 0x3c0, script: 0x57, flags: 0x0}, - 282: {lang: 0x13e, script: 0x57, flags: 0x0}, - 284: {lang: 0x45, script: 0x2, flags: 0x1}, - 288: {lang: 0x15e, script: 0x57, flags: 0x0}, - 289: {lang: 0x15e, script: 0x57, flags: 0x0}, - 290: {lang: 0x47, script: 0x2, flags: 0x1}, - 291: {lang: 0x49, script: 0x3, flags: 0x1}, - 292: {lang: 0x4c, script: 0x2, flags: 0x1}, - 293: {lang: 0x477, script: 0x57, flags: 0x0}, - 294: {lang: 0x3c0, script: 0x57, flags: 0x0}, - 295: {lang: 0x476, script: 0x57, flags: 0x0}, - 296: {lang: 0x4e, script: 0x2, flags: 0x1}, - 297: {lang: 0x482, script: 0x57, flags: 0x0}, - 299: {lang: 0x50, script: 0x4, flags: 0x1}, - 301: {lang: 0x4a0, script: 0x57, flags: 0x0}, - 302: {lang: 0x54, script: 0x2, flags: 0x1}, - 303: {lang: 0x445, script: 0x57, flags: 0x0}, - 304: {lang: 0x56, script: 0x3, flags: 0x1}, - 305: {lang: 0x445, script: 0x57, flags: 0x0}, - 309: {lang: 0x512, script: 0x3b, flags: 0x2}, - 310: {lang: 0x13e, script: 0x57, flags: 0x0}, - 311: {lang: 0x4bc, script: 0x57, flags: 0x0}, - 312: {lang: 0x1f9, script: 0x57, flags: 0x0}, - 315: {lang: 0x13e, script: 0x57, flags: 0x0}, - 318: {lang: 0x4c3, script: 0x57, flags: 0x0}, - 319: {lang: 0x8a, script: 0x57, flags: 0x0}, - 320: {lang: 0x15e, script: 0x57, flags: 0x0}, - 322: {lang: 0x41b, script: 0x57, flags: 0x0}, - 333: {lang: 0x59, script: 0x2, flags: 0x1}, - 350: {lang: 0x3a, script: 0x5, flags: 0x0}, - 351: {lang: 0x5b, script: 0x2, flags: 0x1}, - 356: {lang: 0x423, script: 0x57, flags: 0x0}, -} - -// likelyRegionList holds lists info associated with likelyRegion. -// Size: 372 bytes, 93 elements -var likelyRegionList = [93]likelyLangScript{ - 0: {lang: 0x148, script: 0x5, flags: 0x0}, - 1: {lang: 0x476, script: 0x57, flags: 0x0}, - 2: {lang: 0x431, script: 0x57, flags: 0x0}, - 3: {lang: 0x2ff, script: 0x1f, flags: 0x0}, - 4: {lang: 0x1d7, script: 0x8, flags: 0x0}, - 5: {lang: 0x274, script: 0x57, flags: 0x0}, - 6: {lang: 0xb7, script: 0x57, flags: 0x0}, - 7: {lang: 0x432, script: 0x1f, flags: 0x0}, - 8: {lang: 0x12d, script: 0xe0, flags: 0x0}, - 9: {lang: 0x351, script: 0x21, flags: 0x0}, - 10: {lang: 0x529, script: 0x38, flags: 0x0}, - 11: {lang: 0x4ac, script: 0x5, flags: 0x0}, - 12: {lang: 0x523, script: 0x57, flags: 0x0}, - 13: {lang: 0x29a, script: 0xdf, flags: 0x0}, - 14: {lang: 0x136, script: 0x31, flags: 0x0}, - 15: {lang: 0x48a, script: 0x57, flags: 0x0}, - 16: {lang: 0x3a, script: 0x5, flags: 0x0}, - 17: {lang: 0x15e, script: 0x57, flags: 0x0}, - 18: {lang: 0x27, script: 0x29, flags: 0x0}, - 19: {lang: 0x139, script: 0x57, flags: 0x0}, - 20: {lang: 0x26a, script: 0x5, flags: 0x2}, - 21: {lang: 0x512, script: 0x3b, flags: 0x2}, - 22: {lang: 0x210, script: 0x2b, flags: 0x0}, - 23: {lang: 0x5, script: 0x1f, flags: 0x0}, - 24: {lang: 0x274, script: 0x57, flags: 0x0}, - 25: {lang: 0x136, script: 0x31, flags: 0x0}, - 26: {lang: 0x2ff, script: 0x1f, flags: 0x0}, - 27: {lang: 0x1e1, script: 0x57, flags: 0x0}, - 28: {lang: 0x31f, script: 0x5, flags: 0x0}, - 29: {lang: 0x1be, script: 0x21, flags: 0x0}, - 30: {lang: 0x4b4, script: 0x5, flags: 0x0}, - 31: {lang: 0x236, script: 0x72, flags: 0x0}, - 32: {lang: 0x148, script: 0x5, flags: 0x0}, - 33: {lang: 0x476, script: 0x57, flags: 0x0}, - 34: {lang: 0x24a, script: 0x4b, flags: 0x0}, - 35: {lang: 0xe6, script: 0x5, flags: 0x0}, - 36: {lang: 0x226, script: 0xdf, flags: 0x0}, - 37: {lang: 0x3a, script: 0x5, flags: 0x0}, - 38: {lang: 0x15e, script: 0x57, flags: 0x0}, - 39: {lang: 0x2b8, script: 0x54, flags: 0x0}, - 40: {lang: 0x226, script: 0xdf, flags: 0x0}, - 41: {lang: 0x3a, script: 0x5, flags: 0x0}, - 42: {lang: 0x15e, script: 0x57, flags: 0x0}, - 43: {lang: 0x3dc, script: 0x57, flags: 0x0}, - 44: {lang: 0x4ae, script: 0x1f, flags: 0x0}, - 45: {lang: 0x2ff, script: 0x1f, flags: 0x0}, - 46: {lang: 0x431, script: 0x57, flags: 0x0}, - 47: {lang: 0x331, script: 0x72, flags: 0x0}, - 48: {lang: 0x213, script: 0x57, flags: 0x0}, - 49: {lang: 0x30b, script: 0x1f, flags: 0x0}, - 50: {lang: 0x242, script: 0x5, flags: 0x0}, - 51: {lang: 0x529, script: 0x39, flags: 0x0}, - 52: {lang: 0x3c0, script: 0x57, flags: 0x0}, - 53: {lang: 0x3a, script: 0x5, flags: 0x0}, - 54: {lang: 0x15e, script: 0x57, flags: 0x0}, - 55: {lang: 0x2ed, script: 0x57, flags: 0x0}, - 56: {lang: 0x4b4, script: 0x5, flags: 0x0}, - 57: {lang: 0x88, script: 0x21, flags: 0x0}, - 58: {lang: 0x4b4, script: 0x5, flags: 0x0}, - 59: {lang: 0x4b4, script: 0x5, flags: 0x0}, - 60: {lang: 0xbe, script: 0x21, flags: 0x0}, - 61: {lang: 0x3dc, script: 0x57, flags: 0x0}, - 62: {lang: 0x7e, script: 0x1f, flags: 0x0}, - 63: {lang: 0x3e2, script: 0x1f, flags: 0x0}, - 64: {lang: 0x267, script: 0x57, flags: 0x0}, - 65: {lang: 0x444, script: 0x57, flags: 0x0}, - 66: {lang: 0x512, script: 0x3b, flags: 0x0}, - 67: {lang: 0x412, script: 0x57, flags: 0x0}, - 68: {lang: 0x4ae, script: 0x1f, flags: 0x0}, - 69: {lang: 0x3a, script: 0x5, flags: 0x0}, - 70: {lang: 0x15e, script: 0x57, flags: 0x0}, - 71: {lang: 0x15e, script: 0x57, flags: 0x0}, - 72: {lang: 0x35, script: 0x5, flags: 0x0}, - 73: {lang: 0x46b, script: 0xdf, flags: 0x0}, - 74: {lang: 0x2ec, script: 0x5, flags: 0x0}, - 75: {lang: 0x30f, script: 0x72, flags: 0x0}, - 76: {lang: 0x467, script: 0x1f, flags: 0x0}, - 77: {lang: 0x148, script: 0x5, flags: 0x0}, - 78: {lang: 0x3a, script: 0x5, flags: 0x0}, - 79: {lang: 0x15e, script: 0x57, flags: 0x0}, - 80: {lang: 0x48a, script: 0x57, flags: 0x0}, - 81: {lang: 0x58, script: 0x5, flags: 0x0}, - 82: {lang: 0x219, script: 0x1f, flags: 0x0}, - 83: {lang: 0x81, script: 0x31, flags: 0x0}, - 84: {lang: 0x529, script: 0x39, flags: 0x0}, - 85: {lang: 0x48c, script: 0x57, flags: 0x0}, - 86: {lang: 0x4ae, script: 0x1f, flags: 0x0}, - 87: {lang: 0x512, script: 0x3b, flags: 0x0}, - 88: {lang: 0x3b3, script: 0x57, flags: 0x0}, - 89: {lang: 0x431, script: 0x57, flags: 0x0}, - 90: {lang: 0x432, script: 0x1f, flags: 0x0}, - 91: {lang: 0x15e, script: 0x57, flags: 0x0}, - 92: {lang: 0x446, script: 0x5, flags: 0x0}, -} - -type likelyTag struct { - lang uint16 - region uint16 - script uint8 -} - -// Size: 198 bytes, 33 elements -var likelyRegionGroup = [33]likelyTag{ - 1: {lang: 0x139, region: 0xd6, script: 0x57}, - 2: {lang: 0x139, region: 0x135, script: 0x57}, - 3: {lang: 0x3c0, region: 0x41, script: 0x57}, - 4: {lang: 0x139, region: 0x2f, script: 0x57}, - 5: {lang: 0x139, region: 0xd6, script: 0x57}, - 6: {lang: 0x13e, region: 0xcf, script: 0x57}, - 7: {lang: 0x445, region: 0x12f, script: 0x57}, - 8: {lang: 0x3a, region: 0x6b, script: 0x5}, - 9: {lang: 0x445, region: 0x4b, script: 0x57}, - 10: {lang: 0x139, region: 0x161, script: 0x57}, - 11: {lang: 0x139, region: 0x135, script: 0x57}, - 12: {lang: 0x139, region: 0x135, script: 0x57}, - 13: {lang: 0x13e, region: 0x59, script: 0x57}, - 14: {lang: 0x529, region: 0x53, script: 0x38}, - 15: {lang: 0x1be, region: 0x99, script: 0x21}, - 16: {lang: 0x1e1, region: 0x95, script: 0x57}, - 17: {lang: 0x1f9, region: 0x9e, script: 0x57}, - 18: {lang: 0x139, region: 0x2f, script: 0x57}, - 19: {lang: 0x139, region: 0xe6, script: 0x57}, - 20: {lang: 0x139, region: 0x8a, script: 0x57}, - 21: {lang: 0x41b, region: 0x142, script: 0x57}, - 22: {lang: 0x529, region: 0x53, script: 0x38}, - 23: {lang: 0x4bc, region: 0x137, script: 0x57}, - 24: {lang: 0x3a, region: 0x108, script: 0x5}, - 25: {lang: 0x3e2, region: 0x106, script: 0x1f}, - 26: {lang: 0x3e2, region: 0x106, script: 0x1f}, - 27: {lang: 0x139, region: 0x7b, script: 0x57}, - 28: {lang: 0x10d, region: 0x60, script: 0x57}, - 29: {lang: 0x139, region: 0xd6, script: 0x57}, - 30: {lang: 0x13e, region: 0x1f, script: 0x57}, - 31: {lang: 0x139, region: 0x9a, script: 0x57}, - 32: {lang: 0x139, region: 0x7b, script: 0x57}, -} - -// Size: 264 bytes, 33 elements -var regionContainment = [33]uint64{ - // Entry 0 - 1F - 0x00000001ffffffff, 0x00000000200007a2, 0x0000000000003044, 0x0000000000000008, - 0x00000000803c0010, 0x0000000000000020, 0x0000000000000040, 0x0000000000000080, - 0x0000000000000100, 0x0000000000000200, 0x0000000000000400, 0x000000004000384c, - 0x0000000000001000, 0x0000000000002000, 0x0000000000004000, 0x0000000000008000, - 0x0000000000010000, 0x0000000000020000, 0x0000000000040000, 0x0000000000080000, - 0x0000000000100000, 0x0000000000200000, 0x0000000001c1c000, 0x0000000000800000, - 0x0000000001000000, 0x000000001e020000, 0x0000000004000000, 0x0000000008000000, - 0x0000000010000000, 0x00000000200006a0, 0x0000000040002048, 0x0000000080000000, - // Entry 20 - 3F - 0x0000000100000000, -} - -// regionInclusion maps region identifiers to sets of regions in regionInclusionBits, -// where each set holds all groupings that are directly connected in a region -// containment graph. -// Size: 358 bytes, 358 elements -var regionInclusion = [358]uint8{ - // Entry 0 - 3F - 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, - 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, - 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, - 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, - 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x26, 0x23, - 0x24, 0x26, 0x27, 0x22, 0x28, 0x29, 0x2a, 0x2b, - 0x26, 0x2c, 0x24, 0x23, 0x26, 0x25, 0x2a, 0x2d, - 0x2e, 0x24, 0x2f, 0x2d, 0x26, 0x30, 0x31, 0x28, - // Entry 40 - 7F - 0x26, 0x28, 0x26, 0x25, 0x31, 0x22, 0x32, 0x33, - 0x34, 0x30, 0x22, 0x27, 0x27, 0x27, 0x35, 0x2d, - 0x29, 0x28, 0x27, 0x36, 0x28, 0x22, 0x34, 0x23, - 0x21, 0x26, 0x2d, 0x26, 0x22, 0x37, 0x2e, 0x35, - 0x2a, 0x22, 0x2f, 0x38, 0x26, 0x26, 0x21, 0x39, - 0x39, 0x28, 0x38, 0x39, 0x39, 0x2f, 0x3a, 0x2f, - 0x20, 0x21, 0x38, 0x3b, 0x28, 0x3c, 0x2c, 0x21, - 0x2a, 0x35, 0x27, 0x38, 0x26, 0x24, 0x28, 0x2c, - // Entry 80 - BF - 0x2d, 0x23, 0x30, 0x2d, 0x2d, 0x26, 0x27, 0x3a, - 0x22, 0x34, 0x3c, 0x2d, 0x28, 0x36, 0x22, 0x34, - 0x3a, 0x26, 0x2e, 0x21, 0x39, 0x31, 0x38, 0x24, - 0x2c, 0x25, 0x22, 0x24, 0x25, 0x2c, 0x3a, 0x2c, - 0x26, 0x24, 0x36, 0x21, 0x2f, 0x3d, 0x31, 0x3c, - 0x2f, 0x26, 0x36, 0x36, 0x24, 0x26, 0x3d, 0x31, - 0x24, 0x26, 0x35, 0x25, 0x2d, 0x32, 0x38, 0x2a, - 0x38, 0x39, 0x39, 0x35, 0x33, 0x23, 0x26, 0x2f, - // Entry C0 - FF - 0x3c, 0x21, 0x23, 0x2d, 0x31, 0x36, 0x36, 0x3c, - 0x26, 0x2d, 0x26, 0x3a, 0x2f, 0x25, 0x2f, 0x34, - 0x31, 0x2f, 0x32, 0x3b, 0x2d, 0x2b, 0x2d, 0x21, - 0x34, 0x2a, 0x2c, 0x25, 0x21, 0x3c, 0x24, 0x29, - 0x2b, 0x24, 0x34, 0x21, 0x28, 0x29, 0x3b, 0x31, - 0x25, 0x2e, 0x30, 0x29, 0x26, 0x24, 0x3a, 0x21, - 0x3c, 0x28, 0x21, 0x24, 0x21, 0x21, 0x1f, 0x21, - 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, - // Entry 100 - 13F - 0x21, 0x21, 0x2f, 0x21, 0x2e, 0x23, 0x33, 0x2f, - 0x24, 0x3b, 0x2f, 0x39, 0x38, 0x31, 0x2d, 0x3a, - 0x2c, 0x2e, 0x2d, 0x23, 0x2d, 0x2f, 0x28, 0x2f, - 0x27, 0x33, 0x34, 0x26, 0x24, 0x32, 0x22, 0x26, - 0x27, 0x22, 0x2d, 0x31, 0x3d, 0x29, 0x31, 0x3d, - 0x39, 0x29, 0x31, 0x24, 0x26, 0x29, 0x36, 0x2f, - 0x33, 0x2f, 0x21, 0x22, 0x21, 0x30, 0x28, 0x3d, - 0x23, 0x26, 0x21, 0x28, 0x26, 0x26, 0x31, 0x3b, - // Entry 140 - 17F - 0x29, 0x21, 0x29, 0x21, 0x21, 0x21, 0x21, 0x21, - 0x21, 0x21, 0x21, 0x21, 0x21, 0x23, 0x21, 0x21, - 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, - 0x21, 0x21, 0x21, 0x21, 0x21, 0x24, 0x24, 0x2f, - 0x23, 0x32, 0x2f, 0x27, 0x2f, 0x21, -} - -// regionInclusionBits is an array of bit vectors where every vector represents -// a set of region groupings. These sets are used to compute the distance -// between two regions for the purpose of language matching. -// Size: 584 bytes, 73 elements -var regionInclusionBits = [73]uint64{ - // Entry 0 - 1F - 0x0000000102400813, 0x00000000200007a3, 0x0000000000003844, 0x0000000040000808, - 0x00000000803c0011, 0x0000000020000022, 0x0000000040000844, 0x0000000020000082, - 0x0000000000000102, 0x0000000020000202, 0x0000000020000402, 0x000000004000384d, - 0x0000000000001804, 0x0000000040002804, 0x0000000000404000, 0x0000000000408000, - 0x0000000000410000, 0x0000000002020000, 0x0000000000040010, 0x0000000000080010, - 0x0000000000100010, 0x0000000000200010, 0x0000000001c1c001, 0x0000000000c00000, - 0x0000000001400000, 0x000000001e020001, 0x0000000006000000, 0x000000000a000000, - 0x0000000012000000, 0x00000000200006a2, 0x0000000040002848, 0x0000000080000010, - // Entry 20 - 3F - 0x0000000100000001, 0x0000000000000001, 0x0000000080000000, 0x0000000000020000, - 0x0000000001000000, 0x0000000000008000, 0x0000000000002000, 0x0000000000000200, - 0x0000000000000008, 0x0000000000200000, 0x0000000110000000, 0x0000000000040000, - 0x0000000008000000, 0x0000000000000020, 0x0000000104000000, 0x0000000000000080, - 0x0000000000001000, 0x0000000000010000, 0x0000000000000400, 0x0000000004000000, - 0x0000000000000040, 0x0000000010000000, 0x0000000000004000, 0x0000000101000000, - 0x0000000108000000, 0x0000000000000100, 0x0000000100020000, 0x0000000000080000, - 0x0000000000100000, 0x0000000000800000, 0x00000001ffffffff, 0x0000000122400fb3, - // Entry 40 - 5F - 0x00000001827c0813, 0x000000014240385f, 0x0000000103c1c813, 0x000000011e420813, - 0x0000000112000001, 0x0000000106000001, 0x0000000101400001, 0x000000010a000001, - 0x0000000102020001, -} - -// regionInclusionNext marks, for each entry in regionInclusionBits, the set of -// all groups that are reachable from the groups set in the respective entry. -// Size: 73 bytes, 73 elements -var regionInclusionNext = [73]uint8{ - // Entry 0 - 3F - 0x3e, 0x3f, 0x0b, 0x0b, 0x40, 0x01, 0x0b, 0x01, - 0x01, 0x01, 0x01, 0x41, 0x0b, 0x0b, 0x16, 0x16, - 0x16, 0x19, 0x04, 0x04, 0x04, 0x04, 0x42, 0x16, - 0x16, 0x43, 0x19, 0x19, 0x19, 0x01, 0x0b, 0x04, - 0x00, 0x00, 0x1f, 0x11, 0x18, 0x0f, 0x0d, 0x09, - 0x03, 0x15, 0x44, 0x12, 0x1b, 0x05, 0x45, 0x07, - 0x0c, 0x10, 0x0a, 0x1a, 0x06, 0x1c, 0x0e, 0x46, - 0x47, 0x08, 0x48, 0x13, 0x14, 0x17, 0x3e, 0x3e, - // Entry 40 - 7F - 0x3e, 0x3e, 0x3e, 0x3e, 0x43, 0x43, 0x42, 0x43, - 0x43, -} - -type parentRel struct { - lang uint16 - script uint8 - maxScript uint8 - toRegion uint16 - fromRegion []uint16 -} - -// Size: 414 bytes, 5 elements -var parents = [5]parentRel{ - 0: {lang: 0x139, script: 0x0, maxScript: 0x57, toRegion: 0x1, fromRegion: []uint16{0x1a, 0x25, 0x26, 0x2f, 0x34, 0x36, 0x3d, 0x42, 0x46, 0x48, 0x49, 0x4a, 0x50, 0x52, 0x5c, 0x5d, 0x61, 0x64, 0x6d, 0x73, 0x74, 0x75, 0x7b, 0x7c, 0x7f, 0x80, 0x81, 0x83, 0x8c, 0x8d, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9f, 0xa0, 0xa4, 0xa7, 0xa9, 0xad, 0xb1, 0xb4, 0xb5, 0xbf, 0xc6, 0xca, 0xcb, 0xcc, 0xce, 0xd0, 0xd2, 0xd5, 0xd6, 0xdd, 0xdf, 0xe0, 0xe6, 0xe7, 0xe8, 0xeb, 0xf0, 0x107, 0x109, 0x10a, 0x10b, 0x10d, 0x10e, 0x112, 0x117, 0x11b, 0x11d, 0x11f, 0x125, 0x129, 0x12c, 0x12d, 0x12f, 0x131, 0x139, 0x13c, 0x13f, 0x142, 0x161, 0x162, 0x164}}, - 1: {lang: 0x139, script: 0x0, maxScript: 0x57, toRegion: 0x1a, fromRegion: []uint16{0x2e, 0x4e, 0x60, 0x63, 0x72, 0xd9, 0x10c, 0x10f}}, - 2: {lang: 0x13e, script: 0x0, maxScript: 0x57, toRegion: 0x1f, fromRegion: []uint16{0x2c, 0x3f, 0x41, 0x48, 0x51, 0x54, 0x56, 0x59, 0x65, 0x69, 0x89, 0x8f, 0xcf, 0xd8, 0xe2, 0xe4, 0xec, 0xf1, 0x11a, 0x135, 0x136, 0x13b}}, - 3: {lang: 0x3c0, script: 0x0, maxScript: 0x57, toRegion: 0xee, fromRegion: []uint16{0x2a, 0x4e, 0x5a, 0x86, 0x8b, 0xb7, 0xc6, 0xd1, 0x118, 0x126}}, - 4: {lang: 0x529, script: 0x39, maxScript: 0x39, toRegion: 0x8d, fromRegion: []uint16{0xc6}}, -} - -// Total table size 25886 bytes (25KiB); checksum: 50D3D57D diff --git a/vendor/golang.org/x/text/internal/language/tags.go b/vendor/golang.org/x/text/internal/language/tags.go deleted file mode 100644 index e7afd3188..000000000 --- a/vendor/golang.org/x/text/internal/language/tags.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -// MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed. -// It simplifies safe initialization of Tag values. -func MustParse(s string) Tag { - t, err := Parse(s) - if err != nil { - panic(err) - } - return t -} - -// MustParseBase is like ParseBase, but panics if the given base cannot be parsed. -// It simplifies safe initialization of Base values. -func MustParseBase(s string) Language { - b, err := ParseBase(s) - if err != nil { - panic(err) - } - return b -} - -// MustParseScript is like ParseScript, but panics if the given script cannot be -// parsed. It simplifies safe initialization of Script values. -func MustParseScript(s string) Script { - scr, err := ParseScript(s) - if err != nil { - panic(err) - } - return scr -} - -// MustParseRegion is like ParseRegion, but panics if the given region cannot be -// parsed. It simplifies safe initialization of Region values. -func MustParseRegion(s string) Region { - r, err := ParseRegion(s) - if err != nil { - panic(err) - } - return r -} - -// Und is the root language. -var Und Tag diff --git a/vendor/golang.org/x/text/internal/tag/tag.go b/vendor/golang.org/x/text/internal/tag/tag.go deleted file mode 100644 index b5d348891..000000000 --- a/vendor/golang.org/x/text/internal/tag/tag.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package tag contains functionality handling tags and related data. -package tag // import "golang.org/x/text/internal/tag" - -import "sort" - -// An Index converts tags to a compact numeric value. -// -// All elements are of size 4. Tags may be up to 4 bytes long. Excess bytes can -// be used to store additional information about the tag. -type Index string - -// Elem returns the element data at the given index. -func (s Index) Elem(x int) string { - return string(s[x*4 : x*4+4]) -} - -// Index reports the index of the given key or -1 if it could not be found. -// Only the first len(key) bytes from the start of the 4-byte entries will be -// considered for the search and the first match in Index will be returned. -func (s Index) Index(key []byte) int { - n := len(key) - // search the index of the first entry with an equal or higher value than - // key in s. - index := sort.Search(len(s)/4, func(i int) bool { - return cmp(s[i*4:i*4+n], key) != -1 - }) - i := index * 4 - if cmp(s[i:i+len(key)], key) != 0 { - return -1 - } - return index -} - -// Next finds the next occurrence of key after index x, which must have been -// obtained from a call to Index using the same key. It returns x+1 or -1. -func (s Index) Next(key []byte, x int) int { - if x++; x*4 < len(s) && cmp(s[x*4:x*4+len(key)], key) == 0 { - return x - } - return -1 -} - -// cmp returns an integer comparing a and b lexicographically. -func cmp(a Index, b []byte) int { - n := len(a) - if len(b) < n { - n = len(b) - } - for i, c := range b[:n] { - switch { - case a[i] > c: - return 1 - case a[i] < c: - return -1 - } - } - switch { - case len(a) < len(b): - return -1 - case len(a) > len(b): - return 1 - } - return 0 -} - -// Compare returns an integer comparing a and b lexicographically. -func Compare(a string, b []byte) int { - return cmp(Index(a), b) -} - -// FixCase reformats b to the same pattern of cases as form. -// If returns false if string b is malformed. -func FixCase(form string, b []byte) bool { - if len(form) != len(b) { - return false - } - for i, c := range b { - if form[i] <= 'Z' { - if c >= 'a' { - c -= 'z' - 'Z' - } - if c < 'A' || 'Z' < c { - return false - } - } else { - if c <= 'Z' { - c += 'z' - 'Z' - } - if c < 'a' || 'z' < c { - return false - } - } - b[i] = c - } - return true -} diff --git a/vendor/golang.org/x/text/language/coverage.go b/vendor/golang.org/x/text/language/coverage.go deleted file mode 100644 index a24fd1a4d..000000000 --- a/vendor/golang.org/x/text/language/coverage.go +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -import ( - "fmt" - "sort" - - "golang.org/x/text/internal/language" -) - -// The Coverage interface is used to define the level of coverage of an -// internationalization service. Note that not all types are supported by all -// services. As lists may be generated on the fly, it is recommended that users -// of a Coverage cache the results. -type Coverage interface { - // Tags returns the list of supported tags. - Tags() []Tag - - // BaseLanguages returns the list of supported base languages. - BaseLanguages() []Base - - // Scripts returns the list of supported scripts. - Scripts() []Script - - // Regions returns the list of supported regions. - Regions() []Region -} - -var ( - // Supported defines a Coverage that lists all supported subtags. Tags - // always returns nil. - Supported Coverage = allSubtags{} -) - -// TODO: -// - Support Variants, numbering systems. -// - CLDR coverage levels. -// - Set of common tags defined in this package. - -type allSubtags struct{} - -// Regions returns the list of supported regions. As all regions are in a -// consecutive range, it simply returns a slice of numbers in increasing order. -// The "undefined" region is not returned. -func (s allSubtags) Regions() []Region { - reg := make([]Region, language.NumRegions) - for i := range reg { - reg[i] = Region{language.Region(i + 1)} - } - return reg -} - -// Scripts returns the list of supported scripts. As all scripts are in a -// consecutive range, it simply returns a slice of numbers in increasing order. -// The "undefined" script is not returned. -func (s allSubtags) Scripts() []Script { - scr := make([]Script, language.NumScripts) - for i := range scr { - scr[i] = Script{language.Script(i + 1)} - } - return scr -} - -// BaseLanguages returns the list of all supported base languages. It generates -// the list by traversing the internal structures. -func (s allSubtags) BaseLanguages() []Base { - bs := language.BaseLanguages() - base := make([]Base, len(bs)) - for i, b := range bs { - base[i] = Base{b} - } - return base -} - -// Tags always returns nil. -func (s allSubtags) Tags() []Tag { - return nil -} - -// coverage is used by NewCoverage which is used as a convenient way for -// creating Coverage implementations for partially defined data. Very often a -// package will only need to define a subset of slices. coverage provides a -// convenient way to do this. Moreover, packages using NewCoverage, instead of -// their own implementation, will not break if later new slice types are added. -type coverage struct { - tags func() []Tag - bases func() []Base - scripts func() []Script - regions func() []Region -} - -func (s *coverage) Tags() []Tag { - if s.tags == nil { - return nil - } - return s.tags() -} - -// bases implements sort.Interface and is used to sort base languages. -type bases []Base - -func (b bases) Len() int { - return len(b) -} - -func (b bases) Swap(i, j int) { - b[i], b[j] = b[j], b[i] -} - -func (b bases) Less(i, j int) bool { - return b[i].langID < b[j].langID -} - -// BaseLanguages returns the result from calling s.bases if it is specified or -// otherwise derives the set of supported base languages from tags. -func (s *coverage) BaseLanguages() []Base { - if s.bases == nil { - tags := s.Tags() - if len(tags) == 0 { - return nil - } - a := make([]Base, len(tags)) - for i, t := range tags { - a[i] = Base{language.Language(t.lang())} - } - sort.Sort(bases(a)) - k := 0 - for i := 1; i < len(a); i++ { - if a[k] != a[i] { - k++ - a[k] = a[i] - } - } - return a[:k+1] - } - return s.bases() -} - -func (s *coverage) Scripts() []Script { - if s.scripts == nil { - return nil - } - return s.scripts() -} - -func (s *coverage) Regions() []Region { - if s.regions == nil { - return nil - } - return s.regions() -} - -// NewCoverage returns a Coverage for the given lists. It is typically used by -// packages providing internationalization services to define their level of -// coverage. A list may be of type []T or func() []T, where T is either Tag, -// Base, Script or Region. The returned Coverage derives the value for Bases -// from Tags if no func or slice for []Base is specified. For other unspecified -// types the returned Coverage will return nil for the respective methods. -func NewCoverage(list ...interface{}) Coverage { - s := &coverage{} - for _, x := range list { - switch v := x.(type) { - case func() []Base: - s.bases = v - case func() []Script: - s.scripts = v - case func() []Region: - s.regions = v - case func() []Tag: - s.tags = v - case []Base: - s.bases = func() []Base { return v } - case []Script: - s.scripts = func() []Script { return v } - case []Region: - s.regions = func() []Region { return v } - case []Tag: - s.tags = func() []Tag { return v } - default: - panic(fmt.Sprintf("language: unsupported set type %T", v)) - } - } - return s -} diff --git a/vendor/golang.org/x/text/language/doc.go b/vendor/golang.org/x/text/language/doc.go deleted file mode 100644 index 8afecd50e..000000000 --- a/vendor/golang.org/x/text/language/doc.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package language implements BCP 47 language tags and related functionality. -// -// The most important function of package language is to match a list of -// user-preferred languages to a list of supported languages. -// It alleviates the developer of dealing with the complexity of this process -// and provides the user with the best experience -// (see https://blog.golang.org/matchlang). -// -// -// Matching preferred against supported languages -// -// A Matcher for an application that supports English, Australian English, -// Danish, and standard Mandarin can be created as follows: -// -// var matcher = language.NewMatcher([]language.Tag{ -// language.English, // The first language is used as fallback. -// language.MustParse("en-AU"), -// language.Danish, -// language.Chinese, -// }) -// -// This list of supported languages is typically implied by the languages for -// which there exists translations of the user interface. -// -// User-preferred languages usually come as a comma-separated list of BCP 47 -// language tags. -// The MatchString finds best matches for such strings: -// -// handler(w http.ResponseWriter, r *http.Request) { -// lang, _ := r.Cookie("lang") -// accept := r.Header.Get("Accept-Language") -// tag, _ := language.MatchStrings(matcher, lang.String(), accept) -// -// // tag should now be used for the initialization of any -// // locale-specific service. -// } -// -// The Matcher's Match method can be used to match Tags directly. -// -// Matchers are aware of the intricacies of equivalence between languages, such -// as deprecated subtags, legacy tags, macro languages, mutual -// intelligibility between scripts and languages, and transparently passing -// BCP 47 user configuration. -// For instance, it will know that a reader of Bokmål Danish can read Norwegian -// and will know that Cantonese ("yue") is a good match for "zh-HK". -// -// -// Using match results -// -// To guarantee a consistent user experience to the user it is important to -// use the same language tag for the selection of any locale-specific services. -// For example, it is utterly confusing to substitute spelled-out numbers -// or dates in one language in text of another language. -// More subtly confusing is using the wrong sorting order or casing -// algorithm for a certain language. -// -// All the packages in x/text that provide locale-specific services -// (e.g. collate, cases) should be initialized with the tag that was -// obtained at the start of an interaction with the user. -// -// Note that Tag that is returned by Match and MatchString may differ from any -// of the supported languages, as it may contain carried over settings from -// the user tags. -// This may be inconvenient when your application has some additional -// locale-specific data for your supported languages. -// Match and MatchString both return the index of the matched supported tag -// to simplify associating such data with the matched tag. -// -// -// Canonicalization -// -// If one uses the Matcher to compare languages one does not need to -// worry about canonicalization. -// -// The meaning of a Tag varies per application. The language package -// therefore delays canonicalization and preserves information as much -// as possible. The Matcher, however, will always take into account that -// two different tags may represent the same language. -// -// By default, only legacy and deprecated tags are converted into their -// canonical equivalent. All other information is preserved. This approach makes -// the confidence scores more accurate and allows matchers to distinguish -// between variants that are otherwise lost. -// -// As a consequence, two tags that should be treated as identical according to -// BCP 47 or CLDR, like "en-Latn" and "en", will be represented differently. The -// Matcher handles such distinctions, though, and is aware of the -// equivalence relations. The CanonType type can be used to alter the -// canonicalization form. -// -// References -// -// BCP 47 - Tags for Identifying Languages http://tools.ietf.org/html/bcp47 -// -package language // import "golang.org/x/text/language" - -// TODO: explanation on how to match languages for your own locale-specific -// service. diff --git a/vendor/golang.org/x/text/language/go1_1.go b/vendor/golang.org/x/text/language/go1_1.go deleted file mode 100644 index 380f4c09f..000000000 --- a/vendor/golang.org/x/text/language/go1_1.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.2 - -package language - -import "sort" - -func sortStable(s sort.Interface) { - ss := stableSort{ - s: s, - pos: make([]int, s.Len()), - } - for i := range ss.pos { - ss.pos[i] = i - } - sort.Sort(&ss) -} - -type stableSort struct { - s sort.Interface - pos []int -} - -func (s *stableSort) Len() int { - return len(s.pos) -} - -func (s *stableSort) Less(i, j int) bool { - return s.s.Less(i, j) || !s.s.Less(j, i) && s.pos[i] < s.pos[j] -} - -func (s *stableSort) Swap(i, j int) { - s.s.Swap(i, j) - s.pos[i], s.pos[j] = s.pos[j], s.pos[i] -} diff --git a/vendor/golang.org/x/text/language/go1_2.go b/vendor/golang.org/x/text/language/go1_2.go deleted file mode 100644 index 38268c57a..000000000 --- a/vendor/golang.org/x/text/language/go1_2.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.2 - -package language - -import "sort" - -var sortStable = sort.Stable diff --git a/vendor/golang.org/x/text/language/language.go b/vendor/golang.org/x/text/language/language.go deleted file mode 100644 index abfa17f66..000000000 --- a/vendor/golang.org/x/text/language/language.go +++ /dev/null @@ -1,601 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate go run gen.go -output tables.go - -package language - -// TODO: Remove above NOTE after: -// - verifying that tables are dropped correctly (most notably matcher tables). - -import ( - "strings" - - "golang.org/x/text/internal/language" - "golang.org/x/text/internal/language/compact" -) - -// Tag represents a BCP 47 language tag. It is used to specify an instance of a -// specific language or locale. All language tag values are guaranteed to be -// well-formed. -type Tag compact.Tag - -func makeTag(t language.Tag) (tag Tag) { - return Tag(compact.Make(t)) -} - -func (t *Tag) tag() language.Tag { - return (*compact.Tag)(t).Tag() -} - -func (t *Tag) isCompact() bool { - return (*compact.Tag)(t).IsCompact() -} - -// TODO: improve performance. -func (t *Tag) lang() language.Language { return t.tag().LangID } -func (t *Tag) region() language.Region { return t.tag().RegionID } -func (t *Tag) script() language.Script { return t.tag().ScriptID } - -// Make is a convenience wrapper for Parse that omits the error. -// In case of an error, a sensible default is returned. -func Make(s string) Tag { - return Default.Make(s) -} - -// Make is a convenience wrapper for c.Parse that omits the error. -// In case of an error, a sensible default is returned. -func (c CanonType) Make(s string) Tag { - t, _ := c.Parse(s) - return t -} - -// Raw returns the raw base language, script and region, without making an -// attempt to infer their values. -func (t Tag) Raw() (b Base, s Script, r Region) { - tt := t.tag() - return Base{tt.LangID}, Script{tt.ScriptID}, Region{tt.RegionID} -} - -// IsRoot returns true if t is equal to language "und". -func (t Tag) IsRoot() bool { - return compact.Tag(t).IsRoot() -} - -// CanonType can be used to enable or disable various types of canonicalization. -type CanonType int - -const ( - // Replace deprecated base languages with their preferred replacements. - DeprecatedBase CanonType = 1 << iota - // Replace deprecated scripts with their preferred replacements. - DeprecatedScript - // Replace deprecated regions with their preferred replacements. - DeprecatedRegion - // Remove redundant scripts. - SuppressScript - // Normalize legacy encodings. This includes legacy languages defined in - // CLDR as well as bibliographic codes defined in ISO-639. - Legacy - // Map the dominant language of a macro language group to the macro language - // subtag. For example cmn -> zh. - Macro - // The CLDR flag should be used if full compatibility with CLDR is required. - // There are a few cases where language.Tag may differ from CLDR. To follow all - // of CLDR's suggestions, use All|CLDR. - CLDR - - // Raw can be used to Compose or Parse without Canonicalization. - Raw CanonType = 0 - - // Replace all deprecated tags with their preferred replacements. - Deprecated = DeprecatedBase | DeprecatedScript | DeprecatedRegion - - // All canonicalizations recommended by BCP 47. - BCP47 = Deprecated | SuppressScript - - // All canonicalizations. - All = BCP47 | Legacy | Macro - - // Default is the canonicalization used by Parse, Make and Compose. To - // preserve as much information as possible, canonicalizations that remove - // potentially valuable information are not included. The Matcher is - // designed to recognize similar tags that would be the same if - // they were canonicalized using All. - Default = Deprecated | Legacy - - canonLang = DeprecatedBase | Legacy | Macro - - // TODO: LikelyScript, LikelyRegion: suppress similar to ICU. -) - -// canonicalize returns the canonicalized equivalent of the tag and -// whether there was any change. -func canonicalize(c CanonType, t language.Tag) (language.Tag, bool) { - if c == Raw { - return t, false - } - changed := false - if c&SuppressScript != 0 { - if t.LangID.SuppressScript() == t.ScriptID { - t.ScriptID = 0 - changed = true - } - } - if c&canonLang != 0 { - for { - if l, aliasType := t.LangID.Canonicalize(); l != t.LangID { - switch aliasType { - case language.Legacy: - if c&Legacy != 0 { - if t.LangID == _sh && t.ScriptID == 0 { - t.ScriptID = _Latn - } - t.LangID = l - changed = true - } - case language.Macro: - if c&Macro != 0 { - // We deviate here from CLDR. The mapping "nb" -> "no" - // qualifies as a typical Macro language mapping. However, - // for legacy reasons, CLDR maps "no", the macro language - // code for Norwegian, to the dominant variant "nb". This - // change is currently under consideration for CLDR as well. - // See https://unicode.org/cldr/trac/ticket/2698 and also - // https://unicode.org/cldr/trac/ticket/1790 for some of the - // practical implications. TODO: this check could be removed - // if CLDR adopts this change. - if c&CLDR == 0 || t.LangID != _nb { - changed = true - t.LangID = l - } - } - case language.Deprecated: - if c&DeprecatedBase != 0 { - if t.LangID == _mo && t.RegionID == 0 { - t.RegionID = _MD - } - t.LangID = l - changed = true - // Other canonicalization types may still apply. - continue - } - } - } else if c&Legacy != 0 && t.LangID == _no && c&CLDR != 0 { - t.LangID = _nb - changed = true - } - break - } - } - if c&DeprecatedScript != 0 { - if t.ScriptID == _Qaai { - changed = true - t.ScriptID = _Zinh - } - } - if c&DeprecatedRegion != 0 { - if r := t.RegionID.Canonicalize(); r != t.RegionID { - changed = true - t.RegionID = r - } - } - return t, changed -} - -// Canonicalize returns the canonicalized equivalent of the tag. -func (c CanonType) Canonicalize(t Tag) (Tag, error) { - // First try fast path. - if t.isCompact() { - if _, changed := canonicalize(c, compact.Tag(t).Tag()); !changed { - return t, nil - } - } - // It is unlikely that one will canonicalize a tag after matching. So do - // a slow but simple approach here. - if tag, changed := canonicalize(c, t.tag()); changed { - tag.RemakeString() - return makeTag(tag), nil - } - return t, nil - -} - -// Confidence indicates the level of certainty for a given return value. -// For example, Serbian may be written in Cyrillic or Latin script. -// The confidence level indicates whether a value was explicitly specified, -// whether it is typically the only possible value, or whether there is -// an ambiguity. -type Confidence int - -const ( - No Confidence = iota // full confidence that there was no match - Low // most likely value picked out of a set of alternatives - High // value is generally assumed to be the correct match - Exact // exact match or explicitly specified value -) - -var confName = []string{"No", "Low", "High", "Exact"} - -func (c Confidence) String() string { - return confName[c] -} - -// String returns the canonical string representation of the language tag. -func (t Tag) String() string { - return t.tag().String() -} - -// MarshalText implements encoding.TextMarshaler. -func (t Tag) MarshalText() (text []byte, err error) { - return t.tag().MarshalText() -} - -// UnmarshalText implements encoding.TextUnmarshaler. -func (t *Tag) UnmarshalText(text []byte) error { - var tag language.Tag - err := tag.UnmarshalText(text) - *t = makeTag(tag) - return err -} - -// Base returns the base language of the language tag. If the base language is -// unspecified, an attempt will be made to infer it from the context. -// It uses a variant of CLDR's Add Likely Subtags algorithm. This is subject to change. -func (t Tag) Base() (Base, Confidence) { - if b := t.lang(); b != 0 { - return Base{b}, Exact - } - tt := t.tag() - c := High - if tt.ScriptID == 0 && !tt.RegionID.IsCountry() { - c = Low - } - if tag, err := tt.Maximize(); err == nil && tag.LangID != 0 { - return Base{tag.LangID}, c - } - return Base{0}, No -} - -// Script infers the script for the language tag. If it was not explicitly given, it will infer -// a most likely candidate. -// If more than one script is commonly used for a language, the most likely one -// is returned with a low confidence indication. For example, it returns (Cyrl, Low) -// for Serbian. -// If a script cannot be inferred (Zzzz, No) is returned. We do not use Zyyy (undetermined) -// as one would suspect from the IANA registry for BCP 47. In a Unicode context Zyyy marks -// common characters (like 1, 2, 3, '.', etc.) and is therefore more like multiple scripts. -// See https://www.unicode.org/reports/tr24/#Values for more details. Zzzz is also used for -// unknown value in CLDR. (Zzzz, Exact) is returned if Zzzz was explicitly specified. -// Note that an inferred script is never guaranteed to be the correct one. Latin is -// almost exclusively used for Afrikaans, but Arabic has been used for some texts -// in the past. Also, the script that is commonly used may change over time. -// It uses a variant of CLDR's Add Likely Subtags algorithm. This is subject to change. -func (t Tag) Script() (Script, Confidence) { - if scr := t.script(); scr != 0 { - return Script{scr}, Exact - } - tt := t.tag() - sc, c := language.Script(_Zzzz), No - if scr := tt.LangID.SuppressScript(); scr != 0 { - // Note: it is not always the case that a language with a suppress - // script value is only written in one script (e.g. kk, ms, pa). - if tt.RegionID == 0 { - return Script{scr}, High - } - sc, c = scr, High - } - if tag, err := tt.Maximize(); err == nil { - if tag.ScriptID != sc { - sc, c = tag.ScriptID, Low - } - } else { - tt, _ = canonicalize(Deprecated|Macro, tt) - if tag, err := tt.Maximize(); err == nil && tag.ScriptID != sc { - sc, c = tag.ScriptID, Low - } - } - return Script{sc}, c -} - -// Region returns the region for the language tag. If it was not explicitly given, it will -// infer a most likely candidate from the context. -// It uses a variant of CLDR's Add Likely Subtags algorithm. This is subject to change. -func (t Tag) Region() (Region, Confidence) { - if r := t.region(); r != 0 { - return Region{r}, Exact - } - tt := t.tag() - if tt, err := tt.Maximize(); err == nil { - return Region{tt.RegionID}, Low // TODO: differentiate between high and low. - } - tt, _ = canonicalize(Deprecated|Macro, tt) - if tag, err := tt.Maximize(); err == nil { - return Region{tag.RegionID}, Low - } - return Region{_ZZ}, No // TODO: return world instead of undetermined? -} - -// Variants returns the variants specified explicitly for this language tag. -// or nil if no variant was specified. -func (t Tag) Variants() []Variant { - if !compact.Tag(t).MayHaveVariants() { - return nil - } - v := []Variant{} - x, str := "", t.tag().Variants() - for str != "" { - x, str = nextToken(str) - v = append(v, Variant{x}) - } - return v -} - -// Parent returns the CLDR parent of t. In CLDR, missing fields in data for a -// specific language are substituted with fields from the parent language. -// The parent for a language may change for newer versions of CLDR. -// -// Parent returns a tag for a less specific language that is mutually -// intelligible or Und if there is no such language. This may not be the same as -// simply stripping the last BCP 47 subtag. For instance, the parent of "zh-TW" -// is "zh-Hant", and the parent of "zh-Hant" is "und". -func (t Tag) Parent() Tag { - return Tag(compact.Tag(t).Parent()) -} - -// returns token t and the rest of the string. -func nextToken(s string) (t, tail string) { - p := strings.Index(s[1:], "-") - if p == -1 { - return s[1:], "" - } - p++ - return s[1:p], s[p:] -} - -// Extension is a single BCP 47 extension. -type Extension struct { - s string -} - -// String returns the string representation of the extension, including the -// type tag. -func (e Extension) String() string { - return e.s -} - -// ParseExtension parses s as an extension and returns it on success. -func ParseExtension(s string) (e Extension, err error) { - ext, err := language.ParseExtension(s) - return Extension{ext}, err -} - -// Type returns the one-byte extension type of e. It returns 0 for the zero -// exception. -func (e Extension) Type() byte { - if e.s == "" { - return 0 - } - return e.s[0] -} - -// Tokens returns the list of tokens of e. -func (e Extension) Tokens() []string { - return strings.Split(e.s, "-") -} - -// Extension returns the extension of type x for tag t. It will return -// false for ok if t does not have the requested extension. The returned -// extension will be invalid in this case. -func (t Tag) Extension(x byte) (ext Extension, ok bool) { - if !compact.Tag(t).MayHaveExtensions() { - return Extension{}, false - } - e, ok := t.tag().Extension(x) - return Extension{e}, ok -} - -// Extensions returns all extensions of t. -func (t Tag) Extensions() []Extension { - if !compact.Tag(t).MayHaveExtensions() { - return nil - } - e := []Extension{} - for _, ext := range t.tag().Extensions() { - e = append(e, Extension{ext}) - } - return e -} - -// TypeForKey returns the type associated with the given key, where key and type -// are of the allowed values defined for the Unicode locale extension ('u') in -// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. -// TypeForKey will traverse the inheritance chain to get the correct value. -func (t Tag) TypeForKey(key string) string { - if !compact.Tag(t).MayHaveExtensions() { - if key != "rg" && key != "va" { - return "" - } - } - return t.tag().TypeForKey(key) -} - -// SetTypeForKey returns a new Tag with the key set to type, where key and type -// are of the allowed values defined for the Unicode locale extension ('u') in -// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. -// An empty value removes an existing pair with the same key. -func (t Tag) SetTypeForKey(key, value string) (Tag, error) { - tt, err := t.tag().SetTypeForKey(key, value) - return makeTag(tt), err -} - -// NumCompactTags is the number of compact tags. The maximum tag is -// NumCompactTags-1. -const NumCompactTags = compact.NumCompactTags - -// CompactIndex returns an index, where 0 <= index < NumCompactTags, for tags -// for which data exists in the text repository.The index will change over time -// and should not be stored in persistent storage. If t does not match a compact -// index, exact will be false and the compact index will be returned for the -// first match after repeatedly taking the Parent of t. -func CompactIndex(t Tag) (index int, exact bool) { - id, exact := compact.LanguageID(compact.Tag(t)) - return int(id), exact -} - -var root = language.Tag{} - -// Base is an ISO 639 language code, used for encoding the base language -// of a language tag. -type Base struct { - langID language.Language -} - -// ParseBase parses a 2- or 3-letter ISO 639 code. -// It returns a ValueError if s is a well-formed but unknown language identifier -// or another error if another error occurred. -func ParseBase(s string) (Base, error) { - l, err := language.ParseBase(s) - return Base{l}, err -} - -// String returns the BCP 47 representation of the base language. -func (b Base) String() string { - return b.langID.String() -} - -// ISO3 returns the ISO 639-3 language code. -func (b Base) ISO3() string { - return b.langID.ISO3() -} - -// IsPrivateUse reports whether this language code is reserved for private use. -func (b Base) IsPrivateUse() bool { - return b.langID.IsPrivateUse() -} - -// Script is a 4-letter ISO 15924 code for representing scripts. -// It is idiomatically represented in title case. -type Script struct { - scriptID language.Script -} - -// ParseScript parses a 4-letter ISO 15924 code. -// It returns a ValueError if s is a well-formed but unknown script identifier -// or another error if another error occurred. -func ParseScript(s string) (Script, error) { - sc, err := language.ParseScript(s) - return Script{sc}, err -} - -// String returns the script code in title case. -// It returns "Zzzz" for an unspecified script. -func (s Script) String() string { - return s.scriptID.String() -} - -// IsPrivateUse reports whether this script code is reserved for private use. -func (s Script) IsPrivateUse() bool { - return s.scriptID.IsPrivateUse() -} - -// Region is an ISO 3166-1 or UN M.49 code for representing countries and regions. -type Region struct { - regionID language.Region -} - -// EncodeM49 returns the Region for the given UN M.49 code. -// It returns an error if r is not a valid code. -func EncodeM49(r int) (Region, error) { - rid, err := language.EncodeM49(r) - return Region{rid}, err -} - -// ParseRegion parses a 2- or 3-letter ISO 3166-1 or a UN M.49 code. -// It returns a ValueError if s is a well-formed but unknown region identifier -// or another error if another error occurred. -func ParseRegion(s string) (Region, error) { - r, err := language.ParseRegion(s) - return Region{r}, err -} - -// String returns the BCP 47 representation for the region. -// It returns "ZZ" for an unspecified region. -func (r Region) String() string { - return r.regionID.String() -} - -// ISO3 returns the 3-letter ISO code of r. -// Note that not all regions have a 3-letter ISO code. -// In such cases this method returns "ZZZ". -func (r Region) ISO3() string { - return r.regionID.ISO3() -} - -// M49 returns the UN M.49 encoding of r, or 0 if this encoding -// is not defined for r. -func (r Region) M49() int { - return r.regionID.M49() -} - -// IsPrivateUse reports whether r has the ISO 3166 User-assigned status. This -// may include private-use tags that are assigned by CLDR and used in this -// implementation. So IsPrivateUse and IsCountry can be simultaneously true. -func (r Region) IsPrivateUse() bool { - return r.regionID.IsPrivateUse() -} - -// IsCountry returns whether this region is a country or autonomous area. This -// includes non-standard definitions from CLDR. -func (r Region) IsCountry() bool { - return r.regionID.IsCountry() -} - -// IsGroup returns whether this region defines a collection of regions. This -// includes non-standard definitions from CLDR. -func (r Region) IsGroup() bool { - return r.regionID.IsGroup() -} - -// Contains returns whether Region c is contained by Region r. It returns true -// if c == r. -func (r Region) Contains(c Region) bool { - return r.regionID.Contains(c.regionID) -} - -// TLD returns the country code top-level domain (ccTLD). UK is returned for GB. -// In all other cases it returns either the region itself or an error. -// -// This method may return an error for a region for which there exists a -// canonical form with a ccTLD. To get that ccTLD canonicalize r first. The -// region will already be canonicalized it was obtained from a Tag that was -// obtained using any of the default methods. -func (r Region) TLD() (Region, error) { - tld, err := r.regionID.TLD() - return Region{tld}, err -} - -// Canonicalize returns the region or a possible replacement if the region is -// deprecated. It will not return a replacement for deprecated regions that -// are split into multiple regions. -func (r Region) Canonicalize() Region { - return Region{r.regionID.Canonicalize()} -} - -// Variant represents a registered variant of a language as defined by BCP 47. -type Variant struct { - variant string -} - -// ParseVariant parses and returns a Variant. An error is returned if s is not -// a valid variant. -func ParseVariant(s string) (Variant, error) { - v, err := language.ParseVariant(s) - return Variant{v.String()}, err -} - -// String returns the string representation of the variant. -func (v Variant) String() string { - return v.variant -} diff --git a/vendor/golang.org/x/text/language/match.go b/vendor/golang.org/x/text/language/match.go deleted file mode 100644 index f73492134..000000000 --- a/vendor/golang.org/x/text/language/match.go +++ /dev/null @@ -1,735 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -import ( - "errors" - "strings" - - "golang.org/x/text/internal/language" -) - -// A MatchOption configures a Matcher. -type MatchOption func(*matcher) - -// PreferSameScript will, in the absence of a match, result in the first -// preferred tag with the same script as a supported tag to match this supported -// tag. The default is currently true, but this may change in the future. -func PreferSameScript(preferSame bool) MatchOption { - return func(m *matcher) { m.preferSameScript = preferSame } -} - -// TODO(v1.0.0): consider making Matcher a concrete type, instead of interface. -// There doesn't seem to be too much need for multiple types. -// Making it a concrete type allows MatchStrings to be a method, which will -// improve its discoverability. - -// MatchStrings parses and matches the given strings until one of them matches -// the language in the Matcher. A string may be an Accept-Language header as -// handled by ParseAcceptLanguage. The default language is returned if no -// other language matched. -func MatchStrings(m Matcher, lang ...string) (tag Tag, index int) { - for _, accept := range lang { - desired, _, err := ParseAcceptLanguage(accept) - if err != nil { - continue - } - if tag, index, conf := m.Match(desired...); conf != No { - return tag, index - } - } - tag, index, _ = m.Match() - return -} - -// Matcher is the interface that wraps the Match method. -// -// Match returns the best match for any of the given tags, along with -// a unique index associated with the returned tag and a confidence -// score. -type Matcher interface { - Match(t ...Tag) (tag Tag, index int, c Confidence) -} - -// Comprehends reports the confidence score for a speaker of a given language -// to being able to comprehend the written form of an alternative language. -func Comprehends(speaker, alternative Tag) Confidence { - _, _, c := NewMatcher([]Tag{alternative}).Match(speaker) - return c -} - -// NewMatcher returns a Matcher that matches an ordered list of preferred tags -// against a list of supported tags based on written intelligibility, closeness -// of dialect, equivalence of subtags and various other rules. It is initialized -// with the list of supported tags. The first element is used as the default -// value in case no match is found. -// -// Its Match method matches the first of the given Tags to reach a certain -// confidence threshold. The tags passed to Match should therefore be specified -// in order of preference. Extensions are ignored for matching. -// -// The index returned by the Match method corresponds to the index of the -// matched tag in t, but is augmented with the Unicode extension ('u')of the -// corresponding preferred tag. This allows user locale options to be passed -// transparently. -func NewMatcher(t []Tag, options ...MatchOption) Matcher { - return newMatcher(t, options) -} - -func (m *matcher) Match(want ...Tag) (t Tag, index int, c Confidence) { - var tt language.Tag - match, w, c := m.getBest(want...) - if match != nil { - tt, index = match.tag, match.index - } else { - // TODO: this should be an option - tt = m.default_.tag - if m.preferSameScript { - outer: - for _, w := range want { - script, _ := w.Script() - if script.scriptID == 0 { - // Don't do anything if there is no script, such as with - // private subtags. - continue - } - for i, h := range m.supported { - if script.scriptID == h.maxScript { - tt, index = h.tag, i - break outer - } - } - } - } - // TODO: select first language tag based on script. - } - if w.RegionID != tt.RegionID && w.RegionID != 0 { - if w.RegionID != 0 && tt.RegionID != 0 && tt.RegionID.Contains(w.RegionID) { - tt.RegionID = w.RegionID - tt.RemakeString() - } else if r := w.RegionID.String(); len(r) == 2 { - // TODO: also filter macro and deprecated. - tt, _ = tt.SetTypeForKey("rg", strings.ToLower(r)+"zzzz") - } - } - // Copy options from the user-provided tag into the result tag. This is hard - // to do after the fact, so we do it here. - // TODO: add in alternative variants to -u-va-. - // TODO: add preferred region to -u-rg-. - if e := w.Extensions(); len(e) > 0 { - b := language.Builder{} - b.SetTag(tt) - for _, e := range e { - b.AddExt(e) - } - tt = b.Make() - } - return makeTag(tt), index, c -} - -// ErrMissingLikelyTagsData indicates no information was available -// to compute likely values of missing tags. -var ErrMissingLikelyTagsData = errors.New("missing likely tags data") - -// func (t *Tag) setTagsFrom(id Tag) { -// t.LangID = id.LangID -// t.ScriptID = id.ScriptID -// t.RegionID = id.RegionID -// } - -// Tag Matching -// CLDR defines an algorithm for finding the best match between two sets of language -// tags. The basic algorithm defines how to score a possible match and then find -// the match with the best score -// (see https://www.unicode.org/reports/tr35/#LanguageMatching). -// Using scoring has several disadvantages. The scoring obfuscates the importance of -// the various factors considered, making the algorithm harder to understand. Using -// scoring also requires the full score to be computed for each pair of tags. -// -// We will use a different algorithm which aims to have the following properties: -// - clarity on the precedence of the various selection factors, and -// - improved performance by allowing early termination of a comparison. -// -// Matching algorithm (overview) -// Input: -// - supported: a set of supported tags -// - default: the default tag to return in case there is no match -// - desired: list of desired tags, ordered by preference, starting with -// the most-preferred. -// -// Algorithm: -// 1) Set the best match to the lowest confidence level -// 2) For each tag in "desired": -// a) For each tag in "supported": -// 1) compute the match between the two tags. -// 2) if the match is better than the previous best match, replace it -// with the new match. (see next section) -// b) if the current best match is Exact and pin is true the result will be -// frozen to the language found thusfar, although better matches may -// still be found for the same language. -// 3) If the best match so far is below a certain threshold, return "default". -// -// Ranking: -// We use two phases to determine whether one pair of tags are a better match -// than another pair of tags. First, we determine a rough confidence level. If the -// levels are different, the one with the highest confidence wins. -// Second, if the rough confidence levels are identical, we use a set of tie-breaker -// rules. -// -// The confidence level of matching a pair of tags is determined by finding the -// lowest confidence level of any matches of the corresponding subtags (the -// result is deemed as good as its weakest link). -// We define the following levels: -// Exact - An exact match of a subtag, before adding likely subtags. -// MaxExact - An exact match of a subtag, after adding likely subtags. -// [See Note 2]. -// High - High level of mutual intelligibility between different subtag -// variants. -// Low - Low level of mutual intelligibility between different subtag -// variants. -// No - No mutual intelligibility. -// -// The following levels can occur for each type of subtag: -// Base: Exact, MaxExact, High, Low, No -// Script: Exact, MaxExact [see Note 3], Low, No -// Region: Exact, MaxExact, High -// Variant: Exact, High -// Private: Exact, No -// -// Any result with a confidence level of Low or higher is deemed a possible match. -// Once a desired tag matches any of the supported tags with a level of MaxExact -// or higher, the next desired tag is not considered (see Step 2.b). -// Note that CLDR provides languageMatching data that defines close equivalence -// classes for base languages, scripts and regions. -// -// Tie-breaking -// If we get the same confidence level for two matches, we apply a sequence of -// tie-breaking rules. The first that succeeds defines the result. The rules are -// applied in the following order. -// 1) Original language was defined and was identical. -// 2) Original region was defined and was identical. -// 3) Distance between two maximized regions was the smallest. -// 4) Original script was defined and was identical. -// 5) Distance from want tag to have tag using the parent relation [see Note 5.] -// If there is still no winner after these rules are applied, the first match -// found wins. -// -// Notes: -// [2] In practice, as matching of Exact is done in a separate phase from -// matching the other levels, we reuse the Exact level to mean MaxExact in -// the second phase. As a consequence, we only need the levels defined by -// the Confidence type. The MaxExact confidence level is mapped to High in -// the public API. -// [3] We do not differentiate between maximized script values that were derived -// from suppressScript versus most likely tag data. We determined that in -// ranking the two, one ranks just after the other. Moreover, the two cannot -// occur concurrently. As a consequence, they are identical for practical -// purposes. -// [4] In case of deprecated, macro-equivalents and legacy mappings, we assign -// the MaxExact level to allow iw vs he to still be a closer match than -// en-AU vs en-US, for example. -// [5] In CLDR a locale inherits fields that are unspecified for this locale -// from its parent. Therefore, if a locale is a parent of another locale, -// it is a strong measure for closeness, especially when no other tie -// breaker rule applies. One could also argue it is inconsistent, for -// example, when pt-AO matches pt (which CLDR equates with pt-BR), even -// though its parent is pt-PT according to the inheritance rules. -// -// Implementation Details: -// There are several performance considerations worth pointing out. Most notably, -// we preprocess as much as possible (within reason) at the time of creation of a -// matcher. This includes: -// - creating a per-language map, which includes data for the raw base language -// and its canonicalized variant (if applicable), -// - expanding entries for the equivalence classes defined in CLDR's -// languageMatch data. -// The per-language map ensures that typically only a very small number of tags -// need to be considered. The pre-expansion of canonicalized subtags and -// equivalence classes reduces the amount of map lookups that need to be done at -// runtime. - -// matcher keeps a set of supported language tags, indexed by language. -type matcher struct { - default_ *haveTag - supported []*haveTag - index map[language.Language]*matchHeader - passSettings bool - preferSameScript bool -} - -// matchHeader has the lists of tags for exact matches and matches based on -// maximized and canonicalized tags for a given language. -type matchHeader struct { - haveTags []*haveTag - original bool -} - -// haveTag holds a supported Tag and its maximized script and region. The maximized -// or canonicalized language is not stored as it is not needed during matching. -type haveTag struct { - tag language.Tag - - // index of this tag in the original list of supported tags. - index int - - // conf is the maximum confidence that can result from matching this haveTag. - // When conf < Exact this means it was inserted after applying a CLDR equivalence rule. - conf Confidence - - // Maximized region and script. - maxRegion language.Region - maxScript language.Script - - // altScript may be checked as an alternative match to maxScript. If altScript - // matches, the confidence level for this match is Low. Theoretically there - // could be multiple alternative scripts. This does not occur in practice. - altScript language.Script - - // nextMax is the index of the next haveTag with the same maximized tags. - nextMax uint16 -} - -func makeHaveTag(tag language.Tag, index int) (haveTag, language.Language) { - max := tag - if tag.LangID != 0 || tag.RegionID != 0 || tag.ScriptID != 0 { - max, _ = canonicalize(All, max) - max, _ = max.Maximize() - max.RemakeString() - } - return haveTag{tag, index, Exact, max.RegionID, max.ScriptID, altScript(max.LangID, max.ScriptID), 0}, max.LangID -} - -// altScript returns an alternative script that may match the given script with -// a low confidence. At the moment, the langMatch data allows for at most one -// script to map to another and we rely on this to keep the code simple. -func altScript(l language.Language, s language.Script) language.Script { - for _, alt := range matchScript { - // TODO: also match cases where language is not the same. - if (language.Language(alt.wantLang) == l || language.Language(alt.haveLang) == l) && - language.Script(alt.haveScript) == s { - return language.Script(alt.wantScript) - } - } - return 0 -} - -// addIfNew adds a haveTag to the list of tags only if it is a unique tag. -// Tags that have the same maximized values are linked by index. -func (h *matchHeader) addIfNew(n haveTag, exact bool) { - h.original = h.original || exact - // Don't add new exact matches. - for _, v := range h.haveTags { - if equalsRest(v.tag, n.tag) { - return - } - } - // Allow duplicate maximized tags, but create a linked list to allow quickly - // comparing the equivalents and bail out. - for i, v := range h.haveTags { - if v.maxScript == n.maxScript && - v.maxRegion == n.maxRegion && - v.tag.VariantOrPrivateUseTags() == n.tag.VariantOrPrivateUseTags() { - for h.haveTags[i].nextMax != 0 { - i = int(h.haveTags[i].nextMax) - } - h.haveTags[i].nextMax = uint16(len(h.haveTags)) - break - } - } - h.haveTags = append(h.haveTags, &n) -} - -// header returns the matchHeader for the given language. It creates one if -// it doesn't already exist. -func (m *matcher) header(l language.Language) *matchHeader { - if h := m.index[l]; h != nil { - return h - } - h := &matchHeader{} - m.index[l] = h - return h -} - -func toConf(d uint8) Confidence { - if d <= 10 { - return High - } - if d < 30 { - return Low - } - return No -} - -// newMatcher builds an index for the given supported tags and returns it as -// a matcher. It also expands the index by considering various equivalence classes -// for a given tag. -func newMatcher(supported []Tag, options []MatchOption) *matcher { - m := &matcher{ - index: make(map[language.Language]*matchHeader), - preferSameScript: true, - } - for _, o := range options { - o(m) - } - if len(supported) == 0 { - m.default_ = &haveTag{} - return m - } - // Add supported languages to the index. Add exact matches first to give - // them precedence. - for i, tag := range supported { - tt := tag.tag() - pair, _ := makeHaveTag(tt, i) - m.header(tt.LangID).addIfNew(pair, true) - m.supported = append(m.supported, &pair) - } - m.default_ = m.header(supported[0].lang()).haveTags[0] - // Keep these in two different loops to support the case that two equivalent - // languages are distinguished, such as iw and he. - for i, tag := range supported { - tt := tag.tag() - pair, max := makeHaveTag(tt, i) - if max != tt.LangID { - m.header(max).addIfNew(pair, true) - } - } - - // update is used to add indexes in the map for equivalent languages. - // update will only add entries to original indexes, thus not computing any - // transitive relations. - update := func(want, have uint16, conf Confidence) { - if hh := m.index[language.Language(have)]; hh != nil { - if !hh.original { - return - } - hw := m.header(language.Language(want)) - for _, ht := range hh.haveTags { - v := *ht - if conf < v.conf { - v.conf = conf - } - v.nextMax = 0 // this value needs to be recomputed - if v.altScript != 0 { - v.altScript = altScript(language.Language(want), v.maxScript) - } - hw.addIfNew(v, conf == Exact && hh.original) - } - } - } - - // Add entries for languages with mutual intelligibility as defined by CLDR's - // languageMatch data. - for _, ml := range matchLang { - update(ml.want, ml.have, toConf(ml.distance)) - if !ml.oneway { - update(ml.have, ml.want, toConf(ml.distance)) - } - } - - // Add entries for possible canonicalizations. This is an optimization to - // ensure that only one map lookup needs to be done at runtime per desired tag. - // First we match deprecated equivalents. If they are perfect equivalents - // (their canonicalization simply substitutes a different language code, but - // nothing else), the match confidence is Exact, otherwise it is High. - for i, lm := range language.AliasMap { - // If deprecated codes match and there is no fiddling with the script or - // or region, we consider it an exact match. - conf := Exact - if language.AliasTypes[i] != language.Macro { - if !isExactEquivalent(language.Language(lm.From)) { - conf = High - } - update(lm.To, lm.From, conf) - } - update(lm.From, lm.To, conf) - } - return m -} - -// getBest gets the best matching tag in m for any of the given tags, taking into -// account the order of preference of the given tags. -func (m *matcher) getBest(want ...Tag) (got *haveTag, orig language.Tag, c Confidence) { - best := bestMatch{} - for i, ww := range want { - w := ww.tag() - var max language.Tag - // Check for exact match first. - h := m.index[w.LangID] - if w.LangID != 0 { - if h == nil { - continue - } - // Base language is defined. - max, _ = canonicalize(Legacy|Deprecated|Macro, w) - // A region that is added through canonicalization is stronger than - // a maximized region: set it in the original (e.g. mo -> ro-MD). - if w.RegionID != max.RegionID { - w.RegionID = max.RegionID - } - // TODO: should we do the same for scripts? - // See test case: en, sr, nl ; sh ; sr - max, _ = max.Maximize() - } else { - // Base language is not defined. - if h != nil { - for i := range h.haveTags { - have := h.haveTags[i] - if equalsRest(have.tag, w) { - return have, w, Exact - } - } - } - if w.ScriptID == 0 && w.RegionID == 0 { - // We skip all tags matching und for approximate matching, including - // private tags. - continue - } - max, _ = w.Maximize() - if h = m.index[max.LangID]; h == nil { - continue - } - } - pin := true - for _, t := range want[i+1:] { - if w.LangID == t.lang() { - pin = false - break - } - } - // Check for match based on maximized tag. - for i := range h.haveTags { - have := h.haveTags[i] - best.update(have, w, max.ScriptID, max.RegionID, pin) - if best.conf == Exact { - for have.nextMax != 0 { - have = h.haveTags[have.nextMax] - best.update(have, w, max.ScriptID, max.RegionID, pin) - } - return best.have, best.want, best.conf - } - } - } - if best.conf <= No { - if len(want) != 0 { - return nil, want[0].tag(), No - } - return nil, language.Tag{}, No - } - return best.have, best.want, best.conf -} - -// bestMatch accumulates the best match so far. -type bestMatch struct { - have *haveTag - want language.Tag - conf Confidence - pinnedRegion language.Region - pinLanguage bool - sameRegionGroup bool - // Cached results from applying tie-breaking rules. - origLang bool - origReg bool - paradigmReg bool - regGroupDist uint8 - origScript bool -} - -// update updates the existing best match if the new pair is considered to be a -// better match. To determine if the given pair is a better match, it first -// computes the rough confidence level. If this surpasses the current match, it -// will replace it and update the tie-breaker rule cache. If there is a tie, it -// proceeds with applying a series of tie-breaker rules. If there is no -// conclusive winner after applying the tie-breaker rules, it leaves the current -// match as the preferred match. -// -// If pin is true and have and tag are a strong match, it will henceforth only -// consider matches for this language. This corresponds to the nothing that most -// users have a strong preference for the first defined language. A user can -// still prefer a second language over a dialect of the preferred language by -// explicitly specifying dialects, e.g. "en, nl, en-GB". In this case pin should -// be false. -func (m *bestMatch) update(have *haveTag, tag language.Tag, maxScript language.Script, maxRegion language.Region, pin bool) { - // Bail if the maximum attainable confidence is below that of the current best match. - c := have.conf - if c < m.conf { - return - } - // Don't change the language once we already have found an exact match. - if m.pinLanguage && tag.LangID != m.want.LangID { - return - } - // Pin the region group if we are comparing tags for the same language. - if tag.LangID == m.want.LangID && m.sameRegionGroup { - _, sameGroup := regionGroupDist(m.pinnedRegion, have.maxRegion, have.maxScript, m.want.LangID) - if !sameGroup { - return - } - } - if c == Exact && have.maxScript == maxScript { - // If there is another language and then another entry of this language, - // don't pin anything, otherwise pin the language. - m.pinLanguage = pin - } - if equalsRest(have.tag, tag) { - } else if have.maxScript != maxScript { - // There is usually very little comprehension between different scripts. - // In a few cases there may still be Low comprehension. This possibility - // is pre-computed and stored in have.altScript. - if Low < m.conf || have.altScript != maxScript { - return - } - c = Low - } else if have.maxRegion != maxRegion { - if High < c { - // There is usually a small difference between languages across regions. - c = High - } - } - - // We store the results of the computations of the tie-breaker rules along - // with the best match. There is no need to do the checks once we determine - // we have a winner, but we do still need to do the tie-breaker computations. - // We use "beaten" to keep track if we still need to do the checks. - beaten := false // true if the new pair defeats the current one. - if c != m.conf { - if c < m.conf { - return - } - beaten = true - } - - // Tie-breaker rules: - // We prefer if the pre-maximized language was specified and identical. - origLang := have.tag.LangID == tag.LangID && tag.LangID != 0 - if !beaten && m.origLang != origLang { - if m.origLang { - return - } - beaten = true - } - - // We prefer if the pre-maximized region was specified and identical. - origReg := have.tag.RegionID == tag.RegionID && tag.RegionID != 0 - if !beaten && m.origReg != origReg { - if m.origReg { - return - } - beaten = true - } - - regGroupDist, sameGroup := regionGroupDist(have.maxRegion, maxRegion, maxScript, tag.LangID) - if !beaten && m.regGroupDist != regGroupDist { - if regGroupDist > m.regGroupDist { - return - } - beaten = true - } - - paradigmReg := isParadigmLocale(tag.LangID, have.maxRegion) - if !beaten && m.paradigmReg != paradigmReg { - if !paradigmReg { - return - } - beaten = true - } - - // Next we prefer if the pre-maximized script was specified and identical. - origScript := have.tag.ScriptID == tag.ScriptID && tag.ScriptID != 0 - if !beaten && m.origScript != origScript { - if m.origScript { - return - } - beaten = true - } - - // Update m to the newly found best match. - if beaten { - m.have = have - m.want = tag - m.conf = c - m.pinnedRegion = maxRegion - m.sameRegionGroup = sameGroup - m.origLang = origLang - m.origReg = origReg - m.paradigmReg = paradigmReg - m.origScript = origScript - m.regGroupDist = regGroupDist - } -} - -func isParadigmLocale(lang language.Language, r language.Region) bool { - for _, e := range paradigmLocales { - if language.Language(e[0]) == lang && (r == language.Region(e[1]) || r == language.Region(e[2])) { - return true - } - } - return false -} - -// regionGroupDist computes the distance between two regions based on their -// CLDR grouping. -func regionGroupDist(a, b language.Region, script language.Script, lang language.Language) (dist uint8, same bool) { - const defaultDistance = 4 - - aGroup := uint(regionToGroups[a]) << 1 - bGroup := uint(regionToGroups[b]) << 1 - for _, ri := range matchRegion { - if language.Language(ri.lang) == lang && (ri.script == 0 || language.Script(ri.script) == script) { - group := uint(1 << (ri.group &^ 0x80)) - if 0x80&ri.group == 0 { - if aGroup&bGroup&group != 0 { // Both regions are in the group. - return ri.distance, ri.distance == defaultDistance - } - } else { - if (aGroup|bGroup)&group == 0 { // Both regions are not in the group. - return ri.distance, ri.distance == defaultDistance - } - } - } - } - return defaultDistance, true -} - -// equalsRest compares everything except the language. -func equalsRest(a, b language.Tag) bool { - // TODO: don't include extensions in this comparison. To do this efficiently, - // though, we should handle private tags separately. - return a.ScriptID == b.ScriptID && a.RegionID == b.RegionID && a.VariantOrPrivateUseTags() == b.VariantOrPrivateUseTags() -} - -// isExactEquivalent returns true if canonicalizing the language will not alter -// the script or region of a tag. -func isExactEquivalent(l language.Language) bool { - for _, o := range notEquivalent { - if o == l { - return false - } - } - return true -} - -var notEquivalent []language.Language - -func init() { - // Create a list of all languages for which canonicalization may alter the - // script or region. - for _, lm := range language.AliasMap { - tag := language.Tag{LangID: language.Language(lm.From)} - if tag, _ = canonicalize(All, tag); tag.ScriptID != 0 || tag.RegionID != 0 { - notEquivalent = append(notEquivalent, language.Language(lm.From)) - } - } - // Maximize undefined regions of paradigm locales. - for i, v := range paradigmLocales { - t := language.Tag{LangID: language.Language(v[0])} - max, _ := t.Maximize() - if v[1] == 0 { - paradigmLocales[i][1] = uint16(max.RegionID) - } - if v[2] == 0 { - paradigmLocales[i][2] = uint16(max.RegionID) - } - } -} diff --git a/vendor/golang.org/x/text/language/parse.go b/vendor/golang.org/x/text/language/parse.go deleted file mode 100644 index 11acfd885..000000000 --- a/vendor/golang.org/x/text/language/parse.go +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -import ( - "errors" - "strconv" - "strings" - - "golang.org/x/text/internal/language" -) - -// ValueError is returned by any of the parsing functions when the -// input is well-formed but the respective subtag is not recognized -// as a valid value. -type ValueError interface { - error - - // Subtag returns the subtag for which the error occurred. - Subtag() string -} - -// Parse parses the given BCP 47 string and returns a valid Tag. If parsing -// failed it returns an error and any part of the tag that could be parsed. -// If parsing succeeded but an unknown value was found, it returns -// ValueError. The Tag returned in this case is just stripped of the unknown -// value. All other values are preserved. It accepts tags in the BCP 47 format -// and extensions to this standard defined in -// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. -// The resulting tag is canonicalized using the default canonicalization type. -func Parse(s string) (t Tag, err error) { - return Default.Parse(s) -} - -// Parse parses the given BCP 47 string and returns a valid Tag. If parsing -// failed it returns an error and any part of the tag that could be parsed. -// If parsing succeeded but an unknown value was found, it returns -// ValueError. The Tag returned in this case is just stripped of the unknown -// value. All other values are preserved. It accepts tags in the BCP 47 format -// and extensions to this standard defined in -// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers. -// The resulting tag is canonicalized using the canonicalization type c. -func (c CanonType) Parse(s string) (t Tag, err error) { - tt, err := language.Parse(s) - if err != nil { - return makeTag(tt), err - } - tt, changed := canonicalize(c, tt) - if changed { - tt.RemakeString() - } - return makeTag(tt), err -} - -// Compose creates a Tag from individual parts, which may be of type Tag, Base, -// Script, Region, Variant, []Variant, Extension, []Extension or error. If a -// Base, Script or Region or slice of type Variant or Extension is passed more -// than once, the latter will overwrite the former. Variants and Extensions are -// accumulated, but if two extensions of the same type are passed, the latter -// will replace the former. For -u extensions, though, the key-type pairs are -// added, where later values overwrite older ones. A Tag overwrites all former -// values and typically only makes sense as the first argument. The resulting -// tag is returned after canonicalizing using the Default CanonType. If one or -// more errors are encountered, one of the errors is returned. -func Compose(part ...interface{}) (t Tag, err error) { - return Default.Compose(part...) -} - -// Compose creates a Tag from individual parts, which may be of type Tag, Base, -// Script, Region, Variant, []Variant, Extension, []Extension or error. If a -// Base, Script or Region or slice of type Variant or Extension is passed more -// than once, the latter will overwrite the former. Variants and Extensions are -// accumulated, but if two extensions of the same type are passed, the latter -// will replace the former. For -u extensions, though, the key-type pairs are -// added, where later values overwrite older ones. A Tag overwrites all former -// values and typically only makes sense as the first argument. The resulting -// tag is returned after canonicalizing using CanonType c. If one or more errors -// are encountered, one of the errors is returned. -func (c CanonType) Compose(part ...interface{}) (t Tag, err error) { - var b language.Builder - if err = update(&b, part...); err != nil { - return und, err - } - b.Tag, _ = canonicalize(c, b.Tag) - return makeTag(b.Make()), err -} - -var errInvalidArgument = errors.New("invalid Extension or Variant") - -func update(b *language.Builder, part ...interface{}) (err error) { - for _, x := range part { - switch v := x.(type) { - case Tag: - b.SetTag(v.tag()) - case Base: - b.Tag.LangID = v.langID - case Script: - b.Tag.ScriptID = v.scriptID - case Region: - b.Tag.RegionID = v.regionID - case Variant: - if v.variant == "" { - err = errInvalidArgument - break - } - b.AddVariant(v.variant) - case Extension: - if v.s == "" { - err = errInvalidArgument - break - } - b.SetExt(v.s) - case []Variant: - b.ClearVariants() - for _, v := range v { - b.AddVariant(v.variant) - } - case []Extension: - b.ClearExtensions() - for _, e := range v { - b.SetExt(e.s) - } - // TODO: support parsing of raw strings based on morphology or just extensions? - case error: - if v != nil { - err = v - } - } - } - return -} - -var errInvalidWeight = errors.New("ParseAcceptLanguage: invalid weight") - -// ParseAcceptLanguage parses the contents of an Accept-Language header as -// defined in http://www.ietf.org/rfc/rfc2616.txt and returns a list of Tags and -// a list of corresponding quality weights. It is more permissive than RFC 2616 -// and may return non-nil slices even if the input is not valid. -// The Tags will be sorted by highest weight first and then by first occurrence. -// Tags with a weight of zero will be dropped. An error will be returned if the -// input could not be parsed. -func ParseAcceptLanguage(s string) (tag []Tag, q []float32, err error) { - var entry string - for s != "" { - if entry, s = split(s, ','); entry == "" { - continue - } - - entry, weight := split(entry, ';') - - // Scan the language. - t, err := Parse(entry) - if err != nil { - id, ok := acceptFallback[entry] - if !ok { - return nil, nil, err - } - t = makeTag(language.Tag{LangID: id}) - } - - // Scan the optional weight. - w := 1.0 - if weight != "" { - weight = consume(weight, 'q') - weight = consume(weight, '=') - // consume returns the empty string when a token could not be - // consumed, resulting in an error for ParseFloat. - if w, err = strconv.ParseFloat(weight, 32); err != nil { - return nil, nil, errInvalidWeight - } - // Drop tags with a quality weight of 0. - if w <= 0 { - continue - } - } - - tag = append(tag, t) - q = append(q, float32(w)) - } - sortStable(&tagSort{tag, q}) - return tag, q, nil -} - -// consume removes a leading token c from s and returns the result or the empty -// string if there is no such token. -func consume(s string, c byte) string { - if s == "" || s[0] != c { - return "" - } - return strings.TrimSpace(s[1:]) -} - -func split(s string, c byte) (head, tail string) { - if i := strings.IndexByte(s, c); i >= 0 { - return strings.TrimSpace(s[:i]), strings.TrimSpace(s[i+1:]) - } - return strings.TrimSpace(s), "" -} - -// Add hack mapping to deal with a small number of cases that occur -// in Accept-Language (with reasonable frequency). -var acceptFallback = map[string]language.Language{ - "english": _en, - "deutsch": _de, - "italian": _it, - "french": _fr, - "*": _mul, // defined in the spec to match all languages. -} - -type tagSort struct { - tag []Tag - q []float32 -} - -func (s *tagSort) Len() int { - return len(s.q) -} - -func (s *tagSort) Less(i, j int) bool { - return s.q[i] > s.q[j] -} - -func (s *tagSort) Swap(i, j int) { - s.tag[i], s.tag[j] = s.tag[j], s.tag[i] - s.q[i], s.q[j] = s.q[j], s.q[i] -} diff --git a/vendor/golang.org/x/text/language/tables.go b/vendor/golang.org/x/text/language/tables.go deleted file mode 100644 index e22807719..000000000 --- a/vendor/golang.org/x/text/language/tables.go +++ /dev/null @@ -1,298 +0,0 @@ -// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. - -package language - -// CLDRVersion is the CLDR version from which the tables in this package are derived. -const CLDRVersion = "32" - -const ( - _de = 269 - _en = 313 - _fr = 350 - _it = 505 - _mo = 784 - _no = 879 - _nb = 839 - _pt = 960 - _sh = 1031 - _mul = 806 - _und = 0 -) -const ( - _001 = 1 - _419 = 31 - _BR = 65 - _CA = 73 - _ES = 110 - _GB = 123 - _MD = 188 - _PT = 238 - _UK = 306 - _US = 309 - _ZZ = 357 - _XA = 323 - _XC = 325 - _XK = 333 -) -const ( - _Latn = 87 - _Hani = 54 - _Hans = 56 - _Hant = 57 - _Qaaa = 139 - _Qaai = 147 - _Qabx = 188 - _Zinh = 236 - _Zyyy = 241 - _Zzzz = 242 -) - -var regionToGroups = []uint8{ // 357 elements - // Entry 0 - 3F - 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x04, - // Entry 40 - 7F - 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, - 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x08, - 0x00, 0x04, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, - // Entry 80 - BF - 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, - 0x00, 0x04, 0x01, 0x00, 0x04, 0x02, 0x00, 0x04, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, - // Entry C0 - FF - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, - 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // Entry 100 - 13F - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, - 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x04, 0x00, - 0x00, 0x04, 0x00, 0x04, 0x04, 0x05, 0x00, 0x00, - // Entry 140 - 17F - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, -} // Size: 381 bytes - -var paradigmLocales = [][3]uint16{ // 3 elements - 0: [3]uint16{0x139, 0x0, 0x7b}, - 1: [3]uint16{0x13e, 0x0, 0x1f}, - 2: [3]uint16{0x3c0, 0x41, 0xee}, -} // Size: 42 bytes - -type mutualIntelligibility struct { - want uint16 - have uint16 - distance uint8 - oneway bool -} -type scriptIntelligibility struct { - wantLang uint16 - haveLang uint16 - wantScript uint8 - haveScript uint8 - distance uint8 -} -type regionIntelligibility struct { - lang uint16 - script uint8 - group uint8 - distance uint8 -} - -// matchLang holds pairs of langIDs of base languages that are typically -// mutually intelligible. Each pair is associated with a confidence and -// whether the intelligibility goes one or both ways. -var matchLang = []mutualIntelligibility{ // 113 elements - 0: {want: 0x1d1, have: 0xb7, distance: 0x4, oneway: false}, - 1: {want: 0x407, have: 0xb7, distance: 0x4, oneway: false}, - 2: {want: 0x407, have: 0x1d1, distance: 0x4, oneway: false}, - 3: {want: 0x407, have: 0x432, distance: 0x4, oneway: false}, - 4: {want: 0x43a, have: 0x1, distance: 0x4, oneway: false}, - 5: {want: 0x1a3, have: 0x10d, distance: 0x4, oneway: true}, - 6: {want: 0x295, have: 0x10d, distance: 0x4, oneway: true}, - 7: {want: 0x101, have: 0x36f, distance: 0x8, oneway: false}, - 8: {want: 0x101, have: 0x347, distance: 0x8, oneway: false}, - 9: {want: 0x5, have: 0x3e2, distance: 0xa, oneway: true}, - 10: {want: 0xd, have: 0x139, distance: 0xa, oneway: true}, - 11: {want: 0x16, have: 0x367, distance: 0xa, oneway: true}, - 12: {want: 0x21, have: 0x139, distance: 0xa, oneway: true}, - 13: {want: 0x56, have: 0x13e, distance: 0xa, oneway: true}, - 14: {want: 0x58, have: 0x3e2, distance: 0xa, oneway: true}, - 15: {want: 0x71, have: 0x3e2, distance: 0xa, oneway: true}, - 16: {want: 0x75, have: 0x139, distance: 0xa, oneway: true}, - 17: {want: 0x82, have: 0x1be, distance: 0xa, oneway: true}, - 18: {want: 0xa5, have: 0x139, distance: 0xa, oneway: true}, - 19: {want: 0xb2, have: 0x15e, distance: 0xa, oneway: true}, - 20: {want: 0xdd, have: 0x153, distance: 0xa, oneway: true}, - 21: {want: 0xe5, have: 0x139, distance: 0xa, oneway: true}, - 22: {want: 0xe9, have: 0x3a, distance: 0xa, oneway: true}, - 23: {want: 0xf0, have: 0x15e, distance: 0xa, oneway: true}, - 24: {want: 0xf9, have: 0x15e, distance: 0xa, oneway: true}, - 25: {want: 0x100, have: 0x139, distance: 0xa, oneway: true}, - 26: {want: 0x130, have: 0x139, distance: 0xa, oneway: true}, - 27: {want: 0x13c, have: 0x139, distance: 0xa, oneway: true}, - 28: {want: 0x140, have: 0x151, distance: 0xa, oneway: true}, - 29: {want: 0x145, have: 0x13e, distance: 0xa, oneway: true}, - 30: {want: 0x158, have: 0x101, distance: 0xa, oneway: true}, - 31: {want: 0x16d, have: 0x367, distance: 0xa, oneway: true}, - 32: {want: 0x16e, have: 0x139, distance: 0xa, oneway: true}, - 33: {want: 0x16f, have: 0x139, distance: 0xa, oneway: true}, - 34: {want: 0x17e, have: 0x139, distance: 0xa, oneway: true}, - 35: {want: 0x190, have: 0x13e, distance: 0xa, oneway: true}, - 36: {want: 0x194, have: 0x13e, distance: 0xa, oneway: true}, - 37: {want: 0x1a4, have: 0x1be, distance: 0xa, oneway: true}, - 38: {want: 0x1b4, have: 0x139, distance: 0xa, oneway: true}, - 39: {want: 0x1b8, have: 0x139, distance: 0xa, oneway: true}, - 40: {want: 0x1d4, have: 0x15e, distance: 0xa, oneway: true}, - 41: {want: 0x1d7, have: 0x3e2, distance: 0xa, oneway: true}, - 42: {want: 0x1d9, have: 0x139, distance: 0xa, oneway: true}, - 43: {want: 0x1e7, have: 0x139, distance: 0xa, oneway: true}, - 44: {want: 0x1f8, have: 0x139, distance: 0xa, oneway: true}, - 45: {want: 0x20e, have: 0x1e1, distance: 0xa, oneway: true}, - 46: {want: 0x210, have: 0x139, distance: 0xa, oneway: true}, - 47: {want: 0x22d, have: 0x15e, distance: 0xa, oneway: true}, - 48: {want: 0x242, have: 0x3e2, distance: 0xa, oneway: true}, - 49: {want: 0x24a, have: 0x139, distance: 0xa, oneway: true}, - 50: {want: 0x251, have: 0x139, distance: 0xa, oneway: true}, - 51: {want: 0x265, have: 0x139, distance: 0xa, oneway: true}, - 52: {want: 0x274, have: 0x48a, distance: 0xa, oneway: true}, - 53: {want: 0x28a, have: 0x3e2, distance: 0xa, oneway: true}, - 54: {want: 0x28e, have: 0x1f9, distance: 0xa, oneway: true}, - 55: {want: 0x2a3, have: 0x139, distance: 0xa, oneway: true}, - 56: {want: 0x2b5, have: 0x15e, distance: 0xa, oneway: true}, - 57: {want: 0x2b8, have: 0x139, distance: 0xa, oneway: true}, - 58: {want: 0x2be, have: 0x139, distance: 0xa, oneway: true}, - 59: {want: 0x2c3, have: 0x15e, distance: 0xa, oneway: true}, - 60: {want: 0x2ed, have: 0x139, distance: 0xa, oneway: true}, - 61: {want: 0x2f1, have: 0x15e, distance: 0xa, oneway: true}, - 62: {want: 0x2fa, have: 0x139, distance: 0xa, oneway: true}, - 63: {want: 0x2ff, have: 0x7e, distance: 0xa, oneway: true}, - 64: {want: 0x304, have: 0x139, distance: 0xa, oneway: true}, - 65: {want: 0x30b, have: 0x3e2, distance: 0xa, oneway: true}, - 66: {want: 0x31b, have: 0x1be, distance: 0xa, oneway: true}, - 67: {want: 0x31f, have: 0x1e1, distance: 0xa, oneway: true}, - 68: {want: 0x320, have: 0x139, distance: 0xa, oneway: true}, - 69: {want: 0x331, have: 0x139, distance: 0xa, oneway: true}, - 70: {want: 0x351, have: 0x139, distance: 0xa, oneway: true}, - 71: {want: 0x36a, have: 0x347, distance: 0xa, oneway: false}, - 72: {want: 0x36a, have: 0x36f, distance: 0xa, oneway: true}, - 73: {want: 0x37a, have: 0x139, distance: 0xa, oneway: true}, - 74: {want: 0x387, have: 0x139, distance: 0xa, oneway: true}, - 75: {want: 0x389, have: 0x139, distance: 0xa, oneway: true}, - 76: {want: 0x38b, have: 0x15e, distance: 0xa, oneway: true}, - 77: {want: 0x390, have: 0x139, distance: 0xa, oneway: true}, - 78: {want: 0x395, have: 0x139, distance: 0xa, oneway: true}, - 79: {want: 0x39d, have: 0x139, distance: 0xa, oneway: true}, - 80: {want: 0x3a5, have: 0x139, distance: 0xa, oneway: true}, - 81: {want: 0x3be, have: 0x139, distance: 0xa, oneway: true}, - 82: {want: 0x3c4, have: 0x13e, distance: 0xa, oneway: true}, - 83: {want: 0x3d4, have: 0x10d, distance: 0xa, oneway: true}, - 84: {want: 0x3d9, have: 0x139, distance: 0xa, oneway: true}, - 85: {want: 0x3e5, have: 0x15e, distance: 0xa, oneway: true}, - 86: {want: 0x3e9, have: 0x1be, distance: 0xa, oneway: true}, - 87: {want: 0x3fa, have: 0x139, distance: 0xa, oneway: true}, - 88: {want: 0x40c, have: 0x139, distance: 0xa, oneway: true}, - 89: {want: 0x423, have: 0x139, distance: 0xa, oneway: true}, - 90: {want: 0x429, have: 0x139, distance: 0xa, oneway: true}, - 91: {want: 0x431, have: 0x139, distance: 0xa, oneway: true}, - 92: {want: 0x43b, have: 0x139, distance: 0xa, oneway: true}, - 93: {want: 0x43e, have: 0x1e1, distance: 0xa, oneway: true}, - 94: {want: 0x445, have: 0x139, distance: 0xa, oneway: true}, - 95: {want: 0x450, have: 0x139, distance: 0xa, oneway: true}, - 96: {want: 0x461, have: 0x139, distance: 0xa, oneway: true}, - 97: {want: 0x467, have: 0x3e2, distance: 0xa, oneway: true}, - 98: {want: 0x46f, have: 0x139, distance: 0xa, oneway: true}, - 99: {want: 0x476, have: 0x3e2, distance: 0xa, oneway: true}, - 100: {want: 0x3883, have: 0x139, distance: 0xa, oneway: true}, - 101: {want: 0x480, have: 0x139, distance: 0xa, oneway: true}, - 102: {want: 0x482, have: 0x139, distance: 0xa, oneway: true}, - 103: {want: 0x494, have: 0x3e2, distance: 0xa, oneway: true}, - 104: {want: 0x49d, have: 0x139, distance: 0xa, oneway: true}, - 105: {want: 0x4ac, have: 0x529, distance: 0xa, oneway: true}, - 106: {want: 0x4b4, have: 0x139, distance: 0xa, oneway: true}, - 107: {want: 0x4bc, have: 0x3e2, distance: 0xa, oneway: true}, - 108: {want: 0x4e5, have: 0x15e, distance: 0xa, oneway: true}, - 109: {want: 0x4f2, have: 0x139, distance: 0xa, oneway: true}, - 110: {want: 0x512, have: 0x139, distance: 0xa, oneway: true}, - 111: {want: 0x518, have: 0x139, distance: 0xa, oneway: true}, - 112: {want: 0x52f, have: 0x139, distance: 0xa, oneway: true}, -} // Size: 702 bytes - -// matchScript holds pairs of scriptIDs where readers of one script -// can typically also read the other. Each is associated with a confidence. -var matchScript = []scriptIntelligibility{ // 26 elements - 0: {wantLang: 0x432, haveLang: 0x432, wantScript: 0x57, haveScript: 0x1f, distance: 0x5}, - 1: {wantLang: 0x432, haveLang: 0x432, wantScript: 0x1f, haveScript: 0x57, distance: 0x5}, - 2: {wantLang: 0x58, haveLang: 0x3e2, wantScript: 0x57, haveScript: 0x1f, distance: 0xa}, - 3: {wantLang: 0xa5, haveLang: 0x139, wantScript: 0xe, haveScript: 0x57, distance: 0xa}, - 4: {wantLang: 0x1d7, haveLang: 0x3e2, wantScript: 0x8, haveScript: 0x1f, distance: 0xa}, - 5: {wantLang: 0x210, haveLang: 0x139, wantScript: 0x2b, haveScript: 0x57, distance: 0xa}, - 6: {wantLang: 0x24a, haveLang: 0x139, wantScript: 0x4b, haveScript: 0x57, distance: 0xa}, - 7: {wantLang: 0x251, haveLang: 0x139, wantScript: 0x4f, haveScript: 0x57, distance: 0xa}, - 8: {wantLang: 0x2b8, haveLang: 0x139, wantScript: 0x54, haveScript: 0x57, distance: 0xa}, - 9: {wantLang: 0x304, haveLang: 0x139, wantScript: 0x6b, haveScript: 0x57, distance: 0xa}, - 10: {wantLang: 0x331, haveLang: 0x139, wantScript: 0x72, haveScript: 0x57, distance: 0xa}, - 11: {wantLang: 0x351, haveLang: 0x139, wantScript: 0x21, haveScript: 0x57, distance: 0xa}, - 12: {wantLang: 0x395, haveLang: 0x139, wantScript: 0x7d, haveScript: 0x57, distance: 0xa}, - 13: {wantLang: 0x39d, haveLang: 0x139, wantScript: 0x33, haveScript: 0x57, distance: 0xa}, - 14: {wantLang: 0x3be, haveLang: 0x139, wantScript: 0x5, haveScript: 0x57, distance: 0xa}, - 15: {wantLang: 0x3fa, haveLang: 0x139, wantScript: 0x5, haveScript: 0x57, distance: 0xa}, - 16: {wantLang: 0x40c, haveLang: 0x139, wantScript: 0xca, haveScript: 0x57, distance: 0xa}, - 17: {wantLang: 0x450, haveLang: 0x139, wantScript: 0xd7, haveScript: 0x57, distance: 0xa}, - 18: {wantLang: 0x461, haveLang: 0x139, wantScript: 0xda, haveScript: 0x57, distance: 0xa}, - 19: {wantLang: 0x46f, haveLang: 0x139, wantScript: 0x29, haveScript: 0x57, distance: 0xa}, - 20: {wantLang: 0x476, haveLang: 0x3e2, wantScript: 0x57, haveScript: 0x1f, distance: 0xa}, - 21: {wantLang: 0x4b4, haveLang: 0x139, wantScript: 0x5, haveScript: 0x57, distance: 0xa}, - 22: {wantLang: 0x4bc, haveLang: 0x3e2, wantScript: 0x57, haveScript: 0x1f, distance: 0xa}, - 23: {wantLang: 0x512, haveLang: 0x139, wantScript: 0x3b, haveScript: 0x57, distance: 0xa}, - 24: {wantLang: 0x529, haveLang: 0x529, wantScript: 0x38, haveScript: 0x39, distance: 0xf}, - 25: {wantLang: 0x529, haveLang: 0x529, wantScript: 0x39, haveScript: 0x38, distance: 0x13}, -} // Size: 232 bytes - -var matchRegion = []regionIntelligibility{ // 15 elements - 0: {lang: 0x3a, script: 0x0, group: 0x4, distance: 0x4}, - 1: {lang: 0x3a, script: 0x0, group: 0x84, distance: 0x4}, - 2: {lang: 0x139, script: 0x0, group: 0x1, distance: 0x4}, - 3: {lang: 0x139, script: 0x0, group: 0x81, distance: 0x4}, - 4: {lang: 0x13e, script: 0x0, group: 0x3, distance: 0x4}, - 5: {lang: 0x13e, script: 0x0, group: 0x83, distance: 0x4}, - 6: {lang: 0x3c0, script: 0x0, group: 0x3, distance: 0x4}, - 7: {lang: 0x3c0, script: 0x0, group: 0x83, distance: 0x4}, - 8: {lang: 0x529, script: 0x39, group: 0x2, distance: 0x4}, - 9: {lang: 0x529, script: 0x39, group: 0x82, distance: 0x4}, - 10: {lang: 0x3a, script: 0x0, group: 0x80, distance: 0x5}, - 11: {lang: 0x139, script: 0x0, group: 0x80, distance: 0x5}, - 12: {lang: 0x13e, script: 0x0, group: 0x80, distance: 0x5}, - 13: {lang: 0x3c0, script: 0x0, group: 0x80, distance: 0x5}, - 14: {lang: 0x529, script: 0x39, group: 0x80, distance: 0x5}, -} // Size: 114 bytes - -// Total table size 1471 bytes (1KiB); checksum: 4CB1CD46 diff --git a/vendor/golang.org/x/text/language/tags.go b/vendor/golang.org/x/text/language/tags.go deleted file mode 100644 index 42ea79266..000000000 --- a/vendor/golang.org/x/text/language/tags.go +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -import "golang.org/x/text/internal/language/compact" - -// TODO: Various sets of commonly use tags and regions. - -// MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed. -// It simplifies safe initialization of Tag values. -func MustParse(s string) Tag { - t, err := Parse(s) - if err != nil { - panic(err) - } - return t -} - -// MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed. -// It simplifies safe initialization of Tag values. -func (c CanonType) MustParse(s string) Tag { - t, err := c.Parse(s) - if err != nil { - panic(err) - } - return t -} - -// MustParseBase is like ParseBase, but panics if the given base cannot be parsed. -// It simplifies safe initialization of Base values. -func MustParseBase(s string) Base { - b, err := ParseBase(s) - if err != nil { - panic(err) - } - return b -} - -// MustParseScript is like ParseScript, but panics if the given script cannot be -// parsed. It simplifies safe initialization of Script values. -func MustParseScript(s string) Script { - scr, err := ParseScript(s) - if err != nil { - panic(err) - } - return scr -} - -// MustParseRegion is like ParseRegion, but panics if the given region cannot be -// parsed. It simplifies safe initialization of Region values. -func MustParseRegion(s string) Region { - r, err := ParseRegion(s) - if err != nil { - panic(err) - } - return r -} - -var ( - und = Tag{} - - Und Tag = Tag{} - - Afrikaans Tag = Tag(compact.Afrikaans) - Amharic Tag = Tag(compact.Amharic) - Arabic Tag = Tag(compact.Arabic) - ModernStandardArabic Tag = Tag(compact.ModernStandardArabic) - Azerbaijani Tag = Tag(compact.Azerbaijani) - Bulgarian Tag = Tag(compact.Bulgarian) - Bengali Tag = Tag(compact.Bengali) - Catalan Tag = Tag(compact.Catalan) - Czech Tag = Tag(compact.Czech) - Danish Tag = Tag(compact.Danish) - German Tag = Tag(compact.German) - Greek Tag = Tag(compact.Greek) - English Tag = Tag(compact.English) - AmericanEnglish Tag = Tag(compact.AmericanEnglish) - BritishEnglish Tag = Tag(compact.BritishEnglish) - Spanish Tag = Tag(compact.Spanish) - EuropeanSpanish Tag = Tag(compact.EuropeanSpanish) - LatinAmericanSpanish Tag = Tag(compact.LatinAmericanSpanish) - Estonian Tag = Tag(compact.Estonian) - Persian Tag = Tag(compact.Persian) - Finnish Tag = Tag(compact.Finnish) - Filipino Tag = Tag(compact.Filipino) - French Tag = Tag(compact.French) - CanadianFrench Tag = Tag(compact.CanadianFrench) - Gujarati Tag = Tag(compact.Gujarati) - Hebrew Tag = Tag(compact.Hebrew) - Hindi Tag = Tag(compact.Hindi) - Croatian Tag = Tag(compact.Croatian) - Hungarian Tag = Tag(compact.Hungarian) - Armenian Tag = Tag(compact.Armenian) - Indonesian Tag = Tag(compact.Indonesian) - Icelandic Tag = Tag(compact.Icelandic) - Italian Tag = Tag(compact.Italian) - Japanese Tag = Tag(compact.Japanese) - Georgian Tag = Tag(compact.Georgian) - Kazakh Tag = Tag(compact.Kazakh) - Khmer Tag = Tag(compact.Khmer) - Kannada Tag = Tag(compact.Kannada) - Korean Tag = Tag(compact.Korean) - Kirghiz Tag = Tag(compact.Kirghiz) - Lao Tag = Tag(compact.Lao) - Lithuanian Tag = Tag(compact.Lithuanian) - Latvian Tag = Tag(compact.Latvian) - Macedonian Tag = Tag(compact.Macedonian) - Malayalam Tag = Tag(compact.Malayalam) - Mongolian Tag = Tag(compact.Mongolian) - Marathi Tag = Tag(compact.Marathi) - Malay Tag = Tag(compact.Malay) - Burmese Tag = Tag(compact.Burmese) - Nepali Tag = Tag(compact.Nepali) - Dutch Tag = Tag(compact.Dutch) - Norwegian Tag = Tag(compact.Norwegian) - Punjabi Tag = Tag(compact.Punjabi) - Polish Tag = Tag(compact.Polish) - Portuguese Tag = Tag(compact.Portuguese) - BrazilianPortuguese Tag = Tag(compact.BrazilianPortuguese) - EuropeanPortuguese Tag = Tag(compact.EuropeanPortuguese) - Romanian Tag = Tag(compact.Romanian) - Russian Tag = Tag(compact.Russian) - Sinhala Tag = Tag(compact.Sinhala) - Slovak Tag = Tag(compact.Slovak) - Slovenian Tag = Tag(compact.Slovenian) - Albanian Tag = Tag(compact.Albanian) - Serbian Tag = Tag(compact.Serbian) - SerbianLatin Tag = Tag(compact.SerbianLatin) - Swedish Tag = Tag(compact.Swedish) - Swahili Tag = Tag(compact.Swahili) - Tamil Tag = Tag(compact.Tamil) - Telugu Tag = Tag(compact.Telugu) - Thai Tag = Tag(compact.Thai) - Turkish Tag = Tag(compact.Turkish) - Ukrainian Tag = Tag(compact.Ukrainian) - Urdu Tag = Tag(compact.Urdu) - Uzbek Tag = Tag(compact.Uzbek) - Vietnamese Tag = Tag(compact.Vietnamese) - Chinese Tag = Tag(compact.Chinese) - SimplifiedChinese Tag = Tag(compact.SimplifiedChinese) - TraditionalChinese Tag = Tag(compact.TraditionalChinese) - Zulu Tag = Tag(compact.Zulu) -) diff --git a/vendor/modules.txt b/vendor/modules.txt index bb2c5f70c..782310867 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,5 +1,3 @@ -# github.com/BurntSushi/toml v0.3.1 -## explicit # github.com/OpenPeeDeeP/xdg v1.0.0 ## explicit github.com/OpenPeeDeeP/xdg @@ -149,11 +147,6 @@ github.com/mattn/go-runewidth github.com/mgutz/str # github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-homedir -# github.com/nicksnyder/go-i18n/v2 v2.0.3 -## explicit -github.com/nicksnyder/go-i18n/v2/i18n -github.com/nicksnyder/go-i18n/v2/internal -github.com/nicksnyder/go-i18n/v2/internal/plural # github.com/onsi/ginkgo v1.10.3 ## explicit # github.com/onsi/gomega v1.7.1 @@ -162,8 +155,6 @@ github.com/nicksnyder/go-i18n/v2/internal/plural github.com/pmezard/go-difflib/difflib # github.com/sergi/go-diff v1.1.0 github.com/sergi/go-diff/diffmatchpatch -# github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0 -## explicit # github.com/sirupsen/logrus v1.4.2 ## explicit github.com/sirupsen/logrus @@ -209,12 +200,6 @@ golang.org/x/sys/cpu golang.org/x/sys/internal/unsafeheader golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/text v0.3.2 -## explicit -golang.org/x/text/internal/language -golang.org/x/text/internal/language/compact -golang.org/x/text/internal/tag -golang.org/x/text/language # gopkg.in/warnings.v0 v0.1.2 gopkg.in/warnings.v0 # gopkg.in/yaml.v2 v2.3.0