# Plugin example of using translations This advanced TypeScript plugin example demonstrates the use of translations. A record parameter provides a translation table for easy editing. The plugin automatically detects the current language and displays the appropriate text. It includes default texts in both manifest.json and the code, allowing updates to the plugin without requiring simultaneous changes to the plugin configuration. _myplugin.ts_ Plugin that display a title and a description in a div. ```typescript import { useLocalization } from './locale'; import { MypluginContext } from './config'; export default async (context: MypluginContext) => { context.componentLoader.registerBlockComponent({ location: 'start-bottom', loadContent: async ctx => { const { shadow } = ctx; const css = new CSSStyleSheet(); await css.replace(` div { font-size: 1rem; } `); shadow.adoptedStyleSheets.push(css); const { getText } = useLocalization(context); const container = document.createElement('div'); container.innerHTML = `
${getText('description')}
`; shadow.appendChild(container); }, }); }; ``` _manifest.json_ ```json { "version": "1.0.0", "description": "Adds reward plugin", "esm": true, "parameters": [ { "name": "translations", "friendlyName": "Translations", "description": "Json with translations", "required": false, "schema": { "type": "record", "keys": { "type": "string" }, "values": { "type": "object", "properties": { "title": { "type": "string" }, "description": { "type": "string" } } } }, "defaultValue": { "en": { "title": "Points & Rewards", "description": "Gather points and earn rewards" }, "sv": { "title": "Poäng & Erbjudanden", "description": "Samla poäng of få erbjudanden" } } } ] } ``` _config/index.ts_ ```typescript import { PluginContext } from '@futureordering/fo-web-plugin-types'; import { LocalizedStringsValues } from '../locale'; export type MypluginContext = PluginContext & { config: { translations?: Partial