mglang

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: MIT Imports: 4 Imported by: 0

README

MGLang

MGLang é um componente que detecta e retorna o código base do idioma do sistema operacional.

Recursos

  • GetLang: Retorna pt, en, es e assim por diante, de acordo com o idioma do sistema operacional.
  • Set: Adicione o texto original e a tradução.
  • T: Retorna a tradução

Instalação

go get github.com/mugomes/mglang

Exemplo

import "github.com/mugomes/mglang"

func main() {
	if mglang.GetLang() == "pt" {
		mglang.Set("File", "Arquivo")
	}
	
	print(mglang.T("File"))
}

Information

Requirement

  • Go 1.25.3

Support

License

Copyright (c) 2025 Murilo Gomes Julio

Licensed under the MIT license.

All contributions to the MGLang are subject to this license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLang

func GetLang() string

Detecta o idioma do sistema e retorna apenas o código base (pt, en, es, etc.)

func Set

func Set(name, value string)

func T

func T(key string, args ...any) string

T retorna o texto traduzido com formatação opcional.

Types

type Provider

type Provider interface {
	GetSystemLanguage() string
}
var Current Provider

type Translations

type Translations map[string]string

Jump to

Keyboard shortcuts

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