# HG changeset patch # User IBBoard # Date 1266437427 0 # Node ID 5fb2e5a2e7a89a160c10890037d44248e644ab8c # Parent 7e5f5cb0a9ea09b5d970de2eaccd1f28ec0a929a * Remove errors on uninitialised translations - means that the translations just fall back to the provided string if they haven't been initialised no-open-ticket diff -r 7e5f5cb0a9ea -r 5fb2e5a2e7a8 Lang/Translation.cs --- a/Lang/Translation.cs Thu Dec 24 13:57:03 2009 +0000 +++ b/Lang/Translation.cs Wed Feb 17 20:10:27 2010 +0000 @@ -26,8 +26,8 @@ private static readonly string DIVIDER_STRING = "-"; private static string lang = ""; private static DirectoryInfo translationDir; - private static Dictionary translationsLocal; - private static Dictionary translationsDefault; + private static Dictionary translationsLocal = new Dictionary(); + private static Dictionary translationsDefault = new Dictionary(); private static XmlReaderSettings settings; /// @@ -200,9 +200,7 @@ } private static void LoadTranslationForLanguage(string translationLanguage) - { - CheckInitialisation(); - + { if (translationLanguage != DEFAULT_LANGUAGE && translationLanguage != "" && translationLanguage != null) { FileInfo file = GetTranslationFile(translationLanguage); @@ -271,7 +269,6 @@ /// public static string GetTranslation(string translationID, string defaultTranslation, params object[] replacements) { - CheckInitialisation(); string trans = GetTranslationFromTables(translationID); if (trans == null) @@ -320,14 +317,6 @@ return translation; } - - private static void CheckInitialisation() - { - if (translationDir==null) - { - throw new InvalidOperationException("Translation class has not been initialised"); - } - } /// /// Translate an item, with optional string replacement. If the translation