v8: Get specific culture dictionary value
See original GitHub issueAt the moment UmbracoHelper
have two overload methods to get value or an dictionary item.
GetDictionaryValue(string key)
GetDictionaryValue(string key, string altText)
It would be great if we also could get a dictionary value of a specific culture and/or fallback to a culture, e.g. en
.
Maybe something like this:
public string GetDictionaryValue(string key, string culture = null)
public string GetDictionaryValue(string key, string culture = null, Fallback fallback = default)
public string GetDictionaryValue(string key, Fallback fallback = default)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
how to get dictionary value for specific culture
Hi there,. How can I get the value of a DictionaryItem for a specific Culture ? There's a proposal by Bjarne to add...
Read more >Get Dictionary Value action in the shortcut ...
Handling dictionaries using the Get Dictionary Value action in Shortcuts on iPhone or iPad. To get the value for a particular key in...
Read more >How do you get a specific value from a dictionary that ...
You can retrieve the value from a dictionary key with dictionary['key'] mydict={'alone': '1', 'amazed' : '10', 'amazing' : '10', 'bad': '2', ...
Read more >Object.ToString Method (System)
ToString method to provide support for format strings or culture-sensitive formatting. In this section: The default Object.ToString() method. Overriding the ...
Read more >Resources in Education
cal Language Association of Southern Califor- nia , November 1 , 1969 , in Los Angeles , California Journal Cit - Forum ;...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@umbrabot still relevant I think this is relevant to get a dictionary value for a specific culture similar to what we can for property values.
I Will post the same here as I’ve posted in the PR:
While I am creating this PR, I am not 100% sure that this is the best way of doing it. I wanted to add default properties to the current GetDictionaryValue methods, but I then run into problems regarding overloads being the same. And I can’t quite add regular parameters as that’ll be a breaking change (quite a big one actually)… So, I am open to any feedback!
This PR only adds a new method for a different culture, nothing with a fallback.