Skip to content

Commit

Permalink
Merge pull request #942 from ked4ma/feature/divide-locale-of-preview-…
Browse files Browse the repository at this point in the history
…definition

divide Locale const for Preview and PreviewTest on Annotations.kt
  • Loading branch information
takahirom authored Aug 25, 2023
2 parents 71d1500 + 1efd7b2 commit 99a14d9
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 Language = "ja"
}

object English {
const val Name = "English"
const val Locale = "en_US"
const val Language = "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.Language,
)
@Preview(
name = MultiLanguagePreviewDefinition.English.Name,
group = MultiLanguagePreviewDefinition.Group,
locale = MultiLanguagePreviewDefinition.English.Locale,
locale = MultiLanguagePreviewDefinition.English.Language,
)
annotation class MultiLanguagePreviews

0 comments on commit 99a14d9

Please sign in to comment.