diff options
author | Elliott Hughes <enh@google.com> | 2012-09-15 16:12:09 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-09-15 16:12:09 -0700 |
commit | 1a698714b971e244516ecdfad09b31432c4a2ec2 (patch) | |
tree | 22a0a817d384b1b126359abacb7b3d697cdb0e0b /core/java/android/text | |
parent | 5f09b9f52d474eee5d3ec0288819018f81926b89 (diff) | |
parent | c3ff72f5bd5896ad2584e0cc0582cbd2ad8191f2 (diff) | |
download | frameworks_base-1a698714b971e244516ecdfad09b31432c4a2ec2.zip frameworks_base-1a698714b971e244516ecdfad09b31432c4a2ec2.tar.gz frameworks_base-1a698714b971e244516ecdfad09b31432c4a2ec2.tar.bz2 |
am c3ff72f5: Use icu4c for CLDR "yesterday", "today", and "tomorrow" strings.
* commit 'c3ff72f5bd5896ad2584e0cc0582cbd2ad8191f2':
Use icu4c for CLDR "yesterday", "today", and "tomorrow" strings.
Diffstat (limited to 'core/java/android/text')
-rw-r--r-- | core/java/android/text/format/DateUtils.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/java/android/text/format/DateUtils.java b/core/java/android/text/format/DateUtils.java index 2fec5e9..0babcc5 100644 --- a/core/java/android/text/format/DateUtils.java +++ b/core/java/android/text/format/DateUtils.java @@ -552,14 +552,19 @@ public class DateUtils int days = Math.abs(currentDay - startDay); boolean past = (today > day); + // TODO: some locales name other days too, such as de_DE's "Vorgestern" (today - 2). + Locale locale = r.getConfiguration().locale; + if (locale == null) { + locale = Locale.getDefault(); + } if (days == 1) { if (past) { - return r.getString(com.android.internal.R.string.yesterday); + return LocaleData.get(locale).yesterday; } else { - return r.getString(com.android.internal.R.string.tomorrow); + return LocaleData.get(locale).tomorrow; } } else if (days == 0) { - return r.getString(com.android.internal.R.string.today); + return LocaleData.get(locale).today; } int resId; |