diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-15 12:09:56 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-15 12:09:56 +0200 |
commit | 5caa8e41f7ad0db20a89eb9b741e75d45cbb283b (patch) | |
tree | 64aa5f3a840f6cca194641a541b8313de62f406e /modules/gdscript/editor/gdscript_translation_parser_plugin.cpp | |
parent | 77470740de5f0a915ec901e350abe0d2ce4c31d1 (diff) | |
parent | 0bd4345736447e09994061601bef4b7be6d05405 (diff) | |
download | redot-engine-5caa8e41f7ad0db20a89eb9b741e75d45cbb283b.tar.gz |
Merge pull request #91951 from dalexeev/gds-pot-gen-add-atr-and-atr-n
GDScript: Add support for `atr` and `atr_n` to POT generator
Diffstat (limited to 'modules/gdscript/editor/gdscript_translation_parser_plugin.cpp')
-rw-r--r-- | modules/gdscript/editor/gdscript_translation_parser_plugin.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp b/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp index 316281209a..d74d316704 100644 --- a/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp +++ b/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp @@ -276,8 +276,8 @@ void GDScriptEditorTranslationParserPlugin::_assess_call(const GDScriptParser::C id_ctx_plural.resize(3); bool extract_id_ctx_plural = true; - if (function_name == tr_func) { - // Extract from tr(id, ctx). + if (function_name == tr_func || function_name == atr_func) { + // Extract from `tr(id, ctx)` or `atr(id, ctx)`. for (int i = 0; i < p_call->arguments.size(); i++) { if (_is_constant_string(p_call->arguments[i])) { id_ctx_plural.write[i] = p_call->arguments[i]->reduced_value; @@ -289,8 +289,8 @@ void GDScriptEditorTranslationParserPlugin::_assess_call(const GDScriptParser::C if (extract_id_ctx_plural) { ids_ctx_plural->push_back(id_ctx_plural); } - } else if (function_name == trn_func) { - // Extract from tr_n(id, plural, n, ctx). + } else if (function_name == trn_func || function_name == atrn_func) { + // Extract from `tr_n(id, plural, n, ctx)` or `atr_n(id, plural, n, ctx)`. Vector<int> indices; indices.push_back(0); indices.push_back(3); |