De-duplicate string resource keys (#1560)
## Description Ensures that all string & plural resource keys are unique. This should help make sure all of the strings are shown in weblate's translation. ### Related issues Related to #1551 ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
38b4a8c4de
commit
fa5cc99c3b
42 changed files with 156 additions and 183 deletions
|
|
@ -92,18 +92,18 @@ sealed interface ExtrasItem {
|
|||
val ExtraType.stringRes: Int
|
||||
get() =
|
||||
when (this) {
|
||||
ExtraType.UNKNOWN -> R.string.other_extras
|
||||
ExtraType.CLIP -> R.string.clips
|
||||
ExtraType.UNKNOWN -> R.string.other_extras_title
|
||||
ExtraType.CLIP -> R.string.clips_title
|
||||
ExtraType.TRAILER -> R.string.trailers
|
||||
ExtraType.BEHIND_THE_SCENES -> R.string.behind_the_scenes
|
||||
ExtraType.DELETED_SCENE -> R.string.deleted_scenes
|
||||
ExtraType.INTERVIEW -> R.string.interviews
|
||||
ExtraType.SCENE -> R.string.scenes
|
||||
ExtraType.SAMPLE -> R.string.samples
|
||||
ExtraType.THEME_SONG -> R.string.theme_songs
|
||||
ExtraType.THEME_VIDEO -> R.string.theme_videos
|
||||
ExtraType.FEATURETTE -> R.string.featurettes
|
||||
ExtraType.SHORT -> R.string.shorts
|
||||
ExtraType.BEHIND_THE_SCENES -> R.string.behind_the_scenes_title
|
||||
ExtraType.DELETED_SCENE -> R.string.deleted_scenes_title
|
||||
ExtraType.INTERVIEW -> R.string.interviews_title
|
||||
ExtraType.SCENE -> R.string.scenes_title
|
||||
ExtraType.SAMPLE -> R.string.samples_title
|
||||
ExtraType.THEME_SONG -> R.string.theme_songs_title
|
||||
ExtraType.THEME_VIDEO -> R.string.theme_videos_title
|
||||
ExtraType.FEATURETTE -> R.string.featurettes_title
|
||||
ExtraType.SHORT -> R.string.shorts_title
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -506,7 +506,7 @@ class HomeSettingsService
|
|||
is HomeRowConfig.Favorite -> {
|
||||
val name =
|
||||
ResProviderStringProvider(
|
||||
R.string.favorite_items,
|
||||
R.string.favorite_items_title,
|
||||
ResStringProvider(favoriteOptions[config.kind]!!),
|
||||
)
|
||||
HomeRowConfigDisplay(id, name, config)
|
||||
|
|
@ -952,7 +952,7 @@ class HomeSettingsService
|
|||
is HomeRowConfig.Favorite -> {
|
||||
val title =
|
||||
ResProviderStringProvider(
|
||||
R.string.favorite_items,
|
||||
R.string.favorite_items_title,
|
||||
ResStringProvider(favoriteOptions[row.kind]!!),
|
||||
)
|
||||
if (row.kind == BaseItemKind.PERSON) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class TrailerService
|
|||
// TODO would be nice to clean up the trailer name
|
||||
// ?.replace(item.name ?: "", "")
|
||||
// ?.removePrefix(" - ")
|
||||
?: context.getString(R.string.trailer)
|
||||
?: context.resources.getQuantityString(R.plurals.trailers, 1)
|
||||
val subtitle =
|
||||
when (url.toUri().host) {
|
||||
"youtube.com", "www.youtube.com" -> "YouTube"
|
||||
|
|
|
|||
|
|
@ -203,12 +203,12 @@ fun listToDotString(
|
|||
@StringRes
|
||||
fun formatTypeName(type: BaseItemKind): Int =
|
||||
when (type) {
|
||||
BaseItemKind.MOVIE -> R.string.movies
|
||||
BaseItemKind.SERIES -> R.string.tv_shows
|
||||
BaseItemKind.MOVIE -> R.string.movies_title
|
||||
BaseItemKind.SERIES -> R.string.tv_shows_title
|
||||
BaseItemKind.EPISODE -> R.string.episodes
|
||||
BaseItemKind.VIDEO -> R.string.videos
|
||||
BaseItemKind.PLAYLIST -> R.string.playlists
|
||||
BaseItemKind.PERSON -> R.string.people
|
||||
BaseItemKind.PERSON -> R.string.people_title
|
||||
BaseItemKind.BOX_SET -> R.string.collections
|
||||
BaseItemKind.AUDIO -> TODO()
|
||||
BaseItemKind.CHANNEL -> R.string.channels
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ fun ExtrasRow(
|
|||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
ItemRow(
|
||||
title = stringResource(R.string.extras),
|
||||
title = stringResource(R.string.extras_title),
|
||||
items = extras,
|
||||
onClickItem = onClickItem,
|
||||
onLongClickItem = onLongClickItem,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ fun PersonRow(
|
|||
people: List<Person>,
|
||||
onClick: (Person) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
@StringRes title: Int = R.string.people,
|
||||
@StringRes title: Int = R.string.people_title,
|
||||
onLongClick: ((Int, Person) -> Unit)? = null,
|
||||
) {
|
||||
val firstFocus = remember { FocusRequester() }
|
||||
|
|
@ -84,7 +84,7 @@ fun DiscoverPersonRow(
|
|||
people: List<DiscoverItem>,
|
||||
onClick: (DiscoverItem) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
@StringRes title: Int = R.string.people,
|
||||
@StringRes title: Int = R.string.people_title,
|
||||
onLongClick: ((Int, DiscoverItem) -> Unit)? = null,
|
||||
) {
|
||||
val firstFocus = remember { FocusRequester() }
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@ fun FavoritesPage(
|
|||
val tabs =
|
||||
remember {
|
||||
listOf(
|
||||
TabDetails(R.string.movies),
|
||||
TabDetails(R.string.tv_shows),
|
||||
TabDetails(R.string.movies_title),
|
||||
TabDetails(R.string.tv_shows_title),
|
||||
TabDetails(R.string.episodes),
|
||||
TabDetails(R.string.videos),
|
||||
TabDetails(R.string.playlists),
|
||||
TabDetails(R.string.people),
|
||||
TabDetails(R.string.people_title),
|
||||
)
|
||||
}
|
||||
val actions =
|
||||
|
|
|
|||
|
|
@ -363,7 +363,7 @@ fun PersonPageContent(
|
|||
}
|
||||
item {
|
||||
LoadingRow(
|
||||
title = rowTitle(stringResource(R.string.movies), movies),
|
||||
title = rowTitle(stringResource(R.string.movies_title), movies),
|
||||
state = movies,
|
||||
rowIndex = MOVIE_ROW,
|
||||
position = position,
|
||||
|
|
@ -376,7 +376,7 @@ fun PersonPageContent(
|
|||
}
|
||||
item {
|
||||
LoadingRow(
|
||||
title = rowTitle(stringResource(R.string.tv_shows), series),
|
||||
title = rowTitle(stringResource(R.string.tv_shows_title), series),
|
||||
state = series,
|
||||
rowIndex = SERIES_ROW,
|
||||
position = position,
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class SeerrDiscoverViewModel
|
|||
this.copy(
|
||||
movies =
|
||||
DiscoverRowData(
|
||||
ResStringProvider(R.string.movies),
|
||||
ResStringProvider(R.string.movies_title),
|
||||
it,
|
||||
DiscoverRequestType.DISCOVER_MOVIES,
|
||||
),
|
||||
|
|
@ -90,7 +90,7 @@ class SeerrDiscoverViewModel
|
|||
this.copy(
|
||||
tv =
|
||||
DiscoverRowData(
|
||||
ResStringProvider(R.string.tv_shows),
|
||||
ResStringProvider(R.string.tv_shows_title),
|
||||
it,
|
||||
DiscoverRequestType.DISCOVER_TV,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -682,7 +682,7 @@ fun SearchPage(
|
|||
modifier = Modifier.focusGroup(),
|
||||
) {
|
||||
searchResultRow(
|
||||
title = R.string.movies,
|
||||
title = R.string.movies_title,
|
||||
result = state.movies,
|
||||
rowIndex = MOVIE_ROW,
|
||||
position = position,
|
||||
|
|
@ -692,7 +692,7 @@ fun SearchPage(
|
|||
modifier = Modifier.fillMaxWidth(),
|
||||
)
|
||||
searchResultRow(
|
||||
title = R.string.tv_shows,
|
||||
title = R.string.tv_shows_title,
|
||||
result = state.series,
|
||||
rowIndex = SERIES_ROW,
|
||||
position = position,
|
||||
|
|
|
|||
|
|
@ -53,12 +53,12 @@ fun HomeSettingsFavoriteList(
|
|||
|
||||
val favoriteOptions by lazy {
|
||||
mapOf(
|
||||
BaseItemKind.MOVIE to R.string.movies,
|
||||
BaseItemKind.SERIES to R.string.tv_shows,
|
||||
BaseItemKind.MOVIE to R.string.movies_title,
|
||||
BaseItemKind.SERIES to R.string.tv_shows_title,
|
||||
BaseItemKind.EPISODE to R.string.episodes,
|
||||
BaseItemKind.VIDEO to R.string.videos,
|
||||
BaseItemKind.PLAYLIST to R.string.playlists,
|
||||
BaseItemKind.PERSON to R.string.people,
|
||||
BaseItemKind.PERSON to R.string.people_title,
|
||||
BaseItemKind.MUSIC_ARTIST to R.string.artists,
|
||||
BaseItemKind.MUSIC_ALBUM to R.string.albums,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ class HomeSettingsViewModel
|
|||
id = id,
|
||||
title =
|
||||
ResProviderStringProvider(
|
||||
R.string.favorite_items,
|
||||
R.string.favorite_items_title,
|
||||
ResStringProvider(favoriteOptions[type]!!),
|
||||
),
|
||||
config = HomeRowConfig.Favorite(type),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue