Copied to clipboard

Flag this post as spam?

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


  • Damiaan 438 posts 1290 karma points MVP 3x c-trib
    Aug 02, 2011 @ 18:45
    Damiaan
    0

    dictionary translations c#

    Hi 
    My filter list remains empty when i try to loop my dictionary items.  
    Has anyone an idea why (or a more simple solution)?
        // get default search text
    
              XPathNodeIterator iterator = umbraco.library.GetDictionaryItems("Filter.DefaultSearchText");
              iterator.MoveNext(); //move to first
    
              XPathNodeIterator dictionaryItems = iterator.Current.SelectChildren("DictionaryItems", "");
    
              List<string> defaultSearchText = new List<string>();
              while (dictionaryItems.MoveNext()) {
                    // preValueIterator.Current.GetAttribute("id", "")
                    defaultSearchText.Add(dictionaryItems.Current.Value);
              }
    
  • Damiaan 438 posts 1290 karma points MVP 3x c-trib
    Aug 03, 2011 @ 11:22
    Damiaan
    0

    Ok, i found another solution.

    List<string> defaultSearchText = new List<string>();
    var DictionaryItem = new umbraco.cms.businesslogic.Dictionary.DictionaryItem("Faculty.Filter.DefaultSearchText");
    foreach (var item in umbraco.cms.businesslogic.language.Language.GetAllAsList()) {
        defaultSearchText.Add(DictionaryItem.Value(item.id));
    }
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies