Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Native Country Names

Native Country Names Laravel Package

laravel-lang/native-country-names

Laravel package providing country names in their native languages for localized UIs and forms. Part of the Laravel Lang ecosystem, install via Composer and use alongside your app’s localization setup. MIT licensed.

View on GitHub
Deep Wiki
Context7

Translation of country names

Frequently asked questions about Native Country Names
How do I install `laravel-lang/native-country-names` in a Laravel project?
Run `composer require laravel-lang/native-country-names` in your project root. The package auto-registers via Laravel’s service provider system, so no additional configuration is needed unless you want to customize the default locale behavior.
Does this package support Laravel 13’s new app contexts or locale detection?
Yes, the package is fully compatible with Laravel 13 and leverages the framework’s built-in locale detection (`app()->getLocale()`). For dynamic contexts, use `Country::setLocale($locale)` to override the default or pass a locale directly to `Country::name($code, $locale)`.
Can I use this for country dropdowns in a multi-language admin panel?
Absolutely. The package integrates natively with Blade templates—just use `{{ Country::name('US', app()->getLocale()) }}` in your dropdown options. For frontend frameworks like Vue or React, expose the data via an API endpoint (e.g., `Country::all()`) or bundle it with Laravel Mix.
What happens if a country name isn’t available in the user’s preferred locale?
The package defaults to English (`en`) if the requested locale lacks a translation. You can customize this by extending the dataset via `Country::extend()` or setting a fallback locale globally in the service provider. The fallback behavior is configurable.
Is there a performance impact for high-traffic sites (e.g., e-commerce checkouts)?
No. The package loads country names from static JSON files (~50KB) and caches responses automatically. For critical endpoints, manually cache `Country::all()` or `Country::name()` calls using Laravel’s cache drivers (e.g., Redis) to reduce overhead.
How do I handle country names that differ by region (e.g., 'Korea' vs. 'Republic of Korea')?
The package uses ISO 3166-1 compliant datasets, which include regionally preferred names (e.g., '대한민국' for South Korea in Korean). For exceptions, override specific entries via `Country::extend(['KR' => ['ko' => '대한민국']])` or fork the package to customize the dataset.
Can I use this package in a headless Laravel API for a React/Vue frontend?
Yes. The package returns structured JSON (e.g., `{ code: 'US', name: 'United States' }`) when called via APIs. Expose endpoints like `route('api.countries')` with `Country::all()` or `Country::name($code, $locale)` to serve localized data to your frontend.
Are there alternatives if I need country flags, subdivisions, or additional metadata?
This package focuses solely on native country names. For flags or subdivisions (e.g., states/provinces), consider supplementing with `league/iso3166` or `spatie/laravel-country` (which includes flags). The MIT license allows forking to combine datasets if needed.
How often are the country name datasets updated, and how can I contribute?
Datasets are updated via GitHub Actions and validated against ISO standards. Contributions are welcome—submit PRs to the [GitHub repo](https://github.com/Laravel-Lang/native-country-names) or report missing translations. The Laravel Lang team monitors updates closely for breaking changes.
Does this package work with Laravel’s localization tools like Crowdin or Lokalise?
Yes, but with a caveat: the package’s datasets are static JSON files. For dynamic syncs, export your Crowdin/Lokalise translations to a compatible format and merge them into the package’s `resources/lang` directory. Automate this via CI/CD pipelines to keep datasets in sync.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai