_log(f”My variable is {x + y}”)
_log(“My variable is {}”.format(x+y))
_log(“My variable is {z}”.format(z=x+y))
I am not very familiar with Python. How do you localize (translate) first one?
You don't with f-strings because they're substituted eagerly. You could with the new t-strings proposed here because you can get at the individual parts.