Skip to content

Show banner translation feature#1530

Open
kramosss wants to merge 2 commits into
processing:mainfrom
kramosss:show-banner-translation-feature
Open

Show banner translation feature#1530
kramosss wants to merge 2 commits into
processing:mainfrom
kramosss:show-banner-translation-feature

Conversation

@kramosss

Copy link
Copy Markdown

Addresses Issue #1329

Summary

Non-English tutorial pages don't currently warn readers when their translation is out of date compared to the English version. This PR adds an outdated translation banner that appears on tutorial pages when the translation is known to be outdated.

Changes

  • src/components/OutdatedTranslationBanner/index.astro - New banner component with localized copy for es, hi, ko, and zh-Hans. Links to the English page and to the contributing guide.
  • src/utils/translationBanner.ts - Utility that reads a JSON manifest (public/translation-status/tutorials.json) to determine if a given tutorial is outdated or missing.
  • src/layouts/TutorialLayout.astro - Integrates the banner check and conditionally renders the banner above tutorial content.
  • .github/workflows/translation-sync.yml - New GitHub Actions workflow that runs the translation tracker when English tutorial content changes on main, and commits an updated status manifest.
  • public/translation-status/tutorials.json - Initial mainfest marking the variables-and-change tutorial as outdated for hi.

@kramosss
kramosss marked this pull request as ready for review July 24, 2026 19:58
Copilot AI review requested due to automatic review settings July 24, 2026 19:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an “outdated translation” warning banner for non-English tutorial pages by consulting a generated translation-status manifest, and introduces automation to keep that manifest up to date when English tutorials change.

Changes:

  • Added checkTranslationBanner() utility that reads public/translation-status/<contentType>.json and determines whether to show an outdated/missing banner for a locale.
  • Integrated the banner into TutorialLayout.astro so it renders above tutorial content when indicated.
  • Introduced an initial translation-status manifest and a GitHub Actions workflow intended to update it automatically.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/utils/translationBanner.ts New server-side utility that computes the English URL and checks a cached manifest for outdated/missing translations.
src/layouts/TutorialLayout.astro Calls the banner check during render and conditionally shows the banner.
src/components/OutdatedTranslationBanner/index.astro New banner UI component with localized copy and links to the English page and contribution guide.
public/translation-status/tutorials.json Initial manifest data for tutorial translation status.
.github/workflows/translation-sync.yml New workflow intended to run a translation tracker and commit updated manifest data.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +24 to +25
const englishPath = currentPathname.replace(`${currentLocale}/`, '/');
const englishUrl = `${origin}${englishPath}`;
Comment on lines +31 to +34
- name: Run translation tracker
uses: ./.github/actions/translation-tracker
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add public/translation/status/
Comment on lines +3 to +12
on:
push:
branches: [main]
paths:
- 'src/content/tutorials/en/**'
pull_request:
branches: [main]
paths:
- 'src/content/tutorials/en/**'
workflow_dispatch:
@ksen0

ksen0 commented Jul 24, 2026

Copy link
Copy Markdown
Member

Hi @kramosss , sorry I missed your comment on the issue - please feel free to @ me on the #codeday channel in Discord! Plase do review the linked issue #1000 in the original description; a lot of this was adde on v1 branch, but needs to be reinstated and added to v2. Please resue as much as possible of the existing work. You can also check ongoing work in this are here: #1404

Eg, I have no had time to review this closely, but here is the banner component already introduced that should also be used, unless you find a bug with it: https://github.com/processing/p5.js-website/blob/v1/src/components/OutdatedTranslationBanner/index.astro

Thanks for your work on this!

(Lastly: since I see the copilot reviews I'd also like to draw your attention to the ai usage policy, FYI.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants