Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding example to docs to pass translation keys from Vue I18n in (pro) components #3395

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

jeffreyvanhees
Copy link
Contributor

@jeffreyvanhees jeffreyvanhees commented Sep 27, 2023

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.

See: https://vue-i18n.intlify.dev/api/composition.html#tm-key

lang/media-library.php

<?php

return [
    'fileTypeNotAllowed' => 'Je moet een bestand van het type',
    'tooLarge' => 'Bestand te groot, maximaal',
    'tooSmall' => 'Bestand te klein, minimaal',
    'tryAgain' => 'probeer dit bestand opnieuw te uploaden',
    // ...
];
<MediaLibraryCollection
    :translations="$tm('media-library')"
/>

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
@jeffreyvanhees jeffreyvanhees changed the title Adding example to pass translation keys from Vue I18n in components Adding example to pass translation keys from Vue I18n in (pro) components Sep 27, 2023
@freekmurze freekmurze merged commit e5251db into spatie:main Sep 27, 2023
@jeffreyvanhees jeffreyvanhees changed the title Adding example to pass translation keys from Vue I18n in (pro) components Adding example to docs to pass translation keys from Vue I18n in (pro) components Sep 27, 2023
@freekmurze
Copy link
Member

Thanks!

@jeffreyvanhees
Copy link
Contributor Author

Wow that was fast @freekmurze! Thanks for accepting :)

@jeffreyvanhees jeffreyvanhees deleted the patch-2 branch September 27, 2023 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants