| | | 1 | | namespace Kestrun.Localization; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Options for configuring PowerShell-style localization using string table files. |
| | | 5 | | /// </summary> |
| | | 6 | | public sealed class KestrunLocalizationOptions |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// Gets or sets the default culture to use when no match is found. Default is "en-US". |
| | | 10 | | /// </summary> |
| | 48 | 11 | | public string DefaultCulture { get; set; } = "en-US"; |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// Gets or sets the base path for localization resources. Default is "i18n". |
| | | 15 | | /// </summary> |
| | 64 | 16 | | public string ResourcesBasePath { get; set; } = "i18n"; |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Gets or sets the localization file name. Default is "Messages.psd1". |
| | | 20 | | /// </summary> |
| | 58 | 21 | | public string FileName { get; set; } = "Messages.psd1"; |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// Gets or sets the query string key used to request a culture. Default is "lang". |
| | | 25 | | /// </summary> |
| | 18 | 26 | | public string QueryKey { get; set; } = "lang"; |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Gets or sets the cookie name used to request a culture. Default is "lang". |
| | | 30 | | /// </summary> |
| | 17 | 31 | | public string CookieName { get; set; } = "lang"; |
| | | 32 | | |
| | | 33 | | /// <summary> |
| | | 34 | | /// Gets or sets a value indicating whether Accept-Language should be used. Default is true. |
| | | 35 | | /// </summary> |
| | 22 | 36 | | public bool EnableAcceptLanguage { get; set; } = true; |
| | | 37 | | |
| | | 38 | | /// <summary> |
| | | 39 | | /// Gets or sets a value indicating whether query string resolution is enabled. Default is false. |
| | | 40 | | /// </summary> |
| | 11 | 41 | | public bool EnableQuery { get; set; } |
| | | 42 | | |
| | | 43 | | /// <summary> |
| | | 44 | | /// Gets or sets a value indicating whether cookie resolution is enabled. Default is false. |
| | | 45 | | /// </summary> |
| | 8 | 46 | | public bool EnableCookie { get; set; } |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// Gets or sets a value indicating whether to set the thread's culture to the resolved culture. Default is false. |
| | | 50 | | /// </summary> |
| | 8 | 51 | | public bool SetDefaultThreadCulture { get; set; } |
| | | 52 | | } |