Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

Latest commit

 

History

History
22 lines (14 loc) · 1012 Bytes

I18N.md

File metadata and controls

22 lines (14 loc) · 1012 Bytes

Toucan - Localization

Below are some details relating to localization support

The EF model builders for both Mssql and Postgres generate tables with

  • datetime fields which store timezone
  • string fields which support unicode

When coding you should always save dates as local UTC time. Datetime values are implicitly converted for any requests handled by Asp.NET Core controllers. This is done by registering a

  • custom modelbinder (for handling inbound datetime values)
  • custom json formatter (for handling both inbound and outbound datetime values)

Each of the above customizations to the pipeline uses an injected instance of IHttpServiceContextResolver to return an instance of IDomainContext. The IDomainContext exposes the current

  • culture
  • timezone
  • user details

The ILocalizationService can be used to get a full list of all supported cultures, timezones, and create a dictionary of culture-specific resource strings.

The default implementation of the localization service is thread-safe.