diff options
Diffstat (limited to 'editor/pot_generator.h')
-rw-r--r-- | editor/pot_generator.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/editor/pot_generator.h b/editor/pot_generator.h index abe1a21d41..8853b784ed 100644 --- a/editor/pot_generator.h +++ b/editor/pot_generator.h @@ -32,14 +32,29 @@ #define POT_GENERATOR_H #include "core/ordered_hash_map.h" +#include "core/os/file_access.h" #include "core/set.h" +//#define DEBUG_POT + class POTGenerator { static POTGenerator *singleton; - // Stores all translatable strings and the source files containing them. - OrderedHashMap<String, Set<String>> all_translation_strings; + + struct MsgidData { + String ctx; + String plural; + Set<String> locations; + }; + // Store msgid as key and the additional data around the msgid - if it's under a context, has plurals and its file locations. + OrderedHashMap<String, Vector<MsgidData>> all_translation_strings; void _write_to_pot(const String &p_file); + void _write_msgid(FileAccess *r_file, const String &p_id, bool p_plural); + void _add_new_msgid(const String &p_msgid, const String &p_context, const String &p_plural, const String &p_location); + +#ifdef DEBUG_POT + void _print_all_translation_strings(); +#endif public: static POTGenerator *get_singleton(); |