Move version upgrade arrow string to resources

Hardcoded strings cannot be localized.
This commit is contained in:
relan 2016-03-29 11:32:51 +03:00
parent ec53f4e05c
commit d54a4b07e5
2 changed files with 5 additions and 2 deletions

View File

@ -20,6 +20,7 @@ public abstract class AppListAdapter extends CursorAdapter {
private LayoutInflater mInflater;
private DisplayImageOptions displayImageOptions;
private String upgradeFromTo;
public AppListAdapter(Context context, Cursor c) {
super(context, c);
@ -45,7 +46,7 @@ public abstract class AppListAdapter extends CursorAdapter {
mInflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
displayImageOptions = Utils.getImageLoadingOptions().build();
upgradeFromTo = context.getResources().getString(R.string.upgrade_from_to);
}
protected abstract boolean showStatusUpdate();
@ -122,7 +123,8 @@ public abstract class AppListAdapter extends CursorAdapter {
final String installedVersionString = app.installedVersionName;
if (app.canAndWantToUpdate() && showStatusUpdate()) {
return installedVersionString + "" + app.getSuggestedVersion();
return String.format(upgradeFromTo,
installedVersionString, app.getSuggestedVersion());
}
if (app.installedVersionCode > 0 && showStatusInstalled()) {

View File

@ -9,6 +9,7 @@
<string name="license_gplv3_later">GNU General Public License version\u00A03 or later</string>
<string name="https">https://</string>
<string name="upgrade_from_to">%1$s → %2$s</string>
<string-array name="updateIntervalValues">
<item>0</item>