From fba1fc7ee6a67173583e7f543a94630ea9e86261 Mon Sep 17 00:00:00 2001 From: Alejandro Akbal <37181533+AlejandroAkbal@users.noreply.github.com> Date: Sun, 19 Apr 2026 11:20:47 +0700 Subject: [PATCH 01/29] feat: localization --- assets/js/sidebarLinks.ts | 22 +- components/PostPageError.vue | 12 +- components/layout/FeedbackButton.vue | 4 +- components/layout/PwaUpdater.vue | 8 +- components/layout/Slideover.vue | 2 +- components/layout/modal/FeedbackPrompt.vue | 10 +- components/layout/modal/NewsletterPrompt.vue | 2 +- components/layout/modal/PremiumPrompt.vue | 19 +- components/layout/modal/PwaPrompt.vue | 16 +- components/layout/modal/ReviewPrompt.vue | 10 +- .../layout/navigation/BottomSheetWrapper.vue | 2 +- components/layout/navigation/Sidebar.vue | 28 +- .../layout/navigation/SidebarWrapper.vue | 11 +- components/pages/home/News.vue | 22 +- components/pages/home/Newsletter.vue | 35 +- components/pages/home/SimpleSearch.vue | 6 +- .../pages/posts/navigation/DomainSelector.vue | 31 +- .../navigation/DomainSelectorFallback.vue | 4 +- .../posts/navigation/search/SearchMenu.vue | 47 +- .../navigation/search/SearchMenuWrapper.vue | 2 +- .../posts/navigation/search/SearchSelect.vue | 4 +- .../navigation/search/TagCollections.vue | 22 +- .../pages/posts/post/PostChatWithAi.vue | 23 +- components/pages/posts/post/PostDownload.vue | 2 +- components/pages/posts/post/PostMedia.vue | 24 +- components/pages/posts/post/PostSave.vue | 2 +- .../pages/posts/post/PostSaveFallback.vue | 2 +- components/pages/posts/post/PostTag.vue | 20 +- components/pages/settings/SettingSelect.vue | 4 +- components/shared/ScrollTopButton.vue | 2 +- components/shared/ShareButton.vue | 7 +- components/shared/ShowMore.vue | 2 +- composables/useLocalizedHref.ts | 11 + composables/useTagCollections.ts | 32 +- config/promotions.ts | 12 +- i18n/locales/en.json | 532 + i18n/locales/es.json | 545 + i18n/locales/ja.json | 545 + i18n/locales/ru.json | 545 + middleware/auth-redirect-if-logged-in.ts | 3 +- middleware/auth.ts | 5 +- package-lock.json | 24744 +++++++++------- package.json | 1 + pages/cookie-policy.vue | 9 +- pages/dmca.vue | 9 +- pages/index.vue | 94 +- pages/legal.vue | 47 +- pages/other-sites.vue | 19 +- pages/premium/additional-boorus.vue | 49 +- pages/premium/backup.vue | 26 +- pages/premium/dashboard.vue | 75 +- pages/premium/forgot-password.vue | 28 +- pages/premium/sign-in.vue | 34 +- pages/privacy-policy.vue | 17 +- pages/terms-of-service.vue | 9 +- test/pages/posts.test.ts | 35 + 56 files changed, 16560 insertions(+), 11273 deletions(-) create mode 100644 composables/useLocalizedHref.ts create mode 100644 i18n/locales/en.json create mode 100644 i18n/locales/es.json create mode 100644 i18n/locales/ja.json create mode 100644 i18n/locales/ru.json diff --git a/assets/js/sidebarLinks.ts b/assets/js/sidebarLinks.ts index 1a553943..4387eee5 100644 --- a/assets/js/sidebarLinks.ts +++ b/assets/js/sidebarLinks.ts @@ -11,16 +11,14 @@ import { project } from '@/config/project' export const sidebarNavigation = [ { - name: 'Home', + nameKey: 'nav.home', icon: HomeIcon, - href: '/', isExternal: false }, { - name: 'Other sites', + nameKey: 'nav.otherSites', icon: UserGroupIcon, - href: '/other-sites', isExternal: false }, @@ -30,7 +28,7 @@ export const sidebarNavigation = [ ? [] : [ { - name: 'Install App', + nameKey: 'nav.installApp', icon: ArrowDownTrayIcon, href: `https://www.installpwa.com/from/${project.urls.production.hostname}`, isExternal: true @@ -38,30 +36,26 @@ export const sidebarNavigation = [ ]), { - name: 'F.A.Q.', + nameKey: 'nav.faq', icon: QuestionMarkCircleIcon, - href: 'https://rule34.app/frequently-asked-questions', isExternal: true }, { - name: 'Blog', + nameKey: 'nav.blog', icon: NewspaperIcon, - href: `${project.urls.production.toString()}blog`, - isExternal: false + isExternal: true }, { - name: 'Legal', + nameKey: 'nav.legal', icon: BuildingLibraryIcon, - href: '/legal', isExternal: false }, { - name: 'Settings', + nameKey: 'nav.settings', icon: Cog6ToothIcon, - href: '/settings', isExternal: false } diff --git a/components/PostPageError.vue b/components/PostPageError.vue index 1c04a2ef..7a56de69 100644 --- a/components/PostPageError.vue +++ b/components/PostPageError.vue @@ -14,6 +14,7 @@ const props = defineProps() const config = useRuntimeConfig() + const { t } = useI18n() diff --git a/components/layout/FeedbackButton.vue b/components/layout/FeedbackButton.vue index 38eb8a3f..7f993709 100644 --- a/components/layout/FeedbackButton.vue +++ b/components/layout/FeedbackButton.vue @@ -2,6 +2,8 @@ import { PencilSquareIcon } from '@heroicons/vue/24/outline' import { project } from '@/config/project' + const { t } = useI18n() + function handleClick(event: Event) { window.open(`https://feedback.${project.urls.production.hostname}`, '_blank') } @@ -18,7 +20,7 @@ target="_blank" :to="`https://feedback.${project.urls.production.hostname}`" > - Feedback + {{ t('common.feedback') }}