Index: cms/converters.py |
diff --git a/cms/converters.py b/cms/converters.py |
index b853f78c4eb0625671a797a6640006c772929ad6..0fbfebadc2e3904e5428cd95292679bb8fbf1fc2 100644 |
--- a/cms/converters.py |
+++ b/cms/converters.py |
@@ -145,6 +145,7 @@ class Converter: |
# Insert attributes |
result = escape(result) |
def stringify_attribute((name, value)): |
+ value = self.insert_localized_strings(value, escapes) |
if name == "href": |
link_locale, link = self._params["source"].resolve_link(value, locale) |
if link: |
@@ -177,7 +178,12 @@ class Converter: |
return self.localize_string(name, default, self._params["localedata"], escapes) |
return re.sub( |
- r"\{\{\s*([\w\-]+)(?:\[(.*?)\])?\s+(.*?)\}\}", |
+ r"\{\{\s*" |
+ r"([\w\-]+)" # String ID |
+ r"(?:\[(.*?)\])?" # Optional comment |
+ r"\s+" |
+ r"((?:[^\{]|\{(?!\{)|\{\{(?:[^\}]|\}(?!\}))*?\}\})*?)" # Translatable text |
+ r"\}\}", |
lookup_string, |
text, |
flags=re.S |