feat(translations): Add NFS support#3688
Conversation
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
066309f to
85c0a0b
Compare
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
85c0a0b to
7d0841a
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3688 +/- ##
==========================================
- Coverage 54.28% 54.25% -0.03%
==========================================
Files 2347 2349 +2
Lines 89650 89698 +48
Branches 25062 25078 +16
==========================================
Hits 48666 48666
- Misses 40724 40769 +45
- Partials 260 263 +3
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
3c9c385 to
ec24500
Compare
ec24500 to
6822f69
Compare
|



🚀 feat(translations): Add NFS (New Frontend System) support
Jira: https://redhat.atlassian.net/browse/RHIDP-14176
📋 Summary
This PR adds full New Frontend System (NFS) support to the
@red-hat-developer-hub/backstage-plugin-translationsand@red-hat-developer-hub/backstage-plugin-translations-testplugins, while preserving backward compatibilitywith the Old Frontend System (OFS) via
./legacyexports.RHDH (OFS)
Screen.Recording.2026-07-06.at.2.20.26.PM.mov
RHDH-LOCAL (NFS)
Screen.Recording.2026-07-06.at.2.24.38.PM.mov
✨ What's New
🏗️ NFS Plugin Architecture
createFrontendPlugin— Translations plugin now exports a default NFS plugin withPageBlueprintandTranslationBlueprintextensionstranslationsApiModule— Replaces the built-inTranslationApiwith a customI18nextTranslationApithat exposes
getI18nInstance(), required for the debug page and pseudo-localizationtranslationsPseudoLocalizationModule— Standalone module for OFS/dynamic plugin pseudo-localization viaAppRootWrapperBlueprinttranslationsTestPlugin— NFS version of the test plugin with its ownPageBlueprintandTranslationBlueprint🌍 Self-Contained Translation Refs
translationsPluginTranslationRefandtranslationsTestTranslationRefnow include inlinetranslationsconfig
#registerDefaults()— nolonger dependent onTranslationBlueprintcollection, which resolves issues caused by duplicate@backstage/plugin-app-reactinstances (v0.2.1 vs v0.2.4)
📦 Dynamic Plugin Support (OFS)
app-config.dynamic.yamlwithdynamicRoutes,mountPoints, andtranslationResourcesconfig.d.tstofilesarray so the config schema is included in the published packageapp-config.dynamic.yamltofilesarrayPluginRoot(NFS),Alpha,Legacy(OFS),TranslationsApiModule,TranslationsPseudoLocalizationModule🔄 API Graduation
translationsPluginTranslationRefpromoted from@alpha→@publictranslationsPluginTranslationspromoted from@alpha→@publicalpha.tsexport path deprecated in favor of root import🗑️ Removed (Legacy App Scaffolding)
Removed unnecessary legacy app boilerplate that the NFS framework handles automatically:
public/— favicons, manifest, index.html, robots.txtRoot/,EntityPage.tsx,SearchPage.tsx,apis.tsApp.test.tsx,e2e-tests/,setupTests.ts.eslintrc.js,.eslintignore,knip-report.md🔧 Key Changes
packages/app/src/App.tsxcreateApp({ features: [...] }).packages/app/src/index.tsxApp.createRoot()instead of manually rendering with ReactDOM.packages/app/package.json@backstage/frontend-defaultsand@backstage/frontend-plugin-api.plugins/translations/src/index.tsxPageBlueprint,ApiBlueprint, andTranslationBlueprint.plugins/translations/src/legacy.tsplugins/translations/package.jsonexportsmap,scalprumconfiguration, and NFS dependencies.plugins/translations-test/src/index.tsxPageBlueprintandTranslationBlueprint.plugins/translations/app-config.dynamic.yaml*/translations/ref.tstranslationsdirectly intocreateTranslationReffor self-contained language loading.components/LoadedTranslationsTable.tsxgetI18nInstance()is unavailable.components/PseudoLocalizationProvider.tsxgetI18nInstance()is unavailable.app-config.yaml🔌 RHDH Dynamic Plugin Config
For OFS deployment in RHDH, add to
app-config.yaml:▎⚠️ Important: module: Legacy is required because PluginRoot now points to the NFS entry. Without it, scalprum
▎ will try to load OFS components from the NFS module and fail silently.
🧪 Test Plan
| 🧪 Tests |
App.test.tsx,e2e-tests/,setupTests.ts|| 🔧 Config |
.eslintrc.js,.eslintignore,knip-report.md|Checklist