abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2
diff options
context:
space:
mode:
authorJules Aguillon2022-01-23 19:19:38 +0100
committerJules Aguillon2022-01-23 19:20:02 +0100
commitcb95e99f50ef3065fb8359ac77cc72cc0894a720 (patch)
treeae9e12516b93e573757009ee8356cf63b40e254f /srcs/juloo.keyboard2
parent28f98cc1298491e1b9133b1e110cfb7ed310dc79 (diff)
downloadunexpected-keyboard-cb95e99f50ef3065fb8359ac77cc72cc0894a720.tar.gz
unexpected-keyboard-cb95e99f50ef3065fb8359ac77cc72cc0894a720.zip
Make action key labels translatable
Diffstat (limited to 'srcs/juloo.keyboard2')
-rw-r--r--srcs/juloo.keyboard2/Keyboard2.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java
index fdaa672..06fbed5 100644
--- a/srcs/juloo.keyboard2/Keyboard2.java
+++ b/srcs/juloo.keyboard2/Keyboard2.java
@@ -141,18 +141,20 @@ public class Keyboard2 extends InputMethodService
private String actionLabel_of_imeAction(int action)
{
+ int res;
switch (action)
{
case EditorInfo.IME_ACTION_UNSPECIFIED:
- case EditorInfo.IME_ACTION_NEXT: return "Next";
- case EditorInfo.IME_ACTION_DONE: return "Done";
- case EditorInfo.IME_ACTION_GO: return "Go";
- case EditorInfo.IME_ACTION_PREVIOUS: return "Prev";
- case EditorInfo.IME_ACTION_SEARCH: return "Search";
- case EditorInfo.IME_ACTION_SEND: return "Send";
+ case EditorInfo.IME_ACTION_NEXT: res = R.string.key_action_next; break;
+ case EditorInfo.IME_ACTION_DONE: res = R.string.key_action_done; break;
+ case EditorInfo.IME_ACTION_GO: res = R.string.key_action_go; break;
+ case EditorInfo.IME_ACTION_PREVIOUS: res = R.string.key_action_prev; break;
+ case EditorInfo.IME_ACTION_SEARCH: res = R.string.key_action_search; break;
+ case EditorInfo.IME_ACTION_SEND: res = R.string.key_action_send; break;
case EditorInfo.IME_ACTION_NONE:
default: return null;
}
+ return getResources().getString(res);
}
private void refreshEditorInfo(EditorInfo info)