Copied to clipboard

Flag this post as spam?

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


  • javier 64 posts 84 karma points
    Mar 21, 2011 @ 15:00
    javier
    0

    Set culture language on URL. fast question

    Hi guys! I was trying to do something i did months ago. I believe this wasn't a dream ^^'

    How to specify language on URL? and get the Dictionary values with the parameter?

    I have tried all I think that worked, for example: http://myweb.com?language=fr , ?lang=en-US , ?culture=es-ES

    i can't remember , or was it a dream?

     

    thanks

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Mar 21, 2011 @ 15:12
    Jan Skovgaard
    0

    Hi Javier

    It's possible to do it like that. But I think it depends on the context - it's not something that will work out of the box.

    But it's possible to set a uiculture attribute and a culture attribute in the web.config if I'm not mistaken. Could this be what you were thinking about?

    /Jan

  • javier 64 posts 84 karma points
    Mar 21, 2011 @ 17:33
    javier
    0

    I dont know, because i think that was the simple way. Just put the parameter (who knos which one), and see like all my page variables linked to dictionary changes. I have multiple domains for my website, so i use the structure:

    >ROOT
    -------ES
    -----------page1
    -----------page2
    -------EN
    -----------page1
    -----------page2
    -------FR
    -----------page1
    -----------page2
    -------PT
    -----------page1
    -----------page2

    Now i need to add a special part on my web site like this:

    >ROOT
    -------ES
    -----------page1
    -----------page2
    -------EN
    -----------page1
    -----------page2
    -------FR
    -----------page1
    -----------page2
    -------PT
    -----------page1
    -----------page2
    -------PRIVATE ZONE
    -----------page3
    -----------page4
    -----------page5
    -----------...

    And the new "private zone" must be translated into the 4 languages. The problem is make the new section with translations "on the fly", the easiest way (i think) is to change the language/culture depending where i come from.

    for example if i'm on ES(spanish) pages and go to private zone, i must show private zone in spanish.

    By the way, all current main nodes ES / FR / EN / PT are with a hostname or with a language selected.

    Thanks for you help Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Mar 21, 2011 @ 18:10
    Jan Skovgaard
    0

    Hi Javier

    Hmm...perhaps you have been using the requestservervariables to get the language returned? http://www.w3schools.com/asp/coll_servervariables.asp

    /Jan

  • javier 64 posts 84 karma points
    Mar 22, 2011 @ 07:44
    javier
    0

    no, never :( . i'm thinking that I only used the hostnames to view different language version, and so which is the way to know and to change the actual language/culture page from a xslt?? I think that a xslt will be the only way to do that, isn't it?

    thanks Jan

  • Daniel Bardi 927 posts 2562 karma points
    Mar 22, 2011 @ 08:11
    Daniel Bardi
    0

    Go here to get session language: http://our.umbraco.org/forum/developers/api-questions/3024-Multilingual-11-site-in-Umbraco-4

    Redirect based on a current language.

    Note: You can retreive a list of all languages using uCompnents xslt extensions.

    http://ucomponents.codeplex.com/wikipage?title=Cms

  • javier 64 posts 84 karma points
    Mar 22, 2011 @ 08:26
    javier
    0

    Hey Daniel, but will this work on 4.0.4.2? it looks great.

    then, with this function i can set the language of the document:

    <xsl:template match="Languages">
    <xsl:apply-templates select="Language" />
    </xsl:template>
  • Daniel Bardi 927 posts 2562 karma points
    Mar 22, 2011 @ 09:03
    Daniel Bardi
    0

    That's just going to apply the list of languages to a template.

    You won't need to set the language if you redirect based on the session language.

    Second half of my last post was for reference and don't think that it will work on 4.0, only 4.5+.

    First link of my last post will work on t 4.0. our.umbraco.org/.../3024-Multilingual-11-site-in-Umbraco-4

  • javier 64 posts 84 karma points
    Mar 22, 2011 @ 11:31
    javier
    0

    Thansk Daniel, this can work perfect with some XSLT modifications for the news . I'll try it.

    And how about changing the language directly while rendering XSLT macros? Because when we open this aspx, the language can't be changed. so i'll use a URL parameter cos is the easiest/fastest way for me.

     

    regards

     

    javier

  • javier 64 posts 84 karma points
    Mar 22, 2011 @ 12:35
    javier
    0

    uhm.... I'm sorry Daniel and Jan , but i'm a newbie with those things, i'll pay you with something :(

    Daniel with your last post i see it clearer but i'm afraid watching C# code (no problem, i'll go with vb). "If i redirect based on the session language", and how i redirect based on the session language??. This is what i would do if i know how:

    1- FROM A NODE WITH A HOSTNAME AND LANGUAGE
    ---------------------> .ASCX User Control WITH ASP.NET MEMBERSHIP LOGIN (Where i need to know
    --------------------- how to now current language, actually i dont know how)
    2- .ASCX Calls "/privatesection.aspx" FOR ALL LANGUAGES when login is correct, but needs 
    ------------------------------------------------------------to send, or tell, or put,
    ----------------------------------------------------------- the correct language to
    ----------------------------------------------------------- privatesection.aspx
    3- PRIVATESECTION.ASCX knows which language we need and load the translation from dictionary
    ------------------------------------------------------------and different document properties

    I have problems in points 1,2 and 3. :( i'm very oriented with "multilingual-1:1" post, but i have a problem. BusinessLogic is lost, i can't have access to any method or umbraco fuctions where i can use "GetByCultureCode" for example. I don't know if i need more references on my code or use others like:

    umbraco.settings.editLanguage and change Culture property

     

    I'm sorry guys, but i'm only a medium vb.net developer who 4 months ago didn't know anything about CSS.

  • Daniel Bardi 927 posts 2562 karma points
    Mar 22, 2011 @ 18:34
    Daniel Bardi
    0

    You can have a separate private section for each language either under the language nodes or under the top private section.

    -- privatesection
    ---- es
    ------ page 3
    ------ page 4
    ---- en
    ------ page 3
    ------ page 4
    url redirect to /privatesection/es.aspx or /privatesection/en.aspx
    -- es
    ---- privatesection
    ------ page 3
    ------ page 4
    -- en
    ---- privatesection
    ------ page 3
    ------ page 4
    url redirect to /es/privatesection.aspx or /en/privatesection.aspx
  • javier 64 posts 84 karma points
    Mar 23, 2011 @ 07:15
    javier
    0

    yeah Daniel, would be great to follow same schema like the rest of the website, but there isn't a lot of subpages, and we need to unify in one node to make it easier to administrate.

    where can i find a complete reference to XSLT functions to change the culture/language of the page?

     

    regarsd

Please Sign in or register to post replies

Write your reply to:

Draft