label xlations with the language name

This commit is contained in:
Eric House 2014-05-17 16:57:24 -07:00
parent 018424e6e8
commit 8f15f76fed
8 changed files with 152 additions and 133 deletions

View file

@ -81,66 +81,66 @@ public final class R {
public static final int add_player=0x7f0a0032;
public static final int advertise_new_room_check=0x7f0a0038;
public static final int blessed_label=0x7f0a0059;
public static final int board_menu_chat=0x7f0a00a6;
public static final int board_menu_dict=0x7f0a00a2;
public static final int board_menu_done=0x7f0a008d;
public static final int board_menu_file_about=0x7f0a009b;
public static final int board_menu_file_prefs=0x7f0a009a;
public static final int board_menu_flip=0x7f0a00a4;
public static final int board_menu_game_counts=0x7f0a0093;
public static final int board_menu_game_history=0x7f0a0095;
public static final int board_menu_game_left=0x7f0a0094;
public static final int board_menu_game_netstats=0x7f0a009c;
public static final int board_menu_game_resend=0x7f0a0097;
public static final int board_menu_game_resign=0x7f0a0096;
public static final int board_menu_hint_next=0x7f0a00a0;
public static final int board_menu_hint_prev=0x7f0a009f;
public static final int board_menu_invite=0x7f0a008c;
public static final int board_menu_juggle=0x7f0a00a3;
public static final int board_menu_toggle=0x7f0a00a7;
public static final int board_menu_trade=0x7f0a008e;
public static final int board_menu_trade_cancel=0x7f0a008f;
public static final int board_menu_trade_commit=0x7f0a0090;
public static final int board_menu_tray=0x7f0a0092;
public static final int board_menu_undo_current=0x7f0a00a1;
public static final int board_menu_undo_last=0x7f0a0091;
public static final int board_menu_zoom=0x7f0a00a5;
public static final int board_menu_chat=0x7f0a00a7;
public static final int board_menu_dict=0x7f0a00a3;
public static final int board_menu_done=0x7f0a008e;
public static final int board_menu_file_about=0x7f0a009c;
public static final int board_menu_file_prefs=0x7f0a009b;
public static final int board_menu_flip=0x7f0a00a5;
public static final int board_menu_game_counts=0x7f0a0094;
public static final int board_menu_game_history=0x7f0a0096;
public static final int board_menu_game_left=0x7f0a0095;
public static final int board_menu_game_netstats=0x7f0a009d;
public static final int board_menu_game_resend=0x7f0a0098;
public static final int board_menu_game_resign=0x7f0a0097;
public static final int board_menu_hint_next=0x7f0a00a1;
public static final int board_menu_hint_prev=0x7f0a00a0;
public static final int board_menu_invite=0x7f0a008d;
public static final int board_menu_juggle=0x7f0a00a4;
public static final int board_menu_toggle=0x7f0a00a8;
public static final int board_menu_trade=0x7f0a008f;
public static final int board_menu_trade_cancel=0x7f0a0090;
public static final int board_menu_trade_commit=0x7f0a0091;
public static final int board_menu_tray=0x7f0a0093;
public static final int board_menu_undo_current=0x7f0a00a2;
public static final int board_menu_undo_last=0x7f0a0092;
public static final int board_menu_zoom=0x7f0a00a6;
public static final int board_root=0x7f0a0002;
public static final int board_view=0x7f0a0003;
public static final int boardsize_spinner=0x7f0a0045;
public static final int bt_disabled=0x7f0a0070;
public static final int bt_separator=0x7f0a006f;
public static final int bt_stuff=0x7f0a0072;
public static final int button_add=0x7f0a0085;
public static final int bt_disabled=0x7f0a0071;
public static final int bt_separator=0x7f0a0070;
public static final int bt_stuff=0x7f0a0073;
public static final int button_add=0x7f0a0086;
public static final int button_clear=0x7f0a0013;
public static final int button_done=0x7f0a0063;
public static final int button_done=0x7f0a0064;
public static final int button_invite=0x7f0a0014;
public static final int button_rescan=0x7f0a0012;
public static final int button_study=0x7f0a0062;
public static final int button_study=0x7f0a0063;
public static final int chat_button_horizontal=0x7f0a000d;
public static final int chat_edit=0x7f0a0016;
public static final int chat_history=0x7f0a0015;
public static final int chat_menu_clear=0x7f0a00a8;
public static final int chat_menu_clear=0x7f0a00a9;
public static final int checkbox=0x7f0a0053;
public static final int color_display_sample=0x7f0a0018;
public static final int color_edit_sample=0x7f0a0019;
public static final int config_button=0x7f0a0083;
public static final int config_button=0x7f0a0084;
public static final int confirm_sms_reasons=0x7f0a0020;
public static final int connect_set_relay=0x7f0a0034;
public static final int connect_set_sms=0x7f0a003c;
public static final int del=0x7f0a0056;
public static final int desc=0x7f0a0023;
public static final int dict_label=0x7f0a0079;
public static final int dict_label=0x7f0a007a;
public static final int dict_spinner=0x7f0a002f;
public static final int dictlist_button_horizontal=0x7f0a000c;
public static final int dicts_delete=0x7f0a00aa;
public static final int dicts_download=0x7f0a00a9;
public static final int dicts_move=0x7f0a00ab;
public static final int dicts_select=0x7f0a00ac;
public static final int dicts_delete=0x7f0a00ab;
public static final int dicts_download=0x7f0a00aa;
public static final int dicts_move=0x7f0a00ac;
public static final int dicts_select=0x7f0a00ad;
public static final int divider=0x7f0a0028;
public static final int download=0x7f0a0022;
public static final int dwnld_message=0x7f0a0050;
public static final int edit=0x7f0a0075;
public static final int edit=0x7f0a0076;
public static final int edit_blue=0x7f0a001f;
public static final int edit_green=0x7f0a001d;
public static final int edit_red=0x7f0a001b;
@ -150,45 +150,45 @@ public final class R {
public static final int exchange_cancel=0x7f0a0006;
public static final int exchange_commit=0x7f0a0005;
public static final int expander=0x7f0a0047;
public static final int explain=0x7f0a0081;
public static final int explain=0x7f0a0082;
public static final int filters=0x7f0a005e;
public static final int flip_button_horizontal=0x7f0a000f;
public static final int game_locked_check=0x7f0a002a;
public static final int game_name=0x7f0a0046;
public static final int gamel_menu_checkmoves=0x7f0a0099;
public static final int games_game_config=0x7f0a00b7;
public static final int games_game_copy=0x7f0a00bc;
public static final int games_game_delete=0x7f0a00b6;
public static final int games_game_move=0x7f0a00b8;
public static final int games_game_new_from=0x7f0a00ba;
public static final int games_game_rename=0x7f0a00bb;
public static final int games_game_reset=0x7f0a00b9;
public static final int games_group_default=0x7f0a00c0;
public static final int games_group_delete=0x7f0a00bf;
public static final int games_group_movedown=0x7f0a00be;
public static final int games_group_moveup=0x7f0a00bd;
public static final int games_group_rename=0x7f0a00c1;
public static final int games_menu_about=0x7f0a00b3;
public static final int games_menu_checkmoves=0x7f0a00b5;
public static final int games_menu_checkupdates=0x7f0a00c2;
public static final int games_menu_dicts=0x7f0a00b1;
public static final int games_menu_email=0x7f0a00b2;
public static final int games_menu_loaddb=0x7f0a00c4;
public static final int games_menu_newgame=0x7f0a00ad;
public static final int games_menu_newgroup=0x7f0a00ae;
public static final int games_menu_prefs=0x7f0a00af;
public static final int games_menu_rateme=0x7f0a00b0;
public static final int games_menu_resend=0x7f0a00b4;
public static final int games_menu_storedb=0x7f0a00c3;
public static final int games_menu_study=0x7f0a0098;
public static final int group_done=0x7f0a008b;
public static final int group_exchange=0x7f0a009d;
public static final int group_hint=0x7f0a009e;
public static final int gamel_menu_checkmoves=0x7f0a009a;
public static final int games_game_config=0x7f0a00b8;
public static final int games_game_copy=0x7f0a00bd;
public static final int games_game_delete=0x7f0a00b7;
public static final int games_game_move=0x7f0a00b9;
public static final int games_game_new_from=0x7f0a00bb;
public static final int games_game_rename=0x7f0a00bc;
public static final int games_game_reset=0x7f0a00ba;
public static final int games_group_default=0x7f0a00c1;
public static final int games_group_delete=0x7f0a00c0;
public static final int games_group_movedown=0x7f0a00bf;
public static final int games_group_moveup=0x7f0a00be;
public static final int games_group_rename=0x7f0a00c2;
public static final int games_menu_about=0x7f0a00b4;
public static final int games_menu_checkmoves=0x7f0a00b6;
public static final int games_menu_checkupdates=0x7f0a00c3;
public static final int games_menu_dicts=0x7f0a00b2;
public static final int games_menu_email=0x7f0a00b3;
public static final int games_menu_loaddb=0x7f0a00c5;
public static final int games_menu_newgame=0x7f0a00ae;
public static final int games_menu_newgroup=0x7f0a00af;
public static final int games_menu_prefs=0x7f0a00b0;
public static final int games_menu_rateme=0x7f0a00b1;
public static final int games_menu_resend=0x7f0a00b5;
public static final int games_menu_storedb=0x7f0a00c4;
public static final int games_menu_study=0x7f0a0099;
public static final int group_done=0x7f0a008c;
public static final int group_exchange=0x7f0a009e;
public static final int group_hint=0x7f0a009f;
public static final int hideable=0x7f0a004c;
public static final int hints_allowed=0x7f0a003e;
public static final int invite_desc=0x7f0a0011;
public static final int item_name=0x7f0a007d;
public static final int item_score=0x7f0a007e;
public static final int item_name=0x7f0a007e;
public static final int item_score=0x7f0a007f;
public static final int join_public_room_check=0x7f0a0035;
public static final int juggle_players=0x7f0a0033;
public static final int lang_separator=0x7f0a002d;
@ -196,36 +196,37 @@ public final class R {
public static final int loc_search_button=0x7f0a0060;
public static final int loc_search_field=0x7f0a005f;
public static final int local_label=0x7f0a005b;
public static final int local_name_edit=0x7f0a0082;
public static final int local_player_set=0x7f0a0077;
public static final int manual_add_button=0x7f0a0086;
public static final int local_name_edit=0x7f0a0083;
public static final int local_player_set=0x7f0a0078;
public static final int manual_add_button=0x7f0a0087;
public static final int modtime=0x7f0a004d;
public static final int msg_marker=0x7f0a004a;
public static final int name=0x7f0a0087;
public static final int name=0x7f0a0088;
public static final int name_edit=0x7f0a0021;
public static final int name_label=0x7f0a0084;
public static final int newgame_bt_config=0x7f0a0074;
public static final int newgame_enable_bt=0x7f0a0071;
public static final int newgame_enable_sms=0x7f0a006b;
public static final int newgame_invite_bt=0x7f0a0073;
public static final int newgame_invite_net=0x7f0a0067;
public static final int newgame_invite_sms=0x7f0a006d;
public static final int newgame_local=0x7f0a0065;
public static final int newgame_local_config=0x7f0a0066;
public static final int newgame_local_desc=0x7f0a0064;
public static final int newgame_net_config=0x7f0a0068;
public static final int newgame_sms_config=0x7f0a006e;
public static final int name_label=0x7f0a0085;
public static final int newgame_bt_config=0x7f0a0075;
public static final int newgame_enable_bt=0x7f0a0072;
public static final int newgame_enable_sms=0x7f0a006c;
public static final int newgame_invite_bt=0x7f0a0074;
public static final int newgame_invite_net=0x7f0a0068;
public static final int newgame_invite_sms=0x7f0a006e;
public static final int newgame_local=0x7f0a0066;
public static final int newgame_local_config=0x7f0a0067;
public static final int newgame_local_desc=0x7f0a0065;
public static final int newgame_net_config=0x7f0a0069;
public static final int newgame_sms_config=0x7f0a006f;
public static final int nexthint_button_horizontal=0x7f0a0009;
public static final int number=0x7f0a0088;
public static final int password_edit=0x7f0a007c;
public static final int password_set=0x7f0a007b;
public static final int number=0x7f0a0089;
public static final int other_lang=0x7f0a0061;
public static final int password_edit=0x7f0a007d;
public static final int password_set=0x7f0a007c;
public static final int phonies_spinner=0x7f0a0043;
public static final int pick_faceup=0x7f0a0044;
public static final int pick_lang=0x7f0a0089;
public static final int pick_lang_spinner=0x7f0a008a;
public static final int pick_lang=0x7f0a008a;
public static final int pick_lang_spinner=0x7f0a008b;
public static final int play_button=0x7f0a002b;
public static final int player_list=0x7f0a0031;
public static final int player_name_edit=0x7f0a0078;
public static final int player_name_edit=0x7f0a0079;
public static final int player_view=0x7f0a0052;
public static final int players=0x7f0a0029;
public static final int players_label=0x7f0a0030;
@ -234,10 +235,10 @@ public final class R {
public static final int progress_bar=0x7f0a0051;
public static final int public_rooms_set=0x7f0a0039;
public static final int refresh_button=0x7f0a003b;
public static final int remote_check=0x7f0a0076;
public static final int revert_all=0x7f0a0080;
public static final int revert_colors=0x7f0a007f;
public static final int robot_check=0x7f0a007a;
public static final int remote_check=0x7f0a0077;
public static final int revert_all=0x7f0a0081;
public static final int revert_colors=0x7f0a0080;
public static final int robot_check=0x7f0a007b;
public static final int role=0x7f0a004f;
public static final int room_edit=0x7f0a0037;
public static final int room_spinner=0x7f0a003a;
@ -248,18 +249,18 @@ public final class R {
public static final int seek_red=0x7f0a001a;
public static final int send_button=0x7f0a0017;
public static final int shuffle_button_horizontal=0x7f0a000a;
public static final int slmenu_clear_sel=0x7f0a00c9;
public static final int slmenu_copy_sel=0x7f0a00c8;
public static final int slmenu_deselect_all=0x7f0a00c7;
public static final int slmenu_lookup_sel=0x7f0a00c5;
public static final int slmenu_select_all=0x7f0a00c6;
public static final int slmenu_clear_sel=0x7f0a00ca;
public static final int slmenu_copy_sel=0x7f0a00c9;
public static final int slmenu_deselect_all=0x7f0a00c8;
public static final int slmenu_lookup_sel=0x7f0a00c6;
public static final int slmenu_select_all=0x7f0a00c7;
public static final int smart_robot=0x7f0a0042;
public static final int sms_disabled=0x7f0a006a;
public static final int sms_disabled=0x7f0a006b;
public static final int sms_phones=0x7f0a003d;
public static final int sms_separator=0x7f0a0069;
public static final int sms_stuff=0x7f0a006c;
public static final int sms_separator=0x7f0a006a;
public static final int sms_stuff=0x7f0a006d;
public static final int state=0x7f0a004e;
public static final int summary=0x7f0a0061;
public static final int summary=0x7f0a0062;
public static final int text_item=0x7f0a0054;
public static final int text_item2=0x7f0a0055;
public static final int thumbnail=0x7f0a004b;
@ -873,7 +874,7 @@ public final class R {
/**
*/
public static final int cur_tiles_fmt=0x7f0601f6;
public static final int data_gsm_only=0x7f0602a7;
public static final int data_gsm_only=0x7f0602a8;
public static final int debug_features=0x7f06007b;
public static final int debug_features_summary=0x7f06007c;
/** dictionary used by default for human players when creating
@ -1454,18 +1455,19 @@ public final class R {
/**
*/
public static final int loc_external=0x7f0600bb;
public static final int loc_filters_all=0x7f0602aa;
public static final int loc_filters_menu=0x7f0602ac;
public static final int loc_filters_modified=0x7f0602ad;
public static final int loc_filters_prompt=0x7f0602a8;
public static final int loc_filters_screen=0x7f0602ab;
public static final int loc_filters_all=0x7f0602ab;
public static final int loc_filters_menu=0x7f0602ad;
public static final int loc_filters_modified=0x7f0602ae;
public static final int loc_filters_prompt=0x7f0602a9;
public static final int loc_filters_screen=0x7f0602ac;
/** see move_dictf above
*/
public static final int loc_internal=0x7f0600ba;
public static final int loc_main_english=0x7f0602ae;
public static final int loc_main_yourlang=0x7f0602a2;
public static final int loc_menu_xlate=0x7f0602a3;
public static final int loc_search_prompt=0x7f0602a9;
public static final int loc_lang_blessed=0x7f0602a3;
public static final int loc_lang_local=0x7f0602a4;
public static final int loc_main_english=0x7f0602af;
public static final int loc_menu_xlate=0x7f0602a2;
public static final int loc_search_prompt=0x7f0602aa;
/** This is the "hint" printed in light text in the empty player
name field
*/
@ -1631,7 +1633,7 @@ public final class R {
/**
*/
public static final int new_smsmove_title=0x7f060223;
public static final int new_xlations_fmt=0x7f0602a4;
public static final int new_xlations_fmt=0x7f0602a5;
/**
###########################################################
# :Dialogs:
@ -2572,8 +2574,8 @@ public final class R {
/**
*/
public static final int word_search_hint=0x7f0601f3;
public static final int xlations_enabled_summary=0x7f0602a6;
public static final int xlations_enabled_title=0x7f0602a5;
public static final int xlations_enabled_summary=0x7f0602a7;
public static final int xlations_enabled_title=0x7f0602a6;
public static final int xlations_locale=0x7f060088;
/** Empty in English, this should contain the name of the
translator/creator of the strings.xml file for this

View file

@ -61,8 +61,8 @@
android:gravity="center"
/>
<TextView style="@style/evenly_spaced_horizontal"
android:text="@string/loc_main_yourlang"
<TextView android:id="@+id/other_lang"
style="@style/evenly_spaced_horizontal"
android:gravity="center"
/>

View file

@ -2219,8 +2219,9 @@
<string name="slmenu_deselect_all">Unselect all</string>
<string name="sel_items_fmt">Selected: %1$d</string>
<string name="loc_main_yourlang">Your language</string>
<string name="loc_menu_xlate">Translate</string>
<string name="loc_lang_blessed">%1$s (official)</string>
<string name="loc_lang_local">%1$s (yours)</string>
<string name="new_xlations_fmt">Installed %1$d new translations</string>

View file

@ -1903,8 +1903,9 @@
<string name="slmenu_select_all">Tceles lla</string>
<string name="slmenu_deselect_all">Tcelesnu lla</string>
<string name="sel_items_fmt">Detceles: %1$d</string>
<string name="loc_main_yourlang">Ruoy egaugnal</string>
<string name="loc_menu_xlate">Etalsnart</string>
<string name="loc_lang_blessed">%1$s )laiciffo(</string>
<string name="loc_lang_local">%1$s )sruoy(</string>
<string name="new_xlations_fmt">Dellatsni %1$d wen snoitalsnart</string>
<string name="xlations_enabled_title">Elbane lacol gnitalsnart</string>
<string name="xlations_enabled_summary">Dda noitpo ot yreve neercs unem</string>

View file

@ -1903,8 +1903,9 @@
<string name="slmenu_select_all">SELECT ALL</string>
<string name="slmenu_deselect_all">UNSELECT ALL</string>
<string name="sel_items_fmt">SELECTED: %1$d</string>
<string name="loc_main_yourlang">YOUR LANGUAGE</string>
<string name="loc_menu_xlate">TRANSLATE</string>
<string name="loc_lang_blessed">%1$s (OFFICIAL)</string>
<string name="loc_lang_local">%1$s (YOURS)</string>
<string name="new_xlations_fmt">INSTALLED %1$d NEW TRANSLATIONS</string>
<string name="xlations_enabled_title">ENABLE LOCAL TRANSLATING</string>
<string name="xlations_enabled_summary">ADD OPTION TO EVERY SCREEN MENU</string>

View file

@ -29,6 +29,7 @@ import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.TextView;
import org.eehouse.android.xw4.DbgUtils;
import org.eehouse.android.xw4.ListDelegateBase;
@ -104,6 +105,9 @@ public class LocDelegate extends ListDelegateBase
m_filterBy = (Spinner)findViewById( R.id.filters );
m_filterBy.setOnItemSelectedListener( this );
TextView view = (TextView)findViewById( R.id.other_lang );
view.setText( LocUtils.getCurLocaleName( m_activity ) );
LocSearcher.Pair[] pairs = LocUtils.makePairs( m_activity );
String contextName = getIntent().getStringExtra( LocUtils.CONTEXT_NAME );
m_searcher = new LocSearcher( m_activity, pairs, contextName );

View file

@ -56,9 +56,16 @@ public class LocItemEditDelegate extends DelegateBase {
m_edit = (EditText)findViewById( R.id.xlated_view_local );
m_edit.setText( LocUtils.getLocalXlation( m_activity, key, true ) );
setLabel( R.id.english_label, R.string.loc_main_english );
setLabel( R.id.blessed_label, R.string.loc_main_yourlang );
setLabel( R.id.local_label, R.string.loc_main_yourlang );
view = (TextView)findViewById( R.id.english_label );
view.setText( LocUtils.getString( m_activity, R.string.loc_main_english ) );
String langName = LocUtils.getCurLocaleName( m_activity );
view = (TextView)findViewById( R.id.blessed_label );
view.setText( LocUtils.getString( m_activity, R.string.loc_lang_blessed,
langName ) );
view = (TextView)findViewById( R.id.local_label );
view.setText( LocUtils.getString( m_activity, R.string.loc_lang_local,
langName ) );
}
@Override
@ -73,12 +80,6 @@ public class LocItemEditDelegate extends DelegateBase {
super.onPause();
}
private void setLabel( int viewID, int strID )
{
TextView view = (TextView)findViewById( viewID );
view.setText( LocUtils.getString( m_activity, strID ) );
}
protected static void launch( Context context, LocSearcher.Pair pair )
{
Intent intent = new Intent( context, LocItemEditActivity.class );

View file

@ -431,7 +431,16 @@ public class LocUtils {
}
}
private static String getCurLocale( Context context )
protected static String getCurLocaleName( Context context )
{
String locale_code = getCurLocale( context );
Locale locale = new Locale( locale_code );
String name = locale.getDisplayLanguage( locale );
DbgUtils.logf( "getCurLocaleName(%s)=>%s", locale_code, name );
return name;
}
protected static String getCurLocale( Context context )
{
if ( null == s_curLocale ) {
String locale = XWPrefs.getFakeLocale( context );