Repository navigation
Translate CO2e share image footnote - #939
Merged
Merged
Conversation
The footnote was baked into the background PNGs in English. It is now painted over and redrawn from the share_modal_footnote string (en, fr, fr-BE) in the current locale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cover Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ion test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preview: https://restarters-pr-939.fly.dev✅ Ready - restore and migrations succeeded.
|
Contributor
|
@edwh Looks great in English and French! However I see in other languages (perhaps if the translation key doesn't exist?) then it just shows the translation key name. e.g. in Italian:
It also always say 'generated by restarters.net' in English, regardless of language. That's less of an issue though. |
The Vue translator only fell back to English when the whole locale was missing. A key missing from an existing locale (e.g. a new string in Italian) came back as the key name, which is what showed on the share image. It now falls back per key, the same as Laravel's fallback_locale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The line is baked into every ImpactRange image, range 6 included, in English. Cover it and draw it in the user's language, the same way as the footnote. restarters.net is passed in as :site so it is never translated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
95b4636 stopped using partials.emissions_equivalent_consume_{low,high}_explanation, so translations:check failed on them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This reverts commit 6a6061a.
Develop shows them again (4b0c3da), in the info popover beside the CO2e comparison. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Contributor
|
Great, looks good to me. The 'generated by' is now translatable, and the text falls back to English if no translation exists. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




The CO2e equivalence share image is now in the current user's language: the footnote and the "generated by restarters.net" line, in en, fr and fr-BE. Other languages show English instead of translation key names.
lang-utils.js) now falls back to English for any key a locale doesn't have, the same as Laravel'sfallback_locale. Before, it only fell back when the whole locale was missing, so Italian (and every other locale without the new strings) showed the key name. This applies across the app, not just the share image.partials.share_modal_footnote(urban trees), range 5 (hectares) usespartials.share_modal_footnote_hectares(broadleaf seedlings). Range 6 images have no footnote.partials.share_modal_generated_by("généré par :site" in French).restarters.netis passed in as:site, so it is never translated. Centred below the footnote on square images, bottom right on landscape ones.resources/js/misc, where the footnote keys are used, and ignores*.test.jsfiles. Strings it found unused are removed: the two group search placeholders, andpartials.emissions_equivalent_consume_{low,high}_explanation(no longer used since 95b4636).Screenshots
Close-up of the bottom strip, square (Instagram) and landscape (Facebook), in English, French and Italian:
Fixes #936