Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using ResourceLoader.GetString method to retrieve resources with dots in the key

I'm using ResourceLoader.GetString to get string resources from my .resw file. I'm able to retrieve resources without a dot in the key, but ones with a dot come back as an empty string. For example:

var rl = new Windows.ApplicationModel.Resources.ResourceLoader();
rl.GetString("HelpText"); // gets the string "Help"
rl.GetString("Forget.Text"); // gets "", even though it's defined in resw file as "Forgotten"

I've tried replacing the dot with various other characters:

rl.GetString("Forget_Text");
rl.GetString("Forget:Text");
rl.GetString("Forget-Text");

No luck. All the examples on MSDN skilfully avoid mentioning this little issue, so I'm a bit stumped. Can anyone help?

like image 892
jaucourt Avatar asked Feb 13 '15 18:02

jaucourt


1 Answers

It is actually accessed via a forward-slash:

rl.GetString("Forget/Text");
like image 101
jaucourt Avatar answered Nov 16 '22 00:11

jaucourt