一、进入sublime Text的中文官网 http://www.sublimetext.cn/ 点击Download下载该编程软件
滑至该中文官网最底部的常见问题处,点击Sublime Text插件初始化,进入网页 http://packagecontrol.cn/installation#st3
二、安装插件
1、sublime的汉化
第一步:通过控制台安装插件代码,通过 ctrl+` 或 View > Show Console打开控制台,将Python代码粘贴到控制台,回车。
sublime text 3 :
import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.cn/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
结果获得提示信息:
Error validating download (got 6f4c264a24d933ce70df5dedcf1dcaeeebe013ee18cced0ef93d5f746d80ef60 instead of df21e130d211cfc94d9b0905775a7c0f1e3d39e33b79698005270310898eea76), please try manual install
看字面意思就能够理解,hash指与预期不一致,解决办法:
修改上述命令中的
h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'
部分为:
h = '6f4c264a24d933ce70df5dedcf1dcaeeebe013ee18cced0ef93d5f746d80ef60'
修改后的完整的命令为:
import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaeeebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
当控制台输出286331包的大小表示下载完成 (286331是sublime text3对应包的大小,不同版本输出的数字不一样)
2.手动安装ChineseLocalizations,Emmet
使用快捷键 Ctrl+Shift+P , 输入:install 选中 Package Control:Install Package回车,然后输入ChineseLocalizations回车,搞定。
PyV8 https://github.com/emmetio/pyv8-binaries
借鉴文章:https://blog.bbzhh.com/index.php/archives/163.html
借鉴视频:https://www.bilibili.com/video/BV1w7411e7oP?from=search&seid=18085157646819231241