-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Localization needs a redesign #1142
Comments
I think Json resources it's a good idea! |
👍 On Json Resources |
👍 I tend to agree with most points put forward by @damienbod. The amount of hoops developers have to jump through to migrate projects relying on strongly-typed .resx resources is a bit over the top. It took me a while to figure out why a project I am supposed to migrate to MVC6 would not work just because resx resources get embedded with the wrong resource identifier if the project's default namespace differs from the project name. The fact that the generated designer.cs defaults to making everything internal just makes everything even more painful. |
From my point of view the tooling problem is the biggest problem because I think it blocks some things that are supposed to be possible but I'm not sure what is supposed to be possible. For example maybe it is supposed to still be possible to use resx files the old way with a default resx file and designer and static access but since the tooling forces the designer class as internal it is not currently possible. Or maybe it is not supposed to be possible to use static resources anymore, it is unclear what the intention is. The lack of clarity on what is supposed to work is a problem that could be helped if there were some documentation or guidance. I spent 2 hours yesterday installing VS 2015 update 1 in hopes that it would fix the tooling problems but it did not. The issue about needing a class name or type to identify the resource doesn't really bother me because resx files always did have a class in the past in the designer.cs file so it doesn't seem unreasonable to me that a class is required even if we no longer use static access. Since it can be any class like HomeController or whatever many people will not need any extra class but for the case of sharing a resx file it does not bother me to need to create an empty class that the resx files will be named after. it creates no burden of maintenance and it is cleaner for me to own that class rather than have it generated like designer.cs files were. Myself I just want to use shared resx files from a folder beneath the web app, and other than the tooling problems I do not feel blocked on that right now. Currently the ResourceManagerStringLocalizerFactory.cs does not do what I want because it doesn't work if the class that the resx file is named after is in a class library and not in the web app. But if that is not determined by the team to be a bug I can easily implement my own SharedResxStringLocalizerFactory that would behave exactly as I want it to. My main reasons for wanting to use shared resx files is because they are easy to work with and I have some existing resx files from a previous project that I can potentially harvest and re-purpose. The most reliable translator that helped in my previous project used excel to edit the resx files he translated and that was convenient for him. Embedded resx files and satellite assemblies are much more inconvenient to work with. use of json like in resjson might be interesting especially for localizing SPA style javascript apps but in that case I think I would lean towards more separate smaller files rather than larger shared resource files. I suppose I could also generate json on the server from the resx file if I want to keep using resx. So from my point of view I can't really agree that a redesign is needed for localization. I would like to see more clear guidance on techniques that are supposed to work and I would like to see the tooling issues fixed. |
👍 Cannot add much more to what everyone else has already said, other than that I share the concerns. |
Completely agreed. Like I said in the following post aspnet/Localization#153 it is back to the drawing board on this one. RTM cannot be released without this all fixed and properly tested. Why all this had to be picked up by the community and was not picked up by Microsoft testers is evident of lack of testing, so test more! |
These are top 4 things that I would like to see fixed before RTM
|
Completely agreed with damienbod. After days of spending on localizations, I couldn't find a way that works. Please consider a review on the design. I don't see this way of localization as an improvement. |
@DamianEdwards ping to remind you to update this issue with the changes we discussed. |
Hi Damian Thanks for this. I have updated the title of aspnet/Localization#153 to be more relevant to the remaining issue being discussed in there which relates to "A shared resource requires an empty class to work per default" stated by Damien above. |
Thanks, looks promising. Any chance of a Json resource template? Greetings Damien |
Thanks @DamianEdwards Looking forward to the next drop with these changes |
Thanks @DamianEdwards |
@DamianEdwards thanks for your work, but the link is not working anymore. Did you move your localization sample somewhere? |
I updated his post with an updated link https://github.com/aspnet/Entropy/tree/dev/samples/Localization.StarterWeb |
@davidfowl, thank you! |
thanks, @davidfowl :) |
Hi everyone Localization still does not support Shared Resources using a string identifier instead of a type, so I have opened another issue. |
Hi
At present rc1, the provided localization solution does not provide a good solution for developers. I think the new ASPNET is great, but the new localization solution is really not an improvement. Judging by all the problems in rc1 for localization, this has not really been though through or the different teams don’t seem to work together.
You can find issues in all the different repos for the following problems, some closed even though the problem still exists.
Direct resource dependencies are undesired, as I would like to use the resources using the DI framework.
Would it not be time to reconsider the solution? If the recommended localization is released as it is, you’re just taking away from all the other good parts of ASP.NET 5 and will frustrate many developers. The recommended new localization is not usable for my default application.
Greetings and thanks Damien
The text was updated successfully, but these errors were encountered: