languageutil

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KnownLanguageLabels added in v0.4.0

func KnownLanguageLabels() []string

KnownLanguageLabels returns the sorted base-language vocabulary already used by metadata normalization. Suggestions never limit custom corrections.

func NormalizeLanguageCode added in v0.3.2

func NormalizeLanguageCode(value string) string

NormalizeLanguageCode resolves a complete language code or English display name to its ISO 639 base code, ignoring an explicit subtitle Full/Forced suffix for language matching. Blank and unrecognized inputs return empty.

func NormalizeLanguageDisplay

func NormalizeLanguageDisplay(value string) string

NormalizeLanguageDisplay returns the English base-language label resolved from the first code or name token. It preserves stable labels for the ISO special codes mul and zxx; region and trailing tokens are discarded, and blank or unresolved input returns an empty string.

func NormalizeLanguageLabel added in v0.3.2

func NormalizeLanguageLabel(value string) string

NormalizeLanguageLabel resolves a complete language code or English display name to its complete English label, preserving an explicit subtitle Full/Forced suffix. Blank and unrecognized inputs return empty.

func NormalizeLanguageList added in v0.3.2

func NormalizeLanguageList(values []string) []string

NormalizeLanguageList splits comma-separated entries, normalizes recognized labels, preserves unknown nonempty labels, and removes duplicates in order.

func SubtitleLanguageParts added in v0.4.0

func SubtitleLanguageParts(value string) (string, string)

SubtitleLanguageParts separates an explicit Full/Forced suffix from a language without discarding custom text. Bare suffixes require a recognized language; parenthetical and hyphenated suffixes explicitly qualify any language name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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