-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with globalization asp.net core 3.1 not getting value just key #18026
Comments
Hi @pranavkm this is defo an issue No matter what i cannot get the resource file to show found and get the value of the key and not just the key. |
I can give you Full access to my repo if u have a DevOps account and SQL database? |
Hi @pranavkm Here is a full completed example of globalization not working in 3.1 So please for the love of God tell me what I am doing wrong this needs looked at . Full Git Repo |
Hi, I ran into a very similar problem. I have a lot of razor pages where I inject IStringLocalizers. I created a small sample containing two projects. Localization_Before targets asp.net core 2.2 and Localization_After targets asp.net core 3.1. Hope this helps :) |
@Metetron Thanks hopefully they be able to understand this is a issue in 3.1 I created a project with all the suggestions made on so but none of them work localization is def broken in terms of 3.1 we just need them to admit it. |
@Metetron That means IStringLocater is defo broke in 3.1 and no our project is 3.1 so need this working |
@Metetron I noticed also your example only uses views and not controllers I believe that there is an issue in controllers as well according to my github |
I am still getting blank with this method brand new asp.net 2.0 project private readonly IStringLocalizer _localizer;
|
#17733 is the same as my issue. I tried the proposed workaround of moving the SharedResources.cs- File out of the resources folder and it worked. @davidbuckleyni For testing I added a controller and a view into my test project and was able to reproduce your exact issue. The workaround mentioned above also worked here. Nevertheless I hope this gets fixed. I published my example project here: https://github.com/Metetron/AspNetCore3.1-Localization-Issue |
:Metetron I totally agree I would look at it myself If I could but im not part of the team. |
@Metetron Also the accessability of being able to do Resources.ResourceName to get the value from the default resource appears to be broken as well. |
Solved this It ended being I had to add the following I re did my Project. var supportedCultures = new string[] { "en-GB", "fr-FR" }; Also, I don't believe the above step was in the documentation i believe it needs to be adjusted. |
I have setup globalization as per the documents here but something must be wrong cause I am only getting the value of the key not the value of the resource.
Please find a short screencast video explaining this.
https://drive.google.com/file/d/1DaKvRlM9iRS5_1zvJjqTZlOE16UhhE6r/view
I am using the docs links here
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization?view=aspnetcore-3.1
The following is my code which i have more or less copied from the document link above.
This is my controller where I am accessing the resouce file key
But I am not getting the value that is in my resource file I am just getting the text StockPageTItle which is incorrect also how does one give the en-GB as default in asp.net core routes that is not explained in the docs.
![enter image description here](https://camo.githubusercontent.com/b7d303f9b0b5c537f673736d4d675e13b216b6673f9c8cb6fba4566a654662f4/68747470733a2f2f692e696d6775722e636f6d2f6d376f475931722e706e67)
enter code here
Please note also this screenshot saying the following. I presume it's not finding the resource even though I have the naming correct my culture is en-GB by the way.
The text was updated successfully, but these errors were encountered: