- Home
- Packages
- Go
- infobits-intl
- Documentation
- Getting Started
Getting Started
Getting Started
infobits-intl provides comprehensive internationalization data including countries, languages, currencies, and continents. Each entity comes with ISO-standard codes, metadata, SVG country flags, and translations in multiple languages.
What's Included
- 248+ countries with ISO 3166-1 alpha-2/alpha-3 codes, capitals, calling codes, TLDs, and more
- 185+ languages with ISO 639-1 codes, native names, and dialects
- 179+ currencies with ISO 4217 codes, symbols, and plural forms
- 7 continents with country groupings
- SVG country flags embedded as strings
- Translations for all entities in 7 locales: Danish, German, English, Spanish, French, Italian, and Chinese
Installation
go get github.com/infobits-io/infobits-intl-goQuick Example
Look up a country and print its details:
package main
import (
"fmt"
intl "github.com/infobits-io/infobits-intl-go"
)
func main() {
country, ok := intl.CountryByAlpha2("US")
if ok {
fmt.Println(country.NativeName) // United States
fmt.Println(country.Alpha3Code) // USA
fmt.Println(country.Capital) // Washington, D.C.
}
}Type-Safe Code Constants
Each package provides typed constants for country, language, currency, and continent codes, enabling autocompletion and compile-time safety.
// Use typed country code constants
code := intl.CountryUS
fmt.Println(code.Country().NativeName) // United States
fmt.Println(code.EmojiFlag()) // flag emoji