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

Provides native-language country names for Laravel apps. Install via composer and use localized datasets to display countries in their own languages. Maintained by Laravel Lang; MIT licensed.

View on GitHub
Deep Wiki
Context7

laravel-lang/native-country-names provides native-language country names for Laravel applications, making it easy to display countries as they’re written locally (endonyms) across your UI, forms, and locale-aware features.

Built for seamless integration with the Laravel ecosystem, it helps you ship consistent, localized country labels without maintaining your own datasets.

  • Supplies native country name translations by locale
  • Designed for Laravel localization workflows
  • Ideal for dropdowns, profiles, checkout, and address forms
  • Maintained by the Laravel Lang community
  • Distributed as a lightweight Composer package
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport