From 60e39e23359773af5c3cdbcda9f7d878b77a9e7e Mon Sep 17 00:00:00 2001 From: HiDeoo Date: Fri, 11 Jul 2025 16:26:59 +0200 Subject: docs: fix `t.exists()` documentation + example (#3287) Co-authored-by: Chris Swithinbank --- docs/src/content/docs/guides/i18n.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/src/content/docs/guides/i18n.mdx b/docs/src/content/docs/guides/i18n.mdx index 45b28ded..e305de8a 100644 --- a/docs/src/content/docs/guides/i18n.mdx +++ b/docs/src/content/docs/guides/i18n.mdx @@ -360,15 +360,15 @@ const allStrings = Astro.locals.t.all(); #### `t.exists()` -To check if a translation key exists for a locale, use the `locals.t.exists()` function with the translation key as first argument. -Pass an optional second argument if you need to override the current locale. +To check if a translation key exists, use the `locals.t.exists()` function with the translation key as first argument. +Pass an optional second argument if you need to check if a translation exists for a specific locale. ```astro --- // src/components/Example.astro -const keyExistsInCurrentLocale = Astro.locals.t.exists('a.key'); +const keyExists = Astro.locals.t.exists('a.key'); // ^ true -const keyExistsInFrench = Astro.locals.t.exists('another.key', { lng: 'fr' }); +const keyExistsInFrench = Astro.locals.t.exists('other.key', { lngs: ['fr'] }); // ^ false --- ``` -- cgit