added forcedLocale for forcing a temporary locale. And refactored App::g...

added forcedLocale for forcing a temporary locale. And refactored App::getLocale to a method.