Thanks for reporting this. I have found out what is wrong. As a quick solution, could you try replacing the code in the MacroScripts/PropertyTranslation.cshtml file with the code below and let me know if it works for you? I will perform some tests myself and publish a new version of Polyglot as soon as possible.
Best regards,
Dimitri
@*
PropertyTranslation.cshtml
Part of the Polyglot package.
*@
@inherits umbraco.MacroEngines.DynamicNodeContext
@using umbraco.MacroEngines;
@{
string selectedLanguage = RenderPage("SelectedLanguage.cshtml").ToString().Trim();
string selectedLanguageNoDash = selectedLanguage.Replace("-", string.Empty);
DynamicNode page = Model;
var contentFound = false;
if (page.HasProperty(Parameter.Property + selectedLanguageNoDash) && !string.IsNullOrEmpty(page.GetPropertyValue(Parameter.Property + selectedLanguageNoDash)))
{
contentFound = true;
@Html.Raw(Umbraco.Web.Templates.TemplateUtilities.ParseInternalLinks(library.RenderMacroContent(page.GetPropertyValue(Parameter.Property + selectedLanguageNoDash), page.Id)))
}
if (!contentFound)
{
foreach (DynamicNode child in page.GetChildrenAsList)
{
if (child.NodeTypeAlias == page.NodeTypeAlias + "TranslationFolder")
{
foreach (DynamicNode translation in child.GetChildrenAsList)
{
var language = translation.GetPropertyValue("language");
if (language != null && language.ToString().ToLower() == selectedLanguage.ToLower())
{
if (translation.HasProperty(Parameter.Property) && !string.IsNullOrEmpty(translation.GetPropertyValue(Parameter.Property)))
{
contentFound = true;
@Html.Raw(Umbraco.Web.Templates.TemplateUtilities.ParseInternalLinks(library.RenderMacroContent(translation.GetPropertyValue(Parameter.Property), translation.Id)))
}
}
}
}
}
}
if (!contentFound)
{
if (page.HasProperty(Parameter.Property) && !string.IsNullOrEmpty(page.GetPropertyValue(Parameter.Property)))
{
@Html.Raw(Umbraco.Web.Templates.TemplateUtilities.ParseInternalLinks(library.RenderMacroContent(page.GetPropertyValue(Parameter.Property), page.Id)))
}
}
}
Sorry I could not get back to you, and thank you for your quick replies and patch.
unfortunatly I was in a hurry so i implemented a dirty hack for this and since the site is up and I dont want to mess with it, I shall leave it like this for now.
Just in case someone is in my situation, my very dirty hack:
You're welcome and, no worries! I'm glad you got it to work either way. Thank you very much for sharing your solution. I don't think it's just a hack. I'll keep it in mind because I think that it might be faster than the way I'm usually doing things in Polyglot. Maybe I'll use it someday, if I run into performance problems :)
Macro In translated RTE property
Hi,
I am trying to translate some content in RTE, somehow my Macro gets commented out to:
Any ideas?
(Umbraco V7)
Hi Julien,
Thanks for reporting this. I have found out what is wrong. As a quick solution, could you try replacing the code in the MacroScripts/PropertyTranslation.cshtml file with the code below and let me know if it works for you? I will perform some tests myself and publish a new version of Polyglot as soon as possible.
Best regards,
Dimitri
Hi Julien, I have just released version 2.04 of the package, which corrects this problem. If you need more help, please let me know.
Hi Dim,
Sorry I could not get back to you, and thank you for your quick replies and patch.
unfortunatly I was in a hurry so i implemented a dirty hack for this and since the site is up and I dont want to mess with it, I shall leave it like this for now.
Just in case someone is in my situation, my very dirty hack:
I will try your update net time i version the site, and I'll post here in case of issues.
thank you!
Hi Julien,
You're welcome and, no worries! I'm glad you got it to work either way. Thank you very much for sharing your solution. I don't think it's just a hack. I'll keep it in mind because I think that it might be faster than the way I'm usually doing things in Polyglot. Maybe I'll use it someday, if I run into performance problems :)
Cheers,
Dimitri
is working on a reply...