【问题标题】:How can I use Laravel Multi language with Vue & Blade如何在 Vue 和 Blade 中使用 Laravel 多语言
【发布时间】:2022-01-05 22:23:37
【问题描述】:

我正在使用 Laravel 8 和 VueJs 开发一个小型网站,我想添加多语言功能,

我在刀片文件中调用我的 Vue 组件:

@section('content')
  <profile-component></profile-component>
@endsection

我如何使用 Laravel 多语言功能,就我而言,因为我在 Blade 文件中使用 Vue,如您所见

【问题讨论】:

  • 在刀片模板中使用 __() 函数。
  • @miken32 不可能,请阅读我的问题 :)

标签: laravel vue.js


【解决方案1】:

vue 中的翻译(多语言)使用 i18n 库 https://kazupon.github.io/vue-i18n/introduction.html#%F0%9F%A5%89-bronze 对于 laravel 中的翻译(多语言) https://laravel.com/docs/8.x/localization

【讨论】:

    【解决方案2】:

    如果要在刀片文件中使用它,请使用 __() 或 @lang()。如果在 Vue 组件中,请为 Vue js 使用 i18n 包。不能使用laravel的多语言功能

    【讨论】:

      猜你喜欢
      • 2018-11-21
      • 2021-05-30
      • 2022-01-23
      • 2017-10-28
      • 2018-05-27
      • 2021-10-13
      • 2017-12-23
      • 2016-10-27
      • 2021-04-07
      相关资源
      最近更新 更多