Copied to clipboard

Flag this post as spam?

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


  • jake williamson 207 posts 873 karma points
    Mar 09, 2015 @ 22:04
    jake williamson
    0

    web.config globalization for uk ignored?!

    it maybe cos it's late... it maybe cos i'm tired...

    i've got this in my web.config in the 'system.web' section:

    <globalization culture="en-GB" uiCulture="en-GB" requestEncoding="UTF-8" responseEncoding="UTF-8" />
    

    all my dates (using myDate.ToShortDateString()) are coming out mm/dd/yyyy (american style) and anywhere i'm formatting a decimal (using myDecimal.ToString("C")) it's coming out with a $ sign.

    am i missing somit?! is there a culture setting in umbraco that's overriding the web.config setting?!

    just checking before i loose anymore hair...

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 09, 2015 @ 22:25
    Jan Skovgaard
    0

    Hi Jake

    That sure sounds weird... Don't know if any of the suggestions here will work? http://stackoverflow.com/questions/9700934/how-to-change-en-us-dates-to-en-gb-for-asp-net

    Perhaps leaving it to the browser by using "auto" might be the solution?

    /Jan

  • jake williamson 207 posts 873 karma points
    Mar 09, 2015 @ 23:49
    jake williamson
    0

    it is kinda weird?!

    i'd stumbled upon the stackoverflow post you mentioned in my googling and tried the suggestion. for a multilingual site, i think this'd work fine however the local set by the browser influences the output and the site i'm working on is uk facing (and the sales and only in gbp).

    i've just set up a blank mvc project on my machine to test out if the globalization will work 'out of the box' as it were.

    will report back the results!

    thanks for taking the time to reply ;)

    jake

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Mar 10, 2015 @ 09:08
    Stefan Kip
    1

    Do you have a culture set on any node in umbraco?

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

    Do'h! Of course...that's the obvious question to ask...I should have remembered that :) #h5is!

    /Jan

  • jake williamson 207 posts 873 karma points
    Mar 10, 2015 @ 21:44
    jake williamson
    0

    hey there,

    threw me a bit the setting a culture on an umbraco node as i wasn't aware you could!

    so i took a look into it - right clicked my root not and selected 'culture and hostnames'.

    the only options in the culture > language section are 'inherent' and 'en-US'.

    ah ha!

    so the follow up questions are:

    1 - what does 'inherent' do?!

    2 - how do i get 'en-GB' into the select list?!

    feels like i'm one step closer ;)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 10, 2015 @ 21:50
    Jan Skovgaard
    100

    Hi Jake

    You can setup more languages in the "Settings" section by right clicking "Languages" and choose "Create".

    Once that is done you can add it as a culture when setting up the hostname.

    In regards to the "Inherit" setting I can't quite remember why it's there but in most cases I think it should just be set to "Inherit".

    /Jan

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

    Hi Jake

    If you're up for it you might be learn something about the Umbraco Request pipeline by viewing these slides http://www.zpqrtbnk.net/media/1003/theumbraco6requestpipeline.pdf - Nevermind that it's for v6 since it works the same in v7.

    /Jan

  • jake williamson 207 posts 873 karma points
    Mar 10, 2015 @ 21:58
    jake williamson
    0

    amazing! it worked! far out, that completely threw me ;)

    learnt something new about umbraco today - too good.

    can feel a blog post coming on...

    thank you to everyone who posted a reply on this post, you've saved me the hair on my head ;)

    p.s. as a follow up question, i wonder why my install only had 'en-US' in it? i'm based in the uk but using a peecee that is set up for australia. at work (all uk based systems) i've never had to set this up so i'm wondering if it's got somit to do with my home system...

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 10, 2015 @ 22:16
    Jan Skovgaard
    0

    Hi Jake

    You're welcome - Happy to help.

    The reason is simply that Umbraco is only setup with the en-US culture by default - If you need another culture you need to add it manually. It is like this no matter the culture on your PC etc.

    /Jan

  • jake williamson 207 posts 873 karma points
    Mar 11, 2015 @ 10:26
    jake williamson
    1

    did a bit more playing with this and found that the 'inherit' settings appears to mean 'inheritthe culture from my ancestors'.

    so in the example site i have, the root node is now set to 'en-GB'. i can have a node several child levels down and by default it'll inherit the root nodes culture. however, if i change the child node culture to 'en-US' it'll change the culture for just that node.

    clever stuff ;)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 11, 2015 @ 11:19
    Jan Skovgaard
    0

    Hi Jake

    Ah yes makes sense actually - Just never used it in any scenarios myself but it's a nice option indeed. Can quickly think of scenarios where it's relevant. I learned something new as well now :) Thanks for sharing.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft