Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c84343f authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 4119 into donut

* changes:
  Use locale-appropriate formatting to display application sizes like "252KB".
parents d83d6606 7351dd11
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -59,9 +59,15 @@ public final class Formatter {
            result = result / 1024;
            result = result / 1024;
        }
        }
        if (result < 100) {
        if (result < 100) {
            return String.format("%.2f%s", result, context.getText(suffix).toString());
            String value = String.format("%.2f", result);
            return context.getResources().
                getString(com.android.internal.R.string.fileSizeSuffix,
                          value, context.getString(suffix));
        }
        }
        return String.format("%.0f%s", result, context.getText(suffix).toString());
        String value = String.format("%.0f", result);
        return context.getResources().
            getString(com.android.internal.R.string.fileSizeSuffix,
                      value, context.getString(suffix));
    }
    }
    
    
    /**
    /**
+1 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@
    <string name="gigabyteShort">"Go"</string>
    <string name="gigabyteShort">"Go"</string>
    <string name="terabyteShort">"To"</string>
    <string name="terabyteShort">"To"</string>
    <string name="petabyteShort">"Po"</string>
    <string name="petabyteShort">"Po"</string>
    <string name="fileSizeSuffix"><xliff:g id="number" example="123">%1$s</xliff:g> <xliff:g id="unit" example="KB">%2$s</xliff:g></string>
    <string name="untitled">"&lt;sans titre&gt;"</string>
    <string name="untitled">"&lt;sans titre&gt;"</string>
    <string name="ellipsis">"…"</string>
    <string name="ellipsis">"…"</string>
    <string name="emptyPhoneNumber">"(Aucun numéro de téléphone)"</string>
    <string name="emptyPhoneNumber">"(Aucun numéro de téléphone)"</string>
+5 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,11 @@
    <string name="terabyteShort">TB</string>
    <string name="terabyteShort">TB</string>
    <!-- Suffix added to a number to signify size in petabytes. -->
    <!-- Suffix added to a number to signify size in petabytes. -->
    <string name="petabyteShort">PB</string>
    <string name="petabyteShort">PB</string>
    <!-- Format string used to add a suffix like "KB" or "MB" to a number
         to display a size in kilobytes, megabytes, or other size units.
         Some languages (like French) will want to add a space between
         the placeholders. -->
    <string name="fileSizeSuffix"><xliff:g id="number" example="123">%1$s</xliff:g><xliff:g id="unit" example="KB">%2$s</xliff:g></string>


    <!-- Used in Contacts for a field that has no label and in Note Pad
    <!-- Used in Contacts for a field that has no label and in Note Pad
         for a note with no name. -->
         for a note with no name. -->