mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Translate Showcase section
This commit is contained in:
2 files changed
+78
-46
No files matched your search
@@ -14,8 +14,10 @@ import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { RelaySelector } from "@/components/RelaySelector";
|
||||
import { useAppContext } from "@/hooks/useAppContext";
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export function AppShowcase() {
|
||||
const { t } = useTranslation();
|
||||
const { user } = useCurrentUser();
|
||||
const { config } = useAppContext();
|
||||
const { data: submissions = [], isLoading } = useAppSubmissions();
|
||||
@@ -33,7 +35,7 @@ export function AppShowcase() {
|
||||
const isModerator = user?.pubkey === MODERATOR_HEX;
|
||||
|
||||
// Filter and shuffle submissions - memoized with stable dependency
|
||||
const { templateApps, halloweenApps, featuredApps, approvedApps } = useMemo(() => {
|
||||
const { templateApps, featuredApps, approvedApps } = useMemo(() => {
|
||||
// Filter visible submissions
|
||||
const visibleSubmissions = submissions.filter(app => !app.isHidden);
|
||||
|
||||
@@ -41,23 +43,12 @@ export function AppShowcase() {
|
||||
const templates = shuffleArray(visibleSubmissions.filter(app => app.appTags.includes('Template')));
|
||||
const nonTemplateSubmissions = visibleSubmissions.filter(app => !app.appTags.includes('Template'));
|
||||
|
||||
// Get Halloween Hackathon 2025 apps that are featured (for main showcase)
|
||||
const halloween = shuffleArray(nonTemplateSubmissions.filter(app =>
|
||||
app.appTags.includes('Halloween Hackathon 2025') && app.isFeatured
|
||||
));
|
||||
|
||||
// Filter out Halloween Hackathon 2025 apps from other sections (unless featured, they go in Halloween section)
|
||||
const nonHalloweenSubmissions = nonTemplateSubmissions.filter(app =>
|
||||
!app.appTags.includes('Halloween Hackathon 2025')
|
||||
);
|
||||
|
||||
// Shuffle featured and approved apps for random display order
|
||||
const featured = shuffleArray(nonHalloweenSubmissions.filter(app => app.isFeatured));
|
||||
const approved = shuffleArray(nonHalloweenSubmissions.filter(app => app.isApproved && !app.isFeatured));
|
||||
const featured = shuffleArray(nonTemplateSubmissions.filter(app => app.isFeatured));
|
||||
const approved = shuffleArray(nonTemplateSubmissions.filter(app => app.isApproved && !app.isFeatured));
|
||||
|
||||
return {
|
||||
templateApps: templates,
|
||||
halloweenApps: halloween,
|
||||
featuredApps: featured,
|
||||
approvedApps: approved,
|
||||
};
|
||||
@@ -112,7 +103,7 @@ export function AppShowcase() {
|
||||
<CardContent className="py-12 px-8 text-center">
|
||||
<div className="max-w-sm mx-auto space-y-6">
|
||||
<p className="text-muted-foreground">
|
||||
No apps found. Try another relay?
|
||||
{t('noAppsFound')}
|
||||
</p>
|
||||
<RelaySelector className="w-full" />
|
||||
</div>
|
||||
@@ -134,8 +125,8 @@ export function AppShowcase() {
|
||||
<span className="text-sm">⭐</span>
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="text-xl font-bold text-foreground">Featured Apps</h3>
|
||||
<p className="text-sm text-muted-foreground">Handpicked applications showcasing the best of our community</p>
|
||||
<h3 className="text-xl font-bold text-foreground">{t('featuredApps')}</h3>
|
||||
<p className="text-sm text-muted-foreground">{t('featuredAppsDescription')}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
@@ -151,31 +142,6 @@ export function AppShowcase() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Halloween Hackathon 2025 Apps */}
|
||||
{halloweenApps.length > 0 && (
|
||||
<div>
|
||||
<div className="flex items-start gap-3 mb-6">
|
||||
<div className="flex-none w-8 h-8 bg-orange-100 dark:bg-orange-900/30 rounded-lg flex items-center justify-center">
|
||||
<span className="text-sm">🎃</span>
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="text-xl font-bold text-foreground">Halloween Hackathon 2025</h3>
|
||||
<p className="text-sm text-muted-foreground">Featured spooky creations from our Halloween hackathon</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{halloweenApps.slice(0, 6).map((app) => (
|
||||
<AppShowcaseCard
|
||||
key={app.id}
|
||||
app={app}
|
||||
showModerationControls={isModerator}
|
||||
hideApprovalStatus={true}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Templates Section */}
|
||||
{templateApps.length > 0 && (
|
||||
<div>
|
||||
@@ -184,8 +150,8 @@ export function AppShowcase() {
|
||||
<span className="text-sm">📋</span>
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="text-xl font-bold text-foreground">Templates</h3>
|
||||
<p className="text-sm text-muted-foreground">Ready-to-use templates to kickstart your project</p>
|
||||
<h3 className="text-xl font-bold text-foreground">{t('templates')}</h3>
|
||||
<p className="text-sm text-muted-foreground">{t('templatesDescription')}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
@@ -213,10 +179,10 @@ export function AppShowcase() {
|
||||
</div>
|
||||
<div className="text-left">
|
||||
<h3 className="text-xl font-bold text-foreground">
|
||||
More Apps ({approvedApps.length})
|
||||
{t('moreAppsCount', { count: approvedApps.length })}
|
||||
</h3>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{showAllApps ? 'Click to collapse' : 'Click to view more community apps'}
|
||||
{showAllApps ? t('clickToCollapse') : t('clickToViewMore')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -348,6 +348,17 @@ const resources = {
|
||||
repositoryNotFound: 'Repository not found. Please check the URL and try again.',
|
||||
accessDenied: 'Access denied. The repository may be private or require authentication.',
|
||||
networkError: 'Network error. Please check your connection and try again.',
|
||||
|
||||
// App Showcase
|
||||
featuredApps: 'Featured Apps',
|
||||
featuredAppsDescription: 'Handpicked applications showcasing the best of our community',
|
||||
templates: 'Templates',
|
||||
templatesDescription: 'Ready-to-use templates to kickstart your project',
|
||||
moreApps: 'More Apps',
|
||||
moreAppsCount: 'More Apps ({{count}})',
|
||||
clickToCollapse: 'Click to collapse',
|
||||
clickToViewMore: 'Click to view more community apps',
|
||||
noAppsFound: 'No apps found. Try another relay?',
|
||||
}
|
||||
},
|
||||
pt: {
|
||||
@@ -693,6 +704,17 @@ const resources = {
|
||||
repositoryNotFound: 'Repositório não encontrado. Verifique a URL e tente novamente.',
|
||||
accessDenied: 'Acesso negado. O repositório pode ser privado ou requer autenticação.',
|
||||
networkError: 'Erro de rede. Verifique sua conexão e tente novamente.',
|
||||
|
||||
// App Showcase
|
||||
featuredApps: 'Aplicativos em Destaque',
|
||||
featuredAppsDescription: 'Aplicações selecionadas mostrando o melhor da nossa comunidade',
|
||||
templates: 'Modelos',
|
||||
templatesDescription: 'Modelos prontos para usar para iniciar seu projeto',
|
||||
moreApps: 'Mais Aplicativos',
|
||||
moreAppsCount: 'Mais Aplicativos ({{count}})',
|
||||
clickToCollapse: 'Clique para recolher',
|
||||
clickToViewMore: 'Clique para ver mais aplicativos da comunidade',
|
||||
noAppsFound: 'Nenhum aplicativo encontrado. Tentar outro relay?',
|
||||
}
|
||||
},
|
||||
zh: {
|
||||
@@ -1038,6 +1060,17 @@ const resources = {
|
||||
repositoryNotFound: '未找到仓库。请检查URL并重试。',
|
||||
accessDenied: '访问被拒绝。仓库可能是私有的或需要身份验证。',
|
||||
networkError: '网络错误。请检查您的连接并重试。',
|
||||
|
||||
// App Showcase
|
||||
featuredApps: '精选应用',
|
||||
featuredAppsDescription: '精选应用展示我们社区的最佳作品',
|
||||
templates: '模板',
|
||||
templatesDescription: '即用型模板助您快速启动项目',
|
||||
moreApps: '更多应用',
|
||||
moreAppsCount: '更多应用 ({{count}})',
|
||||
clickToCollapse: '点击折叠',
|
||||
clickToViewMore: '点击查看更多社区应用',
|
||||
noAppsFound: '未找到应用。尝试另一个中继?',
|
||||
}
|
||||
},
|
||||
ha: {
|
||||
@@ -1373,6 +1406,17 @@ const resources = {
|
||||
repositoryNotFound: 'Ba a sami repository ba. Da fatan za a duba URL kuma a sake gwadawa.',
|
||||
accessDenied: 'An hana shiga. Repository na iya zama na sirri ko yana buƙatar tabbatarwa.',
|
||||
networkError: 'Kuskuren hanyar sadarwa. Da fatan za a duba haɗinku kuma a sake gwadawa.',
|
||||
|
||||
// App Showcase
|
||||
featuredApps: 'Aikace-aikacen da aka Zaɓa',
|
||||
featuredAppsDescription: 'Aikace-aikacen da aka zaɓa suna nuna mafi kyawun al\'ummarmu',
|
||||
templates: 'Samfura',
|
||||
templatesDescription: 'Samfura masu shirye-shirye don fara aikinku',
|
||||
moreApps: 'Ƙarin Aikace-aikace',
|
||||
moreAppsCount: 'Ƙarin Aikace-aikace ({{count}})',
|
||||
clickToCollapse: 'Danna don rufe',
|
||||
clickToViewMore: 'Danna don ganin ƙarin aikace-aikacen al\'umma',
|
||||
noAppsFound: 'Ba a sami aikace-aikace ba. Gwada wani relay?',
|
||||
}
|
||||
},
|
||||
yo: {
|
||||
@@ -1703,6 +1747,17 @@ const resources = {
|
||||
repositoryNotFound: 'Repository ko ri. Jọwọ ṣayẹwo URL ati gbiyanju lẹẹkansi.',
|
||||
accessDenied: 'Wiwọle ni idinamọ. Repository le jẹ ikọkọ tabi nilo ijẹrisi.',
|
||||
networkError: 'Aṣiṣe nẹtiwọọki. Jọwọ ṣayẹwo asopọ rẹ ati gbiyanju lẹẹkansi.',
|
||||
|
||||
// App Showcase
|
||||
featuredApps: 'Awọn Ohun elo Ti a Yan',
|
||||
featuredAppsDescription: 'Awọn ohun elo ti a yan n ṣafihan ti o dara julọ ti agbegbe wa',
|
||||
templates: 'Awọn Awoṣe',
|
||||
templatesDescription: 'Awọn awoṣe ti o ṣetan lati lo lati bẹrẹ iṣẹ akanṣe rẹ',
|
||||
moreApps: 'Awọn Ohun elo Diẹ Sii',
|
||||
moreAppsCount: 'Awọn Ohun elo Diẹ Sii ({{count}})',
|
||||
clickToCollapse: 'Tẹ lati subu',
|
||||
clickToViewMore: 'Tẹ lati wo awọn ohun elo agbegbe diẹ sii',
|
||||
noAppsFound: 'Ko si awọn ohun elo ti a ri. Gbiyanju relay miiran?',
|
||||
}
|
||||
},
|
||||
ig: {
|
||||
@@ -2033,6 +2088,17 @@ const resources = {
|
||||
repositoryNotFound: 'Ahụghị repository. Biko lelee URL wee nwaa ọzọ.',
|
||||
accessDenied: 'Ajụrụ ohere. Repository nwere ike bụrụ nke nzuzo ma ọ bụ chọrọ nkwenye.',
|
||||
networkError: 'Njehie netwọk. Biko lelee njikọ gị wee nwaa ọzọ.',
|
||||
|
||||
// App Showcase
|
||||
featuredApps: 'Ngwa Ahọpụtara',
|
||||
featuredAppsDescription: 'Ngwa ahọpụtara na-egosi nke kacha mma nke obodo anyị',
|
||||
templates: 'Ụdịdị',
|
||||
templatesDescription: 'Ụdịdị dị njikere iji jiri malite ọrụ gị',
|
||||
moreApps: 'Ngwa Ndị Ọzọ',
|
||||
moreAppsCount: 'Ngwa Ndị Ọzọ ({{count}})',
|
||||
clickToCollapse: 'Pịa iji gbakọọ',
|
||||
clickToViewMore: 'Pịa iji hụ ngwa obodo ndị ọzọ',
|
||||
noAppsFound: 'Ahụghị ngwa ọ bụla. Nwaa relay ọzọ?',
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user