Localize.py 文件源码

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

项目:LocalizedMenu 作者: zam1024t 项目源码 文件源码
def setLocale(locale, force = False):
    if not locale:
        return

    if (not force) and locale == getSetting('locale'):
        return

    link = getLink(locale)
    if link:
        locale = link

    m = {}
    d = os.path.join(mDir, v, locale)
    m.update(findMenu(d))

    sDir = ''
    d = os.path.join(mDir, version)
    ld = os.path.join(d, locale)
    if (not os.path.isdir(ld)) and getSetting('findSimilarVer', True):
        sDir = findSimilarVer()
        if not sDir:
            return
        d = os.path.join(mDir, sDir)

    d = os.path.join(d, locale)
    if not os.path.isdir(d):
        return
    m.update(findMenu(d))

    d = os.path.join(d, p)
    m.update(findMenu(d))

    d = os.path.join(d, sublime.arch())
    m.update(findMenu(d))

    updateMenu(m)
    if getSetting('updateTopMenu', True):
        updateTopMenu()
    sublime.status_message('Locale ' + locale + ' has loaded.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号