1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

save-overlays: add localization

This commit is contained in:
Megamouse 2021-04-24 16:00:24 +02:00
parent 5720a32bc5
commit 14b6d6291b
5 changed files with 22 additions and 15 deletions

View File

@ -1023,7 +1023,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
// UI returns -1 for new save games
if (selected == -1)
{
message = get_localized_string(localized_string_id::CELL_SAVEDATA_CREATE_CONFIRMATION);
message = get_localized_string(localized_string_id::CELL_SAVEDATA_SAVE_CONFIRMATION);
save_entry.dirName = listSet->newData->dirName.get_ptr();
save_entry.escaped = vfs::escape(save_entry.dirName);
}
@ -1155,7 +1155,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
if (selected == -1)
{
message = get_localized_string(localized_string_id::CELL_SAVEDATA_CREATE_CONFIRMATION);
message = get_localized_string(localized_string_id::CELL_SAVEDATA_SAVE_CONFIRMATION);
}
else
{

View File

@ -209,7 +209,7 @@ namespace rsx
if (listSet && listSet->newData)
{
const char* title = "Create New";
std::string title = get_localized_string(localized_string_id::CELL_SAVEDATA_NEW_SAVED_DATA_TITLE);
std::vector<u8> icon;
int id = resource_config::standard_image_resource::new_entry;
@ -232,7 +232,7 @@ namespace rsx
id = image_resource_id::raw_image;
}
std::unique_ptr<overlay_element> new_stub = std::make_unique<save_dialog_entry>(title, "Select to create a new entry", "", id, icon);
std::unique_ptr<overlay_element> new_stub = std::make_unique<save_dialog_entry>(title, get_localized_string(localized_string_id::CELL_SAVEDATA_NEW_SAVED_DATA_SUB_TITLE), "", id, icon);
m_list->add_entry(new_stub);
}
@ -247,7 +247,7 @@ namespace rsx
if (m_list->m_items.empty())
{
m_no_saves_text = std::make_unique<label>("There is no saved data.");
m_no_saves_text = std::make_unique<label>(get_localized_string(localized_string_id::CELL_SAVEDATA_NO_DATA));
m_no_saves_text->set_font("Arial", 20);
m_no_saves_text->align_text(overlay_element::text_align::center);
m_no_saves_text->set_pos(m_list->x, m_list->y + m_list->h / 2);

View File

@ -75,7 +75,7 @@ namespace rsx
m_description = std::make_unique<label>();
m_description->set_font("Arial", 20);
m_description->set_pos(20, 37);
m_description->set_text("Select user");
m_description->set_text("Select user"); // Fallback. I don't think this will ever be used, so I won't localize it.
m_description->auto_resize();
m_description->back_color.a = 0.f;

View File

@ -116,10 +116,14 @@ enum class localized_string_id
CELL_SAVEDATA_CB_FAILURE,
CELL_SAVEDATA_CB_NO_DATA,
CELL_SAVEDATA_CB_NO_SPACE,
CELL_SAVEDATA_CREATE_CONFIRMATION,
CELL_SAVEDATA_NO_DATA,
CELL_SAVEDATA_NEW_SAVED_DATA_TITLE,
CELL_SAVEDATA_NEW_SAVED_DATA_SUB_TITLE,
CELL_SAVEDATA_SAVE_CONFIRMATION,
CELL_SAVEDATA_DELETE_CONFIRMATION,
CELL_SAVEDATA_DELETE_SUCCESS,
CELL_SAVEDATA_DELETE,
CELL_SAVEDATA_SAVE,
CELL_SAVEDATA_LOAD,
CELL_SAVEDATA_OVERWRITE,
};

View File

