let LocalHelpActivity detect language-region combinations

This commit is contained in:
B. Petersen
2021-04-13 14:37:42 +02:00
committed by bjoern
parent 943d49ab7e
commit c2de12e1a3
2 changed files with 4 additions and 1 deletions
@@ -20,8 +20,11 @@ public class LocalHelpActivity extends WebViewActivity
try {
Locale locale = dynamicLanguage.getCurrentLocale();
String appLang = locale.getLanguage();
String appCountry = locale.getCountry();
if (assetExists(helpPath.replace("LANG", appLang))) {
helpLang = appLang;
} else if (assetExists(helpPath.replace("LANG", appLang+"_"+appCountry))) {
helpLang = appLang+"_"+appCountry;
} else {
appLang = appLang.substring(0, 2);
if (assetExists(helpPath.replace("LANG", appLang))) {
@@ -247,7 +247,7 @@ public class LogViewFragment extends Fragment {
Prefs.reliableService(context)).append("\n");
Locale locale = fragment.dynamicLanguage.getCurrentLocale();
builder.append("lang=").append(locale.getLanguage()).append("\n");
builder.append("lang=").append(locale.toString()).append("\n");
if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN_MR1) {
boolean isRtl = DynamicLanguage.getLayoutDirection(context) == View.LAYOUT_DIRECTION_RTL;
builder.append("rtl=").append(isRtl).append("\n");