code: def tr(text, context='@default'):
      
      # noinspection PyCallByClass,PyTypeChecker,PyArgumentList
      if type(text) != str:
          text = str(text)
      translated_text = QCoreApplication.translate(context, text)
      # Check if there is missing container. If so, return the original text.
      # See #3164
      if text.count('%') == translated_text.count('%'):
          return translated_text
      else:
          content = (
              'There is a problem in the translation text.\n'
              'The original text: "%s".\n'
              'The translation: "%s".\n'
              'The number of %% character does not match (%s and %s).'
              'Please check the translation in transifex for %s.' % (
                  text,
                  translated_text,
                  text.count('%'),
                  translated_text.count('%s'),
                  locale()
              ))
          LOGGER.warning(content)
          return text
docs: We define a tr function alias here since the utilities implementation
      below is not a class and does not inherit from QObject.
  
      .. note:: see http://tinyurl.com/pyqt-differences
  
      :param text: String to be translated
      :type text: str, unicode
  
      :param context: A context for the translation. Since a same can be
          translated to different text depends on the context.
      :type context: str
  
      :returns: Translated version of the given string if available, otherwise
          the original string.
      :rtype: str, unicode