JcMinarro / Philology

An easy way to dynamically replace Strings of your Android App or provide new languages Over-the-air without needed to publish a new release on Google Play.
Apache License 2.0
511 stars 37 forks source link

Activity#getTitle method returns untranslated activity title #24

Open antercepter opened 5 years ago

antercepter commented 5 years ago

Describe the bug Activity#getTitle method returns untranslated label we set in android:label attribute in the AndroidManifest.xml and we cannot intercept it. The workaround is to read label of the activity directly from the AndroidManifest.xml and after that request string by this id from repository:

ActivityInfo activityInfo = getPackageManager().getActivityInfo(
                        getComponentName(),
                        PackageManager.GET_META_DATA
                );
 String label = getString(activityInfo.labelRes);

Expected behavior Activity#getTitle method should return translated label

Library version 2.0.1