Sylius: Adding Translations for locale

浪尽此生 提交于 2019-12-02 18:58:14

问题


I'm using the Sylius/Sylius package for development and would like to serve my visitors with a Dutch interface. Not all strings are translated to Dutch, and some are done poorly. My question now is, without touching the Sylius bundles directly, what would be the best way to add/override translations?

Because I want to re-use these translations I'm writing my own Sylius "wrapper", which in its current approach extends the Sylius bundles and have their own Resources/translations folder. For example: MyWebBundle extends SyliusWebBundle through getParent() and has a Resource/translations/messages.nl.yml file containing Dutch strings.

I'm looking forward to hearing your thoughts.


回答1:


Since translations are not related to bundles, but to domains, you can overwrite the translations from anywhere. Either from app/Resources/translations/ or from your bundles Resources/translations/ directory.

Unfortunately Sylius is correctly missing a translations domain and uses only messages, this is a little mess, but there is already a discussion on GitHub. Translations is a very living part in Sylius and can change evrytime.




回答2:


Actually Sylius is using crowdin for maintaining languages support. As I can see dutch is at 95% so you can edit or update translation there and they will be updated in core.

https://crowdin.com/project/sylius



来源:https://stackoverflow.com/questions/21983070/sylius-adding-translations-for-locale

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!