Skip to content

Commit

Permalink
devide Locale const for Preview and PreviewTest on Annotations.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
ked4ma committed Aug 24, 2023
1 parent 70a4200 commit 468c887
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 468c887

Please sign in to comment.