All Projects → go-playground → Universal Translator

go-playground / Universal Translator

Licence: mit
💬 i18n Translator for Go/Golang using CLDR data + pluralization rules

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects
language
365 projects

Labels

Projects that are alternatives of or similar to Universal Translator

Redux React I18n
An i18n solution for React/Redux and React Native projects
Stars: ✭ 64 (-67.18%)
Mutual labels:  i18n, l10n
Pootle
Online translation tool
Stars: ✭ 1,346 (+590.26%)
Mutual labels:  i18n, l10n
Locale2
💪 Try as hard as possible to detect the client's language tag ("locale") in node or the browser. Browserify and Webpack friendly!
Stars: ✭ 65 (-66.67%)
Mutual labels:  i18n, l10n
Es2015 I18n Tag
ES2015 template literal tag for i18n and l10n (translation and internationalization)
Stars: ✭ 171 (-12.31%)
Mutual labels:  i18n, l10n
Dom I18n
Provides a very basic HTML multilingual support using JavaScript
Stars: ✭ 125 (-35.9%)
Mutual labels:  i18n, l10n
Webfactoryicutranslationbundle
Enables ICU message formatting for translations in Symfony applications.
Stars: ✭ 27 (-86.15%)
Mutual labels:  i18n, l10n
Keys Translations Manager
KTM, a locale management web app built on MERN stack, lets you manage and control locales in one place. It's particularly useful for someone who needs to manage multiple internationalization/localization projects.
Stars: ✭ 81 (-58.46%)
Mutual labels:  i18n, l10n
Globalize
A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data
Stars: ✭ 4,612 (+2265.13%)
Mutual labels:  i18n, l10n
Node Gettext
A JavaScript implementation of gettext, a localization framework.
Stars: ✭ 175 (-10.26%)
Mutual labels:  i18n, l10n
Pseudo Localization
Dynamic pseudo-localization in the browser and nodejs
Stars: ✭ 109 (-44.1%)
Mutual labels:  i18n, l10n
Translation
The Translation component provides tools to internationalize your application.
Stars: ✭ 6,196 (+3077.44%)
Mutual labels:  i18n, l10n
Ngettext
A cross-platform .NET implementation of the GNU/Gettext library.
Stars: ✭ 172 (-11.79%)
Mutual labels:  i18n, l10n
Fluent.js
JavaScript implementation of Project Fluent
Stars: ✭ 622 (+218.97%)
Mutual labels:  i18n, l10n
Corpus Christi
Church management suite, open source, fully internationalized
Stars: ✭ 29 (-85.13%)
Mutual labels:  i18n, l10n
Fluent Rs
Rust implementation of Project Fluent
Stars: ✭ 503 (+157.95%)
Mutual labels:  i18n, l10n
Nativescript Localize
Internationalization plugin for NativeScript using native capabilities of each platform
Stars: ✭ 78 (-60%)
Mutual labels:  i18n, l10n
Gotext
Go (Golang) GNU gettext utilities package
Stars: ✭ 292 (+49.74%)
Mutual labels:  i18n, l10n
Laravel Js Localization
🌐 Convert your Laravel messages and consume them in the front-end!
Stars: ✭ 451 (+131.28%)
Mutual labels:  i18n, l10n
Android Gradle Localization Plugin
Gradle plugin for generating localized string resources
Stars: ✭ 100 (-48.72%)
Mutual labels:  i18n, l10n
Punic
PHP translation and localization made easy!
Stars: ✭ 133 (-31.79%)
Mutual labels:  i18n, l10n

universal-translator

Project status Build Status Coverage Status Go Report Card GoDoc License Gitter

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 the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].