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

Commit fd8fbad2 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

More fix for bug #8555992 [BiDi][ar] Lap time units are displayed in the wrong order

- use correct decimal separator depending on Locale

Change-Id: I92a964215610b29f5333319ad18bae6213bb0233
parent c45fe2bf
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -368,19 +368,19 @@
        [CHAR LIMIT=1] for each abbreviation as in hours_label, etc. -->
    <string-array name="stopwatch_format_set" translatable="false">
        <item> <!-- <10 minutes - example "1 02.03" -->
            <xliff:g id="M">%2$d</xliff:g> &#x200E;<xliff:g id="S">%3$02d</xliff:g>.<xliff:g id="D">%4$02d</xliff:g>
            <xliff:g id="M">%2$d</xliff:g> &#x200E;<xliff:g id="S">%3$02d</xliff:g><xliff:g id="decimal_separator">%5$c</xliff:g><xliff:g id="D">%4$02d</xliff:g>
        </item>
        <item> <!-- <1 hour - example "12 03.04" -->
            <xliff:g id="M">%2$02d</xliff:g> &#x200E;<xliff:g id="S">%3$02d</xliff:g>.<xliff:g id="D">%4$02d</xliff:g>
            <xliff:g id="M">%2$02d</xliff:g> &#x200E;<xliff:g id="S">%3$02d</xliff:g><xliff:g id="decimal_separator">%5$c</xliff:g><xliff:g id="D">%4$02d</xliff:g>
        </item>
        <item> <!-- <10 hours - example "1 02 03.04" -->
            <xliff:g id="H">%1$d</xliff:g> &#x200E;<xliff:g id="M">%2$02d</xliff:g> &#x200E;<xliff:g id="S">%3$02d</xliff:g>.<xliff:g id="D">%4$02d</xliff:g>
            <xliff:g id="H">%1$d</xliff:g> &#x200E;<xliff:g id="M">%2$02d</xliff:g> &#x200E;<xliff:g id="S">%3$02d</xliff:g><xliff:g id="decimal_separator">%5$c</xliff:g><xliff:g id="D">%4$02d</xliff:g>
        </item>
        <item> <!-- <100 hours - example "12 03 04.05" -->
            <xliff:g id="H">%1$02d</xliff:g> &#x200E;<xliff:g id="M">%2$02d</xliff:g> &#x200E;<xliff:g id="S">%3$02d</xliff:g>.<xliff:g id="D">%4$02d</xliff:g>
            <xliff:g id="H">%1$02d</xliff:g> &#x200E;<xliff:g id="M">%2$02d</xliff:g> &#x200E;<xliff:g id="S">%3$02d</xliff:g><xliff:g id="decimal_separator">%5$c</xliff:g><xliff:g id="D">%4$02d</xliff:g>
        </item>
        <item> <!-- <1000 hours - example "123 04 05.06" -->
            <xliff:g id="H">%1$03d</xliff:g> &#x200E;<xliff:g id="M">%2$02d</xliff:g> &#x200E;<xliff:g id="S">%3$02d</xliff:g>.<xliff:g id="D">%4$02d</xliff:g>
            <xliff:g id="H">%1$03d</xliff:g> &#x200E;<xliff:g id="M">%2$02d</xliff:g> &#x200E;<xliff:g id="S">%3$02d</xliff:g><xliff:g id="decimal_separator">%5$c</xliff:g><xliff:g id="D">%4$02d</xliff:g>
        </item>
        </string-array>
    <!-- Label to enumerate the number of laps the user has counted -->
+4 −1
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import android.content.Context;

import com.android.deskclock.R;

import java.text.DecimalFormatSymbols;

public class Stopwatches {
    // Private actions processed by the receiver
    public static final String START_STOPWATCH = "start_stopwatch";
@@ -121,7 +123,8 @@ public class Stopwatches {
        seconds = seconds - minutes * 60;
        hours = minutes / 60;
        minutes = minutes - hours * 60;
        String timeStr = String.format(format, hours, minutes, seconds, hundreds);
        char decimalSeparator = DecimalFormatSymbols.getInstance().getDecimalSeparator();
        String timeStr = String.format(format, hours, minutes, seconds, hundreds, decimalSeparator);
        return timeStr;
    }