Try our conversational search powered by Generative AI!

Dropdown with translated categories

Vote:
 

I know I can have translated categories, adding to language xml file:


  
    
      
        CategoryName translated
      

    

  

How would be the correct way to display child translated categories from one selected parent in a dropdownlist???? Either in edit or user mode....

Best Regards

#141650
Nov 17, 2015 13:18
Vote:
 

It's as easy as using:

@Html.DropDownListFor(x => x.CategoryList1,
             new SelectList(Model.CategoryList1, "ID""LocalizedDescription"))

I was not aware of "LocalizedDescription".

And in Resources\LanguageFiles\Viwews.xml:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<languages>
  <language name="dutch" id="nl">
    <categories>
      <category name="CategoryName">
        <description>CategoryName translated</description>
      </category>
    </categories>
  </language>
</languages>

Regards

#141655
Edited, Nov 17, 2015 15:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.