From b659a8eb1472d74aee6f9b1445c163e597b85615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Montan=C3=A9?= Date: Sun, 16 Aug 2026 09:53:37 +0200 Subject: [PATCH 1/3] Add Catalan translation --- src/lib/i18n.tsx | 67 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/src/lib/i18n.tsx b/src/lib/i18n.tsx index 5b4e129..defcaa0 100644 --- a/src/lib/i18n.tsx +++ b/src/lib/i18n.tsx @@ -2,7 +2,7 @@ import { createContext, useCallback, useContext, useEffect, useState, type ReactNode } from "react"; -export type Locale = "es" | "en" | "fr" | "de" | "it" | "pt" | "pl" | "cs" | "hu" | "bg" | "sk" | "da" | "sv" | "no" | "sr" | "fi"; +export type Locale = "es" | "en" | "fr" | "de" | "it" | "pt" | "pl" | "cs" | "hu" | "bg" | "sk" | "da" | "sv" | "no" | "sr" | "fi" | "ca"; export const LOCALES: { code: Locale; label: string; flag: string }[] = [ { code: "es", label: "Español", flag: "ES" }, @@ -21,6 +21,7 @@ export const LOCALES: { code: Locale; label: string; flag: string }[] = [ { code: "no", label: "Norsk", flag: "NO" }, { code: "sr", label: "Srpski", flag: "RS" }, { code: "fi", label: "Suomi", flag: "FI" }, + { code: "ca", label: "Suomi", flag: "EU" }, ]; // --------------------------------------------------------------------------- @@ -1052,6 +1053,70 @@ const translations: Record> = { "stats.prices": "hintaa", "stats.lastUpdate": "Viimeisin päivitys", }, + ca: { + "search.placeholder": "Cerca un lloc...", + "search.destination": "Destinació", + "search.origin": "Origen", + "search.whereTo": "On aneu?", + "sheet.routeAndStations": "Ruta i estacions", + "sheet.resize": "Canvia la mida del panell", + "search.addWaypoint": "Afegeix una parada", + "search.waypoint": "Parada intermèdia", + "search.swap": "Intercanvia origen i destinació", + "route.distance": "km", + "route.duration": "min", + "route.loading": "S'està calculant la ruta...", + "route.alternatives": "Rutes alternatives", + "route.error": "S'ha produït un error en calcular la ruta", + "route.noRoute": "No s'ha trobat cap ruta", + "stations.noStations": "No hi ha estacions en aquest tram", + "stations.loadError": "S'ha produït un error en carregar les estacions", + "search.noResults": "No hi ha resultats", + "stations.title": "Estacions en ruta", + "stations.empty": "No hi ha estacions amb aquest filtre", + "stations.detourBasis": "Base del desviament", + "stations.basisRoute": "Aquesta ruta", + "stations.basisAny": "Qualsevol", + "stations.detourMax": "Desvíament màxim", + "stations.corridor": "Radi de cerca", + "stations.noLimit": "Sense límit", + "stations.cheapest": "MÉS BARATA", + "stations.leastDetour": "MENYS DESVIAMENT", + "stations.balanced": "EQUILIBRADA", + "stations.avg": "Mitjana:", + "stations.sortPrice": "Preu", + "stations.sortDetour": "Desviament", + "stations.sortKm": "km ruta", + "stations.loading": "S'estan cercant estacions...", + "stations.maxStops": "S'ha arribat al màximo d'aturades", + "fuel.diesel": "Dièsel", + "fuel.gasoline": "Gasolina", + "fuel.gas": "Gas", + "fuel.hydrogen": "Hidrògen", + "fuel.electric": "Elèctric", + "fuel.other": "Altres", + "geo.myLocation": "La meva ubicació", + "geo.center": "Centra en la meva ubicació", + "geo.denied": "S'ha denegat la ubicació denegada", + "filter.maxPrice": "Preu máx.", + "filter.clear": "Neteja", + "popup.updatedNow": "Actualitzat ara", + "popup.updated": "Fa", + "popup.noPrice": "Sense preu per a", + "popup.navigate": "Com arribar-hi", + "popup.showOnMap": "Mostra-ho en el mapa", + "popup.share": "Comparteix", + "popup.copied": "S'ha copiat!", + "popup.copyLink": "Copia l'enllaç", + "share.point": "Punt compartit", + "share.routeTitle": "Ruta en Pumperly", + "share.shareRoute": "Comparteix la ruta", + "share.copied": "S'ha copiat!", + "stats.title": "Estadístiques", + "stats.stations": "estacions", + "stats.prices": "preus", + "stats.lastUpdate": "Última actualització", + }, }; // --------------------------------------------------------------------------- From cf79b01ec736866091a772e4ea74f55edbd15c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Montan=C3=A9?= Date: Sun, 16 Aug 2026 12:33:27 +0200 Subject: [PATCH 2/3] Fix typos --- src/lib/i18n.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/i18n.tsx b/src/lib/i18n.tsx index defcaa0..5f2f03b 100644 --- a/src/lib/i18n.tsx +++ b/src/lib/i18n.tsx @@ -21,7 +21,7 @@ export const LOCALES: { code: Locale; label: string; flag: string }[] = [ { code: "no", label: "Norsk", flag: "NO" }, { code: "sr", label: "Srpski", flag: "RS" }, { code: "fi", label: "Suomi", flag: "FI" }, - { code: "ca", label: "Suomi", flag: "EU" }, + { code: "ca", label: "Català", flag: "EU" }, ]; // --------------------------------------------------------------------------- @@ -1088,7 +1088,7 @@ const translations: Record> = { "stations.sortDetour": "Desviament", "stations.sortKm": "km ruta", "stations.loading": "S'estan cercant estacions...", - "stations.maxStops": "S'ha arribat al màximo d'aturades", + "stations.maxStops": "S'ha arribat al màxim d'aturades", "fuel.diesel": "Dièsel", "fuel.gasoline": "Gasolina", "fuel.gas": "Gas", @@ -1097,7 +1097,7 @@ const translations: Record> = { "fuel.other": "Altres", "geo.myLocation": "La meva ubicació", "geo.center": "Centra en la meva ubicació", - "geo.denied": "S'ha denegat la ubicació denegada", + "geo.denied": "S'ha denegat l'accés a la ubicació", "filter.maxPrice": "Preu máx.", "filter.clear": "Neteja", "popup.updatedNow": "Actualitzat ara", From 250ae1425f541cbab53d03df0c20bd4eef095369 Mon Sep 17 00:00:00 2001 From: GeiserX <9169332+GeiserX@users.noreply.github.com> Date: Sun, 16 Aug 2026 12:59:05 +0200 Subject: [PATCH 3/3] fix(i18n): register Catalan in the routing/OG locale registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Locale union gained "ca" but OG_TRANSLATIONS did not. That map is the source of SUPPORTED_LOCALES, which drives the middleware, sitemap, hreflang alternates and OG images - so /ca would be unroutable, and Record fails the type check, breaking the build. Also fix three spellings (desviament, hidrogen, "màx." with grave accent) and the ca block indentation. --- src/lib/i18n.tsx | 8 ++++---- src/lib/og-translations.ts | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/lib/i18n.tsx b/src/lib/i18n.tsx index 5f2f03b..f65e4d4 100644 --- a/src/lib/i18n.tsx +++ b/src/lib/i18n.tsx @@ -1053,7 +1053,7 @@ const translations: Record> = { "stats.prices": "hintaa", "stats.lastUpdate": "Viimeisin päivitys", }, - ca: { + ca: { "search.placeholder": "Cerca un lloc...", "search.destination": "Destinació", "search.origin": "Origen", @@ -1077,7 +1077,7 @@ const translations: Record> = { "stations.detourBasis": "Base del desviament", "stations.basisRoute": "Aquesta ruta", "stations.basisAny": "Qualsevol", - "stations.detourMax": "Desvíament màxim", + "stations.detourMax": "Desviament màxim", "stations.corridor": "Radi de cerca", "stations.noLimit": "Sense límit", "stations.cheapest": "MÉS BARATA", @@ -1092,13 +1092,13 @@ const translations: Record> = { "fuel.diesel": "Dièsel", "fuel.gasoline": "Gasolina", "fuel.gas": "Gas", - "fuel.hydrogen": "Hidrògen", + "fuel.hydrogen": "Hidrogen", "fuel.electric": "Elèctric", "fuel.other": "Altres", "geo.myLocation": "La meva ubicació", "geo.center": "Centra en la meva ubicació", "geo.denied": "S'ha denegat l'accés a la ubicació", - "filter.maxPrice": "Preu máx.", + "filter.maxPrice": "Preu màx.", "filter.clear": "Neteja", "popup.updatedNow": "Actualitzat ara", "popup.updated": "Fa", diff --git a/src/lib/og-translations.ts b/src/lib/og-translations.ts index 28ea0b5..ce6cb6c 100644 --- a/src/lib/og-translations.ts +++ b/src/lib/og-translations.ts @@ -123,6 +123,13 @@ export const OG_TRANSLATIONS: Record = { imageSubtitle: "Edullisimmat polttoaineet ja EV-lataus reitilläsi", ogLocale: "fi_FI", }, + ca: { + title: "Pumperly - Planificador de Rutes Energètiques", + description: + "Trobeu les benzineres i els punts de càrrega més barats a la vostra ruta. Preus en temps real a 36 països.", + imageSubtitle: "Benzineres i càrrega EV més barates a la vostra ruta", + ogLocale: "ca_ES", + }, }; export const SUPPORTED_LOCALES = Object.keys(OG_TRANSLATIONS) as Locale[];