We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I wanted to check how localization would work with plugins, but ran into an issue.
What I have is a LocaleHelper class,
LocaleHelper
object LocaleHelper { @JvmStatic fun onAttach(context: Context): Context { val chinese = Locale.CHINESE val locale = Locale(chinese.language, chinese.country) Locale.setDefault(locale) val configuration = context.resources.configuration configuration.setLocale(locale) configuration.setLayoutDirection(locale) return context.createConfigurationContext(configuration) } }
I use this class with the plugin context mContext that is created in the BaseActivity.
mContext
BaseActivity
LocaleHelper.onAttach(mContext).getString(R.string.localized_text)
I have added this localized_text string resource for both English and Chinese. But on running this, it prints some random text.
localized_text
I tried this with the pluginApk sample app and it printed "sans-serif-medium", which is just weird.
A solution for this would be really helpful.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I wanted to check how localization would work with plugins, but ran into an issue.
What I have is a
LocaleHelper
class,I use this class with the plugin context
mContext
that is created in theBaseActivity
.LocaleHelper.onAttach(mContext).getString(R.string.localized_text)
I have added this
localized_text
string resource for both English and Chinese. But on running this, it prints some random text.I tried this with the pluginApk sample app and it printed "sans-serif-medium", which is just weird.
A solution for this would be really helpful.
The text was updated successfully, but these errors were encountered: