Support spaces and apostrophes in categories
Just like the hard-coded ones, for consistency.
This commit is contained in:
parent
5c4de9a166
commit
b94e2e3648
@ -114,9 +114,11 @@ public class AvailableAppsFragment extends AppListFragment implements
|
|||||||
List<String> translatedCategories = new ArrayList<>(categories.size());
|
List<String> translatedCategories = new ArrayList<>(categories.size());
|
||||||
Resources res = getResources();
|
Resources res = getResources();
|
||||||
String pkgName = getActivity().getPackageName();
|
String pkgName = getActivity().getPackageName();
|
||||||
for (final String category : categories) {
|
for (String category : categories) {
|
||||||
String resName = "category_" + category.replace(" & ", "_");
|
category = category.replace(" & ", "_");
|
||||||
int id = res.getIdentifier(resName, "string", pkgName);
|
category = category.replace(" ", "_");
|
||||||
|
category = category.replace("'", "");
|
||||||
|
int id = res.getIdentifier("category_" + category, "string", pkgName);
|
||||||
translatedCategories.add(id == 0 ? category : getString(id));
|
translatedCategories.add(id == 0 ? category : getString(id));
|
||||||
}
|
}
|
||||||
return translatedCategories;
|
return translatedCategories;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user