Skip to content

Commit

Permalink
Code tweaks in TranslationSource class (#688)
Browse files Browse the repository at this point in the history
  • Loading branch information
IhateTrains authored Nov 21, 2024
1 parent 8bb24aa commit 1a8e09a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build_frontend/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ then

if [ "$RUNNER_OS" = "macOS" ]
then
brew uninstall packaging
brew uninstall python-packaging
fi

PIP_BREAK_SYSTEM_PACKAGES=1 pip3 install -r requirements.txt
Expand Down
10 changes: 5 additions & 5 deletions Fronter.NET/Extensions/TranslationSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private TranslationSource() {
cultureInfo = CultureInfo.GetCultureInfo(cultureName);
} catch (CultureNotFoundException) {
logger.Debug($"Culture {cultureName} for language {langKey} not found!");
if (langKey == "english") {
if (string.Equals(langKey, "english", StringComparison.OrdinalIgnoreCase)) {
cultureInfo = CultureInfo.InvariantCulture;
} else {
return;
Expand Down Expand Up @@ -95,7 +95,7 @@ private void LoadLanguages() {
var fileNames = SystemUtils.GetAllFilesInFolder("Configuration");

foreach (var fileName in fileNames) {
if (!fileName.EndsWith(".yml")) {
if (!fileName.EndsWith(".yml", StringComparison.OrdinalIgnoreCase)) {
continue;
}

Expand Down Expand Up @@ -148,9 +148,9 @@ private void LoadLanguages() {
}
}

public IList<string> LoadedLanguages { get; } = new List<string>();
private readonly Dictionary<string, CultureInfo> languages = new();
private readonly Dictionary<string, Dictionary<string, string>> translations = new(); // key, <language, text>
public IList<string> LoadedLanguages { get; } = [];
private readonly Dictionary<string, CultureInfo> languages = [];
private readonly Dictionary<string, Dictionary<string, string>> translations = []; // key, <language, text>

private string currentLanguage = "english";
public string CurrentLanguage {
Expand Down

0 comments on commit 1a8e09a

Please sign in to comment.