#include "zypp/PathInfo.h"
#include "zypp/parser/IniDict.h"
+#include "zypp/sat/Pool.h"
+
using namespace std;
using namespace zypp::filesystem;
using namespace zypp::parser;
{
WAR << "Overriding text locale (" << _pimpl->cfg_textLocale << "): " << locale_r << endl;
_pimpl->cfg_textLocale = locale_r;
+#warning prefer signal
+ sat::Pool::instance().setTextLocale( locale_r );
}
}
/////////////////////////////////////////////////////////////////
+ void Pool::setTextLocale( const Locale & locale_r )
+ { myPool().setTextLocale( locale_r ); }
+
void Pool::setRequestedLocales( const LocaleSet & locales_r )
{ myPool().setRequestedLocales( locales_r ); }
public:
/** \name Requested locales. */
//@{
+ /** Set the default language for retrieving translated texts.
+ * Updated when calling \ref ZConfig::setTextLocale.
+ */
+ void setTextLocale( const Locale & locale_r );
+
/** Set the requested locales.
* Languages to be supported by the system, e.g. language specific
* packages to be installed.
}
if ( ! _pool->languages )
{
- std::vector<std::string> fallbacklist;
- for ( Locale l( ZConfig::instance().textLocale() ); l != Locale::noCode; l = l.fallback() )
- {
- fallbacklist.push_back( l.code() );
- }
- dumpRangeLine( MIL << "pool_set_languages: ", fallbacklist.begin(), fallbacklist.end() ) << endl;
-
- std::vector<const char *> fallbacklist_cstr;
- for_( it, fallbacklist.begin(), fallbacklist.end() )
- {
- fallbacklist_cstr.push_back( it->c_str() );
- }
- ::pool_set_languages( _pool, &fallbacklist_cstr.front(), fallbacklist_cstr.size() );
+ // initial seting
+ const_cast<PoolImpl*>(this)->setTextLocale( ZConfig::instance().textLocale() );
}
}
MIL << "New Solver Locales: " << locale2Solver << endl;
}
+ void PoolImpl::setTextLocale( const Locale & locale_r )
+ {
+ std::vector<std::string> fallbacklist;
+ for ( Locale l( locale_r ); l != Locale::noCode; l = l.fallback() )
+ {
+ fallbacklist.push_back( l.code() );
+ }
+ dumpRangeLine( MIL << "pool_set_languages: ", fallbacklist.begin(), fallbacklist.end() ) << endl;
+
+ std::vector<const char *> fallbacklist_cstr;
+ for_( it, fallbacklist.begin(), fallbacklist.end() )
+ {
+ fallbacklist_cstr.push_back( it->c_str() );
+ }
+ ::pool_set_languages( _pool, &fallbacklist_cstr.front(), fallbacklist_cstr.size() );
+ }
+
void PoolImpl::setRequestedLocales( const LocaleSet & locales_r )
{
depSetDirty( "setRequestedLocales" );
public:
/** \name Requested locales. */
//@{
+ void setTextLocale( const Locale & locale_r );
void setRequestedLocales( const LocaleSet & locales_r );
bool addRequestedLocale( const Locale & locale_r );
bool eraseRequestedLocale( const Locale & locale_r );