From 468c8874788ab20ea12993b73cac41861b41e396 Mon Sep 17 00:00:00 2001 From: ked4ma Date: Thu, 24 Aug 2023 20:36:16 +0900 Subject: [PATCH 1/2] devide Locale const for Preview and PreviewTest on Annotations.kt --- .../confsched2023/designsystem/preview/Annotations.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/designsystem/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/designsystem/preview/Annotations.kt b/core/designsystem/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/designsystem/preview/Annotations.kt index 3993485ea..4eb5b69e8 100644 --- a/core/designsystem/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/designsystem/preview/Annotations.kt +++ b/core/designsystem/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/designsystem/preview/Annotations.kt @@ -60,25 +60,29 @@ object MultiLanguagePreviewDefinition { object Japanese { const val Name = "Japanese" const val Locale = "ja_JP" + const val LocaleShort = "ja" } object English { const val Name = "English" const val Locale = "en_US" + const val LocaleShort = "en" } } /** * Annotation for previewing multiple languages. + * + * Note: locale param need to follow [locale qualifier](https://developer.android.com/guide/topics/resources/providing-resources#LocaleQualifier). */ @Preview( name = MultiLanguagePreviewDefinition.Japanese.Name, group = MultiLanguagePreviewDefinition.Group, - locale = MultiLanguagePreviewDefinition.Japanese.Locale, + locale = MultiLanguagePreviewDefinition.Japanese.LocaleShort, ) @Preview( name = MultiLanguagePreviewDefinition.English.Name, group = MultiLanguagePreviewDefinition.Group, - locale = MultiLanguagePreviewDefinition.English.Locale, + locale = MultiLanguagePreviewDefinition.English.LocaleShort, ) annotation class MultiLanguagePreviews From 1efd7b2a34d267557187f9c4dca5947537c34461 Mon Sep 17 00:00:00 2001 From: ked4ma Date: Fri, 25 Aug 2023 01:45:23 +0900 Subject: [PATCH 2/2] use Language instead of LocaleShort --- .../confsched2023/designsystem/preview/Annotations.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/designsystem/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/designsystem/preview/Annotations.kt b/core/designsystem/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/designsystem/preview/Annotations.kt index 4eb5b69e8..44acb7abb 100644 --- a/core/designsystem/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/designsystem/preview/Annotations.kt +++ b/core/designsystem/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/designsystem/preview/Annotations.kt @@ -60,13 +60,13 @@ object MultiLanguagePreviewDefinition { object Japanese { const val Name = "Japanese" const val Locale = "ja_JP" - const val LocaleShort = "ja" + const val Language = "ja" } object English { const val Name = "English" const val Locale = "en_US" - const val LocaleShort = "en" + const val Language = "en" } } @@ -78,11 +78,11 @@ object MultiLanguagePreviewDefinition { @Preview( name = MultiLanguagePreviewDefinition.Japanese.Name, group = MultiLanguagePreviewDefinition.Group, - locale = MultiLanguagePreviewDefinition.Japanese.LocaleShort, + locale = MultiLanguagePreviewDefinition.Japanese.Language, ) @Preview( name = MultiLanguagePreviewDefinition.English.Name, group = MultiLanguagePreviewDefinition.Group, - locale = MultiLanguagePreviewDefinition.English.LocaleShort, + locale = MultiLanguagePreviewDefinition.English.Language, ) annotation class MultiLanguagePreviews