Skip to content

Commit df2c153

Browse files
committed
docs: add i18n file loader to documentation
1 parent 3fc4672 commit df2c153

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libs/astro-loader-i18n/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251

252252
Sometimes to have multilingual content in a single file is more convenient. For example data for menus or galleries. This allows sharing untranslated content across locales.
253253

254-
Use the `i18nContentLoader` loader to load in-file localized content.
254+
Use the `i18nContentLoader` loader to load in-file localized content. If you want to load a single file, you can use the `i18nFileLoader`.
255255

256256
1. Create a collection:
257257
<details>
@@ -361,6 +361,12 @@ It adds the following properties to an entrys `data` object:
361361

362362
See [i18nLoader](#i18nloader) for more information.
363363

364+
### `i18nFileLoader`
365+
366+
`i18nFileLoader` creates multiple entries based on a single yaml or json that contain i18n text fields.
367+
368+
It is a wrapper around the `file()` loader. See the [Astro documentation](https://docs.astro.build/en/reference/content-loader-reference/#file-loader) for more information.
369+
364370
### `localized`
365371

366372
`localized` is a helper function to define a schema for in-file localized content. It takes a schema and an array of locales and returns a schema that is an object with the locale as key and the schema as value.

0 commit comments

Comments
 (0)