Publisher is EE6 compatible, but it does not support the Fluid field. 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: Cannot translate cookies consent cookies titles

Status Resolved
Add-on / Version Publisher 3.5.3
Severity
EE Version 6.3.4

pixi

May 09, 2022

Hi Brian,

I have phrases named for example : consent-title__ee_cookies_targeting

I want to translate cookies titles in the cookies consent loop with the exp:publisher:translate_phrase tag. But it doesn’t seem to work.
As I can’t name a publisher variable with a “:” symbol in it, I use the plugin Stringer to replace the semicolon with an underscore.

{exp:consent:form}
{consents}
{exp:publisher:translate_phrase name="consent-title__{exp:stringer:find_replace find=':' replace='_'}{consent_short_name}{/exp:stringer:find_replace}”}
{/consents}
{/exp:consent:form}

It gives me “consent-title__ee_cookies_targeting” instead of the current language translation.

Any idea? A bug?

Thanks in advance.

#1

BoldMinded (Brian)

May 10, 2022

This isn’t a bug, phrases are variable names similar to custom fields, and as such I’ve made them follow similar naming scheme and don’t plan on changing that. Unfortunately I don’t have a better suggestion at the moment though.

#2

pixi

May 11, 2022

I understand but what I don’t is that {exp:publisher:translate_phrase} tag is to use when you have a phrase name from another module variable or custom field value according to the doc.

The phrase name seems to parse correctly (it “prints out” the correct phrase name) but why it doesn’t give the translation, I don’t know… it should work according to the docs.

May I ask you to test it on your end to see if it works please?

#3

BoldMinded (Brian)

May 11, 2022

I don’t think I need to test it on my end b/c I know it works if the phrase name that is passed to the tag is correct. I’m guessing it might be a parse order issue because your exp:stringer:find_replace tag is inside another module tag. Try adding parse=“inward” to the translate_phrase tag.

#4

pixi

May 11, 2022

Indeed a parse order issue, always had problems with parse order. Hahaha obviously I tested the parse inward in the stringer tag, it could not work then!
Thanks for the solution, adding parse inward to the translatee_phrase tag fixed it! 😉

#5

BoldMinded (Brian)

May 11, 2022

Huzzah!

Login to reply