localeutil

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 7 Imported by: 32

README

localeutil Go license codecov PkgGoDev

提供了一些常用的本地化相关功能,依赖于 golang.org/x/text

安装

go get github.com/issue9/localeutil

版权

本项目采用 MIT 开源授权许可证,完整的授权说明可在 LICENSE 文件中找到。

Documentation

Overview

Package localeutil 提供一些本地化的工具

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadMessageFromFS added in v0.2.0

func LoadMessageFromFS(b *catalog.Builder, fsys fs.FS, glob string, unmarshal func([]byte, interface{}) error) error

LoadMessageFromFS 从文件系统中加载文件并写入 b

func LoadMessageFromFile added in v0.2.0

func LoadMessageFromFile(b *catalog.Builder, glob string, unmarshal func([]byte, interface{}) error) error

LoadMessageFromFS 从文件中加载文件并写入 b

func SystemLanguageTag

func SystemLanguageTag() (language.Tag, error)

SystemLanguageTag 返回当前系统的本地化信息

*nix 系统会使用 LANG 环境变量中的值,windows 在 LANG 环境变量不存在的情况下,调用 GetUserDefaultLocaleName 函数获取。

Types

This section is empty.

Directories

Path Synopsis
internal
syslocale
Package syslocale 获取所在系统的本地化语言信息
Package syslocale 获取所在系统的本地化语言信息

Jump to

Keyboard shortcuts

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