first release of translation facility

* runtime - loading and translating
 * design-time - works with *.ts file (pip_tr utility)
 * compile-time - CMake macro for compile *.ts
This commit is contained in:
2024-11-05 13:49:00 +03:00
parent 73ed51e3d4
commit 57f8c1313e
52 changed files with 1571 additions and 480 deletions

View File

@@ -124,10 +124,12 @@ int main(int argc, char * argv[]) {
piCout << Cyan << Bold << "Reading ts file ...";
auto content = TSFile::read(out_path);
if (content.lang.isEmpty()) content.lang = cli.argumentValue("language");
content.markAllMissing();
piCout << Cyan << Bold << "Reading done";
piCout << Cyan << Bold << "Read" << files.size_s() << "files ...";
auto & context(content[contextName]);
auto & context(content.contexts[contextName]);
PIDir out_dir(PIFile::FileInfo(out_path).dir());
for (const auto & p: files) {
PIString ext = PIFile::FileInfo(p).extension().toLowerCase().trim();
@@ -142,7 +144,7 @@ int main(int argc, char * argv[]) {
piCout << Cyan << Bold << "Reading done";
piCout << Cyan << Bold << "Writing ts file ...";
if (!TSFile::write(out_path, content, cli.argumentValue("language"), cli.hasArgument("no-obsolete"))) return 1;
if (!TSFile::write(out_path, content, cli.hasArgument("no-obsolete"))) return 1;
piCout << Cyan << Bold << "Writing done";
return 0;