Use plurals for first time as test case. More to follow, along with

accomodating fixes to the LocUtils system.
This commit is contained in:
Eric House 2015-03-17 07:20:56 -07:00
parent 80c8a7231d
commit caf4d73e46
11 changed files with 906 additions and 865 deletions

File diff suppressed because it is too large Load diff

View file

@ -65,7 +65,10 @@
<!-- Otherwise they're listed with this to give some indication of <!-- Otherwise they're listed with this to give some indication of
how far along they are. I may list "tiles left" someday how far along they are. I may list "tiles left" someday
instead... --> instead... -->
<string name="moves_fmt">%1$d coups joués</string> <plurals name="moves_fmt">
<item quantity="one">%1$d coup joué</item>
<item quantity="other">%1$d coups joués</item>
</plurals>
<!-- When you select the gamel_menu_delete_all menuitem or <!-- When you select the gamel_menu_delete_all menuitem or
list_item_delete contextual menu, you are asked to confirm. list_item_delete contextual menu, you are asked to confirm.
@ -3207,4 +3210,12 @@ numéros de téléphones sont les mêmes</string>
<!--XLATE-ME--> <!--XLATE-ME-->
<!--<string name="nfc_to_self">Send via NFC to self?</string>--> <!--<string name="nfc_to_self">Send via NFC to self?</string>-->
<string name="nfc_to_self">Envoyer par NFC à soi-même ?</string> <string name="nfc_to_self">Envoyer par NFC à soi-même ?</string>
<!--XLATE-ME-->
<string name="game_summary_field_rowid">rowid</string>
<!--XLATE-ME-->
<string name="game_summary_field_gameid">gameid</string>
<!--XLATE-ME-->
<string name="game_summary_field_npackets">Pending packet count</string>
<!--XLATE-ME-->
<string name="expl_update_url">Update checks URL</string>
</resources> </resources>

View file

@ -65,7 +65,10 @@
<!-- Otherwise they're listed with this to give some indication of <!-- Otherwise they're listed with this to give some indication of
how far along they are. I may list "tiles left" someday how far along they are. I may list "tiles left" someday
instead... --> instead... -->
<string name="moves_fmt">%1$d moves played</string> <plurals name="moves_fmt">
<item quantity="one">%1$d move played</item>
<item quantity="other">%1$d moves played</item>
</plurals>
<!-- When you select the gamel_menu_delete_all menuitem or <!-- When you select the gamel_menu_delete_all menuitem or
list_item_delete contextual menu, you are asked to confirm. list_item_delete contextual menu, you are asked to confirm.

View file

