locale

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package locale defines a Locale type that represents a POSIX locale value, as required by desktop-entry-spec.

Index

Constants

View Source
const (
	// ErrUnexpectedRune indicates an unexpected rune was encountered while
	// parsing a locale string.
	ErrUnexpectedRune = localeError("unexpected rune")
	// ErrLangEmpty indicates that a lang value was not specified.
	ErrLangEmpty = localeError("lang empty")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Locale

type Locale struct {
	Lang     string
	Country  string
	Encoding string
	Modifier string
}

Locale represents a POSIX locale value.

func Parse

func Parse(value string) (Locale, error)

Parse parses a formatted locale string and returns the corresponding Locale.

func (Locale) String

func (locale Locale) String() string

String returns the string representation of the Locale. Unspecified values are left out.

Jump to

Keyboard shortcuts

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