mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Fix localizable formatted strings in About screen, part 1.
We can't use formatted strings directly because it breaks with our localization tools. Grab an HTML string and turn it into a formatted string. Localized versions will have to be updated still, but that should happen automatically at TWN.
This commit is contained in:
parent
0b00a9f54e
commit
e24ce770f1
2 changed files with 15 additions and 3 deletions
|
|
@ -75,9 +75,9 @@
|
|||
<string name="preference_tracking_summary">Send usage reports to Wikimedia to help us improve the app</string>
|
||||
<string name="title_activity_settings">Settings</string>
|
||||
<string name="menu_about">About</string>
|
||||
<string name="about_license">Open Source software released under the <a href="https://github.com/wikimedia/android-commons/blob/master/COPYING">Apache License v2</a></string>
|
||||
<string name="about_improve">Source on <a href="https://github.com/wikimedia/android-commons">GitHub</a>. Bugs at <a href="https://bugzilla.wikimedia.org/enter_bug.cgi?product=Commons%20App">Bugzilla</a>.</string>
|
||||
<string name="about_privacy_policy"><a href="https://wikimediafoundation.org/wiki/Privacy_policy">Privacy policy</a></string>
|
||||
<string name="about_license">Open Source software released under the <a href="https://github.com/wikimedia/android-commons/blob/master/COPYING">Apache License v2</a></string>
|
||||
<string name="about_improve">Source on <a href="https://github.com/wikimedia/android-commons">GitHub</a>. Bugs at <a href="https://bugzilla.wikimedia.org/enter_bug.cgi?product=Commons%20App">Bugzilla</a>.</string>
|
||||
<string name="about_privacy_policy"><a href="https://wikimediafoundation.org/wiki/Privacy_policy">Privacy policy</a></string>
|
||||
<string name="title_activity_about">About</string>
|
||||
<string name="menu_feedback">Send Feedback (via Email)</string>
|
||||
<string name="provider_categories">Recently used categories</string>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.wikimedia.commons;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
|
@ -23,8 +24,19 @@ public class AboutActivity extends Activity {
|
|||
|
||||
versionText.setText(CommonsApplication.APPLICATION_VERSION);
|
||||
|
||||
// We can't use formatted strings directly because it breaks with
|
||||
// our localization tools. Grab an HTML string and turn it into
|
||||
// a formatted string.
|
||||
fixFormatting(licenseText, R.string.about_license);
|
||||
fixFormatting(improveText, R.string.about_improve);
|
||||
fixFormatting(privacyPolicyText, R.string.about_privacy_policy);
|
||||
|
||||
licenseText.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
improveText.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
privacyPolicyText.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
private void fixFormatting(TextView textView, int resource) {
|
||||
textView.setText(Html.fromHtml(getResources().getString(resource)));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue