Description
Universal Translator is an i18n Translator for Go/Golang using CLDR data + pluralization rules
universal-translator alternatives and similar packages
Based on the "Natural Language Processing" category.
Alternatively, view universal-translator 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. -
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 -
go-nlp
Utilities for working with discrete probability distributions and other tools useful for doing NLP work. -
gounidecode
Unicode transliterator (also known as unidecode) for Go -
segment
A Go library for performing Unicode Text Segmentation as described in Unicode Standard Annex #29 -
paicehusk
Golang implementation of the Paice/Husk Stemming Algorithm -
petrovich
Petrovich is the library which inflects Russian names to given grammatical case. -
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. -
iuliia-go
Transliterate Cyrillic โ Latin in every possible way. -
go-localize
Simple and easy to use i18n (Internationalization and localization) engine -
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.
Get performance insights in less than 4 minutes
* 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 universal-translator or a related project?
README
universal-translator
Universal Translator is an i18n Translator for Go/Golang using CLDR data + pluralization rules
Why another i18n library?
Because none of the plural rules seem to be correct out there, including the previous implementation of this package, so I took it upon myself to create locales for everyone to use; this package is a thin wrapper around locales in order to store and translate text for use in your applications.
Features
- [x] Rules generated from the CLDR data, v30.0.3
- [x] Contains Cardinal, Ordinal and Range Plural Rules
- [x] Contains Month, Weekday and Timezone translations built in
- [x] Contains Date & Time formatting functions
- [x] Contains Number, Currency, Accounting and Percent formatting functions
- [x] Supports the "Gregorian" calendar only ( my time isn't unlimited, had to draw the line somewhere )
- [x] Support loading translations from files
- [x] Exporting translations to file(s), mainly for getting them professionally translated
- [ ] Code Generation for translation files -> Go code.. i.e. after it has been professionally translated
- [ ] Tests for all languages, I need help with this, please see here
Installation
Use go get
go get github.com/go-playground/universal-translator
Usage & Documentation
Please see https://godoc.org/github.com/go-playground/universal-translator for usage docs
Examples:
File formatting
All types, Plain substitution, Cardinal, Ordinal and Range translations can all be contained withing the same file(s); they are only separated for easy viewing.
Examples:
Basic Makeup
NOTE: not all fields are needed for all translation types, see examples
{
"locale": "en",
"key": "days-left",
"trans": "You have {0} day left.",
"type": "Cardinal",
"rule": "One",
"override": false
}
Field | Description |
---|---|
locale | The locale for which the translation is for. |
key | The translation key that will be used to store and lookup each translation; normally it is a string or integer. |
trans | The actual translation text. |
type | The type of translation Cardinal, Ordinal, Range or "" for a plain substitution(not required to be defined if plain used) |
rule | The plural rule for which the translation is for eg. One, Two, Few, Many or Other.(not required to be defined if plain used) |
override | If you wish to override an existing translation that has already been registered, set this to 'true'. 99% of the time there is no need to define it. |
Help With Tests
To anyone interesting in helping or contributing, I sure could use some help creating tests for each language. Please see issue here for details.
License
Distributed under MIT License, please see license file in code for more details.
*Note that all licence references and agreements mentioned in the universal-translator README section above
are relevant to that project's source code only.