def METHOD_NAME(ps, header_replacements, body_replacements):
    replace_header_items(ps, header_replacements)
    try:
        while True:
            eat_whitespace(ps)
            skip_no_translate(ps)
            match = string_entry_re.match(ps.current_line)
            if match is not None:
                key = match.groupdict()["id"]
                if key in body_replacements:
                    value = (
                        body_replacements[key].target or body_replacements[key].source
                    )
                    ps.current_line = match.expand(
                        "\\g<start>\\g<id>\\g<space>%s\n" % escape(value)
                    )
            ps.read_line()
    except StopIteration:
        pass