@ -57,7 +57,10 @@
<!-- Otherwise they're listed with this to give some indication of <!-- Otherwise they're listed with this to give some indication of
how far along they are. I may list "tiles left" someday how far along they are. I may list "tiles left" someday
instead... --> instead... -->
<string name="moves_fmt">%1$d sevom deyalp</string> <plurals name="moves_fmt">
<item quantity="one">%1$d move played</item>
<item quantity="other">%1$d moves played</item>
</plurals>
<!-- When you select the gamel_menu_delete_all menuitem or <!-- When you select the gamel_menu_delete_all menuitem or
list_item_delete contextual menu, you are asked to confirm. list_item_delete contextual menu, you are asked to confirm.
This is the text of the first button ("Cancel" is the This is the text of the first button ("Cancel" is the

View file

@ -160,7 +160,7 @@
<string name="force_title">Jugador/s remot/s</string> <string name="force_title">Jugador/s remot/s</string>
<string name="force_expl">Un amfitrió ha de tenir com a mínim un jugador remot.</string> <string name="force_expl">Un amfitrió ha de tenir com a mínim un jugador remot.</string>
<string name="gameOver">Final de partida</string> <string name="gameOver">Final de partida</string>
<string name="moves_fmt">%1$d torns jugats</string> <!-- <string name="moves_fmt">%1$d torns jugats</string> -->
<!-- about dialog stuff --> <!-- about dialog stuff -->
<string name="about_copyright">Copyright (C) 1998-2012 d\'Eric <string name="about_copyright">Copyright (C) 1998-2012 d\'Eric
House. Aquest programari es troba sota la Llicència Pública General GNU.</string> House. Aquest programari es troba sota la Llicència Pública General GNU.</string>

View file

@ -57,7 +57,10 @@
<!-- Otherwise they're listed with this to give some indication of <!-- Otherwise they're listed with this to give some indication of
how far along they are. I may list "tiles left" someday how far along they are. I may list "tiles left" someday
instead... --> instead... -->
<string name="moves_fmt">%1$d MOVES PLAYED</string> <plurals name="moves_fmt">
<item quantity="one">%1$d move played</item>
<item quantity="other">%1$d moves played</item>
</plurals>
<!-- When you select the gamel_menu_delete_all menuitem or <!-- When you select the gamel_menu_delete_all menuitem or
list_item_delete contextual menu, you are asked to confirm. list_item_delete contextual menu, you are asked to confirm.
This is the text of the first button ("Cancel" is the This is the text of the first button ("Cancel" is the

View file

@ -147,7 +147,7 @@
<string name="force_expl">Jako Server vyberte jedoho nebo více hráčů kteří se budou moct <string name="force_expl">Jako Server vyberte jedoho nebo více hráčů kteří se budou moct
připojit jako Klient.</string> připojit jako Klient.</string>
<string name="gameOver">Hra skončena</string> <string name="gameOver">Hra skončena</string>
<string name="moves_fmt">Bylo zahráno %1$d tahů</string> <!-- <string name="moves_fmt">Bylo zahráno %1$d tahů</string> -->
<!-- about dialog stuff --> <!-- about dialog stuff -->
<string name="about_vers_fmt">Crosswords pro Android, Verze %1$s, <string name="about_vers_fmt">Crosswords pro Android, Verze %1$s,
revize %2$s.</string> revize %2$s.</string>

View file

@ -54,7 +54,7 @@
<!-- Otherwise they're listed with this to give some indication of <!-- Otherwise they're listed with this to give some indication of
how far along they are. I may list "tiles left" someday how far along they are. I may list "tiles left" someday
instead... --> instead... -->
<string name="moves_fmt">%1$d turnos jogados</string> <!-- <string name="moves_fmt">%1$d turnos jogados</string> -->
<!-- When you select the gamel_menu_delete_all menuitem or <!-- When you select the gamel_menu_delete_all menuitem or
list_item_delete contextual menu, you are asked to confirm. list_item_delete contextual menu, you are asked to confirm.
This is the text of the first button ("Cancel" is the This is the text of the first button ("Cancel" is the

View file

@ -1012,7 +1012,7 @@
always pick the first. --> always pick the first. -->
<string name="forced_consistent">XLATE ME: Modified first player.</string> <string name="forced_consistent">XLATE ME: Modified first player.</string>
<string name="gameOver">Hra skončená</string> <string name="gameOver">Hra skončená</string>
<string name="moves_fmt">Bolo zahraných %1$d ťahov</string> <!-- <string name="moves_fmt">Bolo zahraných %1$d ťahov</string> -->
<!-- When you select the list_item_reset contextual menu, you are <!-- When you select the list_item_reset contextual menu, you are
asked to confirm. This is the text of the first button asked to confirm. This is the text of the first button
("Cancel" is the second). --> ("Cancel" is the second). -->

View file

@ -183,7 +183,8 @@ public class GameSummary {
if ( gameOver ) { if ( gameOver ) {
result = LocUtils.getString( m_context, R.string.gameOver ); result = LocUtils.getString( m_context, R.string.gameOver );
} else { } else {
result = LocUtils.getString( m_context, R.string.moves_fmt, nMoves ); result = LocUtils.getQuantityString( m_context, R.plurals.moves_fmt,
nMoves, nMoves );
} }
return result; return result;
} }

View file

@ -191,7 +191,7 @@ public class LocUtils {
public static String getString( Context context, int id ) public static String getString( Context context, int id )
{ {
return getString( context, true, id ); return getString( context, true, id );
} }
public static String getString( Context context, boolean canUseDB, int id ) public static String getString( Context context, boolean canUseDB, int id )
@ -225,6 +225,16 @@ public class LocUtils {
return result; return result;
} }
public static String getQuantityString( Context context, int id,
int quantity, Object... params )
{
DbgUtils.logf( "getQuantityString(%d): punting on locutils stuff for"
+ " now. FIXME", quantity );
String result = context.getResources()
.getQuantityString( id, quantity, params );
return result;
}
public static void setXlation( Context context, String key, CharSequence txt ) public static void setXlation( Context context, String key, CharSequence txt )
{ {
loadXlations( context ); loadXlations( context );