Skip to content
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

CultureInfo should independent from local computer settings (Lombiq Technologies: OCORE-86) #12467

Merged
merged 38 commits into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8d27f7f
CultureInfo should independent from local computer settings
hishamco Sep 21, 2022
13c7e71
LocalizationOptions -> CultureLocalizationOptions
hishamco Sep 21, 2022
513deb6
Ability to set the user selected culture settings via CultureScope
hishamco Sep 21, 2022
09ae038
Add GetCultureSettingsAsync() to ILocalizationService
hishamco Sep 21, 2022
8a73fe4
Fix the build
hishamco Sep 21, 2022
a3943c6
Use ShellScope.Services
hishamco Sep 21, 2022
c19f09f
Fix CultureScopeTests
hishamco Sep 21, 2022
ed03682
Add cultureSettings param
hishamco Sep 22, 2022
a6814bb
Update LocalizationSettings.cs
sebastienros Sep 22, 2022
c147a58
Update LocalizationService.cs
sebastienros Sep 22, 2022
80f35c7
Update Startup.cs
sebastienros Sep 22, 2022
aec12f5
Update CultureScope.cs
sebastienros Sep 22, 2022
6f82230
Update ILocalizationService.cs
sebastienros Sep 22, 2022
7732ae2
Update DefaultLocalizationService.cs
sebastienros Sep 22, 2022
ea11abe
Update CultureScopeTests.cs
sebastienros Sep 22, 2022
7ad6674
Merge remote-tracking branch 'origin/hishamco/culture-info' into hish…
hishamco Sep 24, 2022
33d949e
Bring CultureLocalizationOptions
hishamco Sep 24, 2022
75a6271
Address feedback
hishamco Sep 24, 2022
1ba99ba
Revert changes in localization service
hishamco Sep 24, 2022
7b1d4ad
Update OC.Settings
hishamco Sep 24, 2022
ba30774
Cleanup
hishamco Sep 24, 2022
f09b7a3
Add docs
hishamco Sep 24, 2022
b9d31dc
Rename params
hishamco Sep 26, 2022
df51b5e
Rename section name
hishamco Sep 26, 2022
198aa65
Move CultureOptions registration into AddDefaultServices()
hishamco Sep 26, 2022
1a64d88
Update appsettings.json
hishamco Sep 26, 2022
ba0796b
Simplification
hishamco Sep 29, 2022
464194a
Add missing docs
hishamco Sep 30, 2022
2af3693
Fix useUserOverride value
hishamco Sep 30, 2022
624d69c
Add SetDefaultCulture() extension method
hishamco Sep 30, 2022
021a0e1
Simplification with OrchardCoreRequestLocalizationOptions
hishamco Sep 30, 2022
1400dbd
Don't use optional params in constructor
hishamco Sep 30, 2022
7139293
Fix the build
hishamco Sep 30, 2022
d716912
Address feedback
hishamco Sep 30, 2022
5c56161
Remove extra line
hishamco Oct 1, 2022
c76fc25
Fix typo
hishamco Oct 1, 2022
01ed694
Refer to the issue in the remarks tag
hishamco Oct 1, 2022
1abcbf0
Address feedback
hishamco Oct 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ public class CultureOptions
/// <summary>
/// Gets or sets whether to ignore the system culture settings or not.
hishamco marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
/// <remarks>The current culture should not depend on local computer settings by default. For more information refer to https://github.com/OrchardCMS/OrchardCore/issues/11228</remarks>
public bool IgnoreSystemSettings { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace OrchardCore.Localization
/// <summary>
/// Represents a scope that you can change the current culture within.
/// </summary>
/// <remarks>The scope disallow the current culture depends on local computer settings by default. For more information refer to https://github.com/OrchardCMS/OrchardCore/issues/11228</remarks>
Piedone marked this conversation as resolved.
Show resolved Hide resolved
public sealed class CultureScope : IDisposable
{
private readonly CultureInfo _originalCulture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ public class OrchardCoreRequestLocalizationOptions : RequestLocalizationOptions
private readonly bool _useUserOverride;

/// <summary>
/// Creates a new <see cref="OrchardCoreRequestLocalizationOptions"/> with adefault values.
/// Creates a new <see cref="OrchardCoreRequestLocalizationOptions"/> with default values.
/// </summary>
public OrchardCoreRequestLocalizationOptions() : this(ignoreSystemSettings: false)
{

}

/// <summary>
/// Creates a new <see cref="OrchardCoreRequestLocalizationOptions"/> with adefault values and ability to ignore system settings.
/// Creates a new <see cref="OrchardCoreRequestLocalizationOptions"/> with default values and ability to ignore system settings.
/// <param name="ignoreSystemSettings">Whether to ignore the system culture settings or not.</param>
/// </summary>
public OrchardCoreRequestLocalizationOptions(bool ignoreSystemSettings) : base()
Expand Down