diff options
author | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-06-28 12:41:20 +0000 |
---|---|---|
committer | k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2009-06-28 12:41:20 +0000 |
commit | 208595ac674dfaeb586e07c8c11020298f5c6ddd (patch) | |
tree | 20f6b2f73bba8cb98edb6d0ade95f822291a6007 /src | |
parent | 78f15f68ff8f7097066c28012a1af6dbab880305 (diff) | |
download | usdx-208595ac674dfaeb586e07c8c11020298f5c6ddd.tar.gz usdx-208595ac674dfaeb586e07c8c11020298f5c6ddd.tar.xz usdx-208595ac674dfaeb586e07c8c11020298f5c6ddd.zip |
Translation of the language settings. Part 1
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1834 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src')
-rw-r--r-- | src/base/UIni.pas | 49 | ||||
-rw-r--r-- | src/screens/UScreenOptionsGame.pas | 2 |
2 files changed, 44 insertions, 7 deletions
diff --git a/src/base/UIni.pas b/src/base/UIni.pas index 2bcc7305..8cf01081 100644 --- a/src/base/UIni.pas +++ b/src/base/UIni.pas @@ -36,8 +36,8 @@ interface uses Classes, IniFiles, - ULog, - SysUtils; + SysUtils, + ULog; type // TInputDeviceConfig stores the configuration for an input device. @@ -254,6 +254,8 @@ const IMicBoost: array[0..3] of string = ('Off', '+6dB', '+12dB', '+18dB'); var + ILanguageTranslated: array of string; + IDifficultyTranslated: array[0..2] of string = ('Easy', 'Medium', 'Hard'); ITabsTranslated: array[0..1] of string = ('Off', 'On'); @@ -316,22 +318,57 @@ implementation uses StrUtils, - UMain, SDL, + UCommandLine, ULanguage, UPlatform, - USkins, + UMain, + UPath, URecord, - UCommandLine, - UPath; + USkins; (** * Translate and set the values of options, which need translation. *) procedure TIni.TranslateOptionValues; +const + NumberOfLanguages = 14; +var + ErrorStringStart: string; begin ULanguage.Language.ChangeLanguage(ILanguage[Language]); + + ErrorStringStart := 'The number of language files (' + + IntToStr(Length(ILanguage)) + ') is '; + + if Length(ILanguage) > NumberOfLanguages then + begin + Log.LogError(ErrorStringStart + 'larger than expected (' + IntToStr(NumberOfLanguages) + ').', + 'Ini.TranslateOptionValues'); + Halt; + end; + if Length(ILanguage) < NumberOfLanguages then + Log.LogWarn(ErrorStringStart + 'smaller than expected (' + IntToStr(NumberOfLanguages) + ').', + 'Ini.TranslateOptionValues'); + + SetLength(ILanguageTranslated, NumberOfLanguages); + + ILanguageTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_CATALAN'); + ILanguageTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_CROATIAN'); + ILanguageTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_DUTCH'); + ILanguageTranslated[3] := ULanguage.Language.Translate('OPTION_VALUE_ENGLISH'); + ILanguageTranslated[4] := ULanguage.Language.Translate('OPTION_VALUE_EUSKARA'); + ILanguageTranslated[5] := ULanguage.Language.Translate('OPTION_VALUE_FINNISH'); + ILanguageTranslated[6] := ULanguage.Language.Translate('OPTION_VALUE_FRENCH'); + ILanguageTranslated[7] := ULanguage.Language.Translate('OPTION_VALUE_GERMAN'); + ILanguageTranslated[8] := ULanguage.Language.Translate('OPTION_VALUE_GREEK'); + ILanguageTranslated[9] := ULanguage.Language.Translate('OPTION_VALUE_ITALIAN'); + ILanguageTranslated[10] := ULanguage.Language.Translate('OPTION_VALUE_JAPANESE'); + ILanguageTranslated[11] := ULanguage.Language.Translate('OPTION_VALUE_PORTUGUESE'); + ILanguageTranslated[12] := ULanguage.Language.Translate('OPTION_VALUE_SPANISH'); + ILanguageTranslated[13] := ULanguage.Language.Translate('OPTION_VALUE_SWEDISH'); + IDifficultyTranslated[0] := ULanguage.Language.Translate('OPTION_VALUE_EASY'); IDifficultyTranslated[1] := ULanguage.Language.Translate('OPTION_VALUE_MEDIUM'); IDifficultyTranslated[2] := ULanguage.Language.Translate('OPTION_VALUE_HARD'); diff --git a/src/screens/UScreenOptionsGame.pas b/src/screens/UScreenOptionsGame.pas index 1d741d25..0c152c41 100644 --- a/src/screens/UScreenOptionsGame.pas +++ b/src/screens/UScreenOptionsGame.pas @@ -137,7 +137,7 @@ begin Theme.OptionsGame.SelectLanguage.showArrows := true; Theme.OptionsGame.SelectLanguage.oneItemOnly := true; - AddSelectSlide(Theme.OptionsGame.SelectLanguage, Ini.Language, ILanguage); + AddSelectSlide(Theme.OptionsGame.SelectLanguage, Ini.Language, ILanguageTranslated); Theme.OptionsGame.SelectTabs.showArrows := true; Theme.OptionsGame.SelectTabs.oneItemOnly := true; |