File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -472,15 +472,14 @@ def process_template(text):
472472 """
473473 assert (text .startswith ('{{' ) and text .endswith ('}}' )), "Invalid template tag"
474474 # Split the template content from the rest of the text
475- inner_content = text [2 :- 2 ].strip () # Remove the leading {{ and trailing }}
476- inner_content = capitalise_first_letter (inner_content ) # Capitalise the first letter of the inner content
477-
478- # If the inner content is empty, return an empty string
479- if not inner_content :
480- return text
481-
482- # Wrap the inner content in <translate> tags
483- return '{{' + inner_content + '}}'
475+ code = mwparserfromhell .parse (text )
476+ template = code .filter_templates ()[0 ]
477+
478+ if template .has (2 ):
479+ param = template .get (2 )
480+ param .value = f"2=<translate>{ param .value .strip_code ()} </translate>"
481+
482+ return str (code )
484483
485484def process_raw_url (text ):
486485 """
You can’t perform that action at this time.
0 commit comments