Comments (3)
Actually I think that this is so simple for us to do that it makes no sense to have it in the library. ..
const countryOptions = Object.keys(countryNames)
.map(key => ({ value: key, label: countryNames[key] }))
.sort((a, b) => a.label.localeCompare(b.label));
from node-i18n-iso-countries.
I suggest only doing a localCompare on the first letter if you want country with accented character in their name to be grouped togerther.
const countryNames = countries.getNames(this.$i18n.locale, { select: 'official' });
return Object.keys(countryNames)
.map((key) => ({ value: key, label: countryNames[key] }))
.sort((a, b) => a.label.charAt(0).localeCompare(b.label.charAt(0)));
from node-i18n-iso-countries.
Nvm this actually create more problem as now the second letter is not taken into account for country that start with the same letter. I'm looking to sort alphabetically but accented country should have their own grouping.
from node-i18n-iso-countries.
Related Issues (20)
- Jest: `TypeError: Cannot read property 'registerLocale' of undefined` HOT 2
- ES: Incorrect country translations
- Missing v7.4.0 tag HOT 1
- Missing Monegasque nationality in en dictionary
- Add country calling codes HOT 1
- Turkey officially changed name to Türkiye
- Overwrite country name
- Support ISO 639-2/B - DEU works but not GER
- Missing the Country Netherlands Antilles HOT 4
- ESM, Import fails with "The requested module 'i18n-iso-countries' does not provide an export named 'toAlpha2'" HOT 1
- Alias for South Korea HOT 1
- New Request HOT 1
- The documentation is confusing. HOT 2
- Don't publish the repo
- Missing countries Ascension Island and Tristan da Cunha HOT 4
- Add UAE as english alias for United Arab Emirates (Country Code: AE)
- Proposal: make conversion with toAlpha2 in getName() optional HOT 2
- Wrong Official Name of South Korea and North Korea HOT 3
- Rename Swaziland to Eswatini (Country Code: SZ) HOT 1
- Official name for Hong Kong - HK HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-i18n-iso-countries.