SonataAdminBundleを既に実装しているプロジェクトにSonataMediaBundleを追加しました。
奇妙な点の 1 つは、そのままでは、フォーム/フィールドのラベルが管理ダッシュボードまたは CRUD コンポーネントで翻訳されていないことです。
これはバンドルによって提供された管理者と私が書いた管理者だったからだと思いましたが、SonataUserBundleも統合されており、それらの管理者はうまく翻訳されています(戦略を想定しています。これsonata.admin.label.strategy.native
によるとデフォルトであり、人間が読めるラベルを生成する必要があります)
問題の図を次に示します。
もう 1 つは、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