// Generated by scripts/generate-manifest.mjs. Do not edit by hand. import type { AddOnCompiled } from '../../../../../types.js' type TemplateRecord = Record type TemplateAddOn = TemplateRecord & { integrations?: Array routes?: Array } type TemplateRenderContext = { [key: string]: any packageManager: any projectName: any typescript: any tailwind: any blank: any js: any jsx: any fileRouter: any codeRouter: any routerOnly: any includeExamples: any addOnEnabled: Record addOnOption: Record addOns: Array integrations: Array routes: Array getPackageManagerAddScript: (...args: Array) => string getPackageManagerRunScript: (...args: Array) => string getPackageManagerExecuteScript: (...args: Array) => string relativePath: (...args: Array) => string integrationImportContent: (...args: Array) => string integrationImportCode: (...args: Array) => string | undefined renderTemplate: (content: string) => string ignoreFile: () => never } type TemplateRenderer = (context: TemplateRenderContext) => string | undefined function __escapeXML(value: unknown) { if (value === undefined || value === null) { return '' } return String(value).replace(/[&<>'"]/g, (character) => { switch (character) { case '&': return '&' case '<': return '<' case '>': return '>' case '"': return '"' case "'": return ''' default: return character } }) } export function getManifestTemplateKey(template: string) { let hash = 0x811c9dc5 for (let i = 0; i < template.length; i++) { hash ^= template.charCodeAt(i) hash = Math.imul(hash, 0x01000193) >>> 0 } return `${hash.toString(16).padStart(8, '0')}:${template.length}` } function __render_46ac6367_999(context: TemplateRenderContext) { const { packageManager, projectName, typescript, tailwind, blank, js, jsx, fileRouter, codeRouter, routerOnly, includeExamples, addOnEnabled, addOnOption, addOns, integrations, routes, getPackageManagerAddScript, getPackageManagerRunScript, getPackageManagerExecuteScript, relativePath, integrationImportContent, integrationImportCode, renderTemplate, ignoreFile, } = context let __output = '' const __append = (value: unknown) => { if (value !== undefined && value !== null) { __output += String(value) } } __append("import { createFileRoute } from \"@tanstack/react-router\";\nimport logo from \"../logo.svg\";\nimport { m } from \"#/paraglide/messages\";\nimport LocaleSwitcher from \"../components/LocaleSwitcher\";\n\nexport const Route = createFileRoute(\"/demo/i18n\")({\n component: App,\n});\n\nfunction App() {\n return (\n
\n
\n \n

