Translate genres

This commit is contained in:
Zoe Roux 2024-05-23 15:03:12 +02:00
parent 75a05296f7
commit 6336074544
No known key found for this signature in database
4 changed files with 32 additions and 4 deletions

View File

@ -429,7 +429,7 @@ const Description = ({
{isLoading ? ( {isLoading ? (
<Skeleton {...css({ width: rem(5) })} /> <Skeleton {...css({ width: rem(5) })} />
) : ( ) : (
<A href={`/genres/${genre.toLowerCase()}`}>{genre}</A> <A href={`/genres/${genre.toLowerCase()}`}>{t(`genres.${genre}`)}</A>
)} )}
</Fragment> </Fragment>
))} ))}
@ -481,7 +481,7 @@ const Description = ({
{isLoading ? ( {isLoading ? (
<Skeleton {...css({ marginBottom: 0 })} /> <Skeleton {...css({ marginBottom: 0 })} />
) : ( ) : (
<A href={`/genres/${genre.toLowerCase()}`}>{genre}</A> <A href={`/genres/${genre.toLowerCase()}`}>{t(`genres.${genre}`)}</A>
)} )}
</LI> </LI>
))} ))}

View File

@ -69,7 +69,9 @@ export const GenreGrid = ({ genre }: { genre: Genre }) => {
return ( return (
<> <>
{(displayEmpty.current || query.items?.length !== 0) && <Header title={genre} />} {(displayEmpty.current || query.items?.length !== 0) && (
<Header title={t(`genres.${genre}`)} />
)}
<InfiniteFetchList <InfiniteFetchList
query={query} query={query}
layout={{ ...ItemGrid.layout, layout: "horizontal" }} layout={{ ...ItemGrid.layout, layout: "horizontal" }}

View File

@ -193,7 +193,7 @@ export const ItemDetails = ({
{genres && ( {genres && (
<ScrollView horizontal contentContainerStyle={{ alignItems: "center" }}> <ScrollView horizontal contentContainerStyle={{ alignItems: "center" }}>
{genres.map((x, i) => ( {genres.map((x, i) => (
<Chip key={x ?? i} label={x} size="small" {...css({ mX: ts(0.5) })} /> <Chip key={x ?? i} label={t(`genres.${x}`)} size="small" {...css({ mX: ts(0.5) })} />
))} ))}
</ScrollView> </ScrollView>
)} )}

View File

@ -61,6 +61,32 @@
"switchToGrid": "Switch to grid view", "switchToGrid": "Switch to grid view",
"switchToList": "Switch to list view" "switchToList": "Switch to list view"
}, },
"genres": {
"Action": "Action",
"Adventure": "Adventure",
"Animation": "Animation",
"Comedy": "Comedy",
"Crime": "Crime",
"Documentary": "Documentary",
"Drama": "Drama",
"Family": "Family",
"Fantasy": "Fantasy",
"History": "History",
"Horror": "Horror",
"Music": "Music",
"Mystery": "Mystery",
"Romance": "Romance",
"ScienceFiction": "Science Fiction",
"Thriller": "Thriller",
"War": "War",
"Western": "Western",
"Kids": "Kids",
"News": "News",
"Reality": "Reality",
"Soap": "Soap",
"Talk": "Talk",
"Politics": "Politics"
},
"misc": { "misc": {
"settings": "Settings", "settings": "Settings",
"prev-page": "Previous page", "prev-page": "Previous page",