Skip to content

feat: add translations:pull support#11

Merged
arbrandes merged 1 commit into
openedx:mainfrom
arbrandes:translations-pull
Apr 9, 2026
Merged

feat: add translations:pull support#11
arbrandes merged 1 commit into
openedx:mainfrom
arbrandes:translations-pull

Conversation

@arbrandes
Copy link
Copy Markdown
Contributor

Description

Adds the translations:pull npm script and corresponding Makefile target (pull_translations) so that translated message files can be fetched via openedx translations:pull. Configures atlasTranslations in package.json with the authn and learner-dashboard dependencies.

Also adds the src/i18n/index.js re-export module and a placeholder src/i18n/messages.ts (force-added despite being gitignored) so the build doesn't break before translations are pulled. Updates .gitignore with the standard i18n generated file patterns.

LLM usage notice

Built with assistance from Claude.

@arbrandes arbrandes linked an issue Apr 9, 2026 that may be closed by this pull request
@arbrandes arbrandes force-pushed the translations-pull branch from 9b6ee2c to d11d00a Compare April 9, 2026 12:25
@brian-smith-tcril
Copy link
Copy Markdown
Contributor

I'm working on the authn and learner-dashboard PRs right now. Those will need to land first so we have versions of authn and learner-dashboard that include atlasTranslations in their package.jsons.

Comment thread Makefile Outdated
npm run dev

pull_translations:
npm run translations:pull
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
npm run translations:pull
npm run translations:pull -- --atlas-options="$(ATLAS_OPTIONS)"

Noticed this was missing from the migration guide when I was updating the authn and learner-dashboard PRs. Make a PR to update the guide openedx/frontend-base#217.

@arbrandes arbrandes force-pushed the translations-pull branch from d11d00a to 9b2ecbc Compare April 9, 2026 13:11
Comment thread src/i18n/messages.ts Outdated
@@ -0,0 +1 @@
export default [];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This shouldn't be checked in, we should instead have the messages.d.ts from the migration guide

import type { SiteMessages } from '@openedx/frontend-base';

declare const messages: SiteMessages;
export default messages;

Comment thread README.rst Outdated
Comment on lines +149 to +151
If translations have not been pulled, the build still succeeds thanks to a
placeholder ``src/i18n/messages.ts`` that exports an empty array. The site will
simply fall back to the default English strings baked into each component.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With the fallback plugin "placeholder" isn't fully correct here.

@brian-smith-tcril
Copy link
Copy Markdown
Contributor

We probably want to regenerate the lockfile to ensure npm ci pulls in versions of authn and learner-dashboard that include atlasTranaslations blocks in their package.jsons.

@arbrandes arbrandes force-pushed the translations-pull branch from 9b2ecbc to d011aa1 Compare April 9, 2026 13:31
Co-Authored-By: Claude <noreply@anthropic.com>
@arbrandes arbrandes force-pushed the translations-pull branch from d011aa1 to 76c1f6e Compare April 9, 2026 13:57
Copy link
Copy Markdown
Contributor

@brian-smith-tcril brian-smith-tcril left a comment

Choose a reason for hiding this comment

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

Thanks for doing this one and finding the issues that led to

LGTM!

@arbrandes arbrandes merged commit 220441e into openedx:main Apr 9, 2026
2 checks passed
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.

i18n pipeline

2 participants