Skip to content

Commit

Permalink
improve Chinese locale
Browse files Browse the repository at this point in the history
  • Loading branch information
icodeface committed Nov 27, 2019
1 parent a591361 commit b70278c
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Compile the protobuf description file::
Create translations (optional)::

sudo apt-get install python-requests gettext
./contrib/pull_locale
./contrib/make_locale



Expand Down
18 changes: 18 additions & 0 deletions contrib/make_locale
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env python3
import os

os.chdir(os.path.dirname(os.path.realpath(__file__)))
os.chdir('../electrum')

# Convert .po to .mo
print('Installing')
for lang in os.listdir('locale'):
if lang.startswith('messages'):
continue
# Check LC_MESSAGES folder
mo_dir = 'locale/%s/LC_MESSAGES' % lang
if not os.path.exists(mo_dir):
os.mkdir(mo_dir)
cmd = 'msgfmt --output-file="%s/electrum.mo" "locale/%s/electrum.po"' % (mo_dir, lang)
print('Installing', lang)
os.system(cmd)
4 changes: 2 additions & 2 deletions electrum/gui/qt/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,8 @@ def on_expiry(i):
vbox_g.addStretch()

self.receive_widgets = QTabWidget()
self.receive_widgets.addTab(self.receive_qr, 'QR Code')
self.receive_widgets.addTab(self.receive_address_e, 'Text')
self.receive_widgets.addTab(self.receive_qr, _('QR Code'))
self.receive_widgets.addTab(self.receive_address_e, _('Text'))

hbox = QHBoxLayout()
hbox.addLayout(vbox_g)
Expand Down
2 changes: 1 addition & 1 deletion electrum/gui/qt/token_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, dialog, callback):

addr_type, __ = b58_address_to_hash160(self.addresses[0])
if not addr_type == constants.net.ADDRTYPE_P2PKH:
self.dialog.show_message('only P2PKH address supports QRC20 Token')
self.dialog.show_message(_('only P2PKH address supports QRC20 Token'))
self.dialog.reject()
return

Expand Down
62 changes: 62 additions & 0 deletions electrum/locale/zh_CN/electrum.po
Original file line number Diff line number Diff line change
Expand Up @@ -5546,3 +5546,65 @@ msgstr "收到了{} 笔新的交易,从新交易中一共收到资金 {}"
msgid "{} words"
msgstr "{} 个单词"

msgid "Services"
msgstr "服务"

msgid "Tokens"
msgstr "代币"

msgid "On-chain"
msgstr "链上收款"

msgid "Lightning"
msgstr "闪电网络"

msgid "QR Code"
msgstr "二维码"

msgid "Text"
msgstr "文本"

msgid "only P2PKH address supports QRC20 Token"
msgstr "只有 P2PKH 类型的地址支持 QRC20 代币"

msgid "Contract Address:"
msgstr "合约地址:"

msgid "My Address:"
msgstr "我的地址:"

msgid "Bind Address"
msgstr "绑定地址"

msgid "Symbol"
msgstr "符号"

msgid "Pay to:"
msgstr "发给:"

msgid "Amount:"
msgstr "金额:"

msgid "Optional:"
msgstr "附加选项:"

msgid "In progress"
msgstr "进行中"

msgid "Failed"
msgstr "失败"

msgid "contract gas refund"
msgstr "合约 Gas 返还"

msgid "Pay out {} {}"
msgstr "支出 {} {}"

msgid "pay out {} {}"
msgstr "支出 {} {}"

msgid "Copy Transaction ID"
msgstr "复制交易ID"

msgid "raw transaction"
msgstr "交易字节码"

0 comments on commit b70278c

Please sign in to comment.