Skip to content

Commit 04d5ac4

Browse files
committed
fix: faq translations
1 parent 6f82ec1 commit 04d5ac4

7 files changed

Lines changed: 18 additions & 32 deletions

File tree

src/components/Notion/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export const getNotionContentProps = unstable_cache(
88
try {
99
const result = await notion.getPage(id)
1010
return result
11-
} catch {
11+
} catch (e) {
12+
console.error('Unable to get content from Notion', e)
1213
return undefined
1314
}
1415
},

src/components/faq/FaqsOverscreen.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,10 @@ import styles from './FAQsList.module.css'
1717

1818
const faqCategoriesOrder: Record<FAQCategory, number> = {
1919
[FAQCategory.QuestionsGenerales]: 1,
20-
[FAQCategory.GeneralQuestions]: 1,
21-
[FAQCategory.PreguntasGenerales]: 1,
2220
[FAQCategory.ComprendreLeCalcul]: 2,
23-
[FAQCategory.AboutTheCalculation]: 2,
24-
[FAQCategory.EntenderElCálculo]: 2,
2521
[FAQCategory.CestÉtonnant]: 3,
26-
[FAQCategory.ItsSurprising]: 3,
27-
[FAQCategory.EsSorprendente]: 3,
2822
[FAQCategory.IdéesPourAgir]: 4,
29-
[FAQCategory.IdeasForAction]: 4,
30-
[FAQCategory.IdeasParaActuar]: 4,
3123
[FAQCategory.ÀProposDesOutils]: 5,
32-
[FAQCategory.AboutTheTools]: 5,
33-
[FAQCategory.AcercaDeLasHerramientas]: 5,
3424
}
3525

3626
const FaqsOverscreen = ({ filter, page, slug }: { filter: string; slug: string } & Omit<FAQSListProps, 'faqs'>) => {
@@ -115,7 +105,7 @@ const FaqsOverscreen = ({ filter, page, slug }: { filter: string; slug: string }
115105
<ul className={styles.categories}>
116106
{faqsByCategory.map(([category, faqs]) => (
117107
<li key={category} className={styles.category}>
118-
<h2 className={styles.categoryTitle}>{category}</h2>
108+
<h2 className={styles.categoryTitle}>{t(category)}</h2>
119109
<ul>
120110
{faqs.map((faq) => (
121111
<FAQ key={faq.title} faq={faq} page={page} loadingText={t('loading')} withAnchor />

src/components/faq/faqsOrder.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,8 @@ import { FAQCategory } from 'types/faq'
22

33
export const faqCategoriesOrder: Record<FAQCategory, number> = {
44
[FAQCategory.QuestionsGenerales]: 2,
5-
[FAQCategory.GeneralQuestions]: 2,
6-
[FAQCategory.PreguntasGenerales]: 2,
75
[FAQCategory.ComprendreLeCalcul]: 3,
8-
[FAQCategory.AboutTheCalculation]: 3,
9-
[FAQCategory.EntenderElCálculo]: 3,
106
[FAQCategory.CestÉtonnant]: 4,
11-
[FAQCategory.ItsSurprising]: 4,
12-
[FAQCategory.EsSorprendente]: 4,
137
[FAQCategory.IdéesPourAgir]: 5,
14-
[FAQCategory.IdeasForAction]: 5,
15-
[FAQCategory.IdeasParaActuar]: 5,
168
[FAQCategory.ÀProposDesOutils]: 1,
17-
[FAQCategory.AboutTheTools]: 1,
18-
[FAQCategory.AcercaDeLasHerramientas]: 1,
199
}

src/providers/locales/en.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
"allFAQs": "All questions",
77
"search": "Search for a topic, a question...",
88
"exemple": "For example:",
9+
"Questions générales": "General Questions",
10+
"Comprendre le calcul": "Understanding the Calculation",
11+
"C'est étonnant !": "It's Amazing!",
12+
"Idées pour agir": "Ideas to Act",
13+
"À propos des outils": "About the Tools",
914
"Transport": {
1015
"exemple-1": "construction",
1116
"exemple-2": "occupancy rate",

src/providers/locales/es.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
"allFAQs": "Todas las preguntas",
77
"search": "Buscar un tema, una pregunta...",
88
"exemple": "Por ejemplo:",
9+
"Questions générales": "Preguntas generales",
10+
"Comprendre le calcul": "Comprender el cálculo",
11+
"C'est étonnant !": "¡Es sorprendente!",
12+
"Idées pour agir": "Ideas para actuar",
13+
"À propos des outils": "Acerca de las herramientas",
914
"Transport": {
1015
"exemple-1": "construcción",
1116
"exemple-2": "índice de ocupación",

src/providers/locales/fr.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
"allFAQs": "Toutes les questions",
77
"search": "Rechercher un sujet, une question...",
88
"exemple": "Par exemple :",
9+
"Questions générales": "Questions générales",
10+
"Comprendre le calcul": "Comprendre le calcul",
11+
"C'est étonnant !": "C'est étonnant !",
12+
"Idées pour agir": "Idées pour agir",
13+
"À propos des outils": "À propos des outils",
914
"Transport": {
1015
"exemple-1": "construction",
1116
"exemple-2": "taux de remplissage",

types/faq.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,10 @@ import type { ExtendedRecordMap } from 'notion-types'
22

33
export enum FAQCategory {
44
QuestionsGenerales = 'Questions générales',
5-
GeneralQuestions = 'General questions',
6-
PreguntasGenerales = 'Preguntas generales',
75
ComprendreLeCalcul = 'Comprendre le calcul',
8-
AboutTheCalculation = 'About the calculation',
9-
EntenderElCálculo = 'Entender el cálculo',
106
CestÉtonnant = "C'est étonnant !",
11-
ItsSurprising = 'It’s surprising',
12-
EsSorprendente = 'Es sorprendente',
137
IdéesPourAgir = 'Idées pour agir',
14-
IdeasForAction = 'Ideas for action',
15-
IdeasParaActuar = 'Ideas para actuar',
168
ÀProposDesOutils = 'À propos des outils',
17-
AboutTheTools = 'About the tools',
18-
AcercaDeLasHerramientas = 'Acerca de las herramientas',
199
}
2010

2111
export type FAQ = {

0 commit comments

Comments
 (0)