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 Tags
Status | Resolved |
Add-on / Version | Publisher |
Severity | Trivial |
EE Version |
Matt Bulfair
Mar 13, 2013I am not 100% sure this is possible, but would it be possible to get the {phrase:} to take a variable? Perhaps a parse inward option?
I am using a tag module by solspace.
{exp:tag:tags entry_id="{entry_id}” }
{phrase:{tag}}
{/exp:tag:tags}
Would be nice if the “word” {tag} could be parsed before the phrase so it can be translated, since multilingual tags seems to be a tough one to crack.
BoldMinded (Brian)
Try {exp:publisher:translate_phrase name=”{tag}”}
Matt Bulfair
This works! Except if a translated word doesn’t exist it won’t render the others in english.
Matt Bulfair
I modified this file: mod.publisher.php
Line 422:
to:
/** * Tag to translate phrases, just pulls from the global config, * but provides an option to get a phrase based on another variable value. * * {exp:publisher:translate_phrase name=”{foo}” show_all=”yes”} * * @return string */ public function translate_phrase() { $phrase_name = $this->EE->TMPL->fetch_param(‘name’); $prefix = $this->EE->publisher_setting->get(‘phrase_prefix’);
This fixes it for me, in this situation, but not sure it’s the proper approach.
BoldMinded (Brian)
Oh I see what you did. I think removing that show_all though would be optimal, just have that last parameter return the requested phrase value.
Matt Bulfair
If that works for you, sure, if you were to roll this into a future release, I know this may be a unique case, but there aren’t any tag translation modules out there.
Here’s the updated version:
/** * Tag to translate phrases, just pulls from the global config, * but provides an option to get a phrase based on another variable value. * * {exp:publisher:translate_phrase name=”{foo}”} * * @return string */ public function translate_phrase() { $phrase_name = $this->EE->TMPL->fetch_param(‘name’); $prefix = $this->EE->publisher_setting->get(‘phrase_prefix’);
BoldMinded (Brian)
I’ve already made the commit, so it’ll be in the next release.
Matt Bulfair
Great, glad to help. Great work!