Merge branch 'upgrade-arrow-rtl' into 'master'

Fix version upgrade string for RTL languages

In right-to-left languages _forward_ is the direction to the left, so leftwards arrow should be used to indicate upgrade:

![upgrade-arrow-rtl](/uploads/238dd85c33c92336e71357e4250aaef3/upgrade-arrow-rtl.png)

For left-to-right languages it remains the same:

![upgrade-arrow-ltr](/uploads/5e06ace9e6bf868ed89684c274f4e813/upgrade-arrow-ltr.png)

Closes #609.

See merge request !235
This commit is contained in:
Daniel Martí 2016-03-29 13:50:53 +00:00
commit 7ef4e4245b
4 changed files with 13 additions and 2 deletions

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="upgrade_from_to">%1$s ← %2$s</string>
</resources>

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>

View File

@ -28,6 +28,8 @@ for d in glob.glob(os.path.join('src', 'main', 'res', 'values-*')):
continue
if re.match('^v[0-9]+$', lang):
continue
if lang == 'ldrtl':
continue
if os.path.islink(d):
continue
trans.add(lang)