Socket
Book a DemoInstallSign in
Socket

src.srdev.io/pkg/i18n

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

src.srdev.io/pkg/i18n

Go Modules
Version
v0.0.0-20180719195806-d5b9335d510f
Version published
Created
Source

i18n

The pkg/i18n library provides localization support to Golang microservices.

go get src.srdev.io/pkg/i18n
import "src.srdev.io/pkg/i18n"

Usage

Localized strings can be retrieved from the desired or best available bundle by first creating a Translator func:

T := i18n.NewTranslator("global", "en-US")

The "T" func is then passed the needed message key using dot notation to traverse the bundle structure:

fmt.Println(T("test.key"))

The LoadBundle function retrieves the entire catalog for a given locale as a byte slice

b := i18n.LoadBundle("global", "en-US")

Build: Jenkins

FAQs

Package last updated on 19 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts