How to use gettext with python >3.6 f-strings
问题 Previously you would use gettext as following: _('Hey {},').format(username) but what about new Python's f-string? f'Hey {username}' 回答1: 'Hey {},' is contained in your translation dictionary as is. If you use f'Hey {username},' , that creates another string, which won't be translated. In that case, the format method remains the only one useable. 回答2: Preface I know this question is quite old and already has a very legitimate answer but I’m going to be bold and give my answer to this as I