I'm encountering an issue with the CountryCodePicker library in my Android application. When the locale is set to Turkish (tr), some country flags are not displaying. My app supports two languages, with separate string resources for English and Turkish.
How can I address this issue and ensure that all country flags are displayed correctly regardless of the locale, especially when using the Turkish (tr) locale.
BTW I am using the below library for country code picker:https://github.com/hbb20/CountryCodePickerProject
<com.hbb20.CountryCodePicker android:id="@+id/ccp" app:ccpDialog_showFlag="true" android:layout_width="wrap_content" android:layout_height="45dp" android:background="@drawable/edittxt_bg" app:ccp_autoFormatNumber="false" app:ccp_countryPreference="TR,IN,GY" app:ccp_hintExampleNumber="true" app:ccp_hintExampleNumberType="MOBILE" app:ccp_showFullName="false" app:ccp_showPhoneCode="false" app:ccp_defaultNameCode="TR"/>ccp = findViewById(R.id.ccp); ccp.registerCarrierNumberEditText(userID); ccp.setDefaultCountryUsingNameCode("TR"); TextInputLayout passLayout = findViewById(R.id.textInputLayout); System.out.println("countryCode: " + countryCode); if (countryCode.equalsIgnoreCase("91")) { passLayout.setVisibility(View.GONE); } else { passLayout.setVisibility(View.VISIBLE); } LoadLocale.load(MainActivity.this); // storing current locale for reverting back later SelectedLanguage = getLanguage(MainActivity.this); Log.d("LangCheck", "choosenlanguage: " + SelectedLanguage); // temporarily set to en for displaying country flag LoadLocale.set(MainActivity.this, "en"); ccp.setNumberAutoFormattingEnabled(false); ccp.setOnCountryChangeListener(() -> { countryCode = ccp.getSelectedCountryCode(); String countryName = ccp.getSelectedCountryName(); Log.d("CountryCodePicker", "Selected country code: " + countryCode +", name: " + countryName); });
I tried setting a temporary locale to English(en) and then reverting to whatever user's chosen language, but this is not the right way.