Skip to content

Commit

Permalink
optimize for OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
rexdf committed May 26, 2015
1 parent 37406be commit eb93a68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@ def set_language(lang, force=False):
platform = sublime.platform()
if platform == "osx":
import re
pattern = re.compile(r"(?<=[\u3000-\u9FFFa-zA-Z])\([A-Za-z]\)", re.M)
pattern = re.compile(r"(?<=[\u3000-\u9FFFa-zA-Z])\([A-Za-z]\)", re.M)
pattern_help = re.compile(r"(ヘルプ|帮助|幫助)")
MAIN_MENU = os.path.join(DEFAULT_PATH, "Main.sublime-menu")

fh = open(MAIN_MENU, "rb")
content = fh.read().decode("utf-8")
fh.close()

content = re.sub(pattern, "", content)
content = re.sub(pattern_help, "Help", content)

fh = open(MAIN_MENU, "wb")
fh.write(content.encode("utf-8"))
Expand Down

0 comments on commit eb93a68

Please sign in to comment.