You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by mi...@apache.org on 2018/03/01 08:19:41 UTC
[2/3] incubator-weex git commit: *[android] text localization
*[android] text localization
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/d67a3af2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/d67a3af2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/d67a3af2
Branch: refs/heads/master
Commit: d67a3af27573f483cbe0022e1df6ee5103f260f7
Parents: 94ee706
Author: misakuo <mi...@apache.org>
Authored: Wed Feb 28 20:58:37 2018 +0800
Committer: misakuo <mi...@apache.org>
Committed: Wed Feb 28 20:58:37 2018 +0800
----------------------------------------------------------------------
.../sdk/src/main/java/com/taobao/weex/ui/view/WXTextView.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/d67a3af2/android/sdk/src/main/java/com/taobao/weex/ui/view/WXTextView.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/view/WXTextView.java b/android/sdk/src/main/java/com/taobao/weex/ui/view/WXTextView.java
index 914171f..e4a9808 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/view/WXTextView.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/WXTextView.java
@@ -35,7 +35,6 @@ import com.taobao.weex.ui.view.gesture.WXGesture;
import com.taobao.weex.ui.view.gesture.WXGestureObservable;
import java.lang.ref.WeakReference;
-import java.util.Locale;
/**
* TextView wrapper
@@ -130,13 +129,13 @@ public class WXTextView extends View implements WXGestureObservable, IWXTextView
@Override
public boolean onLongClick(View v) {
PopupMenu popupMenu = new PopupMenu(getContext(), WXTextView.this);
- boolean isCN = false;
+ String s = "Copy";
try {
- isCN = Locale.getDefault().toString().startsWith("zh_CN");
+ s = getContext().getResources().getString(android.R.string.copy);
} catch (Throwable t) {
//ignore
}
- final String title = isCN ? "复制" : "Copy";
+ final String title = s;
popupMenu.getMenu().add(title);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override