瀏覽代碼

Fix extraction of chained tr() calls

(cherry picked from commit 3e88c4cd5c22e6e687ad88b148b0ef26d69c97eb)
Haoyu Qiu 2 年之前
父節點
當前提交
b63db1e6fc
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      modules/gdscript/editor/gdscript_translation_parser_plugin.cpp

+ 8 - 0
modules/gdscript/editor/gdscript_translation_parser_plugin.cpp

@@ -311,6 +311,14 @@ void GDScriptEditorTranslationParserPlugin::_extract_from_call(GDScriptParser::C
 			}
 			}
 		}
 		}
 	}
 	}
+
+	if (p_call->callee && p_call->callee->type == GDScriptParser::Node::SUBSCRIPT) {
+		GDScriptParser::SubscriptNode *subscript_node = static_cast<GDScriptParser::SubscriptNode *>(p_call->callee);
+		if (subscript_node->base && subscript_node->base->type == GDScriptParser::Node::CALL) {
+			GDScriptParser::CallNode *call_node = static_cast<GDScriptParser::CallNode *>(subscript_node->base);
+			_extract_from_call(call_node);
+		}
+	}
 }
 }
 
 
 void GDScriptEditorTranslationParserPlugin::_extract_fd_literals(GDScriptParser::ExpressionNode *p_expression) {
 void GDScriptEditorTranslationParserPlugin::_extract_fd_literals(GDScriptParser::ExpressionNode *p_expression) {