Reuse existing locale instance if we have it
Reuse existing locale instance if we have it

--- a/include/Resource.class.php
+++ b/include/Resource.class.php
@@ -120,7 +120,13 @@
 	{
 		$localeName = __('English');		// for xgettext extraction
 
-		$localeReader = GitPHP_Resource::CreateLocale($locale);
+		$localeReader = null;
+		if (self::$currentLocale == $locale) {
+			$localeReader = self::$instance;
+		}
+		if (!$localeReader) {
+			$localeReader = GitPHP_Resource::CreateLocale($locale);
+		}
 		if (!$localeReader) {
 			return '';
 		}

comments