From 7f9342661ac5a00b6d39ccfb543267ee2fb287b4 Mon Sep 17 00:00:00 2001 From: Jeffrey van Hees Date: Wed, 27 Sep 2023 15:52:16 +0200 Subject: [PATCH] Adding example to pass translation keys from Vue I18n in components The package vue-i18n (https://vue-i18n.intlify.dev/) offers a $tm-function to pass all keys at once as an array from a translation file. Maybe it's good to adapt this in the documentation. https://vue-i18n.intlify.dev/api/composition.html#tm-key --- .../handling-uploads-with-vue.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/handling-uploads-with-media-library-pro/handling-uploads-with-vue.md b/docs/handling-uploads-with-media-library-pro/handling-uploads-with-vue.md index e09c6f5a1..5298f7099 100644 --- a/docs/handling-uploads-with-media-library-pro/handling-uploads-with-vue.md +++ b/docs/handling-uploads-with-media-library-pro/handling-uploads-with-vue.md @@ -687,6 +687,14 @@ window.mediaLibraryTranslations = { }; ``` +If you use the [vue-i18n](https://vue-i18n.intlify.dev/) package from intlify, you can also pass the keys from a translation file like `lang/media-library.php` by using the [`$tm`-function](https://vue-i18n.intlify.dev/api/composition.html#tm-key). + +```js + +``` + ## Props These props are available on both the `attachment` and the `collection` component.