symfony - Symfony2 Sylius setting the default locale -
when want create shipment error:
an exception has been thrown during rendering of template ("no locale has been set , current locale undefined.") in sonataadminbundle::standard_layout.html.twig @ line 148.
i think need set default locale sylius, tried alot of examples, none of them helped..
i have setup:
config.yml:
sylius_shipping: driver: doctrine/orm # configure doctrine orm driver used in documentation. classes: shipping_method: model: application\sylius\shippingbundle\entity\shippingmethod translation: model: application\sylius\shippingbundle\entity\shippingmethodtranslation shipping_method_rule: model: application\sylius\shippingbundle\entity\rule shipment: model: application\sylius\shippingbundle\entity\shipment shipment_item: model: application\sylius\shippingbundle\entity\shipmentitem shipping_category: model: application\sylius\shippingbundle\entity\shippingcategory #stof_doctrine_extensions: # orm: # default: # timestampable: true parameters: sylius.locale: %locale% #sylius_locale: # driver: doctrine/orm sylius_translation: default_locale: "%locale%" #sylius_translation: # default_locale: %sylius.locale%
parameters.yml:
sylius.currency_importer.ecb.base_currency: eur sylius.currency_importer.open_exchange_rates: editme sylius.locale: en_us
nothing works..
update
by changing config this:
framework: #esi: ~ translator: { fallback: %sylius.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: "%sylius.locale%" parameters: sylius.locale: 'en' #sylius_locale: # driver: doctrine/orm sylius_translation: default_locale: %sylius.locale%
i still same error. cleared cache.
try %sylius.locale%
. looks you've not put in full name of parameter in config file.
if you've updated value , it's not working, make sure clear cache.
$ app/console cache/clear --env=dev $ app/console cache/clear --env=prod
you require this:
imports: - { resource: parameters.yml }
otherwise parameters enter not loaded configuration file.
Comments
Post a Comment