Copy of #8867
Explain the extensibility points in localization APIs, including:
- Create a custom RequestCultureProvider.
- Create a custom StringLocalizer.
/cc @Rick-Anderson @ryanbrandenburg
@hishamco did you want this in docs.microsoft.com/en-us/aspnet/core/fundamentals/localization ?
Can you provide code samples for those?
Yep they should go there, by adding a new section after PO Localization section
Can you provide code samples for those?
I already have many sample such as My.Extensions.Localization.Json, My.AspNetCore.Localization.Json, My.AspNetCore.Localization.Session
โ Do not edit this section. It is required for docs.microsoft.com โ GitHub issue linking.
CC @eriawan in case you're interested in helping out on this one.
@Rick-Anderson I'm interested on this one ๐
@Rick-Anderson
Yes, I'd love to work on this one, but I think I will finish the client side (user agent) culture handling article first.
I'll wait for @hishamco to do the Document Localization Extensibility first ๐
No problem we can work together on this :smile:
@hishamco thanks! ๐
Abstract
Items to track
RequestCultureProvider with sample codeStringLocalizer with sample codePlease if there 's anything need to be added let me know /cc @Rick-Anderson @ryanbrandenburg also hope to here from the community folks @damienbod @Bartmax
How dose IStringLocalizer chooses which types are localized?
This is valuable stuff, but I really don't want talk about implementing your own RequestCultureProvider and IStringLocalizer included on the main Localization doc page as the document details here seem to imply. That page is already massive and covers a ton of topics, including something as advanced and niche as writing your own extensibility is likely to cause more confusion than it solves.
If we're thinking of this as a separate page or blog post then I have no problems.
If we're thinking of this as a separate page or blog post then I have no problems.
Or create it as a discussion issue. I'd be happy to edit/help.
@lucaGabi I think you need to check the README.md file of the localization repo which contains examples for both custom RequestCultureProvider and IStringLocalizer
This is valuable stuff, but I really don't want talk about implementing your own RequestCultureProvider and IStringLocalizer included on the main Localization doc page as the document details here seem to imply.
My intend is to separate this into another page, which I think don't have any problem with you ๐
Having recently written (and continuing to maintain) a reasonably comprehensive piece of request localization middleware that extends the framework's native tools I would be very interested to read docs on this topic!
@hishamco let me know if I can help you get started on this.
Sorry I was sick after that too busy, let me start on this week, of course I will let you know when I need your help .. thanks
I think it's the time to start to finalize this ..
guys, I'm sorry I could not finish this sooner.
big apologize...
I'm quite busy this last 4 months with main jobs.
@hishamco I would like to help you to test the doc you have submitted as PR
@eriwan I'd like to help you on you in your other PR if you submitted ๐
@Rick-Anderson this is takes so long because my ankle was broken since 3-4 months ago, hope to push some updates ASAP
@hishamco sorry to hear that. Hope you're feeling better. No hurry.
Thanks Rick .. hope to work on this in the next few days ..