我已将SonataMediaBundle添加到我正在处理的项目中,该项目已经实现了SonataAdminBundle。
奇怪的一件事是,开箱即用的表单/字段标签没有在管理仪表板或任何 CRUD 组件中进行翻译。
我虽然这是因为这是由捆绑提供的管理员与我编写的管理员,但我也集成了SonataUserBundle并且这些管理员的翻译很好(使用我假设的sonata.admin.label.strategy.native
策略,根据这个是默认值,应该生成人类可读的标签)
这是该问题的说明:
另一个显示了即使在管理员旁边通过包含 SonataUserBundle 所暴露的翻译仍然无法正常工作。
如果您需要查看其他内容,请告诉我。
对于版本信息,这是我的composer.json
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3"
, "symfony/symfony": "2.3.*"
, "doctrine/orm": ">=2.2.3,<2.4-dev"
, "doctrine/doctrine-bundle": "1.2.*"
, "twig/extensions": "1.0.*"
, "symfony/assetic-bundle": "2.3.*"
, "symfony/swiftmailer-bundle": "2.3.*"
, "symfony/monolog-bundle": "2.3.*"
, "sensio/distribution-bundle": "2.3.*"
, "sensio/framework-extra-bundle": "2.3.*"
, "sensio/generator-bundle": "2.3.*"
, "incenteev/composer-parameter-handler": "~2.0"
, "sonata-project/cache-bundle": "2.1.6"
, "sonata-project/admin-bundle": "2.2.11"
, "sonata-project/doctrine-orm-admin-bundle": "2.2.3"
, "friendsofsymfony/user-bundle": "1.3.*"
, "sonata-project/user-bundle": "2.2.3"
, "stof/doctrine-extensions-bundle": "v1.1.0"
, "sonata-project/formatter-bundle": "2.3.1"
, "sonata-project/media-bundle": "2.2.3"
, "sonata-project/core-bundle": "~2.2.5"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "stable",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}
config.yml的框架部分
framework:
#esi: ~
translator: { fallback: %locale% }
secret: %secret%
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
templating:
engines: ['twig']
#assets_version: SomeVersionScheme
default_locale: "%locale%"
trusted_proxies: ~
session: ~
fragments: ~
http_method_override: true