Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Daniel 20 posts 40 karma points
    Jan 31, 2012 @ 23:05
    Daniel
    0

    Missing umbracoDictionaryItem output

    I've started to translate some of the static content on a multi lingual site, but I've run into a problem with dictionary items not showing up after being replaced with the placeholder. It only happens with one language thus far (because I haven't gotten to the 3rd language of the site) and only one translated node appears while the rest have gone missing.

    I'm not sure where the problem(s) lies, but here's the xslt:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <div class="calculator">

        <div class="weight">
          <input class="silverCalc" type="text" size="8" />
        </div>

        <dl class="silverDropdown">
            <dt class="dropGradient">
              <a href="#">
                <span>
                  <xsl:value-of select="umbraco.library:GetDictionaryItem('Kvalitet')"/>
                </span>
              </a>
            </dt>
            <dd>
                <ul>
                    <li><a href="#"><xsl:value-of select="umbraco.library:GetDictionaryItem('Finsølv')"/><span class="value"><xsl:value-of select="umbraco.library:GetItem('1074', 'fineSilver')"/></span></a></li>
                    <li><a href="#"><xsl:value-of select="umbraco.library:GetDictionaryItem('Sterlingsølv')"/><span class="value"><xsl:value-of select="umbraco.library:GetItem('1074', 'sterlingSilver')"/></span></a></li>
                </ul>
            </dd>
        </dl>
        
        <a id="silverCalDo" class="doStuff gradient">
          <strong>
            <xsl:value-of select="umbraco.library:GetDictionaryItem('Calculate')"/>
          </strong>
        </a>
        
    </div>

    <div class="silverResult">
      <p>Dit sølv er <strong>000.00</strong> kr værd!</p>
    </div>    

    </xsl:template>

    </xsl:stylesheet>

    Is there anything wrong with my xslt? Where else could the issue be?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 31, 2012 @ 23:31
    Jan Skovgaard
    0

    Hi Daniel

    I suppose you have created the different languages and added the translated text to those in the dictionary, right?

    Have you also set the culture by right clicking the root nodes and select "manage hostnames" where you need to add a host name + a culture?

    /Jan

  • Rodion Novoselov 694 posts 859 karma points
    Feb 01, 2012 @ 02:23
    Rodion Novoselov
    0

    Hi. Daniel, how do you set a current culture for the request? Keep in mind that umbraco localisation through dictionaries doesn't have any fallback mechanics (though it's already not the case in U5) and if you set the locale with a custom method (e.g. from the accept-languages header, user's cookie or geotargeting) you should always make sure that this locale has a corresponding dictionary.

  • Daniel 20 posts 40 karma points
    Feb 01, 2012 @ 07:20
    Daniel
    0

    Jan and Rodion, I have already set the culture of the root nodes as well as the specific domain for each language. I have also, of course, added the translated text to the dictionary. This is why I'm stumped to find that it's not working properly.

  • Rodion Novoselov 694 posts 859 karma points
    Feb 01, 2012 @ 07:34
    Rodion Novoselov
    0

    Hmmm. I've just looked into your code and got a thought - it's just a shot in the dark, though. Maybe to try to get rid of national characters ('ø') in the dictionary key names? I have absolutely no clue how it can affect the bevaviour of the dictionary, but who knows - for me they look a bit suspicious.

  • Rodion Novoselov 694 posts 859 karma points
    Feb 01, 2012 @ 07:37
    Rodion Novoselov
    0

    I mean of course to rename them in both the code and the dictionary.

  • Daniel 20 posts 40 karma points
    Feb 01, 2012 @ 09:09
    Daniel
    0

    I'll give that a shot, could very possibly be something like that.

  • Daniel 20 posts 40 karma points
    Feb 01, 2012 @ 09:42
    Daniel
    0

    No, the problem still persists, it seems.

Please Sign in or register to post replies

Write your reply to:

Draft