Dax
Dax

Reputation: 199

Translation doesn't work in my symfony app

I'm trying to translate my back office into Italian. I use symfony 4 for my site, and sulu like librarie to have a small cms

I added a file "admin.it.json" in my translations folder, and my sulu_core.yaml file looks like this:

sulu_core:
locales:
    de: Deutsch
    en: English
    it: Italian
translations:
    - de
    - en
    - it
fallback_locale: '%default_locale%'

Unfortunately, my site is blocking on loading, and do not do anything else. I can not do anything, there is no mistake.

Even when I go on the link

localhost:8000/admin/translations?local=it

my translations are present, but the administration is not displayed.

Do you have an idea please?

Upvotes: 0

Views: 206

Answers (1)

Alexander Schranz
Alexander Schranz

Reputation: 2450

Your configuration is correctly config/packages/sulu_core.yaml:

sulu_core:
    locales:
        de: Deutsch
        en: English
        it: Italian
    translations:
        - de
        - en
        - it

Then create a translations/admin.it.json

{
    "sulu_tag.tags": "Tags It"
}

Clear the cache then and go to your Profile change the System language from en to it.

See for translation keys the admin.en.json files in the https://github.com/sulu/sulu repository.

Upvotes: 1

Related Questions