Skip to content

Using Locales

Pseudata generates culturally appropriate data for multiple languages and regions. Names, addresses, phone numbers, and other data vary by locale to ensure your test data looks authentic for users in different countries.

Pseudata organizes locale data into bundles—collections of related locales grouped by geography or business regions. Instead of loading all locale data at once, you choose which bundle to use based on your application’s target markets.

Key benefits:

  • Small footprint: Only load the locales you need
  • Tree-shaking optimized: Build tools automatically eliminate unused locale data
  • Culturally authentic: Names and addresses match real-world patterns per locale
  • Easy to expand: Start with one region, add more as you grow

What varies by locale:

  • Person names (e.g., “John Smith” vs “田中 太郎” vs “محمد العلي”)
  • Addresses (cities, states, street names, postal codes)
  • Phone number formats
  • Month and weekday names

What stays the same:

  • Email domains (gmail.com, yahoo.com, etc.)
  • Generated IDs and UUIDs
  • Numeric values

By default, Pseudata loads only the US bundle (which currently contains only en_us locale). This means you can start using Pseudata immediately without any configuration:

package main
import (
"fmt"
"github.com/pseudata/pseudata"
)
func main() {
users := pseudata.NewUserArray(42)
user := users.At(1000)
fmt.Println(user.Name) // → "John Smith"
}

Use the default US bundle for:

  • MVPs and prototypes
  • US-only applications
  • Development and demos
  • Minimal footprint

Switch to a different bundle when:

  • Targeting multiple countries or regions
  • Building enterprise applications with regional divisions
  • Supporting international markets
  • Testing locale-specific features

Starting a new project?

  • Stick with the default US bundle (no imports needed)
  • Upgrade to a different bundle when you expand

Need a specific country?

  • Use single-country bundles (e.g., CA, BR, JP)
  • Automatically available for all supported countries

Expanding to a region?

  • North America: Import NA bundle (US, Canada, Mexico)
  • South America: Import SA bundle (Brazil)
  • Europe: Import EU bundle (6 locales)
  • Asia-Pacific: Import APAC bundle (4 locales)
  • Middle East & Africa: Import MEA bundle (2 locales)

Enterprise with regional divisions?

  • Americas: Import AMER bundle (covers NA + SA)
  • EMEA: Import EMEA bundle (covers EU + MEA)

Need maximum coverage?

  • Import World bundle (all supported locales)

See complete bundle list and locale details →


Import a bundle and pass it via options to use locales from that region.

import (
"github.com/pseudata/pseudata"
"github.com/pseudata/pseudata/resources/bundles/na"
)
users := pseudata.NewUserArray(42, pseudata.WithResources(na.Resources))

For complete bundle information, locale details, and advanced usage patterns, see the Locales Reference.