File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
android/src/main/java/com/reactcommunity/rnlocalize Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -158,12 +158,18 @@ private static String getLanguageCode(Locale locale) {
158
158
159
159
private static String getCountryCode (Locale locale , String fallback ) {
160
160
String countryCode = locale .getCountry ();
161
- return countryCode != null ? countryCode : fallback ;
161
+ return countryCode == null || countryCode . equals ( "" ) ? fallback : countryCode ;
162
162
}
163
163
164
164
private static String getCurrencyCode (Locale locale , String fallback ) {
165
+ String countryCode = locale .getCountry ();
166
+
167
+ if (countryCode == null || countryCode .equals ("" )) {
168
+ return fallback ;
169
+ }
170
+
165
171
Currency currency = Currency .getInstance (locale );
166
- return currency != null ? currency .getCurrencyCode () : fallback ;
172
+ return currency == null ? fallback : currency .getCurrencyCode ();
167
173
}
168
174
169
175
private static boolean getIsRTL (Locale locale ) {
You can’t perform that action at this time.
0 commit comments