How to select a string in resx (internationalization) without using the static method

0

I have .resx files where I keep strings in English and Portuguese, in my database I have the following table:

AndIwanttochangethedescriptionoftheplansequaltothefirstrecordinthistable:

WiththisIcangetthisstring"plano_1" directly from my resource, thus transforming it into English and Portuguese.

But since the resource only lets me get the static methods with the strings inside, I can not solve this problem.

I would rather do this: string plano1 = Messages.plano_1; use the string I'm going to pull from the database something like string plano1 = Messages("plano_1") .

    
asked by anonymous 03.07.2017 / 16:31

1 answer

2

You can use ResourceManager.GetString for this

var resManager = Messages.ResourceManager;
string plano1 = resManager.GetString("plano_1");
    
03.07.2017 / 16:35