Copied to clipboard

Flag this post as spam?

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


  • Damiaan 442 posts 1302 karma points MVP 6x 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 442 posts 1302 karma points MVP 6x 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));
    }
Please Sign in or register to post replies

Write your reply to:

Draft