Skip to content

Commit

Permalink
Change the date and time formats for English localization (closes #162)
Browse files Browse the repository at this point in the history
- default English locale is now en-GB
- a new option to switch to en-US
  • Loading branch information
dymanoid committed Aug 26, 2018
1 parent eeb26d6 commit bfd897e
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/RealTime/Config/RealTimeConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ public RealTimeConfig(bool latestVersion)
[ConfigItemCheckBox]
public bool ShowIncompatibilityNotifications { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the mod should use the English-US time and date formats, if the English language is selected.
/// </summary>
[ConfigItem("Tools", 1)]
[ConfigItemCheckBox]
public bool UseEnglishUSFormats { get; set; }

/// <summary>Checks the version of the deserialized object and migrates it to the latest version when necessary.</summary>
public void MigrateWhenNecessary()
{
Expand Down
2 changes: 2 additions & 0 deletions src/RealTime/Core/RealTimeCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public static RealTimeCore Run(
LoadStorageData(new[] { configProvider }, StorageBase.CurrentLevelStorage);
}

localizationProvider.SetEnglishUSFormatsState(configProvider.Configuration.UseEnglishUSFormats);

var timeInfo = new TimeInfo(configProvider.Configuration);
var buildingManager = new BuildingManagerConnection();
var randomizer = new GameRandomizer();
Expand Down
1 change: 1 addition & 0 deletions src/RealTime/Core/RealTimeMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ private void ApplyLanguage()

if (localizationProvider.LoadTranslation(LocaleManager.instance.language))
{
localizationProvider.SetEnglishUSFormatsState(configProvider.Configuration.UseEnglishUSFormats);
core?.Translate(localizationProvider);
}

Expand Down
1 change: 1 addition & 0 deletions src/RealTime/Localization/Translations/de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<translation id="Tools" value="Tools" />
<translation id="ShowIncompatibilityNotifications" value="Zeige Inkompatibilitäts-Notifikationen mit anderen Mods" />
<translation id="UseEnglishUSFormats" value="USA-Format für Datum und Uhrzeit für die Englische Spache" />
<translation id="ResetToDefaults" value="Alle Optionen zurücksetzen" />
<translation id="UseForNewGames" value="Aktuelle Einstellungen für neue Spiele verwenden" />

Expand Down
3 changes: 2 additions & 1 deletion src/RealTime/Localization/Translations/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<translation id="Minutes" value="min." />

<translation id="Tools" value="Tools" />
<translation id="ShowIncompatibilityNotifications" value="Show mod incompatibility notifications" />
<translation id="ShowIncompatibilityNotifications" value="Show mod incompatibility notifications" />
<translation id="UseEnglishUSFormats" value="Use USA time and date format with English language" />
<translation id="ResetToDefaults" value="Reset all to defaults" />
<translation id="UseForNewGames" value="Use current values for new games" />

Expand Down
1 change: 1 addition & 0 deletions src/RealTime/Localization/Translations/es.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<translation id="Tools" value="Herramientas" />
<translation id="ShowIncompatibilityNotifications" value="Show mod incompatibility notifications" />
<translation id="UseEnglishUSFormats" value="Use USA time and date formats with English language" />
<translation id="ResetToDefaults" value="Restablecer todo por defecto" />
<translation id="UseForNewGames" value="Usar los valores actuales para nuevas partidas" />

Expand Down
1 change: 1 addition & 0 deletions src/RealTime/Localization/Translations/fr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<translation id="Tools" value="Outils" />
<translation id="ShowIncompatibilityNotifications" value="Montrer les notifications de mods incompatibles." />
<translation id="UseEnglishUSFormats" value="Use USA time and date formats with English language" />
<translation id="ResetToDefaults" value="Tout réinitialiser aux valeurs par défaut" />
<translation id="UseForNewGames" value="Utiliser les valeurs actuelles pour les prochaines parties" />

Expand Down
4 changes: 3 additions & 1 deletion src/RealTime/Localization/Translations/ko.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
<translation id="RestrictedModeMessage" value="Real Time이 제한된 모드로 실행중에 있습니다. 몇몇 기능들이 꺼집니다. 서드 파티 라이브러리의 문제 이거나 혹은 모드가 호환되지 않아서 일수 있습니다. 도움이 필요하시다면 게임 로그파일을 모드 개발자에게 보내주세요." />
<translation id="ModNotWorkingMessage" value="어이쿠! 무엇인가 잘못되었습니다 - 모드가 정상 동작하지 않습니다! 모드 제작자에게 로그 파일을 보내주세요." />
<translation id="IncompatibleModsFoundMessage" value="Real Time 모드가 최소 한개 이상의 호환되지 않는(혹은 부분적으로 호환되지 않는) 모드를 발견했습니다. 해당 모드를 구독해제 하시는 것을 추천드립니다. 여러분이 원하신다면 놔두셔도 상관없지만, 게임이 정상적으로 흐르지 않거나 튕길 가능성이 있습니다." />
<translation id="Minutes" value="" />
<translation id="Minutes" value="" />

<translation id="Tools" value="도구" />
<translation id="ShowIncompatibilityNotifications" value="호환되지 않는 모드 알람 보이기" />
<translation id="UseEnglishUSFormats" value="Use USA time and date formats with English language" />
<translation id="ResetToDefaults" value="모두 초기값으로 되돌리기" />
<translation id="UseForNewGames" value="새 게임에 현재 값을 사용" />

Expand Down
1 change: 1 addition & 0 deletions src/RealTime/Localization/Translations/pl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<translation id="Tools" value="Tools" />
<translation id="ShowIncompatibilityNotifications" value="Show mod incompatibility notifications" />
<translation id="UseEnglishUSFormats" value="Use USA time and date formats with English language" />
<translation id="ResetToDefaults" value="Reset all to defaults" />
<translation id="UseForNewGames" value="Use current values for new games" />

Expand Down
1 change: 1 addition & 0 deletions src/RealTime/Localization/Translations/pt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<translation id="Tools" value="Ferramentas" />
<translation id="ShowIncompatibilityNotifications" value="Show mod incompatibility notifications" />
<translation id="UseEnglishUSFormats" value="Use USA time and date formats with English language" />
<translation id="ResetToDefaults" value="Reiniciar para os padrões" />
<translation id="UseForNewGames" value="Use current values for new games" />

Expand Down
1 change: 1 addition & 0 deletions src/RealTime/Localization/Translations/ru.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<translation id="Tools" value="Утилиты" />
<translation id="ShowIncompatibilityNotifications" value="Показывать сообщения о несовместимости с другими модами" />
<translation id="UseEnglishUSFormats" value="Использовать формат даты/времени как в США для английского языка" />
<translation id="ResetToDefaults" value="Вернуть опции по умолчанию" />
<translation id="UseForNewGames" value="Использовать текущие настройки для новых игр" />

Expand Down
1 change: 1 addition & 0 deletions src/RealTime/Localization/Translations/zh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<translation id="Tools" value="工具" />
<translation id="ShowIncompatibilityNotifications" value="Show mod incompatibility notifications" />
<translation id="UseEnglishUSFormats" value="Use USA time and date formats with English language" />
<translation id="ResetToDefaults" value="重设至默认" />
<translation id="UseForNewGames" value="Use current values for new games" />

Expand Down

0 comments on commit bfd897e

Please sign in to comment.