refactor progress

This commit is contained in:
Hampus Kraft
2026-02-17 12:22:36 +00:00
parent cb31608523
commit d5abd1a7e4
8257 changed files with 1190207 additions and 761040 deletions

View File

@@ -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;
};