mirror of
https://github.com/pezkuwichain/pezkuwi-telegram-miniapp.git
synced 2026-06-19 19:11:04 +00:00
feat: add i18n support with 6 languages (en, tr, krd, ar, fa, ckb)
- Add translation system with useTranslation hook and LanguageProvider - Auto-detect language from Telegram user settings - Update all components and sections to use translation keys - Support English, Turkish, Kurdish, Arabic, Persian, Sorani
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { ExternalLink } from 'lucide-react';
|
||||
import { useTelegram } from '@/hooks/useTelegram';
|
||||
import { useTranslation } from '@/i18n';
|
||||
|
||||
interface SocialLink {
|
||||
name: string;
|
||||
url: string;
|
||||
icon: string;
|
||||
color: string;
|
||||
description: string;
|
||||
descriptionKey: string;
|
||||
}
|
||||
|
||||
const SOCIAL_LINKS: SocialLink[] = [
|
||||
@@ -15,61 +16,62 @@ const SOCIAL_LINKS: SocialLink[] = [
|
||||
url: 'https://www.instagram.com/pezkuwichain',
|
||||
icon: '📸',
|
||||
color: 'from-pink-500 to-purple-600',
|
||||
description: 'Wêne û Story',
|
||||
descriptionKey: 'social.instagram',
|
||||
},
|
||||
{
|
||||
name: 'TikTok',
|
||||
url: 'https://www.tiktok.com/@pezkuwi.chain',
|
||||
icon: '🎵',
|
||||
color: 'from-gray-800 to-gray-900',
|
||||
description: 'Vîdyoyên kurt',
|
||||
descriptionKey: 'social.tiktok',
|
||||
},
|
||||
{
|
||||
name: 'Snapchat',
|
||||
url: 'https://www.snapchat.com/add/pezkuwichain',
|
||||
icon: '👻',
|
||||
color: 'from-yellow-400 to-yellow-500',
|
||||
description: 'Snap bike!',
|
||||
descriptionKey: 'social.snapchat',
|
||||
},
|
||||
{
|
||||
name: 'Telegram',
|
||||
url: 'https://t.me/pezkuwichain',
|
||||
icon: '📢',
|
||||
color: 'from-blue-400 to-blue-600',
|
||||
description: 'Kanala fermî',
|
||||
descriptionKey: 'social.telegram',
|
||||
},
|
||||
{
|
||||
name: 'X (Twitter)',
|
||||
url: 'https://x.com/pezkuwichain',
|
||||
icon: '𝕏',
|
||||
color: 'from-gray-700 to-gray-900',
|
||||
description: 'Nûçeyên rojane',
|
||||
descriptionKey: 'social.twitter',
|
||||
},
|
||||
{
|
||||
name: 'YouTube',
|
||||
url: 'https://www.youtube.com/@SatoshiQazi',
|
||||
icon: '▶️',
|
||||
color: 'from-red-500 to-red-700',
|
||||
description: 'Vîdyoyên me',
|
||||
descriptionKey: 'social.youtube',
|
||||
},
|
||||
{
|
||||
name: 'Facebook',
|
||||
url: 'https://www.facebook.com/people/Pezkuwi-Chain/61587122224932/',
|
||||
icon: '📘',
|
||||
color: 'from-blue-600 to-blue-800',
|
||||
description: 'Rûpela fermî',
|
||||
descriptionKey: 'social.facebook',
|
||||
},
|
||||
{
|
||||
name: 'Discord',
|
||||
url: 'https://discord.gg/Y3VyEC6h8W',
|
||||
icon: '💬',
|
||||
color: 'from-indigo-500 to-purple-600',
|
||||
description: 'Civaka me',
|
||||
descriptionKey: 'social.discord',
|
||||
},
|
||||
];
|
||||
|
||||
export function SocialLinks() {
|
||||
const { openLink, hapticImpact } = useTelegram();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleClick = (url: string) => {
|
||||
hapticImpact('light');
|
||||
@@ -80,11 +82,9 @@ export function SocialLinks() {
|
||||
<div className="bg-secondary/30 rounded-xl p-4 border border-border/50">
|
||||
<h3 className="font-medium text-foreground mb-3 flex items-center gap-2">
|
||||
<ExternalLink className="w-4 h-4 text-primary" />
|
||||
Me bişopîne
|
||||
{t('social.followUs')}
|
||||
</h3>
|
||||
<p className="text-sm text-muted-foreground mb-4">
|
||||
Bi me re têkiliyê ragire û nûçeyên herî dawî bistîne!
|
||||
</p>
|
||||
<p className="text-sm text-muted-foreground mb-4">{t('social.stayConnected')}</p>
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
{SOCIAL_LINKS.map((link) => (
|
||||
<button
|
||||
@@ -100,7 +100,7 @@ export function SocialLinks() {
|
||||
<span className="text-2xl">{link.icon}</span>
|
||||
<div className="text-left">
|
||||
<p className="text-sm font-medium text-white">{link.name}</p>
|
||||
<p className="text-xs text-white/70">{link.description}</p>
|
||||
<p className="text-xs text-white/70">{t(link.descriptionKey)}</p>
|
||||
</div>
|
||||
</button>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user