Join Chris Woodruff for an in-depth discussion in this video Creating a custom localizer, part of ASP.NET Core: Internationalization.
- [Instructor] So let's finish up our CustomLocalizer.…I'm going to go into MyStringLocalizer.…And I need two properties in this for it to work.…The first one is a public property,…it will return a LocalizedString.…It will use the same name as the class…for the property.…And we are going to send in a name.…And this will only have a get on the property,…it won't have a set.…
So I need to say var,…and I need to get the culture of the application.…So I'm going to check to see if…_culture is filled in.…If it's not, then I'm going to go out…to CultureInfo and get the Current UICulture.…I'm also going to get the translation string…that we get back from our strings that we populated.…
So in this FirstOrDefault,…I'm going to do a search on…both the culture and the name.…And I'm also going to do a search…on the name passed into the property.…Then I'm going to return that as a LocalizedString,…with one caveat.…
If the translation came back with…nothing, meaning an empty string,…I'm going to send back the name, instead.…So the second property is very…
- Globalization and localization
- Internationalization considerations
- Creating the ASP.NET Core project
- Using the HTTP Accept-Language header
- Using the ASP.NET Core store project
- Displaying content with the controller
- Modifying the views
- Selecting a culture with cookies
- Systems of measurement formats
Skill Level Advanced
ASP.NET Core: Test-Driven Developmentwith Richard Rout37m 30s Intermediate
1. Introduction to Internationalization
2. Strategies for Internationalization
3. ASP.NET Core Configuration for Internationalization
4. Custom Internationalization
Next steps1m 7s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.