-
-
Notifications
You must be signed in to change notification settings - Fork 51
translations
github-actions[bot] edited this page Dec 19, 2025
·
2 revisions
The plugin supports translations. To add a new language, create a new file in packages/app/src/locales with the
language code (e.g. qeta-fi.ts).
Create the translations as described here https://backstage.io/docs/plugins/internationalization/ using the
qetaTranslationRef from @drodil/backstage-plugin-qeta as the translation reference:
// packages/app/src/locales/qeta-fi.ts
import { qetaTranslationRef } from '@drodil/backstage-plugin-qeta';
import { createTranslationMessages } from '@backstage/core-plugin-api/alpha';
const fi = createTranslationMessages({
ref: qetaTranslationRef,
full: false,
translations: {
'answerList.errorLoading': 'Vastauksia ei voitu ladata',
'answerList.noAnswers': 'Ei vastauksia',
},
});
export default fi;Then add the translation to your packages/app/src/App.tsx:
import { createTranslationResource } from '@backstage/core-plugin-api/alpha';
import { qetaTranslationRef } from '@drodil/backstage-plugin-qeta';
const app = createApp({
//...
__experimentalTranslations: {
availableLanguages: ['en', 'fi'],
resources: [
createTranslationResource({
ref: qetaTranslationRef,
translations: {
fi: () => import('./locales/qeta-fi'),
},
}),
],
},
});You can also use the predefined translations from the plugin:
import { qetaTranslations } from '@drodil/backstage-plugin-qeta';
const app = createApp({
//...
__experimentalTranslations: {
availableLanguages: ['en', 'fi'],
resources: [qetaTranslations],
},
});Note that these translations might not contain your desired language. If you want to add a new language, you can contribute it to the plugin by creating a pull request.