update MsgDialog, OskDialog, SaveDialog translatable

Make a new section "Dialog" into language ini files.
This commit is contained in:
Mgaver 2013-04-21 04:36:50 +09:00
parent 63d8267bd4
commit d09a69906d
3 changed files with 38 additions and 26 deletions

13
Core/Dialog/PSPMsgDialog.cpp Normal file → Executable file
View File

@ -21,6 +21,7 @@
#include "../Core/MemMap.h"
#include "Core/Reporting.h"
#include "ChunkFile.h"
#include "i18n/i18n.h"
PSPMsgDialog::PSPMsgDialog()
: PSPDialog()
@ -129,15 +130,16 @@ int PSPMsgDialog::Init(unsigned int paramAddr)
void PSPMsgDialog::DisplayBack()
{
I18NCategory *m = GetI18NCategory("Dialog");
PPGeDrawImage(cancelButtonImg, 290, 220, 20, 20, 0, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText("Back", 320, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText(m->T("Back"), 320, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
}
void PSPMsgDialog::DisplayYesNo()
{
PPGeDrawText("Yes", 200, 150, PPGE_ALIGN_LEFT, 0.55f, CalcFadedColor(yesnoChoice == 1?0xFF0000FF:0xFFFFFFFF));
PPGeDrawText("No", 320, 150, PPGE_ALIGN_LEFT, 0.55f, CalcFadedColor(yesnoChoice == 0?0xFF0000FF:0xFFFFFFFF));
I18NCategory *m = GetI18NCategory("Dialog");
PPGeDrawText(m->T("Yes"), 200, 150, PPGE_ALIGN_LEFT, 0.55f, CalcFadedColor(yesnoChoice == 1?0xFF0000FF:0xFFFFFFFF));
PPGeDrawText(m->T("No"), 320, 150, PPGE_ALIGN_LEFT, 0.55f, CalcFadedColor(yesnoChoice == 0?0xFF0000FF:0xFFFFFFFF));
if (IsButtonPressed(CTRL_LEFT) && yesnoChoice == 0)
{
@ -151,8 +153,9 @@ void PSPMsgDialog::DisplayYesNo()
void PSPMsgDialog::DisplayOk()
{
I18NCategory *m = GetI18NCategory("Dialog");
PPGeDrawImage(okButtonImg, 200, 220, 20, 20, 0, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText("Enter", 230, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText(m->T("Enter"), 230, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
}
int PSPMsgDialog::Update()

14
Core/Dialog/PSPOskDialog.cpp Normal file → Executable file
View File

@ -19,6 +19,7 @@
#include "../Util/PPGeDraw.h"
#include "../HLE/sceCtrl.h"
#include "ChunkFile.h"
#include "i18n/i18n.h"
#ifndef _WIN32
#include <ctype.h>
@ -187,12 +188,13 @@ int PSPOskDialog::Update()
//PPGeDrawImage(I_BUTTON, 230, 220, 50, 20, 0, CalcFadedColor(0xFFFFFFFF));
//PPGeDrawImage(I_BUTTON, 350, 220, 55, 20, 0, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText("Select", 60, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText("Delete", 160, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText("Start", 245, 220, PPGE_ALIGN_LEFT, 0.6f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText("Finish", 290, 222, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText("Select", 365, 220, PPGE_ALIGN_LEFT, 0.6f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText("Caps", 415, 222, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
I18NCategory *m = GetI18NCategory("Dialog");
PPGeDrawText(m->T("Select"), 60, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText(m->T("Delete"), 160, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText(m->T("Start"), 245, 220, PPGE_ALIGN_LEFT, 0.6f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText(m->T("Finish"), 290, 222, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText(m->T("Select"), 365, 220, PPGE_ALIGN_LEFT, 0.6f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText(m->T("Caps"), 415, 222, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
if (IsButtonPressed(CTRL_UP))
{

37
Core/Dialog/PSPSaveDialog.cpp Normal file → Executable file
View File

@ -22,6 +22,7 @@
#include "../Config.h"
#include "Core/Reporting.h"
#include "Core/HW/MemoryStick.h"
#include "i18n/i18n.h"
PSPSaveDialog::PSPSaveDialog()
: PSPDialog()
@ -250,7 +251,8 @@ void PSPSaveDialog::DisplaySaveDataInfo1()
{
if(param.GetFileInfo(currentSelectedSave).size == 0)
{
PPGeDrawText("New Save", 180, 100, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
I18NCategory *m = GetI18NCategory("Dialog");
PPGeDrawText(m->T("New Save"), 180, 100, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
}
else
{
@ -333,11 +335,12 @@ void PSPSaveDialog::DisplaySaveDataInfo2()
void PSPSaveDialog::DisplayConfirmationYesNo(std::string text)
{
I18NCategory *m = GetI18NCategory("Dialog");
PPGeDrawRect(180, 105, 460, 106, CalcFadedColor(0xFFFFFFFF));
PPGeDrawRect(180, 160, 460, 161, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText(text.c_str(), 220, 110, PPGE_ALIGN_LEFT, 0.45f, 0xFFFFFFFF);
PPGeDrawText("Yes", 250, 140, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(yesnoChoice == 1?0xFF0000FF:0xFFFFFFFF));
PPGeDrawText("No", 350, 140, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(yesnoChoice == 0?0xFF0000FF:0xFFFFFFFF));
PPGeDrawText(m->T("Yes"), 250, 140, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(yesnoChoice == 1?0xFF0000FF:0xFFFFFFFF));
PPGeDrawText(m->T("No"), 350, 140, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(yesnoChoice == 0?0xFF0000FF:0xFFFFFFFF));
if (IsButtonPressed(CTRL_LEFT) && yesnoChoice == 0)
{
yesnoChoice = 1;
@ -360,13 +363,15 @@ void PSPSaveDialog::DisplayTitle(std::string name)
}
void PSPSaveDialog::DisplayEnterBack()
{
I18NCategory *m = GetI18NCategory("Dialog");
PPGeDrawImage(okButtonImg, 180, 257, 11, 11, 0, CalcFadedColor(0xFFFFFFFF));
PPGeDrawImage(cancelButtonImg, 270, 257, 11, 11, 0, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText("Enter", 195, 255, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText("Back", 285, 255, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText(m->T("Enter"), 195, 255, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText(m->T("Back"), 285, 255, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(0xFFFFFFFF));
}
void PSPSaveDialog::DisplayBack()
{
I18NCategory *m = GetI18NCategory("Dialog");
PPGeDrawImage(cancelButtonImg, 180, 257, 11, 11, 0, CalcFadedColor(0xFFFFFFFF));
PPGeDrawText("Back", 195, 255, PPGE_ALIGN_LEFT, 0.45f, CalcFadedColor(0xFFFFFFFF));
}
@ -406,6 +411,8 @@ int PSPSaveDialog::Update()
cancelButtonFlag = CTRL_CIRCLE;
}
I18NCategory *m = GetI18NCategory("Dialog");
switch(display)
{
case DS_SAVE_LIST_CHOICE:
@ -452,7 +459,7 @@ int PSPSaveDialog::Update()
DisplaySaveIcon();
DisplaySaveDataInfo2();
DisplayConfirmationYesNo("Do you want to overwrite the data ?");
DisplayConfirmationYesNo(m->T("Do you want to overwrite the data?"));
DisplayEnterBack();
if (IsButtonPressed(cancelButtonFlag))
@ -489,7 +496,7 @@ int PSPSaveDialog::Update()
DisplaySaveIcon();
DisplaySaveDataInfo2();
DisplayInfo("Saving\nPlease Wait...");
DisplayInfo(m->T("Saving\nPlease Wait..."));
EndDraw();
break;
@ -501,7 +508,7 @@ int PSPSaveDialog::Update()
DisplaySaveDataInfo2();
DisplayBack();
DisplayInfo("Save completed");
DisplayInfo(m->T("Save completed"));
if (IsButtonPressed(cancelButtonFlag))
{
@ -544,7 +551,7 @@ int PSPSaveDialog::Update()
DisplaySaveIcon();
DisplaySaveDataInfo2();
DisplayInfo("Loading\nPlease Wait...");
DisplayInfo(m->T("Loading\nPlease Wait..."));
EndDraw();
break;
@ -556,7 +563,7 @@ int PSPSaveDialog::Update()
DisplaySaveDataInfo2();
DisplayBack();
DisplayInfo("Load completed");
DisplayInfo(m->T("Load completed"));
if (IsButtonPressed(cancelButtonFlag))
{
@ -574,7 +581,7 @@ int PSPSaveDialog::Update()
DisplayBack();
DisplayInfo("There is no data");
DisplayInfo(m->T("There is no data"));
if (IsButtonPressed(cancelButtonFlag))
{
@ -612,7 +619,7 @@ int PSPSaveDialog::Update()
DisplaySaveIcon();
DisplaySaveDataInfo2();
DisplayConfirmationYesNo(" This save data will be deleted.\nAre you sure you want to continue?");
DisplayConfirmationYesNo(m->T("This save data will be deleted.\nAre you sure you want to continue?"));
DisplayEnterBack();
@ -647,7 +654,7 @@ int PSPSaveDialog::Update()
StartDraw();
DisplayInfo("Deleting\nPlease Wait...");
DisplayInfo(m->T("Deleting\nPlease Wait..."));
EndDraw();
break;
@ -657,7 +664,7 @@ int PSPSaveDialog::Update()
DisplayBack();
DisplayInfo("Delete completed");
DisplayInfo(m->T("Delete completed"));
if (IsButtonPressed(cancelButtonFlag))
{
@ -675,7 +682,7 @@ int PSPSaveDialog::Update()
DisplayBack();
DisplayInfo("There is no data");
DisplayInfo(m->T("There is no data"));
if (IsButtonPressed(cancelButtonFlag))
{