@ -54,8 +54,8 @@ private:
case localized_string_id::RSX_OVERLAYS_OSK_DIALOG_SHIFT: return tr("Shift", "OSK Dialog");
case localized_string_id::RSX_OVERLAYS_OSK_DIALOG_ENTER_TEXT: return tr("[Enter Text]", "OSK Dialog");
case localized_string_id::RSX_OVERLAYS_OSK_DIALOG_ENTER_PASSWORD: return tr("[Enter Password]", "OSK Dialog");
case localized_string_id::RSX_OVERLAYS_LIST_SELECT: return tr("Select", "Save Dialog List");
case localized_string_id::RSX_OVERLAYS_LIST_CANCEL: return tr("Back", "Save Dialog List");
case localized_string_id::RSX_OVERLAYS_LIST_SELECT: return tr("Enter", "Enter Dialog List");
case localized_string_id::RSX_OVERLAYS_LIST_CANCEL: return tr("Back", "Cancel Dialog List");
case localized_string_id::CELL_GAME_ERROR_BROKEN_GAMEDATA: return tr("ERROR: Game data is corrupted. The application will continue.", "Game Error");
case localized_string_id::CELL_GAME_ERROR_BROKEN_HDDGAME: return tr("ERROR: HDD boot game is corrupted. The application will continue.", "Game Error");
case localized_string_id::CELL_GAME_ERROR_BROKEN_EXIT_GAMEDATA: return tr("ERROR: Game data is corrupted. The application will be terminated.", "Game Error");
@ -140,12 +140,15 @@ private:
case localized_string_id::CELL_SAVEDATA_CB_FAILURE: return tr("Error - Failed to save or load", "Savedata Error");
case localized_string_id::CELL_SAVEDATA_CB_NO_DATA: return tr("Error - Save data cannot be found", "Savedata Error");
case localized_string_id::CELL_SAVEDATA_CB_NO_SPACE: return tr("Error - Insufficient free space\n\nSpace needed: %0 KB", "Savedata Error").arg(std::forward<Args>(args)...);
case localized_string_id::CELL_SAVEDATA_CREATE_CONFIRMATION: return tr("Create new Save Data?", "Savedata Dialog");
case localized_string_id::CELL_SAVEDATA_DELETE_CONFIRMATION: return tr("Do you really want to delete this entry?\n\n%0", "Savedata entry info").arg(std::forward<Args>(args)...);
case localized_string_id::CELL_SAVEDATA_DELETE_SUCCESS: return tr("Successfully removed entry!\n\n%0", "Savedata entry info").arg(std::forward<Args>(args)...);
case localized_string_id::CELL_SAVEDATA_DELETE: return tr("Delete this entry?\n\n%0", "Savedata entry info").arg(std::forward<Args>(args)...);
case localized_string_id::CELL_SAVEDATA_LOAD: return tr("Load this entry?\n\n%0", "Savedata entry info").arg(std::forward<Args>(args)...);
case localized_string_id::CELL_SAVEDATA_OVERWRITE: return tr("Overwrite this entry?\n\n%0", "Savedata entry info").arg(std::forward<Args>(args)...);
case localized_string_id::CELL_SAVEDATA_NO_DATA: return tr("There is no saved data.", "Savedata entry info");
case localized_string_id::CELL_SAVEDATA_NEW_SAVED_DATA_TITLE: return tr("New Saved Data", "Savedata Dialog");
case localized_string_id::CELL_SAVEDATA_NEW_SAVED_DATA_SUB_TITLE: return tr("Select to create a new entry", "Savedata Dialog");
case localized_string_id::CELL_SAVEDATA_SAVE_CONFIRMATION: return tr("Do you want to save this data?", "Savedata Dialog");
case localized_string_id::CELL_SAVEDATA_DELETE_CONFIRMATION: return tr("Do you really want to delete this data?\n\n%0", "Savedata entry info").arg(std::forward<Args>(args)...);
case localized_string_id::CELL_SAVEDATA_DELETE_SUCCESS: return tr("Successfully removed data!\n\n%0", "Savedata entry info").arg(std::forward<Args>(args)...);
case localized_string_id::CELL_SAVEDATA_DELETE: return tr("Delete this data?\n\n%0", "Savedata entry info").arg(std::forward<Args>(args)...);
case localized_string_id::CELL_SAVEDATA_LOAD: return tr("Load this data?\n\n%0", "Savedata entry info").arg(std::forward<Args>(args)...);
case localized_string_id::CELL_SAVEDATA_OVERWRITE: return tr("Do you want to overwrite the saved data?\n\n%0", "Savedata entry info").arg(std::forward<Args>(args)...);
case localized_string_id::INVALID: return tr("Invalid");
default: return tr("Unknown");