An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 7.1% on proxy.golang.org
Top 6.1% forks on proxy.golang.org

proxy.golang.org : github.com/shibukawa/i18n4v

Package i18n4v provides i18n feature including pluralisation support, replacing kes, contextual translation to Golang. It is a member of https://i18n4v.js.org family. JavaScript runtime and this packages uses same translation format (JSON). It supports translation via default translator instance or independent translator instances. Default translator is good for command line tools. To use default translator, you can initialize via Add() function (and AddFromString(), MustAdd(), MustAddFromString()), and translate via global Translate() function. Independent translator is good for web services, each client have their own preferred languages (in Accept-Language header). To use independent translator, you can create via Craete() function (and CreateFromString(), MustCreate(), MustCreateFromStrgin()), and translate via Translate() method of the instance. The simplest translation is selecting words from language JSON: The following JSON provides pluralisation support. Each array contains matching pattern(minimum value and maximum value) and translation. null means math.MinInt64 or math.MaxInt64. %n and -%n are replaced with the number in parameter: %{key} is replaced via replacement parameters. Parameter should be passed via Replace container (this is an alias of map[string]string): If translation is missing, it passes through translation keys as a translations. You can pass text for fall back: Context feature supports selecting translations from context (like gender). Of cource, you can use all features together that are described before: This package is released under MIT license.

Registry - Source - Documentation - JSON - codemeta.json
purl: pkg:golang/github.com/shibukawa/i18n4v
License: MIT
Latest release: about 8 years ago
First release: about 9 years ago
Namespace: github.com/shibukawa
Stars: 7 on GitHub
Forks: 2 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 10 days ago

    Loading...
    Readme
    Loading...