Change the catalog loading so it will crawl up the catalogs even if the rt root one is not found. This will allow to load "fr" even if "fr_FR" is not found. This way the preflet in its current state works again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35787 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2010-03-09 10:47:03 +00:00
parent 3dfc3a17a5
commit a7764b301c
+6 -3
View File
@@ -600,7 +600,7 @@ BLocaleRoster::LoadCatalog(const char *signature, const char *language,
const char *lang;
for (int32 l=0; languages.FindString("language", l, &lang)==B_OK; ++l) {
catalog = info->fInstantiateFunc(signature, lang, fingerprint);
if (catalog) {
if (catalog)
info->fLoadedCatalogs.AddItem(catalog);
// Chain-load catalogs for languages that depend on
// other languages.
@@ -614,20 +614,23 @@ BLocaleRoster::LoadCatalog(const char *signature, const char *language,
int32 pos;
BString langName(lang);
BCatalogAddOn *currCatalog=catalog, *nextCatalog;
while ((pos = langName.FindLast('-')) >= 0) {
while ((pos = langName.FindLast('_')) >= 0) {
// language is based on parent, so we load that, too:
// (even if the parent catalog was not found)
langName.Truncate(pos);
nextCatalog = info->fInstantiateFunc(signature,
langName.String(), fingerprint);
if (nextCatalog) {
info->fLoadedCatalogs.AddItem(nextCatalog);
if(currCatalog)
currCatalog->fNext = nextCatalog;
else
catalog = nextCatalog;
currCatalog = nextCatalog;
}
}
return catalog;
}
}
info->UnloadIfPossible();
}