Skip to content

Commit 85f6841

Browse files
committed
chore: fix bad code smell
1 parent 2eebad0 commit 85f6841

File tree

1 file changed

+11
-11
lines changed
  • src/BuildingBlocks/Globalization/Masa.BuildingBlocks.Globalization.I18N

1 file changed

+11
-11
lines changed

src/BuildingBlocks/Globalization/Masa.BuildingBlocks.Globalization.I18N/I18N.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Masa.BuildingBlocks.Globalization.I18N;
66
public static class I18N
77
{
88
private static readonly IServiceProvider _serviceProvider = MasaApp.RootServiceProvider;
9-
private static readonly II18N Ii18N = InitI18N();
9+
private static readonly II18N _i18N = InitI18N();
1010
private static readonly ILanguageProvider _languageProvider = InitLanguage();
1111

1212
static II18N InitI18N() => _serviceProvider.GetRequiredService<II18N>();
@@ -18,68 +18,68 @@ public static class I18N
1818
/// </summary>
1919
/// <param name="name">The name of the string resource.</param>
2020
/// <returns></returns>
21-
public static string T(string name) => Ii18N.T(name);
21+
public static string T(string name) => _i18N.T(name);
2222

2323
/// <summary>
2424
/// Gets the string resource with the given name.
2525
/// </summary>
2626
/// <param name="name">The name of the string resource.</param>
2727
/// <param name="returnKey">Return Key when key does not exist, default: true</param>
2828
/// <returns></returns>
29-
public static string? T(string name, bool returnKey) => Ii18N.T(name, returnKey);
29+
public static string? T(string name, bool returnKey) => _i18N.T(name, returnKey);
3030

3131
/// <summary>
3232
/// Gets the string resource with the given name and formatted with the supplied arguments.
3333
/// </summary>
3434
/// <param name="name">The name of the string resource.</param>
3535
/// <param name="arguments">The values to format the string with.</param>
36-
public static string T(string name, params object[] arguments) => Ii18N.T(name, arguments);
36+
public static string T(string name, params object[] arguments) => _i18N.T(name, arguments);
3737

3838
/// <summary>
3939
/// Gets the string resource with the given name and formatted with the supplied arguments.
4040
/// </summary>
4141
/// <param name="name">The name of the string resource.</param>
4242
/// <param name="returnKey">Return Key when key does not exist, default: true</param>
4343
/// <param name="arguments">The values to format the string with.</param>
44-
public static string? T(string name, bool returnKey, params object[] arguments) => Ii18N.T(name, returnKey, arguments);
44+
public static string? T(string name, bool returnKey, params object[] arguments) => _i18N.T(name, returnKey, arguments);
4545

46-
public static CultureInfo GetCultureInfo() => Ii18N.GetCultureInfo();
46+
public static CultureInfo GetCultureInfo() => _i18N.GetCultureInfo();
4747

4848
/// <summary>
4949
/// Set the CultureName
5050
/// Data used to define "regional options", standards, formats, etc
5151
/// </summary>
5252
/// <param name="cultureName">A predefined <see cref="T:System.Globalization.CultureInfo" /> name, <see cref="P:System.Globalization.CultureInfo.Name" /> of an existing <see cref="T:System.Globalization.CultureInfo" />, or Windows-only culture name. <paramref name="name" /> is not case-sensitive.</param>
5353
/// <param name="useUserOverride">A Boolean that denotes whether to use the user-selected culture settings (<see langword="true" />) or the default culture settings (<see langword="false" />).</param>
54-
public static void SetCulture(string cultureName, bool useUserOverride = true) => Ii18N.SetCulture(cultureName, useUserOverride);
54+
public static void SetCulture(string cultureName, bool useUserOverride = true) => _i18N.SetCulture(cultureName, useUserOverride);
5555

5656
/// <summary>
5757
/// Set the CultureName
5858
/// Data used to define "regional options", standards, formats, etc
5959
/// </summary>
6060
/// <param name="culture"></param>
61-
public static void SetCulture(CultureInfo culture) => Ii18N.SetCulture(culture);
61+
public static void SetCulture(CultureInfo culture) => _i18N.SetCulture(culture);
6262

6363
/// <summary>
6464
/// get interface language
6565
/// </summary>
6666
/// <returns></returns>
67-
public static CultureInfo GetUiCultureInfo() => Ii18N.GetUiCultureInfo();
67+
public static CultureInfo GetUiCultureInfo() => _i18N.GetUiCultureInfo();
6868

6969
/// <summary>
7070
/// Set the CultureName for the current request
7171
/// Used to set the interface language
7272
/// </summary>
7373
/// <param name="cultureName">A predefined <see cref="T:System.Globalization.CultureInfo" /> name, <see cref="P:System.Globalization.CultureInfo.Name" /> of an existing <see cref="T:System.Globalization.CultureInfo" />, or Windows-only culture name. <paramref name="name" /> is not case-sensitive.</param>
7474
/// <param name="useUserOverride">A Boolean that denotes whether to use the user-selected culture settings (<see langword="true" />) or the default culture settings (<see langword="false" />).</param>
75-
public static void SetUiCulture(string cultureName, bool useUserOverride = true) => Ii18N.SetUiCulture(cultureName, useUserOverride);
75+
public static void SetUiCulture(string cultureName, bool useUserOverride = true) => _i18N.SetUiCulture(cultureName, useUserOverride);
7676

7777
/// <summary>
7878
/// Set the CultureName for the current request
7979
/// Used to set the interface language
8080
/// </summary>
8181
/// <param name="culture"></param>
82-
public static void SetUiCulture(CultureInfo culture) => Ii18N.SetUiCulture(culture);
82+
public static void SetUiCulture(CultureInfo culture) => _i18N.SetUiCulture(culture);
8383

8484
public static IReadOnlyList<LanguageInfo> GetLanguages() => _languageProvider.GetLanguages();
8585
}

0 commit comments

Comments
 (0)