Empty character groups and categories are included in translation catalog too now
This commit is contained in:
parent
665b6c3564
commit
86d512e752
@ -120,7 +120,7 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
db.data .reserve(count*4);
|
db.data .reserve(count*4);
|
||||||
|
|
||||||
// Parse translations and build index and data.
|
// Parse translations and build index and data.
|
||||||
while (!ZRCola::DBSource::IsEOF(rs)) {
|
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
|
||||||
// Read translation from the database.
|
// Read translation from the database.
|
||||||
if (src.GetTranslation(rs, trans)) {
|
if (src.GetTranslation(rs, trans)) {
|
||||||
// Add translation to index and data.
|
// Add translation to index and data.
|
||||||
@ -137,8 +137,6 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
db.idxDecomp.push_back(idx);
|
db.idxDecomp.push_back(idx);
|
||||||
} else
|
} else
|
||||||
has_errors = true;
|
has_errors = true;
|
||||||
|
|
||||||
wxVERIFY(SUCCEEDED(rs->MoveNext()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort indices.
|
// Sort indices.
|
||||||
@ -172,7 +170,7 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
db.data .reserve(count*4);
|
db.data .reserve(count*4);
|
||||||
|
|
||||||
// Parse key sequences and build index and data.
|
// Parse key sequences and build index and data.
|
||||||
while (!ZRCola::DBSource::IsEOF(rs)) {
|
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
|
||||||
// Read key sequence from the database.
|
// Read key sequence from the database.
|
||||||
if (src.GetKeySequence(rs, ks)) {
|
if (src.GetKeySequence(rs, ks)) {
|
||||||
// Add key sequence to index and data.
|
// Add key sequence to index and data.
|
||||||
@ -193,8 +191,6 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
db.idxKey.push_back(idx);
|
db.idxKey.push_back(idx);
|
||||||
} else
|
} else
|
||||||
has_errors = true;
|
has_errors = true;
|
||||||
|
|
||||||
wxVERIFY(SUCCEEDED(rs->MoveNext()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort indices.
|
// Sort indices.
|
||||||
@ -240,9 +236,12 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
db.data .reserve(count*4);
|
db.data .reserve(count*4);
|
||||||
|
|
||||||
// Parse languages and build index and data.
|
// Parse languages and build index and data.
|
||||||
while (!ZRCola::DBSource::IsEOF(rs)) {
|
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
|
||||||
// Read language from the database.
|
// Read language from the database.
|
||||||
if (src.GetLanguage(rs, lang)) {
|
if (src.GetLanguage(rs, lang)) {
|
||||||
|
if (build_pot)
|
||||||
|
pot.insert(lang.name);
|
||||||
|
|
||||||
// Add language to index and data.
|
// Add language to index and data.
|
||||||
unsigned __int32 idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
for (wstring::size_type i = 0; i < sizeof(ZRCola::langid_t)/sizeof(unsigned __int16); i++)
|
for (wstring::size_type i = 0; i < sizeof(ZRCola::langid_t)/sizeof(unsigned __int16); i++)
|
||||||
@ -253,12 +252,8 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
for (wstring::size_type i = 0; i < n; i++)
|
for (wstring::size_type i = 0; i < n; i++)
|
||||||
db.data.push_back(lang.name[i]);
|
db.data.push_back(lang.name[i]);
|
||||||
db.idxLng.push_back(idx);
|
db.idxLng.push_back(idx);
|
||||||
if (build_pot)
|
|
||||||
pot.insert(lang.name);
|
|
||||||
} else
|
} else
|
||||||
has_errors = true;
|
has_errors = true;
|
||||||
|
|
||||||
wxVERIFY(SUCCEEDED(rs->MoveNext()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort indices.
|
// Sort indices.
|
||||||
@ -293,7 +288,7 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
db.data .reserve(count*4);
|
db.data .reserve(count*4);
|
||||||
|
|
||||||
// Parse language characters and build index and data.
|
// Parse language characters and build index and data.
|
||||||
while (!ZRCola::DBSource::IsEOF(rs)) {
|
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
|
||||||
// Read language characters from the database.
|
// Read language characters from the database.
|
||||||
if (src.GetLanguageCharacter(rs, lc)) {
|
if (src.GetLanguageCharacter(rs, lc)) {
|
||||||
// Add language characters to index and data.
|
// Add language characters to index and data.
|
||||||
@ -307,8 +302,6 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
has_errors = true;
|
has_errors = true;
|
||||||
|
|
||||||
wxVERIFY(SUCCEEDED(rs->MoveNext()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort indices.
|
// Sort indices.
|
||||||
@ -343,9 +336,12 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
db.data .reserve(count*4);
|
db.data .reserve(count*4);
|
||||||
|
|
||||||
// Parse character groups and build index and data.
|
// Parse character groups and build index and data.
|
||||||
while (!ZRCola::DBSource::IsEOF(rs)) {
|
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
|
||||||
// Read character group from the database.
|
// Read character group from the database.
|
||||||
if (src.GetCharacterGroup(rs, cg)) {
|
if (src.GetCharacterGroup(rs, cg)) {
|
||||||
|
if (build_pot)
|
||||||
|
pot.insert(cg.name);
|
||||||
|
|
||||||
if (cg.chars.empty()) {
|
if (cg.chars.empty()) {
|
||||||
// Skip empty character groups.
|
// Skip empty character groups.
|
||||||
continue;
|
continue;
|
||||||
@ -368,12 +364,8 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
for (wstring::size_type i = 0; i < n_char; i++)
|
for (wstring::size_type i = 0; i < n_char; i++)
|
||||||
db.data.push_back(cg.chars[i]);
|
db.data.push_back(cg.chars[i]);
|
||||||
db.idxRnk.push_back(idx);
|
db.idxRnk.push_back(idx);
|
||||||
if (build_pot)
|
|
||||||
pot.insert(cg.name);
|
|
||||||
} else
|
} else
|
||||||
has_errors = true;
|
has_errors = true;
|
||||||
|
|
||||||
wxVERIFY(SUCCEEDED(rs->MoveNext()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort indices.
|
// Sort indices.
|
||||||
@ -404,7 +396,7 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
ZRCola::DBSource::character_bank chrs;
|
ZRCola::DBSource::character_bank chrs;
|
||||||
|
|
||||||
// Phase 1: Parse characters and build indexes.
|
// Phase 1: Parse characters and build indexes.
|
||||||
while (!ZRCola::DBSource::IsEOF(rs)) {
|
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
|
||||||
// Read character from the database.
|
// Read character from the database.
|
||||||
unique_ptr<ZRCola::DBSource::character> c(new ZRCola::DBSource::character);
|
unique_ptr<ZRCola::DBSource::character> c(new ZRCola::DBSource::character);
|
||||||
if (src.GetCharacter(rs, *c)) {
|
if (src.GetCharacter(rs, *c)) {
|
||||||
@ -412,8 +404,6 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
chrs[chr.chr].swap(c);
|
chrs[chr.chr].swap(c);
|
||||||
} else
|
} else
|
||||||
has_errors = true;
|
has_errors = true;
|
||||||
|
|
||||||
wxVERIFY(SUCCEEDED(rs->MoveNext()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Phase 2: Build related character lists.
|
// Phase 2: Build related character lists.
|
||||||
@ -489,10 +479,17 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
db.data .reserve(count*4);
|
db.data .reserve(count*4);
|
||||||
|
|
||||||
// Parse character categories and build index and data.
|
// Parse character categories and build index and data.
|
||||||
while (!ZRCola::DBSource::IsEOF(rs)) {
|
for (; !ZRCola::DBSource::IsEOF(rs); rs->MoveNext()) {
|
||||||
// Read character category from the database.
|
// Read character category from the database.
|
||||||
if (src.GetCharacterCategory(rs, cc)) {
|
if (src.GetCharacterCategory(rs, cc)) {
|
||||||
if (categories_used.find(cc.id) != categories_used.end()) {
|
if (build_pot)
|
||||||
|
pot.insert(cc.name);
|
||||||
|
|
||||||
|
if (categories_used.find(cc.id) == categories_used.end()) {
|
||||||
|
// Skip empty character categories.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Add character category to index and data.
|
// Add character category to index and data.
|
||||||
unsigned __int32 idx = db.data.size();
|
unsigned __int32 idx = db.data.size();
|
||||||
for (wstring::size_type i = 0; i < sizeof(ZRCola::chrcatid_t)/sizeof(unsigned __int16); i++)
|
for (wstring::size_type i = 0; i < sizeof(ZRCola::chrcatid_t)/sizeof(unsigned __int16); i++)
|
||||||
@ -506,14 +503,8 @@ int _tmain(int argc, _TCHAR *argv[])
|
|||||||
db.data.push_back(cc.name[i]);
|
db.data.push_back(cc.name[i]);
|
||||||
db.idxChrCat.push_back(idx);
|
db.idxChrCat.push_back(idx);
|
||||||
db.idxRnk .push_back(idx);
|
db.idxRnk .push_back(idx);
|
||||||
if (build_pot)
|
|
||||||
pot.insert(cc.name);
|
|
||||||
} else
|
|
||||||
_ftprintf(stderr, wxT("%s: warning ZCC0019: Ommiting empty category %ls.\n"), (LPCTSTR)filenameIn.c_str(), (LPCWSTR)cc.name.c_str());
|
|
||||||
} else
|
} else
|
||||||
has_errors = true;
|
has_errors = true;
|
||||||
|
|
||||||
wxVERIFY(SUCCEEDED(rs->MoveNext()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort indices.
|
// Sort indices.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user