INNER CODE UNIT · Python

clean_msgid

multitheftauto/mtasa-blue · utils/localization/build_gettext_catalog_nsi.py:57

def clean_msgid(msgid: str) -> str:
    """
    Get rid of newlines in the source code file itself (that arent in the string)
    which may impact a msgid
    """
    return MSGID_CLEAN_PTN.sub("", msgid)


def parse_nsi(content: str) -> t.List[LangString]:
    positions = get_newline_positions(content)
    lang_strings = []
    for m in LANG_STRING_PTN.finditer(content):
        lang_strings.append(
            LangString(
                nsi_label=m.group(1),
                line_number=get_line_number_from_position(positions, m.start(1)),
                msgid=clean_msgid(m.group(2))
            )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…