Skip to content

Commit

Permalink
custom arabic locale
Browse files Browse the repository at this point in the history
  • Loading branch information
debbebichouaieb committed Jul 6, 2021
1 parent 5c703d6 commit f2ded80
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1032,13 +1032,20 @@ public Locale getCurrentLocale() {
return customLocale;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return getResources().getConfiguration().getLocales().get(0);
return getArabicLocale(getResources().getConfiguration().getLocales().get(0));
} else {
//noinspection deprecation
return getResources().getConfiguration().locale;
return getArabicLocale(getResources().getConfiguration().locale);
}
}

private Locale getArabicLocale(Locale locale) {
Locale value = new Locale("ar","LY") ;
if (locale.getLanguage().equals(value.getLanguage())) {
return value ;
}else return locale ;
}

public void setDateHelper(DateHelper dateHelper) {
this.dateHelper = dateHelper;
}
Expand Down

0 comments on commit f2ded80

Please sign in to comment.