Closing #6721: avoid unescaping when linking catalogs together
* add SetRawString() to both implementations of DefaultCatalog which sets the translated string as given * use SetRawString() in both (standard- and build-)versions of linkcatkeys git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41167 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -44,6 +44,8 @@ class DefaultCatalog : public BHashMapCatalog {
|
|||||||
status_t WriteToAttribute(entry_ref *appOrAddOnRef);
|
status_t WriteToAttribute(entry_ref *appOrAddOnRef);
|
||||||
status_t WriteToResource(entry_ref *appOrAddOnRef);
|
status_t WriteToResource(entry_ref *appOrAddOnRef);
|
||||||
|
|
||||||
|
status_t SetRawString(const CatKey& key, const char *translated);
|
||||||
|
|
||||||
static BCatalogAddOn *Instantiate(const char *signature,
|
static BCatalogAddOn *Instantiate(const char *signature,
|
||||||
const char *language, uint32 fingerprint);
|
const char *language, uint32 fingerprint);
|
||||||
static BCatalogAddOn *InstantiateEmbedded(entry_ref *appOrAddOnRef);
|
static BCatalogAddOn *InstantiateEmbedded(entry_ref *appOrAddOnRef);
|
||||||
|
|||||||
@@ -128,12 +128,8 @@ main(int argc, char **argv)
|
|||||||
const CatKey fixedCatKey(keyString.String(), keyComment.String(),
|
const CatKey fixedCatKey(keyString.String(), keyComment.String(),
|
||||||
keyContext.String());
|
keyContext.String());
|
||||||
|
|
||||||
BString translatedString = walker.GetValue();
|
if (!targetCatImpl->GetString(fixedCatKey))
|
||||||
|
targetCatImpl->SetRawString(fixedCatKey, walker.GetValue());
|
||||||
if (!targetCatImpl->GetString(fixedCatKey)) {
|
|
||||||
targetCatImpl->SetString(fixedCatKey,
|
|
||||||
translatedString.String());
|
|
||||||
}
|
|
||||||
walker.Next();
|
walker.Next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,6 +146,13 @@ DefaultCatalog::~DefaultCatalog()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
DefaultCatalog::SetRawString(const CatKey& key, const char *translated)
|
||||||
|
{
|
||||||
|
return fCatMap.Put(key, translated);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
DefaultCatalog::ReadFromFile(const char *path)
|
DefaultCatalog::ReadFromFile(const char *path)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -107,6 +107,13 @@ DefaultCatalog::~DefaultCatalog()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
DefaultCatalog::SetRawString(const CatKey& key, const char *translated)
|
||||||
|
{
|
||||||
|
return fCatMap.Put(key, translated);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
DefaultCatalog::ReadFromFile(const char *path)
|
DefaultCatalog::ReadFromFile(const char *path)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -111,12 +111,9 @@ main(int argc, char **argv)
|
|||||||
BHashMapCatalog::CatWalker walker(&inputCatalog);
|
BHashMapCatalog::CatWalker walker(&inputCatalog);
|
||||||
while (!walker.AtEnd()) {
|
while (!walker.AtEnd()) {
|
||||||
const CatKey &key(walker.GetKey());
|
const CatKey &key(walker.GetKey());
|
||||||
BString translatedString = walker.GetValue();
|
|
||||||
|
|
||||||
if (!targetCatImpl.GetString(key)) {
|
if (!targetCatImpl.GetString(key))
|
||||||
targetCatImpl.SetString(key,
|
targetCatImpl.SetRawString(key, walker.GetValue());
|
||||||
translatedString.String());
|
|
||||||
}
|
|
||||||
walker.Next();
|
walker.Next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user