Copied to clipboard

Flag this post as spam?

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


  • Dmitrij Jazel 86 posts 179 karma points
    Aug 02, 2012 @ 10:26
    Dmitrij Jazel
    0

    Multilanguage content placeholder?

    Hello guys,

    I was wondering if it is possible to define a language specific placeholder. Like this

    <!-- English specific content -->
    <img src="img/englishMap.png" /><br/>
    Find us <a href="EnglishOfficeLocation">here</a>
    <!-- English specific End -->
    <!-- Danish specific content -->
    <img src="img/danskKort.png" /><br/>
    Find os <a href="DanishOfficeLocation">Her</a>
    <!-- Danish specific End -->
    

    Something like that... Any suggestions? :-)

    Regards,

    Dmitrij

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Aug 02, 2012 @ 12:36
    Jeroen Breuer
    0

    It's probably best to do something like this in Razor or XSLT. There you can get the current language and show the correct stuff using an if statement.

    Jeroen

  • Dmitrij Jazel 86 posts 179 karma points
    Aug 02, 2012 @ 12:41
    Dmitrij Jazel
    0

    Hej Jeroen,

    Thanks for response :-)

    Hmm, that sounds like a solution, but to make it a bit easyer, could I please ask you to include a simple an example maybe?

    Thanks very much! ;-)

    Regards,

    Dmitrij

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Aug 02, 2012 @ 12:57
    Jeroen Breuer
    0

    Something like this in Razor:

    @{
        string language = System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;
    
        if(language == "EN")
        {
            <img src="img/englishMap.png" /><br/>
            <text>Find us <a href="EnglishOfficeLocation">here</a></text>
        }
        else if (language == "DA") //Don't know if it's DA for Danish
        {
            <img src="img/danskKort.png" /><br/>
            <text>Find os <a href="DanishOfficeLocation">Her</a></text>
        }
    }

    Jeroen

  • Dmitrij Jazel 86 posts 179 karma points
    Aug 02, 2012 @ 12:59
    Dmitrij Jazel
    0

    Hej Jeroen,

    That's just great, Thanks! :-)

    Regards,

    Dmitrij

Please Sign in or register to post replies

Write your reply to:

Draft