def make_gettext_patterns():
    """Strongly inspired from idlelib.ColorDelegator.make_pat"""
    kwstr = 'msgid msgstr'
    kw = '\\b' + any('keyword', kwstr.split()) + '\\b'
    fuzzy = any('builtin', ['#,[^\\n]*'])
    links = any('normal', ['#:[^\\n]*'])
    comment = any('comment', ['#[^\\n]*'])
    number = any('number', ['\\b[+-]?[0-9]+[lL]?\\b',
        '\\b[+-]?0[xX][0-9A-Fa-f]+[lL]?\\b',
        '\\b[+-]?[0-9]+(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b'])
    sqstring = "(\\b[rRuU])?'[^'\\\\\\n]*(\\\\.[^'\\\\\\n]*)*'?"
    dqstring = '(\\b[rRuU])?"[^"\\\\\\n]*(\\\\.[^"\\\\\\n]*)*"?'
    string = any('string', [sqstring, dqstring])
    return '|'.join([kw, string, number, fuzzy, links, comment, any('SYNC',
        ['\\n'])])
