Extract link titles for translation if available
(cherry picked from commit 2b35ecaee4
)
This commit is contained in:
parent
115b65308e
commit
1865f06bef
1 changed files with 7 additions and 5 deletions
|
@ -218,12 +218,14 @@ def _make_translation_catalog(classes):
|
|||
desc_list = classes[class_name]
|
||||
for elem in desc_list.doc.iter():
|
||||
if elem.tag in EXTRACT_TAGS:
|
||||
if not elem.text or len(elem.text) == 0:
|
||||
elem_text = elem.text
|
||||
if elem.tag == "link":
|
||||
elem_text = elem.attrib["title"] if "title" in elem.attrib else ""
|
||||
if not elem_text or len(elem_text) == 0:
|
||||
continue
|
||||
if elem.tag == "link" and "$DOCS_URL" in elem.text: # No need to localize.
|
||||
continue
|
||||
line_no = elem._start_line_number if elem.text[0] != "\n" else elem._start_line_number + 1
|
||||
desc_str = elem.text.strip()
|
||||
|
||||
line_no = elem._start_line_number if elem_text[0] != "\n" else elem._start_line_number + 1
|
||||
desc_str = elem_text.strip()
|
||||
code_block_regions = _make_codeblock_regions(desc_str, desc_list.path)
|
||||
desc_msg = _strip_and_split_desc(desc_str, code_block_regions)
|
||||
desc_obj = Desc(line_no, desc_msg, desc_list)
|
||||
|
|
Loading…
Reference in a new issue