3

I have a symfony (2.8) app (Sylius actually) and I'm overriding some parts of the translation from SyliusUserBundle in app/Resources/translations/messages.en.yml (namely, the translation key is sylius.customer.email.unique)

It works like charm on local dev env, but gives me the key on production. I did clear the cache, multiple times, and it doesn't help.

What are other possible causes?

UPDATE Gives the translation found in the SyliusUserBundle for English (as it exists in the original bundle) but gives the key in other languages, where the original bundle doesn't contain the translation. So as a summary, it seems that translation files app/Resources/translations/messages.<lang>.yml are not being picked up on prod for some reason.

UPDATE 2 I also have discovered that the key with the valid translation is present in this file: app/cache/prod/translations/catalogue.hu_HU.ba674f8d2fd06750dcd7ee5bb021c1b905b518ea.php

Attila Fulop
  • 6,055
  • 2
  • 39
  • 45

3 Answers3

1

Moving the keys into separate files:

app/Resources/translations/validators.en.yml
app/Resources/translations/validators.hu.yml

has solved the problem.

(An interesting question is why did it work on my dev env..)

Attila Fulop
  • 6,055
  • 2
  • 39
  • 45
  • As a possible explanation for why it would work in one environment could be that one can overwrite the validator translation domain by setting the `validator.translation_domain` parameter to *messages* for example. But it wasn't the case (it is *validators* both in my local and in the production environment) – Attila Fulop May 20 '16 at 06:44
0

Did you configure the fallback locale?

# app/config/config.yml
framework:
    translator: { fallbacks: [en] }
gvf
  • 1,009
  • 7
  • 6
0

Try rename your file with messages.hu.yml and if not work change:

sylius.locale: hu_HU

to

sylius.locale: hu
Lowlo
  • 18
  • 3