# HG changeset patch # User IBBoard # Date 1230927126 0 # Node ID f4da31cb09d9f09decdd7c06492a7bbf1831d5f1 # Parent f269d8bcc152810ea759c5b9ecea920260aa69b5 * Add translation DTD to utils project * Alter Translation class to resolve error when initialising with an empty local language (should default to no local language, not exception) no-open-ticket diff -r f269d8bcc152 -r f4da31cb09d9 IBBoard.mdp --- a/IBBoard.mdp Sat Dec 27 20:28:04 2008 +0000 +++ b/IBBoard.mdp Fri Jan 02 20:12:06 2009 +0000 @@ -43,6 +43,8 @@ + + diff -r f269d8bcc152 -r f4da31cb09d9 Lang/Translation.cs --- a/Lang/Translation.cs Sat Dec 27 20:28:04 2008 +0000 +++ b/Lang/Translation.cs Fri Jan 02 20:12:06 2009 +0000 @@ -136,16 +136,21 @@ /// /// The new local language to load /// - public static void LoadTranslation(string translationLang) - { - checkInitialisation(); - - if (translationLang == "" || translationLang == null) + public static void LoadTranslation(string translationLanguage) + { + if (translationLanguage == "" || translationLanguage == null) { throw new ArgumentException("Translation language cannot be empty or null"); } - if (translationLang != DEFAULT_LANGUAGE) + LoadTranslationForLang(translationLanguage); + } + + private static void LoadTranslationForLanguage(string translationLanguage) + { + checkInitialisation(); + + if (translationLanguage != DEFAULT_LANGUAGE && translationLanguage != "" && translationLanguage != null) { FileInfo file = GetTranslationFile(translationLang); XmlDocument doc = LoadTranslationDocument(file); @@ -156,7 +161,7 @@ translationsLocal.Clear(); } - lang = translationLang; + lang = translationLang; } /// diff -r f269d8bcc152 -r f4da31cb09d9 dtds/translation.dtd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dtds/translation.dtd Fri Jan 02 20:12:06 2009 +0000 @@ -0,0 +1,4 @@ + + + + \ No newline at end of file