This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » eZ Publish 5 Platform » Translate countries in fieldtype

Translate countries in fieldtype

Translate countries in fieldtype

Friday 23 January 2015 9:14:42 am - 5 replies


I use the fieldType ezcountry but the display of the country, the name is in English.

I would like to be able to specify the local as on the other FieldTypes.

I did this:

{{ez_render_field (address, 'country', 'fre-FR')}}

But I do not think he gets the fre-fr.ini file in the legacy.

Do you have any idea?
I have a second problem:

In addition, we realized that countries were slightly different for a field of type "Country" Symfony form and a type field "Country" eZ. Is this normal?

Thank you in advance

Saturday 24 January 2015 12:52:38 am

Hello Jonathan,

In legacy the Country datatype fetches the list of countries from the current siteaccess settings override of country.ini

In new stack (which I'm still learning) it seems this information is stored here:

I'd imagine you would need to override this fieldtypes.yml configuration to customize the list of countries (translate them).

I'm sorry I can't (yet) guide you through how to actually do this but perhaps someone else can chime in here.

I hope this helps!



Sunday 25 January 2015 6:29:07 pm

Hello // Heath,

You understood my problem well  happy.gif Emoticon

I hope someone (from eZ Systems team can be : p) can help me.


Tuesday 27 January 2015 11:26:33 am


I have the same problem. Do you have an idea maybe @jvieilledent ?



Thursday 05 February 2015 11:17:48 am



Is anyone has got an idea for this problem ?


Tkx for your help

Tuesday 24 February 2015 10:00:43 am


Here my solution:

I override the ezcountry_field block in the content_fields.html.twig and add an trans filter to the name output:

 {{ country['Name']|trans( {}, 'countries' }}

So it is possible to translate the name by Resources/translations/

Symfony documentation for translation:

Modified on Tuesday 24 February 2015 10:01:21 am by Sebastian Blank


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from