|
@@ -66,9 +66,20 @@ class NumbersList extends Component<Props> {
|
66
|
66
|
(resultNumbers, number) => {
|
67
|
67
|
// The i18n-iso-countries package insists on upper case.
|
68
|
68
|
const countryCode = number.countryCode.toUpperCase();
|
69
|
|
- const countryName = countryCode === 'SIP'
|
70
|
|
- ? t('info.sip')
|
71
|
|
- : t(`countries:countries.${countryCode}`);
|
|
69
|
+
|
|
70
|
+ let countryName;
|
|
71
|
+
|
|
72
|
+ if (countryCode === 'SIP') {
|
|
73
|
+ countryName = t('info.sip');
|
|
74
|
+ } else {
|
|
75
|
+ countryName = t(`countries:countries.${countryCode}`);
|
|
76
|
+
|
|
77
|
+ // Some countries have multiple names as US ['United States of America', 'USA']
|
|
78
|
+ // choose the first one if that is the case
|
|
79
|
+ if (!countryName) {
|
|
80
|
+ countryName = t(`countries:countries.${countryCode}.0`);
|
|
81
|
+ }
|
|
82
|
+ }
|
72
|
83
|
|
73
|
84
|
if (resultNumbers[countryName]) {
|
74
|
85
|
resultNumbers[countryName].push(number);
|