You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libs/astro-loader-i18n/README.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -251,7 +251,7 @@
251
251
252
252
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.
253
253
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`.
255
255
256
256
1. Create a collection:
257
257
<details>
@@ -361,6 +361,12 @@ It adds the following properties to an entrys `data` object:
361
361
362
362
See [i18nLoader](#i18nloader) for more information.
363
363
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
+
364
370
### `localized`
365
371
366
372
`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