localize strings

This commit is contained in:
Chris Danford
2005-12-27 17:08:23 +00:00
parent 2301565b2a
commit e30f456383
+17 -11
View File
@@ -7,6 +7,7 @@
#include "ScreenDimensions.h"
#include "InputEventPlus.h"
#include "RageUtil.h"
#include "LocalizedString.h"
REGISTER_SCREEN_CLASS( ScreenBookkeeping );
@@ -103,6 +104,11 @@ void ScreenBookkeeping::MenuCoin( PlayerNumber pn )
Screen::MenuCoin( pn );
}
static LocalizedString ALL_TIME ( "ScreenBookkeeping", "All-time Total:" );
static LocalizedString LAST_DAYS ( "ScreenBookkeeping", "Coin Data of Last %d Days" );
static LocalizedString LAST_WEEKS ( "ScreenBookkeeping", "Coin Data of Last %d Weeks" );
static LocalizedString DAY_OF_WEEK ( "ScreenBookkeeping", "Coin Data by Day of Week, All-Time" );
static LocalizedString HOUR_OF_DAY ( "ScreenBookkeeping", "Coin Data by Hour of Day, All-Time" );
void ScreenBookkeeping::ChangeView( View newView )
{
m_View = newView;
@@ -110,8 +116,8 @@ void ScreenBookkeeping::ChangeView( View newView )
{
CString s;
s += "All-time Total: ";
s += ssprintf( "%i\n", BOOKKEEPER->GetCoinsTotal() );
s += ALL_TIME.GetValue();
s += ssprintf( " %i\n", BOOKKEEPER->GetCoinsTotal() );
m_textAllTime.SetText( s );
}
@@ -119,7 +125,7 @@ void ScreenBookkeeping::ChangeView( View newView )
{
case VIEW_LAST_DAYS:
{
m_textTitle.SetText( ssprintf("Coin Data of Last %d Days", NUM_LAST_DAYS) );
m_textTitle.SetText( ssprintf(LAST_DAYS.GetValue(), NUM_LAST_DAYS) );
int coins[NUM_LAST_DAYS];
BOOKKEEPER->GetCoinsLastDays( coins );
@@ -128,12 +134,12 @@ void ScreenBookkeeping::ChangeView( View newView )
CString sTitle, sData;
for( int i=0; i<NUM_LAST_DAYS; i++ )
{
sTitle += LastDayToDisplayString(i) + "\n";
sTitle += LastDayToThemedString(i) + "\n";
sData += ssprintf("%d",coins[i]) + "\n";
iTotalLast += coins[i];
}
sTitle += "Total\n";
sTitle += ALL_TIME.GetString()+"\n";
sData += ssprintf("%i\n", iTotalLast);
m_textData[0].SetText( "" );
@@ -146,7 +152,7 @@ void ScreenBookkeeping::ChangeView( View newView )
break;
case VIEW_LAST_WEEKS:
{
m_textTitle.SetText( ssprintf("Coin Data of Last %d Weeks", NUM_LAST_WEEKS) );
m_textTitle.SetText( ssprintf(LAST_WEEKS, NUM_LAST_WEEKS) );
int coins[NUM_LAST_WEEKS];
BOOKKEEPER->GetCoinsLastWeeks( coins );
@@ -158,7 +164,7 @@ void ScreenBookkeeping::ChangeView( View newView )
for( int row=0; row<52/4; row++ )
{
int week = row*4+col;
sTemp += LastWeekToDisplayString(week) + ssprintf(": %d",coins[week]) + "\n";
sTemp += LastWeekToThemedString(week) + ssprintf(": %d",coins[week]) + "\n";
}
m_textData[col].SetHorizAlign( Actor::align_left );
@@ -168,7 +174,7 @@ void ScreenBookkeeping::ChangeView( View newView )
break;
case VIEW_DAY_OF_WEEK:
{
m_textTitle.SetText( "Coin Data by Day of Week, All-Time" );
m_textTitle.SetText( DAY_OF_WEEK );
int coins[DAYS_IN_WEEK];
BOOKKEEPER->GetCoinsByDayOfWeek( coins );
@@ -190,7 +196,7 @@ void ScreenBookkeeping::ChangeView( View newView )
break;
case VIEW_HOUR_OF_DAY:
{
m_textTitle.SetText( "Coin Data by Hour of Day, All-Time" );
m_textTitle.SetText( HOUR_OF_DAY );
int coins[HOURS_IN_DAY];
BOOKKEEPER->GetCoinsByHour( coins );
@@ -198,14 +204,14 @@ void ScreenBookkeeping::ChangeView( View newView )
CString sTitle1, sData1;
for( int i=0; i<HOURS_IN_DAY/2; i++ )
{
sTitle1 += HourInDayToDisplayString(i) + "\n";
sTitle1 += HourInDayToThemedString(i) + "\n";
sData1 += ssprintf("%d",coins[i]) + "\n";
}
CString sTitle2, sData2;
for( int i=(HOURS_IN_DAY/2); i<HOURS_IN_DAY; i++ )
{
sTitle2 += HourInDayToDisplayString(i) + "\n";
sTitle2 += HourInDayToThemedString(i) + "\n";
sData2 += ssprintf("%d",coins[i]) + "\n";
}