gpt4 book ai didi

Symfony : These messages are not available for the given locale and cannot be found in the fallback locales

转载 作者:行者123 更新时间:2023-12-03 23:15:51 25 4
gpt4 key购买 nike

我正在尝试使用 symfony 翻译。这是我的翻译.yml

framework:
default_locale: 'en'
translator:
paths:
- '%kernel.project_dir%/translations'
fallbacks: ['en']

我在 translations 目录中创建了 messages.en.yml。
## YAML Template.
Home: Home
Admin: Admin
Dashboard: Dashboard
Vehicles: Vehicles
Id: Id

但是当我尝试这样使用时,
{% trans %}Dashboard{% endtrans %}

我收到此错误消息,

These messages are not available for the given locale and cannot be found in the fallback locales. Add them to the translation catalogue to avoid Symfony outputting untranslated contents.

最佳答案

php bin/console cache:clear

清除缓存,如果你创建了新的翻译文件,你必须这样做。

关于Symfony : These messages are not available for the given locale and cannot be found in the fallback locales,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50908930/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com