Skip to content

Commit

Permalink
refactor: refactor some translation string names
Browse files Browse the repository at this point in the history
  • Loading branch information
notwindstone committed Jun 24, 2024
1 parent ee4dbe7 commit 97fb44c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@
"now-popular": "Trending",
"page-account-description": "User profile page",
"page-account-title": "Account",
"page-anime-placeholder-description": "Watch anime online with subs or dubs (in Russian) for free without any ads",
"page-anime-placeholder-title": "Watch",
"page-titles-description": "Search anime and movies via the Shikimori API",
"page-titles-title": "Search",
"page-trending-description": "Page with trending anime",
"page-trending-title": "Trending",
"page__anime__metadata-placeholder-description": "Watch anime online with subs or dubs (in Russian) for free without any ads",
"page__anime__metadata-placeholder-title": "Watch",
"page__titles__titles-description": "Search anime and movies via the Shikimori API",
"page__titles__titles-title": "Search",
"page__trending__trending-description": "Page with trending anime",
"page__trending__trending-title": "Trending",
"common__search-placeholder": "Search",
"settings-placeholder": "Settings",
"trending-placeholder": "Trending",
"common__settings-placeholder": "Settings",
"common__trending-placeholder": "Trending",
"common__menu-label": "Menu",
"common__navigation-label": "Navigation"
}
Expand Down
16 changes: 8 additions & 8 deletions messages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@
"now-popular": "Сейчас популярно",
"page-account-description": "Страница с профилем пользователя",
"page-account-title": "Аккаунт",
"page-anime-placeholder-description": "На сайте Animeth можно бесплатно и без рекламы смотреть аниме с субтитрами или озвучкой, которая выбирается в плеере",
"page-anime-placeholder-title": "Просмотр аниме",
"page-titles-description": "Поиск по аниме сериалам и фильмам через Shikimori API",
"page-titles-title": "Поиск аниме",
"page-trending-description": "Страница с популярными тайтлами",
"page-trending-title": "Популярное",
"page__anime__metadata-placeholder-description": "На сайте Animeth можно бесплатно и без рекламы смотреть аниме с субтитрами или озвучкой, которая выбирается в плеере",
"page__anime__metadata-placeholder-title": "Просмотр аниме",
"page__titles__titles-description": "Поиск по аниме сериалам и фильмам через Shikimori API",
"page__titles__titles-title": "Поиск аниме",
"page__trending__trending-description": "Страница с популярными тайтлами",
"page__trending__trending-title": "Популярное",
"common__search-placeholder": "Поиск",
"settings-placeholder": "Настройки",
"trending-placeholder": "Популярное",
"common__settings-placeholder": "Настройки",
"common__trending-placeholder": "Популярное",
"common__menu-label": "Меню",
"common__navigation-label": "Навигация"
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/[locale]/titles/[code]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export async function generateMetadata({ params }: { params: { code: string } })
})
)?.animes[0];

const placeholderTitle = translate('page-anime-placeholder-title');
const placeholderDescription = translate('page-anime-placeholder-description');
const placeholderTitle = translate('page__anime__metadata-placeholder-title');
const placeholderDescription = translate('page__anime__metadata-placeholder-description');

if (!anime) {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/app/[locale]/titles/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {getTranslations} from "next-intl/server";
export async function generateMetadata(): Promise<Metadata> {
const translate = await getTranslations('Translations');

const title = translate('page-titles-title');
const description = translate('page-titles-description');
const title = translate('page__titles__titles-title');
const description = translate('page__titles__titles-description');

return {
title: title,
Expand Down
4 changes: 2 additions & 2 deletions src/app/[locale]/trending/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {getTranslations} from "next-intl/server";
export async function generateMetadata(): Promise<Metadata> {
const translate = await getTranslations('Translations');

const title = translate('page-trending-title');
const description = translate('page-trending-description');
const title = translate('page__trending__trending-title');
const description = translate('page__trending__trending-description');

return {
title: title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {useTranslations} from "next-intl";

export default function SideBarSettingsTarget() {
const translate = useTranslations('Translations');
const settingsLabel = translate('settings-placeholder');
const settingsLabel = translate('common__settings-placeholder');
const { expanded, setExpanded } = useContext(
SideBarPopoverContext
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideBar/SideBarTrending/SideBarTrending.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {useTranslations} from "next-intl";

export default function SideBarTrending() {
const translate = useTranslations('Translations');
const trendingLabel = translate('trending-placeholder');
const trendingLabel = translate('common__trending-placeholder');

const info = useTranslations('Info');
const locale = info('locale');
Expand Down

0 comments on commit 97fb44c

Please sign in to comment.