Repository navigation
Expand file tree
/
Copy pathi18n.js
More file actions
137 lines (119 loc) · 5.89 KB
/
Copy pathi18n.js
File metadata and controls
137 lines (119 loc) · 5.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
const translations = {
en: {
// Hero
"hero.cta": "Get Started on Google Play",
"hero.learn": "Learn More",
"hero.headline": "We don't plan dates.<br>We build <em>memories.</em>",
"hero.sub": "Plan, live, and relive the moments that make your relationship special — all in one place.",
// Features
"features.title": "Everything your relationship deserves.",
// Advantages
"adv.title": "Focused on your relationship,<br>not just features.",
// FAQ
"faq.title": "Frequently asked<br>questions.",
// Open source
"hero.oss.badge": "Open source project",
"hero.oss.cta": "Open source on GitHub",
"oss.eyebrow": "Open source",
"oss.title": "A couples app<br>with open code.",
"oss.lead": "Your moments are intimate, so you shouldn't have to take our word for it. DatePlan is built in the open: anyone can read, audit, and follow how the app and the server work.",
"oss.tag.open": "Open source",
"oss.tag.source": "Source available",
"oss.app.desc": "The Android app, built with Kotlin Multiplatform and Compose Multiplatform.",
"oss.api.desc": "The Spring Boot server, with PostgreSQL and Redis. See how your data is handled.",
"oss.web.desc": "This website. PolyForm Noncommercial license: noncommercial use allowed.",
"oss.point1": "🔍 Transparency: check what the app does with your data",
"oss.point2": "🤝 Contribute: issues, fixes, and translations are welcome",
"oss.point3": "🛠️ Learn: a real-world Kotlin Multiplatform and Spring Boot project",
"oss.cta": "View on GitHub",
"oss.contribute": "How to contribute",
"footer.oss": "Open Source",
// Footer
"footer.copy": "© 2025 DatePlan · Planning moments together 💕 · Made with ❤️",
"footer.download": "Download",
"footer.features": "Features",
"footer.faq": "FAQ",
"footer.privacy": "Privacy Policy",
"footer.terms": "Terms of Use",
"footer.bug": "Report Bug",
"footer.feedback": "Feedback",
},
pt: {
// Hero
"hero.cta": "Baixar no Google Play",
"hero.learn": "Saiba Mais",
"hero.headline": "Não planejamos encontros.<br>Construímos <em>memórias.</em>",
"hero.sub": "Planeje, viva e reviva os momentos que tornam seu relacionamento especial — tudo em um só lugar.",
// Features
"features.title": "Tudo que o seu relacionamento merece.",
// Advantages
"adv.title": "Focado no seu relacionamento,<br>não apenas em recursos.",
// FAQ
"faq.title": "Perguntas<br>frequentes.",
// Open source
"hero.oss.badge": "Projeto open source",
"hero.oss.cta": "Open source no GitHub",
"oss.eyebrow": "Open source",
"oss.title": "Um app para casais<br>com o código aberto.",
"oss.lead": "Seus momentos são íntimos, então você não precisa confiar apenas na nossa palavra. O DatePlan é construído em público: qualquer pessoa pode ler, auditar e acompanhar como o app e o servidor funcionam.",
"oss.tag.open": "Código aberto",
"oss.tag.source": "Código disponível",
"oss.app.desc": "O app Android, feito com Kotlin Multiplatform e Compose Multiplatform.",
"oss.api.desc": "O servidor em Spring Boot, com PostgreSQL e Redis. Veja como seus dados são tratados.",
"oss.web.desc": "Este site. Licença PolyForm Noncommercial: uso não comercial permitido.",
"oss.point1": "🔍 Transparência: confira o que o app faz com seus dados",
"oss.point2": "🤝 Contribua: issues, correções e traduções são bem-vindas",
"oss.point3": "🛠️ Aprenda: um projeto real em Kotlin Multiplatform e Spring Boot",
"oss.cta": "Ver no GitHub",
"oss.contribute": "Como contribuir",
"footer.oss": "Open Source",
// Footer
"footer.copy": "© 2025 DatePlan · Planejando momentos juntos 💕 · Feito com ❤️",
"footer.download": "Baixar",
"footer.features": "Recursos",
"footer.faq": "FAQ",
"footer.privacy": "Política de Privacidade",
"footer.terms": "Termos de Uso",
"footer.bug": "Reportar Bug",
"footer.feedback": "Sugestões",
}
};
const pageMeta = {
pt: {
title: "DatePlan - App para Casais | Planeje Momentos Especiais a Dois",
description: "DatePlan é o app para casais organizarem compromissos, datas especiais e memórias juntos. Calendário compartilhado, lembretes automáticos e privacidade total. Grátis no Google Play."
},
en: {
title: "DatePlan - Couples App | Plan Special Moments Together",
description: "DatePlan is the app for couples to organize commitments, special dates, and memories together. Shared calendar, automatic reminders, and full privacy. Free on Google Play."
}
};
function setLanguage(lang) {
document.querySelectorAll('[data-i18n]').forEach(el => {
const key = el.getAttribute('data-i18n');
if (translations[lang]?.[key]) {
el.innerHTML = translations[lang][key];
}
});
// Re-render dynamic sections (features, advantages, FAQ) in the new language
if (typeof renderDynamicContent === 'function') {
renderDynamicContent(lang);
}
// Update active state on lang buttons
document.querySelectorAll('.lang-btn').forEach(btn => {
btn.classList.toggle('active', btn.getAttribute('data-lang') === lang);
});
// Update title and meta description for SEO consistency
if (pageMeta[lang]) {
document.title = pageMeta[lang].title;
const metaDesc = document.querySelector('meta[name="description"]');
if (metaDesc) metaDesc.setAttribute('content', pageMeta[lang].description);
}
localStorage.setItem('lang', lang);
document.documentElement.setAttribute('lang', lang === 'pt' ? 'pt-BR' : 'en');
}
function initLanguage() {
const saved = localStorage.getItem('lang');
const browser = navigator.language.startsWith('pt') ? 'pt' : 'en';
setLanguage(saved || browser);
}