<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def gettext(ui_file_path):
 """ Let you use gettext instead of the Qt tools for l18n """

    with open(ui_file_path, 'r') as fin:
        content = fin.read()

    # replace ``_translate("context", `` by ``_(``
    content = re.sub(r'_translate\(".*",\s', '_(', content)
    content = content.replace(
        '        _translate = QtCore.QCoreApplication.translate', '')

    with open(ui_file_path, 'w') as fout:
        fout.write(content)