{m.example_message({ username: \"TanStack Router\" })}

\n \n {m.learn_router()}\n \n
\n \n
\n
\n
\n );\n}\n") return __output } function __render_7124b617_1484(context: TemplateRenderContext) { const { packageManager, projectName, typescript, tailwind, blank, js, jsx, fileRouter, codeRouter, routerOnly, includeExamples, addOnEnabled, addOnOption, addOns, integrations, routes, getPackageManagerAddScript, getPackageManagerRunScript, getPackageManagerExecuteScript, relativePath, integrationImportContent, integrationImportCode, renderTemplate, ignoreFile, } = context let __output = '' const __append = (value: unknown) => { if (value !== undefined && value !== null) { __output += String(value) } } __append("// Locale switcher refs:\n// - Paraglide docs: https://inlang.com/m/gerre34r/library-inlang-paraglideJs\n// - Router example: https://github.com/TanStack/router/tree/main/examples/react/i18n-paraglide#switching-locale\nimport { getLocale, locales, setLocale } from '#/paraglide/runtime'\nimport { m } from '#/paraglide/messages'\n\nexport default function ParaglideLocaleSwitcher() {\n const currentLocale = getLocale()\n\n return (\n \n {m.current_locale({ locale: currentLocale })}\n
\n {locales.map((locale) => (\n setLocale(locale)}\n aria-pressed={locale === currentLocale}\n style={{\n cursor: 'pointer',\n padding: '0.35rem 0.75rem',\n borderRadius: '999px',\n border: '1px solid #d1d5db',\n background: locale === currentLocale ? '#0f172a' : 'transparent',\n color: locale === currentLocale ? '#f8fafc' : 'inherit',\n fontWeight: locale === currentLocale ? 700 : 500,\n letterSpacing: '0.01em',\n }}\n >\n {locale.toUpperCase()}\n \n ))}\n
\n \n )\n}\n") return __output } const templateRenderers: Record = { "46ac6367:999": __render_46ac6367_999, "7124b617:1484": __render_7124b617_1484, } export function hasManifestTemplate(template: string) { return getManifestTemplateKey(template) in templateRenderers } export function renderManifestTemplate( template: string, context: TemplateRenderContext, ) { const key = getManifestTemplateKey(template) const renderer = templateRenderers[key] if (!renderer) { throw new Error(`Template ${key} was not precompiled into the manifest`) } return renderer(context) ?? '' } export const addOn = { "name": "Paraglide (i18n)", "description": "Type-safe i18n with localized routing and message bundles.", "phase": "add-on", "modes": [ "file-router" ], "type": "add-on", "category": "i18n", "color": "#14B8A6", "priority": 30, "link": "https://github.com/opral/paraglide-js", "routes": [ { "icon": "Languages", "url": "/demo/i18n", "name": "I18n example", "path": "src/routes/demo.i18n.tsx", "jsName": "I18nDemo" } ], "integrations": [ { "type": "header-user", "path": "src/components/LocaleSwitcher.tsx", "jsName": "ParaglideLocaleSwitcher" } ], "id": "paraglide", "version": "0.0.0", "packageAdditions": { "devDependencies": { "@inlang/paraglide-js": "^2.13.1" } }, "readme": "# Paraglide i18n\n\nThis add-on wires up ParaglideJS for localized routing and message formatting.\n\n- Messages live in `project.inlang/messages`.\n- URLs are localized through the Paraglide Vite plugin and router `rewrite` hooks.\n- Run the dev server or build to regenerate the `src/paraglide` outputs.\n", "readmeIsEjs": false, "files": { "messages/de.json": "{\n \"$schema\": \"https://inlang.com/schema/inlang-message-format\",\n \"home_page\": \"Startseite\",\n \"about_page\": \"Über uns\",\n \"example_message\": \"Willkommen in deiner i18n-App.\",\n \"language_label\": \"Sprache\",\n \"current_locale\": \"Aktuelle Sprache: {locale}\",\n \"learn_router\": \"Paraglide JS lernen\"\n}\n", "messages/en.json": "{\n \"$schema\": \"https://inlang.com/schema/inlang-message-format\",\n \"home_page\": \"Home page\",\n \"about_page\": \"About page\",\n \"example_message\": \"Welcome to your i18n app.\",\n \"language_label\": \"Language\",\n \"current_locale\": \"Current locale: {locale}\",\n \"learn_router\": \"Learn Paraglide JS\"\n}\n", "project.inlang/settings.json": "{\n \"$schema\": \"https://inlang.com/schema/project-settings\",\n \"baseLocale\": \"en\",\n \"locales\": [\"en\", \"de\"],\n \"modules\": [\n \"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@4/dist/index.js\",\n \"https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@2/dist/index.js\"\n ],\n \"plugin.inlang.messageFormat\": {\n \"pathPattern\": \"./messages/{locale}.json\"\n }\n}\n", "src/components/LocaleSwitcher.tsx.ejs": "// Locale switcher refs:\n// - Paraglide docs: https://inlang.com/m/gerre34r/library-inlang-paraglideJs\n// - Router example: https://github.com/TanStack/router/tree/main/examples/react/i18n-paraglide#switching-locale\nimport { getLocale, locales, setLocale } from '#/paraglide/runtime'\nimport { m } from '#/paraglide/messages'\n\nexport default function ParaglideLocaleSwitcher() {\n const currentLocale = getLocale()\n\n return (\n \n {m.current_locale({ locale: currentLocale })}\n
\n {locales.map((locale) => (\n setLocale(locale)}\n aria-pressed={locale === currentLocale}\n style={{\n cursor: 'pointer',\n padding: '0.35rem 0.75rem',\n borderRadius: '999px',\n border: '1px solid #d1d5db',\n background: locale === currentLocale ? '#0f172a' : 'transparent',\n color: locale === currentLocale ? '#f8fafc' : 'inherit',\n fontWeight: locale === currentLocale ? 700 : 500,\n letterSpacing: '0.01em',\n }}\n >\n {locale.toUpperCase()}\n \n ))}\n
\n \n )\n}\n", "src/routes/demo.i18n.tsx.ejs": "import { createFileRoute } from \"@tanstack/react-router\";\nimport logo from \"../logo.svg\";\nimport { m } from \"#/paraglide/messages\";\nimport LocaleSwitcher from \"../components/LocaleSwitcher\";\n\nexport const Route = createFileRoute(\"/demo/i18n\")({\n component: App,\n});\n\nfunction App() {\n return (\n
\n
\n \n

{m.example_message({ username: \"TanStack Router\" })}

\n \n {m.learn_router()}\n \n
\n \n
\n
\n
\n );\n}\n" }, "deletedFiles": [], "smallLogo": "\n \n 🪂\n\n" } satisfies AddOnCompiled