Skip to content

Commit

Permalink
i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
gwang74 committed Dec 10, 2018
1 parent efd2641 commit 5b26a16
Show file tree
Hide file tree
Showing 163 changed files with 719 additions and 3,117 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/com/tokenbank/activity/AboutActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

mTitleBar = (TitleBar) findViewById(R.id.title_bar);
mTitleBar.setLeftDrawable(R.drawable.ic_back);
mTitleBar.setTitle(getString(R.string.title_about_us));
mTitleBar.setTitle(getString(R.string.titleBar_about));
mTitleBar.setRightTextColor(R.color.white);
mTitleBar.setTitleBarClickListener(this);

mTvVersion = (TextView) findViewById(R.id.tv_version);
mTvVersion.setText(getString(R.string.str_current_version) + DeviceUtil.getVersionName());
mTvVersion.setText(getString(R.string.content_version) + DeviceUtil.getVersionName());

mLayoutUserTerms = (RelativeLayout) findViewById(R.id.layout_use_terms);
mLayoutUserTerms.setOnClickListener(this);
Expand All @@ -51,13 +51,13 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
@Override
public void onClick(View view) {
if (view == mLayoutUserTerms) {
WebBrowserActivity.startWebBrowserActivity(AboutActivity.this, getString(R.string.title_agreement), Constant.service_term_url);
WebBrowserActivity.startWebBrowserActivity(AboutActivity.this, getString(R.string.titleBar_agreement), Constant.service_term_url);

} else if (view == mLayoutPrivliTerms) {
WebBrowserActivity.startWebBrowserActivity(AboutActivity.this, getString(R.string.title_privacy_policy), Constant.privilege_url);
WebBrowserActivity.startWebBrowserActivity(AboutActivity.this, getString(R.string.titleBar_privacy), Constant.privilege_url);

} else if (view == mLayoutCheckUpdate) {
ToastUtil.toast(AboutActivity.this, getString(R.string.str_latest_version));
ToastUtil.toast(AboutActivity.this, getString(R.string.toast_latest_version));
}
}

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/tokenbank/activity/BWDInfoActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void onClick(View v) {
private void initView() {
mTitleBar = findViewById(R.id.title_bar);
mTitleBar.setTitleTextColor(R.color.white);
mTitleBar.setTitle(getString(R.string.title_backup_wallet));
mTitleBar.setTitle(getString(R.string.titleBar_backup_wallet));
mTvBakupTitle = findViewById(R.id.tv_bakup_title);
mTvBakupContent = findViewById(R.id.tv_bakup_content);

Expand Down Expand Up @@ -117,13 +117,13 @@ private void updateUIContent() {
mScrollViewWords.setVisibility(View.GONE);
mTvPk.setVisibility(View.VISIBLE);
mTvBakupTitle.setText(getString(R.string.title_backup_private_key));
mTvBakupContent.setText(getString(R.string.str_backup_content));
mTvBakupContent.setText(getString(R.string.content_backup_private_kye));
mTvPk.setText(mWalletData.wpk);
} else if (mType == WORDS_TYPE) {
mScrollViewWords.setVisibility(View.VISIBLE);
mTvPk.setVisibility(View.GONE);
mTvBakupTitle.setText(getString(R.string.title_backup_mnemonic));
mTvBakupContent.setText(getString(R.string.str_backup_mnemonic_content));
mTvBakupContent.setText(getString(R.string.content_backup_mnemonic));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void startChangeWalletActivity(Context context) {
private void init() {
mTitleBar = findViewById(R.id.title_bar);
mTitleBar.setLeftDrawable(R.drawable.ic_back);
mTitleBar.setTitle(getString(R.string.title_switch_account));
mTitleBar.setTitle(getString(R.string.titleBar_switch_account));
mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() {
@Override
public void onLeftClick(View view) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void initView() {

mTitleBar = findViewById(R.id.title_bar);
mTitleBar.setLeftDrawable(R.drawable.ic_back);
mTitleBar.setTitle(getString(R.string.title_select_token));
mTitleBar.setTitle(getString(R.string.titleBar_select_token));

mTitleBar.setBackgroundColor(getResources().getColor(R.color.common_blue));
mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {

private void initView() {
TitleBar mTitleBar = findViewById(R.id.title_bar);
mTitleBar.setTitle(getString(R.string.title_select_block));
mTitleBar.setTitle(getString(R.string.titleBar_select_block));
mTitleBar.setLeftDrawable(R.drawable.ic_back);
mTitleBar.setRightDrawable(R.drawable.ic_walletutil_help);
mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() {
Expand Down Expand Up @@ -64,7 +64,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)

int hid = (int) adapter.getList().get(position).hid;
if (hid == -1) {
ToastUtil.toast(ChooseWalletBlockActivity.this, getString(R.string.str_data_exception) + hid);
ToastUtil.toast(ChooseWalletBlockActivity.this, getString(R.string.toast_abnormal_data) + hid);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ public void onClick(View v) {
WalletInfoManager.getInstance().updateWalletBaked(mWalletData.waddress, true);
gotoMainActivity();
} else {
ToastUtil.toast(ConfirmWalletBakupInfoActivity.this, getString(R.string.str_private_key_error));
ToastUtil.toast(ConfirmWalletBakupInfoActivity.this, getString(R.string.toast_private_key_incorrect));
}
} else if (mType == WORDS_TYPE) {
if (verifyWords()) {
WalletInfoManager.getInstance().updateWalletWords(mWalletData.waddress, "");
WalletInfoManager.getInstance().updateWalletBaked(mWalletData.waddress, true);
gotoMainActivity();
} else {
ToastUtil.toast(ConfirmWalletBakupInfoActivity.this, getString(R.string.str_mnemonic_error))
ToastUtil.toast(ConfirmWalletBakupInfoActivity.this, getString(R.string.toast_mnemonic_incorrect))
;
}
}
Expand All @@ -118,7 +118,7 @@ private void resortWords() {

private void initView() {
mTitleBar = findViewById(R.id.title_bar);
mTitleBar.setTitle(getString(R.string.title_confirm_backup_info));
mTitleBar.setTitle(getString(R.string.titleBar_verify));
mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() {
@Override
public void onLeftClick(View view) {
Expand Down Expand Up @@ -208,13 +208,13 @@ private void updateUIContent() {
if (mType == PK_TYPE) {
mLayoutWords.setVisibility(View.GONE);
mEdtPk.setVisibility(View.VISIBLE);
mTvBakupTitle.setText(getString(R.string.title_confirm_private_key));
mTvBakupContent.setText(getString(R.string.str_confirm_private_key_tips));
mTvBakupTitle.setText(getString(R.string.title_verify_private_key));
mTvBakupContent.setText(getString(R.string.content_verify_private_key));
} else if (mType == WORDS_TYPE) {
mLayoutWords.setVisibility(View.VISIBLE);
mEdtPk.setVisibility(View.GONE);
mTvBakupTitle.setText(getString(R.string.title_confirm_mnemonic));
mTvBakupContent.setText(getString(R.string.str_confirm_mnemonic_tips));
mTvBakupTitle.setText(getString(R.string.title_verify_mnemonic));
mTvBakupContent.setText(getString(R.string.content_verify_mnemonic));
}
}

Expand Down
26 changes: 14 additions & 12 deletions app/src/main/java/com/tokenbank/activity/CreateWalletActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.Html;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
Expand Down Expand Up @@ -59,7 +60,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
private void initView() {
mTitleBar = findViewById(R.id.title_bar);
mTitleBar.setLeftDrawable(R.drawable.ic_back);
mTitleBar.setTitle(R.string.str_create_wallet);
mTitleBar.setTitle(R.string.btn_create_wallet);
mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() {
@Override
public void onLeftClick(View view) {
Expand All @@ -75,6 +76,7 @@ public void onLeftClick(View view) {
mImgServiceTerms = findViewById(R.id.img_service_terms);
mImgServiceTerms.setOnClickListener(this);
mTvServiceTerms = findViewById(R.id.tv_service_terms);
mTvServiceTerms.setText(Html.fromHtml(getString(R.string.content_read_service)));
mTvServiceTerms.setOnClickListener(this);
mBtnConfirm = findViewById(R.id.btn_confirm);

Expand Down Expand Up @@ -157,7 +159,7 @@ public static void navToActivity(Context context, BlockChainData.Block block, in

private boolean paramCheck() {
if (mBlock == null) {
ViewUtil.showSysAlertDialog(this, getString(R.string.str_choose_currencies), "OK");
ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_no_block), "OK");
return false;
}

Expand All @@ -167,29 +169,29 @@ private boolean paramCheck() {
boolean readedTerms = mImgServiceTerms.isSelected();

if (TextUtils.isEmpty(walletName)) {
ViewUtil.showSysAlertDialog(this, getString(R.string.str_no_wallet_name), "OK");
ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_no_wallet_name), "OK");
return false;
}
if (TextUtils.isEmpty(walletPwd)) {
ViewUtil.showSysAlertDialog(this, getString(R.string.str_no_pwd), "OK");
ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_no_password), "OK");
return false;
}

if (TextUtils.isEmpty(walletPwdRepeat)) {
ViewUtil.showSysAlertDialog(this, getString(R.string.str_no_verify_pwd), "OK");
ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_no_verify_password), "OK");
return false;
}

if (!TextUtils.equals(walletPwdRepeat, walletPwd)) {
ViewUtil.showSysAlertDialog(this, getString(R.string.str_verify_pwd_error), "OK");
ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_passwords_unmatch), "OK");
return false;
}
if (walletPwd.length() < 8) {
ViewUtil.showSysAlertDialog(this, getString(R.string.str_short_pwd), "OK");
ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_short_password), "OK");
return false;
}
if (!readedTerms) {
ViewUtil.showSysAlertDialog(this, getString(R.string.str_no_read_service), "OK");
ViewUtil.showSysAlertDialog(this, getString(R.string.dialog_content_no_read_service), "OK");
return false;
}

Expand Down Expand Up @@ -226,7 +228,7 @@ private void recordWallet(final String name, final int walletType, final String
final String words, String tips, final String address) {
long walletID = System.currentTimeMillis();
storeWallet(walletID, walletType, name, address, hash, privateKey, words);
ToastUtil.toast(CreateWalletActivity.this, getString(R.string.str_wallet_created));
ToastUtil.toast(CreateWalletActivity.this, getString(R.string.toast_wallet_created));
gotoBakup();
}

Expand All @@ -244,12 +246,12 @@ private void storeWallet(long walletId, int walletType, String walletName, Strin


private void resetBtn() {
mBtnConfirm.setText(getString(R.string.str_create_wallet));
mBtnConfirm.setText(getString(R.string.btn_create_wallet_done));
mBtnConfirm.setEnabled(true);
}

private void setBtnStateToCreating() {
mBtnConfirm.setText(getString(R.string.str_creating_wallet));
mBtnConfirm.setText(getString(R.string.btn_creating_wallet));
mBtnConfirm.setEnabled(false);
}

Expand All @@ -265,6 +267,6 @@ private void gotoBakup() {
}

private void gotoServiceTermPage() {
WebBrowserActivity.startWebBrowserActivity(this, getString(R.string.title_service_terms), Constant.service_term_url);
WebBrowserActivity.startWebBrowserActivity(this, getString(R.string.titleBar_service_terms), Constant.service_term_url);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private void initView() {

mTitleBar = findViewById(R.id.title_bar);
mTitleBar.setLeftDrawable(R.drawable.ic_back);
mTitleBar.setTitle(getString(R.string.title_import_wallet));
mTitleBar.setTitle(getString(R.string.titleBar_import_wallet));
mTitleBar.setTitleBarClickListener(new TitleBar.TitleBarListener() {
@Override
public void onLeftClick(View view) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private void initView() {

mTitleBar = (TitleBar) findViewById(R.id.title_bar);
mTitleBar.setLeftDrawable(R.drawable.ic_back);
mTitleBar.setTitle(getString(R.string.title_manage_wallet));
mTitleBar.setTitle(getString(R.string.titleBar_manage_wallet));
mTitleBar.setTitleTextColor(R.color.white);
mTitleBar.setBackgroundColor(getResources().getColor(R.color.common_blue));
mTitleBar.setTitleBarClickListener(this);
Expand Down
22 changes: 11 additions & 11 deletions app/src/main/java/com/tokenbank/activity/ModifyPwdActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,37 +56,37 @@ public void onLeftClick(View view) {
@Override
public void onRightClick(View view) {
if (TextUtils.isEmpty(mEdtOldPwd.getText().toString())) {
showTipAlertDialog(getString(R.string.str_no_old_pwd));
showTipAlertDialog(getString(R.string.dialog_content_no_old_password));
return;
}
if (TextUtils.isEmpty(mEdtNewPwd.getText().toString())) {
showTipAlertDialog(getString(R.string.str_no_new_pwd));
showTipAlertDialog(getString(R.string.dialog_content_no_new_password));
return;
}

if (TextUtils.isEmpty(mEdtReaptNewPwd.getText().toString())) {
showTipAlertDialog(getString(R.string.str_no_verify_new_pwd));
showTipAlertDialog(getString(R.string.dialog_content_no_verify_new_password));
return;
}
if (!TextUtils.equals(mEdtReaptNewPwd.getText().toString(), mEdtNewPwd.getText().toString())) {
showTipAlertDialog(getString(R.string.str_verify_new_pwd_error));
showTipAlertDialog(getString(R.string.dialog_new_passwords_unmatch));
return;
}
if (mEdtNewPwd.getText().toString().length() < 8) {
showTipAlertDialog(getString(R.string.str_short_pwd));
showTipAlertDialog(getString(R.string.dialog_content_short_password));
return;
}
if (TextUtils.equals(mEdtNewPwd.getText().toString(), mEdtOldPwd.getText().toString())) {
showTipAlertDialog(getString(R.string.str_reset_pwd));
showTipAlertDialog(getString(R.string.dialog_content_old_new_same));
return;
}
String oldHash = FileUtil.getStringContent(mEdtOldPwd.getText().toString());
if (!TextUtils.equals(oldHash, mWalletData.whash)) {
showTipAlertDialog(getString(R.string.str_old_pwd_error));
showTipAlertDialog(getString(R.string.dialog_content_old_password_incorrect));
mEdtOldPwd.setText("");
return;
}
ToastUtil.toast(ModifyPwdActivity.this, getString(R.string.str_pwd_changed));
ToastUtil.toast(ModifyPwdActivity.this, getString(R.string.toast_password_changed));
WalletInfoManager.getInstance().updateWalletHash(mWalletData.waddress, FileUtil.getStringContent(mEdtNewPwd.getText().toString()));
this.finish();
}
Expand Down Expand Up @@ -115,17 +115,17 @@ private void initView() {
mTitleBar = (TitleBar) findViewById(R.id.title_bar);
mTitleBar.setLeftDrawable(R.drawable.ic_back);

mTitleBar.setTitle(getString(R.string.title_change_pwd));
mTitleBar.setTitle(getString(R.string.titleBar_change_pwd));

mTitleBar.setRightText(getString(R.string.str_completed));
mTitleBar.setRightText(getString(R.string.titleBar_completed));
mTitleBar.setRightTextColor(R.color.white);
mTitleBar.setTitleBarClickListener(this);

mEdtOldPwd = findViewById(R.id.edt_old_pwd);
mEdtNewPwd = findViewById(R.id.edt_new_pwd);
mEdtReaptNewPwd = findViewById(R.id.edt_new_repeat_pwd);
mTvForgetPwdTips = findViewById(R.id.tv_forgetpwd_tip);
mTvForgetPwdTips.setText(Html.fromHtml(getString(R.string.str_forget_pwd_tips)));
mTvForgetPwdTips.setText(Html.fromHtml(getString(R.string.content_forgot_password)));
mTvForgetPwdTips.setOnClickListener(this);
}

Expand Down
Loading

0 comments on commit 5b26a16

Please sign in to comment.