question

EgbertBeuker-7647 avatar image
0 Votes"
EgbertBeuker-7647 asked ajkuma-MSFT commented

How to localize App Service using only App Service Editor

Hello,

I want to build my web app from scratch using only the App Service Editor in Azure.

I am not yet able to get localization to work.

I have a folder in the root "App_GlobalResources" with a file Resources.resx in it.

The resource file contains the entry below:

<data name = "Next" xml: space = "preserve">
<value>Verder</value>
<comment> </comment>
</data>

I would expect to be able to get the value from my index.cshtml something like this:

var txt = Resources.Next

But that doesn't work.

Anyone have an idea?

Thanks for the help!

Regards,
Egbert

azure-webapps-development
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

EgbertBeuker-7647 avatar image
0 Votes"
EgbertBeuker-7647 answered ajkuma-MSFT commented

Sorry, got it working...

It works like this:

 var test = Resources.Resources.Next;

or

 var test = HttpContext.GetGlobalResourceObject("Resources", "Next");

and in the page:

 <button>@Resources.Resources.Next</button>
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@EgbertBeuker-7647, Thanks for the follow-up and sharing the solution that worked with the community. It's much appreciated.
If you have any further questions on this topic, please let us know we will be more than happy to assist you.

0 Votes 0 ·