From f81d0fb1e099c76e298910bd6703c079c6f89061 Mon Sep 17 00:00:00 2001 From: Yan <61414485+yanthomasdev@users.noreply.github.com> Date: Mon, 11 Nov 2024 17:47:32 -0300 Subject: [PATCH] Update Starlight example --- examples/starlight/lunaria.config.ts | 20 ++++++++++++++++++-- examples/starlight/src/content/i18n/en.ts | 4 ++++ examples/starlight/src/content/i18n/pt.ts | 4 ++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 examples/starlight/src/content/i18n/en.ts create mode 100644 examples/starlight/src/content/i18n/pt.ts diff --git a/examples/starlight/lunaria.config.ts b/examples/starlight/lunaria.config.ts index b2be514..03f6803 100644 --- a/examples/starlight/lunaria.config.ts +++ b/examples/starlight/lunaria.config.ts @@ -5,8 +5,16 @@ export default defineConfig({ name: 'yanthomasdev/lunaria', rootDir: 'examples/starlight', }, - sourceLocale: 'en', - locales: ['pt'], + sourceLocale: { + label: 'English', + lang: 'en', + }, + locales: [ + { + label: 'Português', + lang: 'pt', + }, + ], files: [ { include: ['src/content/docs/**/*.(md|mdx)'], @@ -25,6 +33,14 @@ export default defineConfig({ }, type: 'dictionary', }, + { + include: ['src/content/i18n/en.ts'], + pattern: { + source: 'src/content/i18n/@lang.ts', + locales: 'src/content/i18n/@lang.ts', + }, + type: 'dictionary', + }, ], tracking: { localizableProperty: 'i18nReady', diff --git a/examples/starlight/src/content/i18n/en.ts b/examples/starlight/src/content/i18n/en.ts new file mode 100644 index 0000000..84038b1 --- /dev/null +++ b/examples/starlight/src/content/i18n/en.ts @@ -0,0 +1,4 @@ +export default { + one: 'one', + second: 'second', +}; diff --git a/examples/starlight/src/content/i18n/pt.ts b/examples/starlight/src/content/i18n/pt.ts new file mode 100644 index 0000000..523e19f --- /dev/null +++ b/examples/starlight/src/content/i18n/pt.ts @@ -0,0 +1,4 @@ +export default { + one: 'um', + second: 'segundo', +};