diff --git a/gui/AboutScreen.cpp b/gui/AboutScreen.cpp index 62d2c08..453b629 100644 --- a/gui/AboutScreen.cpp +++ b/gui/AboutScreen.cpp @@ -137,7 +137,7 @@ AboutScreen::~AboutScreen() } } -void AboutScreen::credHead(std::string& header, std::string& blurb) +void AboutScreen::credHead(const std::string& header, const std::string& blurb) { auto head = creditHeads.emplace(creditHeads.end()); diff --git a/gui/AboutScreen.hpp b/gui/AboutScreen.hpp index 5563b56..c193814 100644 --- a/gui/AboutScreen.hpp +++ b/gui/AboutScreen.hpp @@ -39,7 +39,7 @@ class AboutScreen : public ListElement void removeEmptyFolders(); void wipeCache(); void launchFeedback(); - void credHead(std::string& header, std::string& blurb); + void credHead(const std::string& header, const std::string& blurb); void credit(const char* username, const char* githubId, const char* twitter = NULL, diff --git a/gui/AppDetails.cpp b/gui/AppDetails.cpp index 97fb431..29c2ca6 100644 --- a/gui/AppDetails.cpp +++ b/gui/AppDetails.cpp @@ -59,14 +59,14 @@ AppDetails::AppDetails(Package& package, AppList* appList, AppCard* appCard) download.position(SCREEN_WIDTH - 310, SCREEN_HEIGHT - 250); cancel.position(SCREEN_WIDTH - 310, SCREEN_HEIGHT - 90); - const char* buttonLabel = "Launch"; + std::string buttonLabel = i18n("details.launch"); bool injectorPresent = false; if (isTheme) // should only happen on switch { auto installer = get->lookup("NXthemes_Installer"); injectorPresent = installer ? true : false; // whether or not the currently hardcoded installer package exists, in the future becomes something functionality-based like "theme_installer" - buttonLabel = (injectorPresent && installer->getStatus() == GET) ? "Injector" : "Inject"; + buttonLabel = (injectorPresent && installer->getStatus() == GET) ? i18n("details.injector") : i18n("details.inject"); } // show the third button if a binary is present, or a theme injector is available (installed or not) @@ -233,8 +233,8 @@ void AppDetails::launch() if (!successLaunch) { - printf("Failed to launch."); - errorText = new TextElement("Couldn't launch app", 24, &red, false, 300); + // printf("Failed to launch."); + errorText = new TextElement(i18n("errors.applaunch"), 24, &red, false, 300); errorText->position(970, 430); super::append(errorText); this->canLaunch = false; diff --git a/gui/AppDetailsContent.cpp b/gui/AppDetailsContent.cpp index 1c47c8c..e4035c8 100644 --- a/gui/AppDetailsContent.cpp +++ b/gui/AppDetailsContent.cpp @@ -44,14 +44,14 @@ std::string getTrimmedDetails(AppDetailsContent* content, std::string details) } AppDetailsContent::AppDetailsContent(Package *package, bool useBannerIcons) - : reportIssue("Report Issue", L_BUTTON) - , moreByAuthor("More by Author", R_BUTTON) + : reportIssue(i18n("contents.report"), L_BUTTON) + , moreByAuthor(i18n("more"), R_BUTTON) , title(package->getTitle().c_str(), 35, &HBAS::ThemeManager::textPrimary) , title2(package->getAuthor().c_str(), 27, &HBAS::ThemeManager::textSecondary) - , details("Package long description", 20 / SCALER, &HBAS::ThemeManager::textPrimary, false, PANE_WIDTH + 20 / SCALER) - , changelog("If you're reading this text, something is wrong", 20 / SCALER, &HBAS::ThemeManager::textPrimary, false, PANE_WIDTH + 20 / SCALER) - , showFiles("Show Installed Files List", ZL_BUTTON, false, 15) - , showChangelog("Show Changelog", ZR_BUTTON, false, 15) + , details(i18n("contents.placeholder1"), 20 / SCALER, &HBAS::ThemeManager::textPrimary, false, PANE_WIDTH + 20 / SCALER) + , changelog(i18n("contents.placeholder2"), 20 / SCALER, &HBAS::ThemeManager::textPrimary, false, PANE_WIDTH + 20 / SCALER) + , showFiles(i18n("contents.showinstalled"), ZL_BUTTON, false, 15) + , showChangelog(i18n("contents.showchangelog"), ZR_BUTTON, false, 15) , banner(useBannerIcons ? package->getBannerUrl().c_str() : package->getIconUrl().c_str(), [package]{ // If the banner fails to load, use an icon banner NetImageElement* icon = new NetImageElement(package->getIconUrl().c_str(), []{ @@ -64,7 +64,7 @@ AppDetailsContent::AppDetailsContent(Package *package, bool useBannerIcons) return icon; }) , screenshotsContainer(COL_LAYOUT, 20) - , viewSSButton("Read More...", Y_BUTTON, false, 15) + , viewSSButton(i18n("contents.readmore"), Y_BUTTON, false, 15) { title.position(MARGIN, 30); super::append(&title); @@ -163,7 +163,7 @@ AppDetailsContent::AppDetailsContent(Package *package, bool useBannerIcons) screenshot->position(0, 0); subParent->child(screenshot); - Button* dismiss = new Button("Back", B_BUTTON, false, 15); + Button* dismiss = new Button(i18n("details.back"), B_BUTTON, false, 15); auto appDetails = RootDisplay::subscreen; dismiss->action = [this, appDetails, subParent] { appDetails->remove(subParent); @@ -253,17 +253,19 @@ bool AppDetailsContent::process(InputEvents* event) if (expandedReadMore) { viewSSButton.hidden = true; } else { + auto readMoreText = i18n("contents.readmore"); // no screenshot is on screen, so get our button out of there viewSSButton.position((banner.x + banner.width)/2 - viewSSButton.width/4, (details.y + details.height + 20)); - if (viewSSButton.getText() != "Read More...") { - viewSSButton.updateText("Read More..."); + if (viewSSButton.getText() != readMoreText) { + viewSSButton.updateText(readMoreText.c_str()); } curScreenIdx = 0; } } else { // if we have a screenshot on screen, let's update the View button's position - if (viewSSButton.getText() != "View") { - viewSSButton.updateText("View"); + auto viewText = i18n("contents.view"); + if (viewSSButton.getText() != viewText) { + viewSSButton.updateText(viewText.c_str()); } viewSSButton.position( screenshotsContainer.x + curScreenshot->x + curScreenshot->width - viewSSButton.width - 5, @@ -293,8 +295,10 @@ bool AppDetailsContent::process(InputEvents* event) void AppDetailsContent::switchExtraInfo(Package* package, int newState) { // update button text - showFiles.updateText((std::string(newState == SHOW_LIST_OF_FILES ? "Hide" : "Show") + " Installed Files List").c_str()); - showChangelog.updateText((std::string(newState == SHOW_CHANGELOG ? "Hide" : "Show") + " Changelog").c_str()); + auto hideText = i18n("contents.hide"); + auto showText = i18n("contents.show"); + showFiles.updateText((std::string(newState == SHOW_LIST_OF_FILES ? hideText : showText) + " " + i18n("contents.showinstalled ")).c_str()); + showChangelog.updateText((std::string(newState == SHOW_CHANGELOG ? hideText : showText) + " " + i18n("contents.changelog")).c_str()); // hide/show changelog text based on if neither is true changelog.hidden = newState == SHOW_NEITHER; @@ -303,7 +307,7 @@ void AppDetailsContent::switchExtraInfo(Package* package, int newState) { // update the "changelog" text depending on which action we're doing if (newState == SHOW_CHANGELOG) { - changelog.setText(std::string("Changelog:\n") + package->getChangelog().c_str()); + changelog.setText(std::string(i18n("contents.changelog") + ":\n") + package->getChangelog().c_str()); changelog.setFont(NORMAL); changelog.update(); } @@ -315,7 +319,7 @@ void AppDetailsContent::switchExtraInfo(Package* package, int newState) { // (LOCAL -> UPDATE packages won't have a manifest) auto status = package->getStatus(); if ((status == INSTALLED || status == UPDATE) && package->manifest .isValid()) { - allEntries << "Currently Installed Files:\n"; + allEntries << i18n("contents.files.current") + "\n"; for (auto &entry : package->manifest.getEntries()) { allEntries << entry.raw << "\n"; } @@ -326,7 +330,7 @@ void AppDetailsContent::switchExtraInfo(Package* package, int newState) { // manifest is either non-local, or we need to display both, download it from the server std::string data(""); downloadFileToMemory(package->getManifestUrl().c_str(), &data); - allEntries << "Manifest of Remote Files:\n" << data; + allEntries << i18n("contents.files.remote") + "\n" << data; } changelog.setText(std::string("") + allEntries.str().c_str()); diff --git a/gui/AppList.cpp b/gui/AppList.cpp index cfcf489..6a099a0 100644 --- a/gui/AppList.cpp +++ b/gui/AppList.cpp @@ -431,7 +431,7 @@ void AppList::update() // category text category.position(20, 90); - category.setText(std::string("Search: \"") + sidebar->searchQuery + "\""); + category.setText(std::string(i18n("listing.search") + " \"") + sidebar->searchQuery + "\""); category.update(); super::append(&category); diff --git a/gui/FeedbackCenter.cpp b/gui/FeedbackCenter.cpp index 0b2b146..f08e134 100644 --- a/gui/FeedbackCenter.cpp +++ b/gui/FeedbackCenter.cpp @@ -159,7 +159,7 @@ FeedbackCenter::FeedbackCenter(AppList* appList) child(header); // back button - child((new Button("Back", B_BUTTON, true))->setPosition(35, 15)->setAction([]{ + child((new Button(i18n("details.back"), B_BUTTON, true))->setPosition(35, 15)->setAction([]{ RootDisplay::switchSubscreen(nullptr); })); diff --git a/gui/MainDisplay.cpp b/gui/MainDisplay.cpp index 9087f96..c6db95e 100644 --- a/gui/MainDisplay.cpp +++ b/gui/MainDisplay.cpp @@ -13,7 +13,7 @@ using namespace std::string_literals; // for ""s MainDisplay::MainDisplay() - : appList(NULL, &sidebar) + : RootDisplay(), appList(NULL, &sidebar) { // add in the sidebar, footer, and main app listing sidebar.appList = &appList; @@ -224,13 +224,14 @@ bool MainDisplay::process(InputEvents* event) if (!isOnline) { - RootDisplay::switchSubscreen(new ErrorScreen("Couldn't connect to the Internet!", "Perform a connection test in the " PLATFORM " System Settings\nEnsure DNS isn't blocking: "s + META_REPO)); + std::string connTestMsg = replaceAll(i18n("errors.conntest"), "PLATFORM", PLATFORM); + RootDisplay::switchSubscreen(new ErrorScreen(i18n("errors.nowifi"), connTestMsg + "\n" + i18n("errors.dnsmsg") + " " + META_REPO)); return true; } if (!atLeastOneEnabled) { - RootDisplay::switchSubscreen(new ErrorScreen("Couldn't connect to a server!", "No enabled repos found, check ./get/repos.json\nMake sure repo has at least one package")); + RootDisplay::switchSubscreen(new ErrorScreen(i18n("errors.noserver"), i18n("errors.norepos") + "\n" + i18n("errors.onepkg"))); return true; } @@ -264,15 +265,15 @@ bool MainDisplay::process(InputEvents* event) } else writeFailed = true; - if (writeFailed) { - std::string cardText = "Ensure "s + tmp_file + " is writable"; + if (writeFailed || true) { + std::string cardText = replaceAll(i18n("errors.writetestfail"), "PATH", tmp_file) + "\n"; #if defined(__WIIU__) - cardText = "Check the physical SD write lock slider\n"s + cardText; + cardText = i18n("errors.sdlock") + "\n"s + cardText; #elif defined (SWITCH) - cardText = "Check for EXFAT FS corruption (no issues on FAT32)\n"s + cardText; + cardText = i18n("errors.exfat") + "\n"s + cardText; #endif - RootDisplay::switchSubscreen(new ErrorScreen("Cannot access SD card!"s, cardText)); + RootDisplay::switchSubscreen(new ErrorScreen(i18n("errors.sdaccess"), cardText)); return true; } @@ -316,10 +317,10 @@ int MainDisplay::updateLoader(void* clientp, double dltotal, double dlnow, doubl ErrorScreen::ErrorScreen(std::string mainErrorText, std::string troubleshootingText) : icon(RAMFS "res/icon.png") - , title("Homebrew App Store", 50 - 25) + , title(i18n("credits.title"), 50 - 25) , errorMessage(mainErrorText.c_str(), 40) - , troubleshooting((std::string("Troubleshooting:\n") + troubleshootingText).c_str(), 20, NULL, false, 600) - , btnQuit("Quit", SELECT_BUTTON, false, 15) + , troubleshooting((std::string(i18n("errors.troubleshooting") + "\n") + troubleshootingText).c_str(), 20, NULL, false, 600) + , btnQuit(i18n("listing.quit"), SELECT_BUTTON, false, 15) { Container* logoCon = new Container(ROW_LAYOUT, 10); icon.resize(35, 35); @@ -332,7 +333,7 @@ ErrorScreen::ErrorScreen(std::string mainErrorText, std::string troubleshootingT troubleshooting.constrain(ALIGN_BOTTOM | ALIGN_CENTER_HORIZONTAL, 40); btnQuit.constrain(ALIGN_LEFT | ALIGN_BOTTOM, 100); - super::append((new Button("Ignore This", X_BUTTON, false, 15)) + super::append((new Button(i18n("errors.ignorethis"), X_BUTTON, false, 15)) ->constrain(ALIGN_RIGHT | ALIGN_BOTTOM, 100) ->setAction([]() { auto mainDisplay = (MainDisplay*)RootDisplay::mainDisplay; diff --git a/gui/Sidebar.cpp b/gui/Sidebar.cpp index a91e6aa..530e870 100644 --- a/gui/Sidebar.cpp +++ b/gui/Sidebar.cpp @@ -60,7 +60,7 @@ Sidebar::Sidebar() if (isEarthDay()) { // easter egg for earth day https://www.earthday.org - title.setText("Happy Earth Day!"); + title.setText(i18n("listing.earthday").c_str()); title.update(); // draw a an icon over the logo @@ -94,7 +94,7 @@ void Sidebar::addHints() hider->position(270, SCREEN_HEIGHT - 35); super::append(hider); - hint = new TextElement("Hide", 15); + hint = new TextElement(i18n("contents.hide"), 15); hint->position(hider->x + hider->width + 5, hider->y); super::append(hint); diff --git a/libs/chesto b/libs/chesto index 227965e..60d7e78 160000 --- a/libs/chesto +++ b/libs/chesto @@ -1 +1 @@ -Subproject commit 227965e646fce668b22ce23ec9adf858513e65e4 +Subproject commit 60d7e78f15f5fd6f0f0a6ff427e74e728a63e519 diff --git a/resin/res/i18n/en-us.ini b/resin/res/i18n/en-us.ini index 08c128e..39402f2 100644 --- a/resin/res/i18n/en-us.ini +++ b/resin/res/i18n/en-us.ini @@ -45,6 +45,11 @@ details.reloading = Reloading Metadata details.syncing = Syncing Packages details.analyzing = Analyzing Files +; Action buttons +details.launch = Launch +details.inject = Inject +details.injector = Injector + ; App Details Contents contents.report = Report Issue contents.more = More by Author @@ -72,13 +77,14 @@ listing.sort.size = by size (descending) listing.sort.random = randomly listing.quit = Quit listing.credits = Credits -listing.delete = Del +listing.delete = Del listing.adjustsort = Adjust Sort listing.togglekeyboard = Toggle Keyboard listing.search = Search: listing.by = by listing.appletwarning = NOTICE: You are in Applet mode! Google "Switch Applet Mode" for more info. listing.debugwarning = NOTICE: You are using a dev build! Update to a stable release if this is unintended. +listing.earthday = Happy Earth Day! ; Feedback page feedback.leaving = Leaving feedback for: @@ -89,12 +95,19 @@ feedback.caps = Caps feedback.help = If you need to send more detailed feedback, please email us at fight@fortheusers.org ; Error Messages -errors.conntest = Perform a connection test in the Generic System Settings -errors.dnsmsg = Ensure DNS isn't blocking: +errors.conntest = Perform a connection test in the PLATFORM System Settings +errors.dnsmsg = Ensure DNS isn't blocking: errors.norepos = No enabled repos found, check ./get/repos.json errors.onepkg = Make sure repo has at least one package errors.nowifi = Couldn't connect to the Internet! +errors.noserver = Couldn't connect to a server! errors.troubleshooting = Troubleshooting: +errors.ignorethis = Ignore This +errors.writetestfail = Ensure "PATH" is writable +errors.sdaccess = Cannot access SD card! +errors.sdlock = Check the physical SD write lock slider +errors.exfat = Check for EXFAT FS corruption (no issues on FAT32) +errors.applaunch = Couldn't launch app ; Sidebar Categories sidebar.search = Search