fix(strommix): full i18n + drop hardcoded grid constraints
Two issues from the audit: 1. Hardcoded `lg:col-span-8 lg:col-start-3` collided with the layout coming from `getBlockLayoutClasses(block.layout)`. Tailwind picked `lg:col-start-3` from the hardcoded class (no opposing `lg:col-start-1` in the layout output) so the widget started at column 3 with span 12 → overflowed past the 12-col grid on desktop, looking like it was "hanging right". Drop the hardcoded constraints; the layout config from the CMS controls width (mobile/tablet/desktop = 12 by default = full width). 2. Roughly 25 German strings were inline. Extracted them to translation keys (T.strommix_*, registered in translations.ts) and read via `useTranslate()` like ImageGalleryBlock / PostOverviewBlock / YoutubeVideoBlock. Includes field labels for the breakdown disclosure, source attribution variants, status bucket markers, error / loading / fallback messages, and the conventional formula text shown under the "Konventionell jetzt" number. Default DE strings live in cms_content/windwiderstand/translation_bundle/ app.json5 (separate CMS push).
This commit is contained in:
@@ -168,6 +168,42 @@ const TRANSLATION_KEYS = [
|
||||
"post_action_copied",
|
||||
"post_action_print",
|
||||
"post_action_reading_time",
|
||||
// Strommix-Live-Widget (StrommixBlock.svelte).
|
||||
"strommix_header",
|
||||
"strommix_stand", // {{time}}
|
||||
"strommix_load_error", // {{error}}
|
||||
"strommix_loading",
|
||||
"strommix_wind_solar_share",
|
||||
"strommix_load_missing",
|
||||
"strommix_conventional_now",
|
||||
"strommix_conventional_formula",
|
||||
"strommix_saldo",
|
||||
"strommix_import",
|
||||
"strommix_export",
|
||||
"strommix_delayed",
|
||||
"strommix_price_de", // {{price}}
|
||||
"strommix_price_fr_inline", // {{price}}
|
||||
"strommix_slot", // {{time}}
|
||||
"strommix_negative_price",
|
||||
"strommix_check_values",
|
||||
"strommix_field_wind_onshore",
|
||||
"strommix_field_wind_offshore",
|
||||
"strommix_field_solar",
|
||||
"strommix_field_lignite",
|
||||
"strommix_field_hard_coal",
|
||||
"strommix_field_gas",
|
||||
"strommix_field_nuclear",
|
||||
"strommix_field_biomass",
|
||||
"strommix_field_hydro",
|
||||
"strommix_field_load",
|
||||
"strommix_source",
|
||||
"strommix_source_smard",
|
||||
"strommix_source_hybrid",
|
||||
"strommix_source_energy_charts",
|
||||
"strommix_source_resolution", // {{time}}
|
||||
"strommix_conventional_explanation",
|
||||
"strommix_stored_data",
|
||||
"strommix_how_calculated",
|
||||
] as const;
|
||||
|
||||
export type TranslationKey = (typeof TRANSLATION_KEYS)[number];
|
||||
|
||||
Reference in New Issue
Block a user