Impacted versions:
Master branch, should by 12.0

Steps to reproduce:
Install a third party addon with localization po file in i18n folder, even loading translation manually, the translation won't work, The console reports error: Translation .... not found in reference pot, skipping.
Reverse the change of  "odoo/tools/translate.py" in this commit, the issue was gone.

Expected behavior:
The po translation works as before.



odoo/tools/translate.py
def _get_db(self):
        
        db_name = getattr(threading.currentThread(), 'dbname', None)
        if db_name:
            return odoo.sql_db.db_connect(db_name)
    def _get_cr(self, frame, allow_create=True):
        
        
        if 'cr' in frame.f_locals:
            return frame.f_locals['cr'], False
        if 'cursor' in frame.f_locals:
            return frame.f_locals['cursor'], False
        s = frame.f_locals.get('self')
        if hasattr(s, 'env'):
            return s.env.cr, False
        if hasattr(s, 'cr'):
            return s.cr, False
        try:
            from odoo.http import request
            return request.env.cr, False
        except RuntimeError:
            pass
        if allow_create:
            
            db = self._get_db()
            if db is not None:
                return db.cursor(), True
        return None, False
    def _get_uid(self, frame):