From 8f936303507be5952ed4bd5c6009f108b8d881d7 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 21 Aug 2015 06:56:47 -0700 Subject: [PATCH 1/6] shorten string to make action bar more obvious (and catch up with generated string file changes) --- xwords4/android/XWords4/archive/R.java | 105 +++++++++--------- .../android/XWords4/res/values/strings.xml | 2 +- .../XWords4/res_src/values-ba_CK/strings.xml | 5 +- .../XWords4/res_src/values-ca_PS/strings.xml | 5 +- 4 files changed, 63 insertions(+), 54 deletions(-) diff --git a/xwords4/android/XWords4/archive/R.java b/xwords4/android/XWords4/archive/R.java index 3ca5799b3..763b09b3f 100644 --- a/xwords4/android/XWords4/archive/R.java +++ b/xwords4/android/XWords4/archive/R.java @@ -70,14 +70,15 @@ public final class R { public static final int save__gen=0x7f02001f; public static final int search__gen=0x7f020020; public static final int select_all__gen=0x7f020021; - public static final int shuffle=0x7f020022; - public static final int sologame__gen=0x7f020023; - public static final int stat_notify_chat=0x7f020024; - public static final int stat_notify_sync=0x7f020025; - public static final int undo=0x7f020026; - public static final int up__gen=0x7f020027; - public static final int values=0x7f020028; - public static final int zoom=0x7f020029; + public static final int send__gen=0x7f020022; + public static final int shuffle=0x7f020023; + public static final int sologame__gen=0x7f020024; + public static final int stat_notify_chat=0x7f020025; + public static final int stat_notify_sync=0x7f020026; + public static final int undo=0x7f020027; + public static final int up__gen=0x7f020028; + public static final int values=0x7f020029; + public static final int zoom=0x7f02002a; } public static final class id { public static final int about_xlator=0x7f0a0001; @@ -120,9 +121,10 @@ public final class R { public static final int button_study=0x7f0a0061; public static final int change_connection=0x7f0a003b; public static final int chat_button=0x7f0a0080; - public static final int chat_edit=0x7f0a0010; - public static final int chat_history=0x7f0a000f; - public static final int chat_menu_clear=0x7f0a00a0; + public static final int chat_edit=0x7f0a0011; + public static final int chat_history=0x7f0a0010; + public static final int chat_menu_clear=0x7f0a00a1; + public static final int chat_menu_send=0x7f0a00a0; public static final int checkbox=0x7f0a0051; public static final int color_display_sample=0x7f0a0012; public static final int color_edit_sample=0x7f0a0013; @@ -137,11 +139,11 @@ public final class R { public static final int dict_label=0x7f0a0069; public static final int dict_spinner=0x7f0a002d; public static final int dictlist_button=0x7f0a007f; - public static final int dicts_delete=0x7f0a00a3; - public static final int dicts_deselect_all=0x7f0a00a2; - public static final int dicts_download=0x7f0a00a1; - public static final int dicts_move=0x7f0a00a4; - public static final int dicts_select=0x7f0a00a5; + public static final int dicts_delete=0x7f0a00a4; + public static final int dicts_deselect_all=0x7f0a00a3; + public static final int dicts_download=0x7f0a00a2; + public static final int dicts_move=0x7f0a00a5; + public static final int dicts_select=0x7f0a00a6; public static final int divider=0x7f0a0024; public static final int download_button=0x7f0a0072; public static final int dwnld_message=0x7f0a004f; @@ -160,31 +162,31 @@ public final class R { public static final int game_locked_check=0x7f0a0028; public static final int game_name=0x7f0a0046; public static final int gamel_menu_checkmoves=0x7f0a0091; - public static final int games_game_config=0x7f0a00b1; - public static final int games_game_copy=0x7f0a00b6; - public static final int games_game_delete=0x7f0a00b0; - public static final int games_game_move=0x7f0a00b2; - public static final int games_game_new_from=0x7f0a00b4; - public static final int games_game_rename=0x7f0a00b5; - public static final int games_game_reset=0x7f0a00b3; - public static final int games_group_default=0x7f0a00ba; - public static final int games_group_delete=0x7f0a00b9; - public static final int games_group_movedown=0x7f0a00b8; - public static final int games_group_moveup=0x7f0a00b7; - public static final int games_group_rename=0x7f0a00bb; - public static final int games_menu_about=0x7f0a00ad; - public static final int games_menu_checkmoves=0x7f0a00af; - public static final int games_menu_checkupdates=0x7f0a00bc; - public static final int games_menu_dicts=0x7f0a00ab; - public static final int games_menu_email=0x7f0a00ac; - public static final int games_menu_loaddb=0x7f0a00be; - public static final int games_menu_newgame_net=0x7f0a00a7; - public static final int games_menu_newgame_solo=0x7f0a00a6; - public static final int games_menu_newgroup=0x7f0a00a8; - public static final int games_menu_prefs=0x7f0a00a9; - public static final int games_menu_rateme=0x7f0a00aa; - public static final int games_menu_resend=0x7f0a00ae; - public static final int games_menu_storedb=0x7f0a00bd; + public static final int games_game_config=0x7f0a00b2; + public static final int games_game_copy=0x7f0a00b7; + public static final int games_game_delete=0x7f0a00b1; + public static final int games_game_move=0x7f0a00b3; + public static final int games_game_new_from=0x7f0a00b5; + public static final int games_game_rename=0x7f0a00b6; + public static final int games_game_reset=0x7f0a00b4; + public static final int games_group_default=0x7f0a00bb; + public static final int games_group_delete=0x7f0a00ba; + public static final int games_group_movedown=0x7f0a00b9; + public static final int games_group_moveup=0x7f0a00b8; + public static final int games_group_rename=0x7f0a00bc; + public static final int games_menu_about=0x7f0a00ae; + public static final int games_menu_checkmoves=0x7f0a00b0; + public static final int games_menu_checkupdates=0x7f0a00bd; + public static final int games_menu_dicts=0x7f0a00ac; + public static final int games_menu_email=0x7f0a00ad; + public static final int games_menu_loaddb=0x7f0a00bf; + public static final int games_menu_newgame_net=0x7f0a00a8; + public static final int games_menu_newgame_solo=0x7f0a00a7; + public static final int games_menu_newgroup=0x7f0a00a9; + public static final int games_menu_prefs=0x7f0a00aa; + public static final int games_menu_rateme=0x7f0a00ab; + public static final int games_menu_resend=0x7f0a00af; + public static final int games_menu_storedb=0x7f0a00be; public static final int games_menu_study=0x7f0a0090; public static final int group_done=0x7f0a0084; public static final int group_exchange=0x7f0a0095; @@ -200,10 +202,10 @@ public final class R { public static final int label=0x7f0a0025; public static final int lang_separator=0x7f0a002b; public static final int lang_spinner=0x7f0a002c; - public static final int loc_item_check=0x7f0a00c0; - public static final int loc_item_clear=0x7f0a00bf; - public static final int loc_item_copy_bless=0x7f0a00c2; - public static final int loc_item_copy_eng=0x7f0a00c1; + public static final int loc_item_check=0x7f0a00c1; + public static final int loc_item_clear=0x7f0a00c0; + public static final int loc_item_copy_bless=0x7f0a00c3; + public static final int loc_item_copy_eng=0x7f0a00c2; public static final int loc_search_button=0x7f0a005e; public static final int loc_search_field=0x7f0a005d; public static final int local_label=0x7f0a0059; @@ -244,18 +246,18 @@ public final class R { public static final int room_edit=0x7f0a0036; public static final int room_spinner=0x7f0a0039; public static final int screen=0x7f0a002a; + public static final int scroll=0x7f0a000f; public static final int search_button=0x7f0a0021; public static final int seek_blue=0x7f0a0018; public static final int seek_green=0x7f0a0016; public static final int seek_red=0x7f0a0014; - public static final int send_button=0x7f0a0011; public static final int show_remote=0x7f0a001e; public static final int shuffle_button=0x7f0a007d; - public static final int slmenu_clear_sel=0x7f0a00c7; - public static final int slmenu_copy_sel=0x7f0a00c6; - public static final int slmenu_deselect_all=0x7f0a00c5; - public static final int slmenu_lookup_sel=0x7f0a00c3; - public static final int slmenu_select_all=0x7f0a00c4; + public static final int slmenu_clear_sel=0x7f0a00c8; + public static final int slmenu_copy_sel=0x7f0a00c7; + public static final int slmenu_deselect_all=0x7f0a00c6; + public static final int slmenu_lookup_sel=0x7f0a00c4; + public static final int slmenu_select_all=0x7f0a00c5; public static final int smart_robot=0x7f0a0040; public static final int state=0x7f0a004d; public static final int summary=0x7f0a0060; @@ -859,6 +861,7 @@ public final class R { */ public static final int clr_crosshairs=0x7f05013d; public static final int config_no_connvia=0x7f0502c7; + public static final int confirm_clear_chat=0x7f05030d; /** Additional text appended to text confirm_delete_dictf in the wordlist delete confiration dialog in the case where the wordlist to be deleted is the last in its language. The name diff --git a/xwords4/android/XWords4/res/values/strings.xml b/xwords4/android/XWords4/res/values/strings.xml index 590a624f0..c84bfb1b7 100644 --- a/xwords4/android/XWords4/res/values/strings.xml +++ b/xwords4/android/XWords4/res/values/strings.xml @@ -1256,7 +1256,7 @@ --> - %1$s message history + %1$s messages Me:\u0020 diff --git a/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml b/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml index 1474ab684..e4e8b5c59 100644 --- a/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml +++ b/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml @@ -1086,7 +1086,7 @@ --> - %1$s egassem yrotsih + %1$s segassem Em:\u0020 @@ -2186,4 +2186,7 @@ Eno egassem tnes %1$s segassem tnes + Era uoy erus uoy tnaw ot eteled + lla tahc yrotsih rof siht ?emag\n\nsIht( noitca tonnac eb + enodnu.) diff --git a/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml b/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml index 52bb792fa..6553d1616 100644 --- a/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml +++ b/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml @@ -1086,7 +1086,7 @@ --> - %1$s MESSAGE HISTORY + %1$s MESSAGES ME:\u0020 @@ -2186,4 +2186,7 @@ ONE MESSAGE SENT %1$s MESSAGES SENT + ARE YOU SURE YOU WANT TO DELETE + ALL CHAT HISTORY FOR THIS GAME?\n\n(THIS ACTION CANNOT BE + UNDONE.) From 8da25dcdd4750953d6328d5077a86452ff5cb707 Mon Sep 17 00:00:00 2001 From: Bernard Massot Date: Sun, 23 Aug 2015 21:19:03 +0200 Subject: [PATCH 2/6] Translated using Weblate (French) Currently translated at 100.0% (691 of 691 strings) --- .../XWords4/res_src/values-fr/strings.xml | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/xwords4/android/XWords4/res_src/values-fr/strings.xml b/xwords4/android/XWords4/res_src/values-fr/strings.xml index a15859965..527b6d636 100644 --- a/xwords4/android/XWords4/res_src/values-fr/strings.xml +++ b/xwords4/android/XWords4/res_src/values-fr/strings.xml @@ -1,4 +1,4 @@ - + + I\'ll choose + + Invitation ready to paste + + Invitation URL + + The \"%1$s\" option copies an + invitation URL to the clipboard. Paste it into the app of your + choice and send it to your friend. diff --git a/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml b/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml index e4e8b5c59..8e405921f 100644 --- a/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml +++ b/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml @@ -2189,4 +2189,18 @@ Era uoy erus uoy tnaw ot eteled lla tahc yrotsih rof siht ?emag\n\nsIht( noitca tonnac eb enodnu.) + + I\'ll esoohc + + Noitativni ydaer ot etsap + + Noitativni LRU + + Eht \"%1$s\" noitpo seipoc na + noitativni LRU ot eht draobpilc. Etsap ti otni eht ppa fo ruoy + eciohc dna dnes ti ot ruoy dneirf. diff --git a/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml b/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml index 6553d1616..e5ea81946 100644 --- a/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml +++ b/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml @@ -2189,4 +2189,18 @@ ARE YOU SURE YOU WANT TO DELETE ALL CHAT HISTORY FOR THIS GAME?\n\n(THIS ACTION CANNOT BE UNDONE.) + + I\'LL CHOOSE + + INVITATION READY TO PASTE + + INVITATION URL + + THE \"%1$s\" OPTION COPIES AN + INVITATION URL TO THE CLIPBOARD. PASTE IT INTO THE APP OF YOUR + CHOICE AND SEND IT TO YOUR FRIEND. diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java index cde6b27fc..ea53dfd80 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java @@ -1046,12 +1046,17 @@ public class BoardDelegate extends DelegateBase SMS_INVITE_RESULT ); break; case EMAIL: + case CLIPBOARD: NetLaunchInfo nli = new NetLaunchInfo( m_summary, m_gi, 1, 1 + m_nGuestDevs ); if ( !m_relayConnected ) { nli.removeAddress( CommsConnType.COMMS_CONN_RELAY ); } - GameUtils.launchEmailInviteActivity( m_activity, nli ); + if ( InviteMeans.EMAIL == means ) { + GameUtils.launchEmailInviteActivity( m_activity, nli ); + } else if ( InviteMeans.CLIPBOARD == means ) { + GameUtils.inviteURLToClip( m_activity, nli ); + } break; default: Assert.fail(); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java index 274c396bb..6906a7a15 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java @@ -138,7 +138,7 @@ public class DlgDelegate { public interface DlgClickNotify { public static enum InviteMeans { - SMS, EMAIL, NFC, BLUETOOTH, + SMS, EMAIL, NFC, BLUETOOTH, CLIPBOARD, }; void dlgButtonClicked( Action action, int button, Object[] params ); void inviteChoiceMade( Action action, InviteMeans means, Object[] params ); @@ -335,6 +335,11 @@ public class DlgDelegate { showNotAgainDlgThen( msgID, prefsKey, Action.SKIP_CALLBACK ); } + private void showNotAgainDlgThen( String msg, int prefsKey ) + { + showNotAgainDlgThen( msg, prefsKey, Action.SKIP_CALLBACK, null, null ); + } + public void showConfirmThen( String msg, Action action ) { showConfirmThen( null, msg, android.R.string.ok, action, null ); @@ -626,6 +631,9 @@ public class DlgDelegate { items.add( getString( R.string.invite_choice_nfc ) ); means.add( DlgClickNotify.InviteMeans.NFC ); } + final int clipPos = means.size(); + items.add( getString( R.string.invite_choice_clip ) ); + means.add( DlgClickNotify.InviteMeans.CLIPBOARD ); final int[] sel = { -1 }; OnClickListener selChanged = new OnClickListener() { @@ -637,6 +645,13 @@ public class DlgDelegate { .setEnabled( true ); } sel[0] = view; + + if ( view == clipPos ) { + String msg = + getString( R.string.not_again_clip_expl_fmt, + getString(R.string.invite_choice_clip) ); + showNotAgainDlgThen( msg, R.string.key_na_clip_expl ); + } } }; OnClickListener okClicked = new OnClickListener() { diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java index 0e1c8392b..716a16860 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameUtils.java @@ -49,7 +49,6 @@ import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType; import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnTypeSet; import org.eehouse.android.xw4.jni.CurGameInfo.DeviceRole; import org.eehouse.android.xw4.jni.LastMoveInfo; -import org.eehouse.android.xw4.DlgDelegate.DlgClickNotify.InviteMeans; public class GameUtils { @@ -605,6 +604,33 @@ public class GameUtils { inviteID, gameID, gameName, isHost ); } + // @SuppressLint({ "NewApi", "NewApi", "NewApi", "NewApi" }) + // @SuppressWarnings("deprecation") + // @TargetApi(11) + public static void inviteURLToClip( Context context, NetLaunchInfo nli ) + { + Uri gameUri = nli.makeLaunchUri( context ); + String asStr = gameUri.toString(); + + int sdk = android.os.Build.VERSION.SDK_INT; + if ( sdk < android.os.Build.VERSION_CODES.HONEYCOMB ) { + android.text.ClipboardManager clipboard = + (android.text.ClipboardManager) + context.getSystemService(Context.CLIPBOARD_SERVICE); + clipboard.setText( asStr ); + } else { + android.content.ClipboardManager clipboard = + (android.content.ClipboardManager) + context.getSystemService(Context.CLIPBOARD_SERVICE); + String label = LocUtils.getString( context, R.string.clip_label ); + android.content.ClipData clip = android.content.ClipData + .newPlainText( label, asStr ); + clipboard.setPrimaryClip( clip ); + } + + Utils.showToast( context, R.string.invite_copied ); + } + public static void launchEmailInviteActivity( Activity activity, NetLaunchInfo nli ) { // DbgUtils.logf( "launchEmailInviteActivity: nli=%s", nli.makeLaunchJSON() ); From 5fd477be758b0eb6a6929f71c6d00dac48e9bee4 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 23 Aug 2015 21:52:07 -0700 Subject: [PATCH 6/6] use existing string -- Copy to clipboard --- xwords4/android/XWords4/archive/R.java | 10 +++------- xwords4/android/XWords4/res/values/strings.xml | 3 --- .../android/XWords4/res_src/values-ba_CK/strings.xml | 3 --- .../android/XWords4/res_src/values-ca_PS/strings.xml | 3 --- .../src/org/eehouse/android/xw4/DlgDelegate.java | 4 ++-- 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/xwords4/android/XWords4/archive/R.java b/xwords4/android/XWords4/archive/R.java index f8cd15d53..e8be48e31 100644 --- a/xwords4/android/XWords4/archive/R.java +++ b/xwords4/android/XWords4/archive/R.java @@ -856,7 +856,7 @@ public final class R { /** EXPERIMENTAL: "label" for invite on clipboard. If it's shown it's by some Android utility */ - public static final int clip_label=0x7f050311; + public static final int clip_label=0x7f050310; /** color of the "crosshairs", lines drawn vertically and horizontally through the square the user is currently touching in order to guide the fat-fingered (most of us) in @@ -1342,10 +1342,6 @@ public final class R { */ public static final int initial_player_minutes=0x7f050127; public static final int invite_choice_bt=0x7f05016c; - /** EXPERIMENTAL: A choice of how to invite, along with SMS, - Bluetooth, email etc - */ - public static final int invite_choice_clip=0x7f05030f; public static final int invite_choice_email=0x7f05016b; public static final int invite_choice_nfc=0x7f05016d; /** EXPLAIN ME @@ -1371,7 +1367,7 @@ public final class R { /** EXPERIMENTAL: Shown as toast when user chooses "My choice" for invitation */ - public static final int invite_copied=0x7f050310; + public static final int invite_copied=0x7f05030f; public static final int invite_dict_missing_body_fmt=0x7f05023c; public static final int invite_dict_missing_body_noname_fmt=0x7f05023d; public static final int invite_dict_missing_title=0x7f05023b; @@ -1984,7 +1980,7 @@ public final class R { /** EXPERIMENTAL: Newbie hint next when invite_choice_clip shown when chosen */ - public static final int not_again_clip_expl_fmt=0x7f050312; + public static final int not_again_clip_expl_fmt=0x7f050311; public static final int not_again_comms_bt=0x7f05030c; public static final int not_again_comms_relay=0x7f05030a; public static final int not_again_comms_sms=0x7f05030b; diff --git a/xwords4/android/XWords4/res/values/strings.xml b/xwords4/android/XWords4/res/values/strings.xml index 04682f157..f5a0507ad 100644 --- a/xwords4/android/XWords4/res/values/strings.xml +++ b/xwords4/android/XWords4/res/values/strings.xml @@ -2541,9 +2541,6 @@ Are you sure you want to delete all chat history for this game?\n\n(This action cannot be undone.) - - I\'ll choose Invitation ready to paste diff --git a/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml b/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml index 8e405921f..c750480f1 100644 --- a/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml +++ b/xwords4/android/XWords4/res_src/values-ba_CK/strings.xml @@ -2189,9 +2189,6 @@ Era uoy erus uoy tnaw ot eteled lla tahc yrotsih rof siht ?emag\n\nsIht( noitca tonnac eb enodnu.) - - I\'ll esoohc Noitativni ydaer ot etsap diff --git a/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml b/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml index e5ea81946..b001f0284 100644 --- a/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml +++ b/xwords4/android/XWords4/res_src/values-ca_PS/strings.xml @@ -2189,9 +2189,6 @@ ARE YOU SURE YOU WANT TO DELETE ALL CHAT HISTORY FOR THIS GAME?\n\n(THIS ACTION CANNOT BE UNDONE.) - - I\'LL CHOOSE INVITATION READY TO PASTE diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java index 6906a7a15..8c0b101b4 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java @@ -632,7 +632,7 @@ public class DlgDelegate { means.add( DlgClickNotify.InviteMeans.NFC ); } final int clipPos = means.size(); - items.add( getString( R.string.invite_choice_clip ) ); + items.add( getString( R.string.slmenu_copy_sel ) ); means.add( DlgClickNotify.InviteMeans.CLIPBOARD ); final int[] sel = { -1 }; @@ -649,7 +649,7 @@ public class DlgDelegate { if ( view == clipPos ) { String msg = getString( R.string.not_again_clip_expl_fmt, - getString(R.string.invite_choice_clip) ); + getString(R.string.slmenu_copy_sel) ); showNotAgainDlgThen( msg, R.string.key_na_clip_expl ); } }