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:
@@ -21,25 +21,33 @@
|
||||
namespace TSFile {
|
||||
|
||||
struct Message {
|
||||
enum Type {
|
||||
Unfinished = 0x1,
|
||||
Missing = 0x2,
|
||||
};
|
||||
PIString source;
|
||||
PIString translation;
|
||||
PIString type;
|
||||
PIString comment;
|
||||
PIString filename;
|
||||
PIString line;
|
||||
bool obsolete = true;
|
||||
PIFlags<Type> type;
|
||||
};
|
||||
|
||||
struct Context {
|
||||
PIMap<PIString, Message> messages;
|
||||
void confirm(const PIString & msg, const PIString & file, int line = -1);
|
||||
bool confirm(const PIString & msg, const PIString & file, int line = -1);
|
||||
};
|
||||
|
||||
using Content = PIMap<PIString, Context>;
|
||||
struct Content {
|
||||
void markAllMissing();
|
||||
PIString lang;
|
||||
PIMap<PIString, Context> contexts;
|
||||
};
|
||||
|
||||
PIString mask(const PIString & in);
|
||||
PIString unmask(const PIString & in);
|
||||
|
||||
Content read(const PIString & path);
|
||||
bool write(const PIString & path, const Content & content, const PIString & lang, bool no_obsolete);
|
||||
bool write(const PIString & path, const Content & content, bool no_obsolete);
|
||||
|
||||
} // namespace TSFile
|
||||
|
||||
Reference in New Issue
Block a user