refactor progress
This commit is contained in:
@@ -17,7 +17,8 @@
|
||||
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import CountryCodeStore from '~/stores/CountryCodeStore';
|
||||
import CountryCodeStore from '@app/stores/CountryCodeStore';
|
||||
import {getRegionDisplayName} from '@fluxer/geo_utils/src/RegionFormatting';
|
||||
|
||||
export interface CountryCode {
|
||||
code: string;
|
||||
@@ -267,6 +268,5 @@ export const getE164PhoneNumber = (phoneNumber: string, country: CountryCode): s
|
||||
};
|
||||
|
||||
export const getCountryName = (countryCode: string, locale: string): string => {
|
||||
const regionNames = new Intl.DisplayNames([locale], {type: 'region'});
|
||||
return regionNames.of(countryCode) || countryCode;
|
||||
return getRegionDisplayName(countryCode, {locale, fallbackToRegionCode: true}) ?? countryCode;
|
||||
};
|
||||
Reference in New Issue
Block a user