All Projects → Xuanwo → go-locale

Xuanwo / go-locale

Licence: Apache-2.0 license
Cross platform locale detection for Golang

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to go-locale

vue-i18n
A small package for implementing translations in Vue.js
Stars: ✭ 40 (-54.55%)
Mutual labels:  locale
laravel-localized-routes
A convenient way to set up and use localized routes in a Laravel app.
Stars: ✭ 257 (+192.05%)
Mutual labels:  locale
rosetta
A blazing fast internationalization (i18n) library for Crystal with compile-time key lookup.
Stars: ✭ 23 (-73.86%)
Mutual labels:  locale
Localizr.swift
Simplified and automated Localization process library in IOS. Please check https://github.com/michaelhenry/Localizr for more info.
Stars: ✭ 18 (-79.55%)
Mutual labels:  locale
LorittaLocales
🌎 Loritta's localization files, bringing Loritta's cuteness to everyone around the world!
Stars: ✭ 21 (-76.14%)
Mutual labels:  locale
go-locale
GoLang library used to retrieve the current locale(s) of the operating system.
Stars: ✭ 16 (-81.82%)
Mutual labels:  locale
Localizr
Localizr is a Tool that handles and automates the generation of localization files for IOS and Android so there will be only one source of truth for all of your localization strings.
Stars: ✭ 33 (-62.5%)
Mutual labels:  locale
vue-translated
Internationalization (i18n) and localization (l10n) library for Vue.js v2.
Stars: ✭ 19 (-78.41%)
Mutual labels:  i10n
cldr-engine
Internationalization and localization in Typescript with Unicode CLDR, batteries included
Stars: ✭ 34 (-61.36%)
Mutual labels:  locale
flutter-devicelocale
A Flutter package to read and return the set device locales
Stars: ✭ 45 (-48.86%)
Mutual labels:  locale
craft3-fallback-site
Failing requests in a multi-site install can fall back to other sites, to prevent 404 errors from missing or disabled entries.
Stars: ✭ 14 (-84.09%)
Mutual labels:  locale
awesome-translations
😎 Awesome lists about Internationalization & localization stuff. l10n, g11n, m17n, i18n. Translations! 🌎🌍
Stars: ✭ 54 (-38.64%)
Mutual labels:  locale
GDCalendar
Calendar component with RTL languages written in swift
Stars: ✭ 27 (-69.32%)
Mutual labels:  locale
react-calendar-mobile
React Calendar Mobile is a component very easy to use with scroll event enabled.
Stars: ✭ 23 (-73.86%)
Mutual labels:  locale
get-user-locale
A function that returns user's locale as an IETF language tag, based on all available sources.
Stars: ✭ 44 (-50%)
Mutual labels:  locale
locale-switcher
Browser Extension to quickly change your browser locale.
Stars: ✭ 75 (-14.77%)
Mutual labels:  locale
laravel-localizer
Automatically detect and set an app locale that matches your visitor's preference.
Stars: ✭ 34 (-61.36%)
Mutual labels:  locale
I18n Ally
🌍 All in one i18n extension for VS Code
Stars: ✭ 1,931 (+2094.32%)
Mutual labels:  i10n
crates
🌎 A tool to generate your locale files compatible with i18n.
Stars: ✭ 52 (-40.91%)
Mutual labels:  locale
local.js
Localization script for web sites which has the multiple languages.
Stars: ✭ 15 (-82.95%)
Mutual labels:  locale

go-locale

Build Status Go Doc License go locale

go-locale is a Golang lib for cross-platform locale detection.

OS Support

Support all OS that Golang supported, except android:

POSIX Compatible Systems

  • Lookup env LANGUAGE
  • Lookup env LC_ALL
  • Lookup env LC_MESSAGES
  • Lookup env LANG
  • Read file $XDG_CONFIG_HOME/locale.conf
  • Read file $HOME/.config/locale.conf
  • Read file /etc/locale.conf

Js

  • Lookup env LANGUAGE
  • Lookup env LC_ALL

Windows

  • Lookup env LANGUAGE
  • Lookup env LC_ALL
  • Lookup env LC_MESSAGES
  • Lookup env LANG
  • Windows Registry

macOS X (darwin)

  • Lookup env LANGUAGE
  • Lookup env LC_ALL
  • Lookup env LC_MESSAGES
  • Lookup env LANG
  • macOS X User Defaults System
    • Lookup user AppleLocale
    • Lookup user AppleLanguages
    • Lookup global AppleLocale
    • Lookup global AppleLanguages

Usage

import (
    "github.com/Xuanwo/go-locale"
)

func main() {
    tag, err := locale.Detect()
    if err != nil {
        log.Fatal(err)
    }
    // Have fun with language.Tag!

    tags, err := locale.DetectAll()
    if err != nil {
        log.Fatal(err)
    }
    // Get all available tags
}

Acknowledgments

Inspired by jibber_jabber

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].