xbmc_context.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:plugin.video.youtube 作者: jdf76 项目源码 文件源码
def localize(self, text_id, default_text=u''):
        if isinstance(text_id, int):
            """
            We want to use all localization strings!
            Addons should only use the range 30000 thru 30999 (see: http://kodi.wiki/view/Language_support) but we
            do it anyway. I want some of the localized strings for the views of a skin.
            """
            if text_id >= 0 and (text_id < 30000 or text_id > 30999):
                result = xbmc.getLocalizedString(text_id)
                if result is not None and result:
                    return utils.to_unicode(result)

        result = self._addon.getLocalizedString(int(text_id))
        if result is not None and result:
            return utils.to_unicode(result)

        return utils.to_unicode(default_text)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号