Skip to content

Commit d46b8c8

Browse files
Copilotneilime
authored andcommitted
feat: improve bilingual French and English content
1 parent fface46 commit d46b8c8

34 files changed

Lines changed: 793 additions & 391 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ define run_linter
5959
-e FILTER_REGEX_INCLUDE="$(filter-out $@,$(MAKECMDGOALS))" \
6060
-e VALIDATE_TYPESCRIPT_PRETTIER=false \
6161
-e VALIDATE_TYPESCRIPT_ES=false \
62-
-e VALIDATE_CSS=false \
62+
-e VALIDATE_CSS=false \
6363
$(1) \
6464
$$LINTER_IMAGE
6565
endef
6666

6767
define docker-compose
68-
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml -f docker-compose.local.yml -f docker-compose.$(1).yml $(2)
68+
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml -f docker-compose.local.yml -f docker-compose.$(1).yml $(2)
6969
endef
7070

7171
define open-in-browser

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,26 @@ Key files:
6868
- `application/src/pages/[lang]/[page].astro` - localized dynamic pages
6969
- `application/src/i18n/routes.ts` - slug mapping and path translation helpers
7070

71-
Translated static pages:
72-
73-
- `about``/fr/a-propos` / `/en/about`
74-
- `contact``/fr/contact` / `/en/contact`
75-
- `sponsoring``/fr/sponsoring` / `/en/sponsoring`
76-
- `brand-guidelines``/fr/charte-graphique` / `/en/brand-guidelines`
77-
- `terms``/fr/conditions-generales-utilisation` / `/en/terms-of-service`
78-
- `privacy``/fr/politique-de-confidentialite` / `/en/privacy-policy`
71+
## Translations
72+
73+
Translations are split by **domain** and **locale** (`en.ts`, `fr.ts`) using nested objects (no dot-string keys in data files).
74+
75+
- Shared UI domains live in `application/src/data/`:
76+
- `navigation/` (header + footer labels)
77+
- `meta/`
78+
- Page-specific content/labels live in `application/src/data/pages/<page>/{en,fr}.ts` and should be consumed only by their related page(s) in `application/src/pages/`.
79+
80+
Runtime behavior:
81+
82+
- Supported languages and default locale are defined in `application/src/i18n/config.ts`.
83+
- Shared translation dictionaries are composed in `application/src/i18n/utils.ts` (`sourceLocales`).
84+
- `useTranslations(lang)` returns a locale object merged with fallback values from the default language (`fr`) when a value is missing or empty.
85+
86+
When adding or changing translations:
87+
88+
1. Put the value in the correct domain (or page file if page-local).
89+
2. Keep `navigation` as the single source of truth for shared navigation/footer labels.
90+
3. Keep `en` and `fr` structures aligned.
7991

8092
## Project structure
8193

application/src/components/common/LanguageAlternates.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { languages, defaultLang } from '~/i18n/ui';
2+
import { languages, defaultLang } from '~/i18n/config';
33
import { translatePathToLang } from '~/i18n/routes';
44
import { findLocalizedBlogPath } from '~/utils/blog';
55

application/src/components/common/LanguageSwitcher.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { languages } from '~/i18n/ui';
2+
import { languages } from '~/i18n/config';
33
import { getLangFromUrl } from '~/i18n/utils';
44
import { translatePathToLang } from '~/i18n/routes';
55
import { findLocalizedBlogPath } from '~/utils/blog';

application/src/data/meta/en.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default {
2+
meta: {
3+
title: {
4+
default: 'Cloud Native Provence',
5+
template: '%s - Cloud Native Provence',
6+
},
7+
description: 'The Cloud Native & Kubernetes day in Aix-en-Provence, organized by the community.',
8+
},
9+
} as const;

application/src/data/meta/fr.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default {
2+
meta: {
3+
title: {
4+
default: 'Cloud Native Provence',
5+
template: '%s - Cloud Native Provence',
6+
},
7+
description: 'La journée Cloud Native & Kubernetes à Aix-en-Provence, organisée par la communauté.',
8+
},
9+
} as const;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export default {
2+
nav: {
3+
event: 'Event',
4+
cfp: 'CFP',
5+
venue: 'Venue',
6+
team: 'Team',
7+
sponsors: 'Sponsors',
8+
tickets: 'Get Tickets',
9+
sponsoring: 'Sponsoring',
10+
about: 'About',
11+
contact: 'Contact',
12+
brandGuidelines: 'Brand Guidelines',
13+
},
14+
footer: {
15+
event: 'Event',
16+
organization: 'Organization',
17+
sponsoring: 'Sponsoring',
18+
program: 'Program',
19+
practicalInfo: 'Practical Information',
20+
about: 'About',
21+
brandGuidelines: 'Brand Guidelines',
22+
contact: 'Contact',
23+
terms: 'Terms of Service',
24+
privacy: 'Privacy Policy',
25+
note: 'Designed by the <a class="text-blue-600 underline dark:text-muted" href="https://cloudnative-provence.fr/">Cloud Native Provence community</a> · All rights reserved.',
26+
logoAlt: 'Cloud Native Provence Logo',
27+
},
28+
} as const;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export default {
2+
nav: {
3+
event: 'Événement',
4+
cfp: 'CFP',
5+
venue: 'Lieu',
6+
team: 'Équipe',
7+
sponsors: 'Sponsors',
8+
tickets: 'Billetterie',
9+
sponsoring: 'Sponsoring',
10+
about: 'À propos',
11+
contact: 'Contact',
12+
brandGuidelines: 'Charte Graphique',
13+
},
14+
footer: {
15+
event: 'Événement',
16+
organization: 'Organisation',
17+
sponsoring: 'Sponsoring',
18+
program: 'Programme',
19+
practicalInfo: 'Infos pratiques',
20+
about: 'À propos',
21+
brandGuidelines: 'Charte Graphique',
22+
contact: 'Contact',
23+
terms: 'Mentions légales',
24+
privacy: 'Politique de confidentialité',
25+
note: 'Conçu par la <a class="text-blue-600 underline dark:text-muted" href="https://cloudnative-provence.fr/">communauté Cloud Native Provence</a> · Tous droits réservés.',
26+
logoAlt: 'Logo Cloud Native Provence',
27+
},
28+
} as const;

application/src/data/pages/brand-guidelines/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const enContent = {
22
metadata: {
3-
title: 'Brand Guidelines Cloud Native Provence',
3+
title: 'Brand Guidelines - Cloud Native Provence',
44
},
55
hero: {
66
tagline: 'Brand Guidelines',

application/src/data/pages/brand-guidelines/fr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const frContent = {
22
metadata: {
3-
title: 'Charte Graphique Cloud Native Provence',
3+
title: 'Charte Graphique - Cloud Native Provence',
44
},
55
hero: {
66
tagline: 'Charte Graphique',

0 commit comments

Comments
 (0)