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

Commit ec9a50bc authored by Mike Lockwood's avatar Mike Lockwood
Browse files

Add support for localizing order of day of week and date in status bar date view



In Japanese, the day of week should follow the date

Bug: 4606219

Change-Id: If385b3f9989bbe5f1b4bc21293d9be651e187c1f
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent 62c7b375
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -135,4 +135,8 @@
    <skip />
    <!-- no translation found for gps_notification_found_text (4619274244146446464) -->
    <skip />

    <!-- in Japanese the day of week should follow the date -->
    <string name="status_bar_date_formatter">%2$s\n%1$s</string>

</resources>
+3 −2
Original line number Diff line number Diff line
@@ -41,8 +41,9 @@
    <!-- Title shown in recents popup for inspecting an application's properties -->
    <string name="status_bar_recent_inspect_item_title">Inspect</string>



    <!-- For formatting day of week and date in DateView.  Day of week precedes date by default,
         but this may be overridden on a per-locale basis if necessary. -->
    <string name="status_bar_date_formatter">%1$s\n%2$s</string>

    <!-- The label in the bar at the top of the status bar when there are no notifications
         showing.  [CHAR LIMIT=40]-->
+3 −1
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewParent;

import com.android.systemui.R;

import java.util.Date;

public final class DateView extends TextView {
@@ -90,7 +92,7 @@ public final class DateView extends TextView {
        Date now = new Date();
        CharSequence dow = DateFormat.format("EEEE", now);
        CharSequence date = DateFormat.getMediumDateFormat(getContext()).format(now);
        setText(dow + "\n" + date);
        setText(context.getString(R.string.status_bar_date_formatter, dow, date));
    }

    private boolean isVisible() {