Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Translate Expression engine default language elements (eg. dates)

Status Resolved
Add-on / Version Publisher 1.6.2
Severity
EE Version v2.9.2 - Build Date: 20141004

Edoardo Biasini

Mar 20, 2015

Description:
I have set Italian as the default Publisher Language.
I also have set Italian as the default Expression engine language in Admin > Localization settings.

My template includes some dates being populated by Low Events extension.
When I switch to english the month name remains in Italian.
Any tip on translating those elements?

#1

BoldMinded (Brian)

The best thing to do is probably make a Phrase group for Months, and create a translation for each month name, then you can use {exp:publisher:translate_phrase=”month name here”}

#2

Edoardo Biasini

Sorry, I don’t know exactly what you mean. Shall I use it like so?

{exp:publisher:translate_phrase name="{myfield:start_date format="%j %F"}"}
#3

BoldMinded (Brian)

If you need just a date number format, this will probably work for you.

{if publisher:current_language_code == "uk"}
    {date_field format="[the format here]"}
{if:else}
    {date_field format="[the format here]"}
{/if}

If you need things like the month or day name, then you’ll need something like this:

{phrase:march}

Then translate “March” into all your languages. People have done this in the past to create an entries archive, e.g. all entries listed in the month of March, April, May etc.

#4

Edoardo Biasini

I can use lang parameter in Low Events as documented here: http://gotolow.com/addons/low-events/docs/fieldtype#vars The problem is that it takes current language as a Language pack value (eg. “english”). Can I get current language name from a Publisher tag?

#5

BoldMinded (Brian)

Edoardo, take a look at the docs, it has listed all the tags you can use to get the language name.

https://boldminded.com/add-ons/publisher/template-tags

Login to reply