Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9224351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:17:52+00:00 2026-06-18T04:17:52+00:00

My project requires me to have a multilingual feature, so using Global.resx I have

  • 0

My project requires me to have a multilingual feature, so using Global.resx I have a list of English terms and in Global.fr.resx I have a list of French terms. This works perfectly. I can call in the term I require by using @Resources.Global. Whatever.

However, I now need to display these terms dynamically from the RESX file in a foreach, from values gathered from the entity framework. Any idea?

Bit more info:

The code is very simple, I’m still learning C#, I’m working in the View, so literally I have @Resources.Global.Whatever to display static terms and then I have a foreach loop:

<ul>

@foreach (var category in Model.categories)

{ <li>@category.categoryName</li> }

</ul>

Where I want @category.categoryName to be called from @Resource.Global too.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:17:54+00:00Added an answer on June 18, 2026 at 4:17 am

    Assuming I understand you correctly, you want to retrieve items from a resource file based on a dynamic key name (i.e. something in a variable?). You could create an extension method for this, like so (obviously replacing the namespace to the namespace of your resource file):

     public static string Resource(this string name)
     {
         return new ResourceManager(
                 "YourApp.Namespace.Resources",
                 Assembly.GetExecutingAssembly()
                    .GetString(name) ?? name;
     }
    

    Then for a foreach, you could do this (assuming yourList is a list of strings):

    foreach (string item in yourList)
    {
        item = item.Resource();
    }
    

    Or even just using Linq?

    List<string> resourceStrings = yourList.Select(s => s.Resource()).ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently just created Java project using Eclipse that requires 2 JAR files
$(.container).hover( function(){ $(.child-1).hide(0); $(.child-2).show(0); },function(){ $(.child-1).show(0); $(.child-2).hide(0); }); A project I have requires that
I have a project which requires creating Classes dynamically at runtime, where the only
I have a project that requires the following. Four arrays will be declared in
I have a project that requires some configuration files. I want to keep the
I have started working on a project which requires Natural Language Processing. We have
I have a project that require me to do a auto complete search using
I have a project that requires eight DIFFERENT lights to cycle between on and
I have all the eggs my project requires pre-downloaded in a directory, and I
We have a project that requires to display a 3D object on the browser

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.