locale

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2022 License: MIT Imports: 2 Imported by: 1

README

Hyperscale Locale Last release Documentation

Go Report Card

Branch Status Coverage
master Build Status Coveralls

The Hyperscale locale library provides a simple locale manager

Example

package main

import (
    "fmt"

    "github.com/hyperscale-stack/locale"
)

func main() {
    ctx := context.Background()

    ctx = locale.ToContext(ctx, language.French)

    tag := locale.FromContext(ctx) // return language.French or locale.DefaultLocale if
}

License

Hyperscale Locale is licensed under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLocale = language.English

Functions

func FromContext

func FromContext(ctx context.Context) language.Tag

FromContext returns language.Tag from context.Context.

func ToContext

func ToContext(ctx context.Context, tag language.Tag) context.Context

ToContext add language.Tag to context.Context.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL