-
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
Things may consider for Localization 3.0.0 #3289
Comments
@ryanbrandenburg could you please have a look |
@pranavkm could you please have a look, or forward it to one of your team if you don't mind |
|
Any chance that support could be added for refreshing cached localizers so that localization strings can be updated live? Currently, after a cshtml file is modified, the changes made are displayed the next time the relevant page is refreshed. However, due to the way localizer caching works, data annotation translations are cached when they are first loaded. Restarting the site is required to refresh the cache. It would be nice to have symmetry of behavior here--save a cshtml file or a translation file and the update is reflected live. From the localizer developer's perspective, the easiest way to do this might be allowing the localizer to specify a caching strategy when it's created/registered(singleton, per request, etc.). Reference: aspnet/Mvc#7887 (comment) |
Sorry for not seeing this earlier, @hishamco. |
I would also welcome support for multiple shared resources, for DataAnnotationsLocalization, view localization and localization. Then it we be easy to use resources from multiple packages, projects, where each brings it's own localization. For example I could have 1 shared resource for each feature X, and use this in my main project. |
@mkArtakMSFT no problem, I knew you 're busy with the team |
@hishamco yes |
BTW I started a prototype to do such thing two weeks ago, hope I can share it with you and make a blog post about it, nothing but have a built-in an optimal solution will be handy for all the developers |
Thanks for sharing your ideas folks. @bgribaudo, can you please file a separate issue for the following ask. We would like to review it further:
@damienbod, please file a separate issue with more details regarding your scenarios, as it's not really clear what the ask is. |
@mkArtakMSFT regarding the pluralization, we need to provide a base infrastructure to support it, after that we can build a new provider or use Orchard Core package on top of the suggested APIs |
There 're some points I'd like to share with you guys, that may we consider for localization 3.0.0:
Microsoft.Extensions.Localization.ResourceManager
, this is useful for APIs organization and if we add another localization source provider such asPOStringLocalizer
also to align with other ASP.NET Core repos such as Configuration, Security .. etcMemoryCache
instead of usingIResourceNamesCache
&ResourceNamesCache
, no need to reivent the wheel, while we are have a rich and tested APIsResourceManager
resource set directly from withinResourceManagerStringLocalizer
instead of introducingIResourceStringProvider
&ResourceManagerStringProvider
. If I'm not wrong those APIs was introduced because the lack and limitation of theResourceManager
resource set APIs support in .NET Core in the pastPOStringLocalizer
IStringLocalizerFactory
theCreate(baseName, assembly)
is not used except testing, also theCreate()
needs to be more generic rather it is used forResourceManager
MoveWithCulture
as extension method (if it's needed)IStringLocalizer
extensions methods - exceptGetAllString()
, because I didn't see any value except calling the indexer from within a methodSearchedLocation
property fromLocalizedString
and move it into a common place, because all the resource should searched in a certain location(s)/cc @mkArtakMSFT
The text was updated successfully, but these errors were encountered: