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: Date names for translation

Status Resolved
Add-on / Version Publisher
Severity Trivial
EE Version

Aaron @ Emagine

Jul 23, 2013

I created a group of phrases in my publisher admin panel called ‘months’ and translated the month names for my news story in the news section of the site. But I can’t get the month names to trigger on language change. I was trying this, but it is not working, which I am guessing is due to a parse order issue. I was going to try and subvert this through stash, but I wanted to avoid it if there was an easier way?

{phrase:{entry_date format='%F'}}
#1

BoldMinded (Brian)

Hi, Aaron. Translating phrases won’t work like that b/c {phrase:foo} is an early parsed global variable. Try the {exp:publisher:translate_phrase} tag mentioned in the docs.

#2

Aaron @ Emagine

If I do:

{exp:publisher:translate_phrase name="{entry_date format='%F'}</code></pre>

It wont fire since the names are case sensitive and the php format is caps only and the phrase name is lowercase only. Even tried ce string to url title it to no avail. 

Solution is to rename the month phrases with numbers (01,02, 03 etc) and translate then change the code to:
<pre><code>{exp:publisher:translate_phrase name="{entry_date format='%m'}"}
#3

BoldMinded (Brian)

This is kind of a crude way to fix it, but if you go into the exp_publisher_phrases table you can change the phrase name to be upper case.

#4

BoldMinded (Brian)

I think another way to fix this is make the name value on translate_phrase lowercased, that way it’ll match up to the phrase names.

#5

BoldMinded (Brian)

Go to line 462 of mod.publisher.php and change it to this:

$phrase_name = strtolower(ee()->TMPL->fetch_param(‘name’));

and see if that finds your phrases properly.

#6

Aaron @ Emagine

Thanks for that Brian. I changed it to numbers and went that way on it, but I will keep that in mind if I run into this again for any other type of variable.

Login to reply