go-i18n alternatives and similar packages
Based on the "Natural Language Processing" category.
Alternatively, view go-i18n alternatives based on common mentions on social networks and blogs.
-
prose
A library for text processing that supports tokenization, part-of-speech tagging, named-entity extraction, and more. -
gojieba
This is a Go implementation of jieba which a Chinese word splitting algorithm. -
gse
Go efficient text segmentation; support english, chinese, japanese and other. -
spaGO
Self-contained Machine Learning and Natural Language Processing library in Go. -
whatlanggo
A natural language detection package for Go. Supports 84 languages and 24 scripts (writing systems e.g. Latin, Cyrillic, etc). -
sentences
A sentence tokenizer: converts text into a list of sentences. -
locales
๐ a set of locales generated from the CLDR Project which can be used independently or within an i18n package; these were built for use with, but not exclusive to https://github.com/go-playground/universal-translator -
universal-translator
๐ฌ i18n Translator for Go/Golang using CLDR data + pluralization rules -
RAKE.go
A Go port of the Rapid Automatic Keyword Extraction Algorithm (RAKE) -
go-nlp
Utilities for working with discrete probability distributions and other tools useful for doing NLP work. -
segment
A Go library for performing Unicode Text Segmentation as described in Unicode Standard Annex #29 -
MMSEGO
This is a GO implementation of MMSEG which a Chinese word splitting algorithm. -
textcat
A Go package for n-gram based text categorization, with support for utf-8 and raw text -
stemmer
Stemmer packages for Go programming language. Includes English and German stemmers. -
petrovich
Petrovich is the library which inflects Russian names to given grammatical case. -
go-localize
Simple and easy to use i18n (Internationalization and localization) engine -
snowball
Snowball stemmer port (cgo wrapper) for Go. Provides word stem extraction functionality Snowball native. -
golibstemmer
Go bindings for the snowball libstemmer library including porter 2 -
libtextcat
Cgo binding for libtextcat C library. Guaranteed compatibility with version 2.2. -
icu
Cgo binding for icu4c C library detection and conversion functions. Guaranteed compatibility with version 50.1. -
go-tinydate
A tiny date object in Go. Tinydate uses only 4 bytes of memory -
gotokenizer
A tokenizer based on the dictionary and Bigram language models for Golang. (Now only support chinese segmentation) -
porter
This is a fairly straightforward port of Martin Porter's C implementation of the Porter stemming algorithm. -
gosentiwordnet
Sentiment analyzer using sentiwordnet lexicon in Go. -
go-eco
Similarity, dissimilarity and distance matrices; diversity, equitability and inequality measures; species richness estimators; coenocline models. -
detectlanguage
Language Detection API Go Client. Supports batch requests, short phrase or single word language detection.
Scout APM - Leading-edge performance monitoring starting at $39/month
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of go-i18n or a related project?
Popular Comparisons
README
go-i18n

go-i18n is a Go package and a command that helps you translate Go programs into multiple languages.
- Supports pluralized strings for all 200+ languages in the Unicode Common Locale Data Repository (CLDR).
- Code and tests are automatically generated from CLDR data.
- Supports strings with named variables using text/template syntax.
- Supports message files of any format (e.g. JSON, TOML, YAML).
Package i18n 
The i18n package provides support for looking up messages according to a set of locale preferences.
import "github.com/nicksnyder/go-i18n/v2/i18n"
Create a Bundle to use for the lifetime of your application.
bundle := i18n.NewBundle(language.English)
Load translations into your bundle during initialization.
bundle.RegisterUnmarshalFunc("toml", toml.Unmarshal)
bundle.LoadMessageFile("es.toml")
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.Localize(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "PersonCats",
One: "{{.Name}} has {{.Count}} cat.",
Other: "{{.Name}} has {{.Count}} cats.",
},
TemplateData: map[string]interface{}{
"Name": "Nick",
"Count": 2,
},
PluralCount: 2,
}) // Nick has 2 cats.
Command goi18n 
The goi18n command manages message files used by the i18n package.
go get -u github.com/nicksnyder/go-i18n/v2/goi18n
goi18n -help
Extracting messages
Use goi18n extract
to extract all i18n.Message struct literals in Go source files to a message file for translation.
# active.en.toml
[PersonCats]
description = "The number of cats a person has"
one = "{{.Name}} has {{.Count}} cat."
other = "{{.Name}} has {{.Count}} cats."
Translating a new language
- Create an empty message file for the language that you want to add (e.g.
translate.es.toml
). - Run
goi18n merge active.en.toml translate.es.toml
to populatetranslate.es.toml
with the mesages to be translated.
# translate.es.toml
[HelloPerson]
hash = "sha1-5b49bfdad81fedaeefb224b0ffc2acc58b09cff5"
other = "Hello {{.Name}}"
- After
translate.es.toml
has been translated, rename it toactive.es.toml
.
# active.es.toml
[HelloPerson]
hash = "sha1-5b49bfdad81fedaeefb224b0ffc2acc58b09cff5"
other = "Hola {{.Name}}"
- Load
active.es.toml
into your bundle.
bundle.RegisterUnmarshalFunc("toml", toml.Unmarshal)
bundle.LoadMessageFile("active.es.toml")
Translating new messages
If you have added new messages to your program:
- Run
goi18n extract
to updateactive.en.toml
with the new messages. - Run
goi18n merge active.*.toml
to generate updatedtranslate.*.toml
files. - Translate all the messages in the
translate.*.toml
files. - Run
goi18n merge active.*.toml translate.*.toml
to merge the translated messages into the active message files.
For more information and examples:
- Read the documentation.
- Look at the code examples and tests.
- Look at an example application.
License
go-i18n is available under the MIT license. See the [LICENSE](LICENSE) file for more info.
*Note that all licence references and agreements mentioned in the go-i18n README section above
are relevant to that project's source code only.