Use proper casing for i18n locales (#1998)

This commit is contained in:
Jeff
2026-05-11 19:42:07 -07:00
committed by GitHub
parent e49e488b4c
commit e2a1d813a9
224 changed files with 17323 additions and 18474 deletions
@@ -28,7 +28,7 @@ export const ActionBar = () => {
open();
}
}}
placeholder={t('common.search', { postProcess: 'titleCase' })}
placeholder={t('common.search')}
readOnly
/>
</Grid.Col>
@@ -37,23 +37,20 @@ export const CollapsedSidebar = () => {
const sidebarItems = useSidebarItems();
const translatedSidebarItemMap = useMemo(
() => ({
Albums: t('page.sidebar.albums', { postProcess: 'titleCase' }),
Artists: t('page.sidebar.albumArtists', { postProcess: 'titleCase' }).replace(
' ',
'\n',
),
'Artists-all': t('page.sidebar.artists', { postProcess: 'titleCase' }),
Collections: t('page.sidebar.collections', { postProcess: 'titleCase' }),
Favorites: t('page.sidebar.favorites', { postProcess: 'titleCase' }),
Folders: t('page.sidebar.folders', { postProcess: 'titleCase' }),
Genres: t('page.sidebar.genres', { postProcess: 'titleCase' }),
Home: t('page.sidebar.home', { postProcess: 'titleCase' }),
'Now Playing': t('page.sidebar.nowPlaying', { postProcess: 'titleCase' }),
Playlists: t('page.sidebar.playlists', { postProcess: 'titleCase' }),
Radio: t('page.sidebar.radio', { postProcess: 'titleCase' }),
Search: t('page.sidebar.search', { postProcess: 'titleCase' }),
Settings: t('page.sidebar.settings', { postProcess: 'titleCase' }),
Tracks: t('page.sidebar.tracks', { postProcess: 'titleCase' }),
Albums: t('page.sidebar.albums'),
Artists: t('page.sidebar.albumArtists').replace(' ', '\n'),
'Artists-all': t('page.sidebar.artists'),
Collections: t('page.sidebar.collections'),
Favorites: t('page.sidebar.favorites'),
Folders: t('page.sidebar.folders'),
Genres: t('page.sidebar.genres'),
Home: t('page.sidebar.home'),
'Now Playing': t('page.sidebar.nowPlaying'),
Playlists: t('page.sidebar.playlists'),
Radio: t('page.sidebar.radio'),
Search: t('page.sidebar.search'),
Settings: t('page.sidebar.settings'),
Tracks: t('page.sidebar.tracks'),
}),
[t],
);
@@ -98,7 +95,7 @@ export const CollapsedSidebar = () => {
activeIcon={null}
component={Flex}
icon={<Icon fill="muted" icon="menu" size="3xl" />}
label={t('common.menu', { postProcess: 'titleCase' })}
label={t('common.menu')}
style={{
cursor: 'pointer',
padding: 'var(--theme-spacing-md) 0',
@@ -26,17 +26,17 @@ export const MobileSidebar = () => {
const translatedSidebarItemMap = useMemo(
() => ({
Albums: t('page.sidebar.albums', { postProcess: 'titleCase' }),
Artists: t('page.sidebar.albumArtists', { postProcess: 'titleCase' }),
'Artists-all': t('page.sidebar.artists', { postProcess: 'titleCase' }),
Favorites: t('page.sidebar.favorites', { postProcess: 'titleCase' }),
Genres: t('page.sidebar.genres', { postProcess: 'titleCase' }),
Home: t('page.sidebar.home', { postProcess: 'titleCase' }),
'Now Playing': t('page.sidebar.nowPlaying', { postProcess: 'titleCase' }),
Playlists: t('page.sidebar.playlists', { postProcess: 'titleCase' }),
Search: t('page.sidebar.search', { postProcess: 'titleCase' }),
Settings: t('page.sidebar.settings', { postProcess: 'titleCase' }),
Tracks: t('page.sidebar.tracks', { postProcess: 'titleCase' }),
Albums: t('page.sidebar.albums'),
Artists: t('page.sidebar.albumArtists'),
'Artists-all': t('page.sidebar.artists'),
Favorites: t('page.sidebar.favorites'),
Genres: t('page.sidebar.genres'),
Home: t('page.sidebar.home'),
'Now Playing': t('page.sidebar.nowPlaying'),
Playlists: t('page.sidebar.playlists'),
Search: t('page.sidebar.search'),
Settings: t('page.sidebar.settings'),
Tracks: t('page.sidebar.tracks'),
}),
[t],
);
@@ -77,9 +77,7 @@ export const MobileSidebar = () => {
<Accordion.Item value="library">
<Accordion.Control>
<Text fw={600} variant="secondary">
{t('page.sidebar.myLibrary', {
postProcess: 'titleCase',
})}
{t('page.sidebar.myLibrary')}
</Text>
</Accordion.Control>
<Accordion.Panel>
@@ -85,15 +85,13 @@ export const ServerSelectorItems = () => {
const handleManageServersModal = () => {
openModal({
children: <ServerList />,
title: t('page.manageServers.title', { postProcess: 'titleCase' }),
title: t('page.manageServers.title'),
});
};
return (
<>
<DropdownMenu.Label>
{t('page.appMenu.selectServer', { postProcess: 'titleCase' })}
</DropdownMenu.Label>
<DropdownMenu.Label>{t('page.appMenu.selectServer')}</DropdownMenu.Label>
{Object.values(serverList).map((server) => {
const isNavidromeExpired =
server.type === ServerType.NAVIDROME && !server.ndCredential;
@@ -127,21 +125,19 @@ export const ServerSelectorItems = () => {
leftSection={<Icon icon="edit" />}
onClick={handleManageServersModal}
>
{t('page.appMenu.manageServers', { postProcess: 'sentenceCase' })}
{t('page.appMenu.manageServers')}
</DropdownMenu.Item>
)}
{musicFolders && musicFolders.items.length > 0 && (
<>
<DropdownMenu.Divider />
<DropdownMenu.Label>
{t('page.appMenu.selectMusicFolder', { postProcess: 'sentenceCase' })}
</DropdownMenu.Label>
<DropdownMenu.Label>{t('page.appMenu.selectMusicFolder')}</DropdownMenu.Label>
<DropdownMenu.Item
isSelected={selectedMusicFolders.length === 0}
leftSection={<Icon icon="minus" />}
onClick={handleClearMusicFolders}
>
{t('common.none', { postProcess: 'titleCase' })}
{t('common.none')}
</DropdownMenu.Item>
{musicFolders.items.map((folder) => {
const isSelected = supportsMultiSelect
@@ -42,13 +42,12 @@ export const ServerSelector = () => {
const musicFolderDisplayText = (() => {
if (selectedMusicFolders.length === 0) {
return t('page.appMenu.noMusicFolder', { postProcess: 'sentenceCase' });
return t('page.appMenu.noMusicFolder');
}
if (supportsMultiSelect && selectedMusicFolders.length > 1) {
return t('page.appMenu.multipleMusicFolders', {
count: selectedMusicFolders.length,
postProcess: 'sentenceCase',
});
}
@@ -123,10 +123,10 @@ const CollectionRow = ({
</DropdownMenu.Target>
<DropdownMenu.Dropdown>
<DropdownMenu.Item onClick={handleRenameOpen}>
{t('common.rename', { postProcess: 'sentenceCase' })}
{t('common.rename')}
</DropdownMenu.Item>
<DropdownMenu.Item color="red" onClick={handleDelete}>
{t('common.delete', { postProcess: 'sentenceCase' })}
{t('common.delete')}
</DropdownMenu.Item>
</DropdownMenu.Dropdown>
</DropdownMenu>
@@ -144,10 +144,10 @@ const CollectionRow = ({
/>
<Group gap="xs" justify="flex-end">
<Button onClick={renameHandlers.close} type="button" variant="subtle">
{t('common.cancel', { postProcess: 'sentenceCase' })}
{t('common.cancel')}
</Button>
<Button type="submit" variant="filled">
{t('common.save', { postProcess: 'sentenceCase' })}
{t('common.save')}
</Button>
</Group>
</Stack>
@@ -176,7 +176,7 @@ export const SidebarCollectionList = () => {
return (
<Accordion.Item value="collections">
<Accordion.Control component="div" role="button" style={{ userSelect: 'none' }}>
<Text fw={500}>{t('page.sidebar.collections', { postProcess: 'titleCase' })}</Text>
<Text fw={500}>{t('page.sidebar.collections')}</Text>
</Accordion.Control>
<Accordion.Panel>
{collections.map((collection) => (
@@ -185,7 +185,7 @@ const PlaylistRowButton = memo(
innerProps: modalProps,
modal: 'addToPlaylist',
size: 'lg',
title: t('form.addToPlaylist.title', { postProcess: 'titleCase' }),
title: t('form.addToPlaylist.title'),
});
},
},
@@ -255,7 +255,7 @@ const PlaylistRowButton = memo(
{item.ownerId === permissions.userId && Boolean(item.public) && (
<div className={styles.metadataGroupItem}>
<Text isMuted size="sm">
{t('common.public', { postProcess: 'titleCase' })}
{t('common.public')}
</Text>
</div>
)}
@@ -489,11 +489,7 @@ export const SidebarPlaylistList = () => {
<Accordion.Item value="playlists">
<Accordion.Control component="div" role="button" style={{ userSelect: 'none' }}>
<Group justify="space-between" pr="var(--theme-spacing-md)">
<Text fw={500}>
{t('page.sidebar.playlists', {
postProcess: 'titleCase',
})}
</Text>
<Text fw={500}>{t('page.sidebar.playlists')}</Text>
<Group gap="xs">
<ActionIcon
icon="add"
@@ -503,9 +499,7 @@ export const SidebarPlaylistList = () => {
onClick={handleCreatePlaylistModal}
size="xs"
tooltip={{
label: t('action.createPlaylist', {
postProcess: 'sentenceCase',
}),
label: t('action.createPlaylist'),
}}
variant="subtle"
/>
@@ -519,9 +513,7 @@ export const SidebarPlaylistList = () => {
size="xs"
to={AppRoute.PLAYLISTS}
tooltip={{
label: t('action.viewPlaylists', {
postProcess: 'sentenceCase',
}),
label: t('action.viewPlaylists'),
}}
variant="subtle"
/>
@@ -684,9 +676,7 @@ export const SidebarSharedPlaylistList = () => {
<Accordion.Item value="shared-playlists">
<Accordion.Control>
<Text fw={500} variant="secondary">
{t('page.sidebar.shared', {
postProcess: 'titleCase',
})}
{t('page.sidebar.shared')}
</Text>
</Accordion.Control>
<Accordion.Panel>
@@ -52,20 +52,20 @@ export const Sidebar = () => {
const translatedSidebarItemMap = useMemo(
() => ({
Albums: t('page.sidebar.albums', { postProcess: 'titleCase' }),
Artists: t('page.sidebar.albumArtists', { postProcess: 'titleCase' }),
'Artists-all': t('page.sidebar.artists', { postProcess: 'titleCase' }),
Collections: t('page.sidebar.collections', { postProcess: 'titleCase' }),
Favorites: t('page.sidebar.favorites', { postProcess: 'titleCase' }),
Folders: t('page.sidebar.folders', { postProcess: 'titleCase' }),
Genres: t('page.sidebar.genres', { postProcess: 'titleCase' }),
Home: t('page.sidebar.home', { postProcess: 'titleCase' }),
'Now Playing': t('page.sidebar.nowPlaying', { postProcess: 'titleCase' }),
Playlists: t('page.sidebar.playlists', { postProcess: 'titleCase' }),
Radio: t('page.sidebar.radio', { postProcess: 'titleCase' }),
Search: t('page.sidebar.search', { postProcess: 'titleCase' }),
Settings: t('page.sidebar.settings', { postProcess: 'titleCase' }),
Tracks: t('page.sidebar.tracks', { postProcess: 'titleCase' }),
Albums: t('page.sidebar.albums'),
Artists: t('page.sidebar.albumArtists'),
'Artists-all': t('page.sidebar.artists'),
Collections: t('page.sidebar.collections'),
Favorites: t('page.sidebar.favorites'),
Folders: t('page.sidebar.folders'),
Genres: t('page.sidebar.genres'),
Home: t('page.sidebar.home'),
'Now Playing': t('page.sidebar.nowPlaying'),
Playlists: t('page.sidebar.playlists'),
Radio: t('page.sidebar.radio'),
Search: t('page.sidebar.search'),
Settings: t('page.sidebar.settings'),
Tracks: t('page.sidebar.tracks'),
}),
[t],
);
@@ -123,9 +123,7 @@ export const Sidebar = () => {
<Accordion.Item value="library">
<Accordion.Control>
<Text fw={500} variant="secondary">
{t('page.sidebar.myLibrary', {
postProcess: 'titleCase',
})}
{t('page.sidebar.myLibrary')}
</Text>
</Accordion.Control>
<Accordion.Panel>
@@ -218,11 +216,7 @@ const SidebarImage = () => {
style={{ aspectRatio: 1 }}
transition={{ duration: 0.3, ease: 'easeInOut' }}
>
<Tooltip
label={t('player.toggleFullscreenPlayer', {
postProcess: 'sentenceCase',
})}
>
<Tooltip label={t('player.toggleFullscreenPlayer')}>
{isRadioActive && radioImageUrl ? (
<img className={styles.sidebarImage} loading="eager" src={radioImageUrl} />
) : isRadioActive ? (
@@ -269,9 +263,7 @@ const SidebarImage = () => {
top: '1rem',
}}
tooltip={{
label: t('common.collapse', {
postProcess: 'titleCase',
}),
label: t('common.collapse'),
openDelay: 500,
}}
/>