Skip to content

Commit

Permalink
Attempted to set flag codes for Chromium Windows users (#3906)
Browse files Browse the repository at this point in the history
* Attempted to set flag codes for Chromium users

* Not sure how I missed MD.
  • Loading branch information
DandelionSprout authored Nov 6, 2023
1 parent d8d42f2 commit a2ab313
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/js/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,20 +294,22 @@ if ( isBackgroundProcess !== true ) {
};

const unicodeFlagToImageSrc = new Map([
[ '🇦🇱', 'al' ], [ '🇦🇷', 'ar' ], [ '🇦🇹', 'at' ], [ '🇧🇬', 'bg' ],
[ '🇧🇷', 'br' ], [ '🇨🇦', 'ca' ], [ '🇨🇭', 'ch' ], [ '🇨🇳', 'cn' ],
[ '🇨🇴', 'co' ], [ '🇨🇿', 'cz' ], [ '🇩🇪', 'de' ], [ '🇩🇰', 'dk' ],
[ '🇩🇿', 'dz' ], [ '🇪🇪', 'ee' ], [ '🇪🇬', 'eg' ], [ '🇪🇸', 'es' ],
[ '🇫🇮', 'fi' ], [ '🇫🇷', 'fr' ], [ '🇬🇷', 'gr' ], [ '🇭🇷', 'hr' ],
[ '🇭🇺', 'hu' ], [ '🇮🇩', 'id' ], [ '🇮🇱', 'il' ], [ '🇮🇳', 'in' ],
[ '🇮🇷', 'ir' ], [ '🇮🇸', 'is' ], [ '🇮🇹', 'it' ], [ '🇯🇵', 'jp' ],
[ '🇰🇷', 'kr' ], [ '🇰🇿', 'kz' ], [ '🇱🇰', 'lk' ], [ '🇱🇹', 'lt' ],
[ '🇱🇻', 'lv' ], [ '🇲🇦', 'ma' ], [ '🇲🇰', 'mk' ], [ '🇲🇽', 'mx' ],
[ '🇦🇱', 'al' ], [ '🇦🇷', 'ar' ], [ '🇦🇹', 'at' ], [ '🇧🇦', 'ba' ],
[ '🇧🇬', 'bg' ], [ '🇧🇷', 'br' ], [ '🇨🇦', 'ca' ], [ '🇨🇭', 'ch' ],
[ '🇨🇳', 'cn' ], [ '🇨🇴', 'co' ], [ '🇨🇾', 'cy' ], [ '🇨🇿', 'cz' ],
[ '🇩🇪', 'de' ], [ '🇩🇰', 'dk' ], [ '🇩🇿', 'dz' ], [ '🇪🇪', 'ee' ],
[ '🇪🇬', 'eg' ], [ '🇪🇸', 'es' ], [ '🇫🇮', 'fi' ], [ '🇫🇴', 'fo' ],
[ '🇫🇷', 'fr' ], [ '🇬🇷', 'gr' ], [ '🇭🇷', 'hr' ], [ '🇭🇺', 'hu' ],
[ '🇮🇩', 'id' ], [ '🇮🇱', 'il' ], [ '🇮🇳', 'in' ], [ '🇮🇷', 'ir' ],
[ '🇮🇸', 'is' ], [ '🇮🇹', 'it' ], [ '🇯🇵', 'jp' ], [ '🇰🇷', 'kr' ],
[ '🇰🇿', 'kz' ], [ '🇱🇰', 'lk' ], [ '🇱🇹', 'lt' ], [ '🇱🇻', 'lv' ],
[ '🇲🇦', 'ma' ], [ '🇲🇩', 'md' ], [ '🇲🇰', 'mk' ], [ '🇲🇽', 'mx' ],
[ '🇲🇾', 'my' ], [ '🇳🇱', 'nl' ], [ '🇳🇴', 'no' ], [ '🇳🇵', 'np' ],
[ '🇵🇱', 'pl' ], [ '🇵🇹', 'pt' ], [ '🇷🇴', 'ro' ], [ '🇷🇸', 'rs' ],
[ '🇷🇺', 'ru' ], [ '🇸🇦', 'sa' ], [ '🇸🇮', 'si' ], [ '🇸🇰', 'sk' ],
[ '🇸🇪', 'se' ], [ '🇹🇭', 'th' ], [ '🇹🇼', 'tw' ], [ '🇹🇷', 'tr' ],
[ '🇺🇦', 'ua' ], [ '🇺🇿', 'uz' ], [ '🇻🇳', 'vn' ],
[ '🇸🇪', 'se' ], [ '🇸🇷', 'sr' ], [ '🇹🇭', 'th' ], [ '🇹🇯', 'tj' ],
[ '🇹🇼', 'tw' ], [ '🇹🇷', 'tr' ], [ '🇺🇦', 'ua' ], [ '🇺🇿', 'uz' ],
[ '🇻🇳', 'vn' ], [ '🇽🇰', 'xk' ],
]);
const reUnicodeFlags = new RegExp(
Array.from(unicodeFlagToImageSrc).map(a => a[0]).join('|'),
Expand Down

0 comments on commit a2ab313

Please sign in to comment.