Can't get dictionary values from codebehind - datatype
Once again I'm working until 3:50 AM and I'm probably too tired to find out what's going on. I'm creating a datatype based on a user control as I already did many times.
The diference this time is that I want to pupulate a dropdownlist using dictionary values.
On the backend i went to "Settings/Dictionary" and created the keys. On the code behind I'm trying to pull the value using the GetDictionaryItem() function and it's always returning an empty string:
I'm pretty sure I already did something similar when creating a usercontrol for a macro and I was expecting the same to work inside a datatype (usercontrol).
Well, as i said before I'm using the same approach on different usercontrols and they are working just fine. The difference is that the other usercontrols are being used as macros, not datatypes.
Based on your question, i took a closer look and here is what i found:
I didn't add another language to umbraco, I'm using the default wich is "English (United States)". My whole system is in English. I double checked my browser just to make sure and it's default (and only language) is English (United States) - [en-US].
So, I believe it's supposed to be working as it does under the macros however, I don't understand why but at runtime the value for
Can't get dictionary values from codebehind - datatype
Once again I'm working until 3:50 AM and I'm probably too tired to find out what's going on.
I'm creating a datatype based on a user control as I already did many times.
The diference this time is that I want to pupulate a dropdownlist using dictionary values.
On the backend i went to "Settings/Dictionary" and created the keys.
On the code behind I'm trying to pull the value using the GetDictionaryItem() function and it's always returning an empty string:
I'm pretty sure I already did something similar when creating a usercontrol for a macro and I was expecting the same to work inside a datatype (usercontrol).
What exactly am I missing here?
Do you have a language in the language tree that corresponds to the
Cheers,
/Dirk
I think/ know for sure this is because the Umbraco language file is using en-gb as a culture. To solve this open the file /umbraco/config/lang/en.xml
Change the following culture="en-GB", must be culture="en-US"
Save the file restart IIS and your dictionary items will be translated.
Cheers,,
Richard
Well, as i said before I'm using the same approach on different usercontrols and they are working just fine. The difference is that the other usercontrols are being used as macros, not datatypes.
Based on your question, i took a closer look and here is what i found:
I didn't add another language to umbraco, I'm using the default wich is "English (United States)".
My whole system is in English. I double checked my browser just to make sure and it's default (and only language) is English (United States) - [en-US].
So, I believe it's supposed to be working as it does under the macros however, I don't understand why but at runtime the value for
is en-GB instead of en-US. Where is it coming from?
@Richard, I think you got it. You test in a few hours. Need some sleep now, it's almost 5AM.
* i meant: I will test it in a few hours...
is working on a reply...