Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shadrix's avatar
Level 12

How to you use Laravel Localization with vue tags?

Look at this code:

<div class="ml-2">
    I agree to the <a
        target="_blank"
        :href="route('terms.show')"
        class="underline"
    >Terms of Service</a> and <a
        target="_blank"
        :href="route('policy.show')"
        class="underline"
    >Privacy Policy</a>
</div>

This case is even "easy", but imagine if you are calling custom vue components like <inertia-link>.

I'm struggling to do the right way.

  • If you are using v-html for rendering, it won't compile the custom component.
  • If you are translating parts by parts like I agree to the you get the problem with languages that use different a syntax

How would you do this?

0 likes
0 replies

Please or to participate in this conversation.