POT Generator: Add support for TRANSLATORS: and NO_TRANSLATE comments
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
#include "editor_translation_parser.h"
|
||||
|
||||
#include "core/error/error_macros.h"
|
||||
#include "core/io/file_access.h"
|
||||
#include "core/object/script_language.h"
|
||||
#include "core/templates/hash_set.h"
|
||||
|
||||
@@ -65,6 +64,21 @@ Error EditorTranslationParserPlugin::parse_file(const String &p_path, Vector<Str
|
||||
}
|
||||
}
|
||||
|
||||
void EditorTranslationParserPlugin::get_comments(Vector<String> *r_ids_comment, Vector<String> *r_ids_ctx_plural_comment) {
|
||||
TypedArray<String> ids_comment;
|
||||
TypedArray<String> ids_ctx_plural_comment;
|
||||
|
||||
if (GDVIRTUAL_CALL(_get_comments, ids_comment, ids_ctx_plural_comment)) {
|
||||
for (int i = 0; i < ids_comment.size(); i++) {
|
||||
r_ids_comment->append(ids_comment[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < ids_ctx_plural_comment.size(); i++) {
|
||||
r_ids_ctx_plural_comment->append(ids_ctx_plural_comment[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorTranslationParserPlugin::get_recognized_extensions(List<String> *r_extensions) const {
|
||||
Vector<String> extensions;
|
||||
if (GDVIRTUAL_CALL(_get_recognized_extensions, extensions)) {
|
||||
@@ -78,6 +92,7 @@ void EditorTranslationParserPlugin::get_recognized_extensions(List<String> *r_ex
|
||||
|
||||
void EditorTranslationParserPlugin::_bind_methods() {
|
||||
GDVIRTUAL_BIND(_parse_file, "path", "msgids", "msgids_context_plural");
|
||||
GDVIRTUAL_BIND(_get_comments, "msgids_comment", "msgids_context_plural_comment");
|
||||
GDVIRTUAL_BIND(_get_recognized_extensions);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user