in fluent/migrate/transforms.py [0:0]
def normalize_printf(text):
"""Normalize printf arguments so that they're all numbered.
Gecko forbids mixing unnumbered and numbered ones, so
we just need to convert unnumbered to numbered ones.
Also remove ones that have zero width, as they're intended
to be removed from the output by the localizer.
"""
next_number = number()
def normalized(match):
if match.group("good") == "%":
return "%"
hidden = match.group("width") == "0"
if match.group("number"):
return "" if hidden else match.group()
num = next(next_number)
return "" if hidden else "%{}${}".format(num, match.group("spec"))
return PRINTF.sub(normalized, text)