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: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2011-08-03 15:26:57 -04:00
parent 62c7b37590
commit ec9a50bccf
3 changed files with 10 additions and 3 deletions

View File

@ -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>

View File

@ -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]-->

View File

@ -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() {