Skip to content

Commit

Permalink
initial i18n changes progress commit, add ini files, new fonts + simp…
Browse files Browse the repository at this point in the history
…lified chinese
  • Loading branch information
vgmoose committed Mar 23, 2024
1 parent 5e1657c commit b22b249
Show file tree
Hide file tree
Showing 21 changed files with 345 additions and 54 deletions.
25 changes: 12 additions & 13 deletions gui/AboutScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@

AboutScreen::AboutScreen(Get* get)
: get(get)
, cancel("Go Back", B_BUTTON, false, 29)
, feedback("Leave Feedback", A_BUTTON, false, 17)
, title("Homebrew App Store", 35, &HBAS::ThemeManager::textPrimary)
, subtitle("by fortheusers.org", 25, &HBAS::ThemeManager::textPrimary)
, cancel(i18n("credits.goback"), B_BUTTON, false, 29)
, feedback(i18n("credits.feedback"), A_BUTTON, false, 17)
, title(i18n("credits.title"), 35, &HBAS::ThemeManager::textPrimary)
, subtitle(i18n("credits.subtitle"), 25, &HBAS::ThemeManager::textPrimary)
, ftuLogo(AVATAR_URL "40721862", []
{ return new ImageElement(RAMFS "res/4TU.png"); })
, creds("Licensed under the GPLv3 license. This app is free and open source because the users (like you!) deserve it.\n\nLet's support homebrew and the right to control what software we run on our own devices!",
20, &HBAS::ThemeManager::textPrimary, false, 1240)
, creds((i18n("credits.license") + "\n\n" + i18n("credits.cta")), 20, &HBAS::ThemeManager::textPrimary, false, 1240)
{

// TODO: show current app status somewhere
Expand Down Expand Up @@ -56,7 +55,7 @@ AboutScreen::AboutScreen(Get* get)
// username, githubId, twitter, github, gitlab, patreon, url, discord, directAvatarURL
// only first two social points will be used

credHead("Repo Maintenance and Development", "These are the primary people responsible for actively maintaining and developing the Homebrew App Store. If there's a problem, these are the ones to get in touch with!");
credHead(i18n("credits.repo"), i18n("credits.repo.desc"));
credit("pwsincd", "20027105", NULL, "pwsincd", NULL, NULL, NULL, "pwsincd#9044");
credit("VGMoose", "2467473", "vgmoose", "vgmoose");
credit("Nightkingale", "63483138", "Nightkingale", "nightkingale");
Expand All @@ -65,7 +64,7 @@ AboutScreen::AboutScreen(Get* get)
credit("CompuCat", "12215288", NULL, NULL, "compucat", NULL, "compucat.me");
credit("Quarky", "8533313", NULL, NULL, "quarktheawesome", NULL, "heyquark.com");

credHead("Library Development and Support", "Without the contributions to open-source libraries and projects by these people, much of the functionality within this program wouldn't be possible.");
credHead(i18n("credits.library"), i18n("credits.library.desc"));
credit("Maschell", "8582508", "maschelldev", "maschell");
credit("brienj", "17801294", "xhp_creations", "xhp-creations");
credit("Dimok", "15055714", NULL, "dimok789");
Expand All @@ -75,11 +74,11 @@ AboutScreen::AboutScreen(Get* get)
credit("CreeperMario", "15356475", "CreeperMario258", "CreeperMario");
credit("Ep8Script", "27195853", "ep8script", "ep8script");

credHead("Music and Sound", "In the Wii U and Switch releases, these guys provide the chiptune melodies that play in the background. They make the app feel more alive, and are all-around awesome!");
credHead(i18n("credits.music"), i18n("credits.music.desc"));
credit("(T-T)b", "40721862", "ttbchiptunes", NULL, NULL, NULL, "t-tb.bandcamp.com", NULL, "https://f4.bcbits.com/img/a2723574369_16.jpg");
credit("drewinator4", "40721862", NULL, NULL, NULL, NULL, NULL, NULL, "https://i.ytimg.com/vi/Tb02CNlhkPA/hqdefault.jpg", "drewinator4");

credHead("Interface Development and Design", "In one way or another, everyone in this category provided information regarding core functionality, quality-of-life changes, or the design of the user interface.");
credHead(i18n("credits.design"), i18n("credits.design.desc"));
credit("exelix", "13405476", "exelix11", "exelix11");
credit("Xortroll", "33005497", NULL, "xortroll", NULL, "xortroll");
credit("Ave", "584369", NULL, NULL, "a", NULL, "ave.zone", NULL, "https://gitlab.com/uploads/-/system/user/avatar/584369/avatar.png");
Expand All @@ -89,7 +88,7 @@ AboutScreen::AboutScreen(Get* get)
credit("Jacob", "12831497", NULL, "jacquesCedric");
credit("iTotalJustice", "47043333", NULL, "iTotalJustice");

credHead("Toolchain and Environment", "The organizations and people in this category enable Homebrew in general by creating and maintaining a cohesive environment for the community.");
credHead(i18n("credits.toolchain"), i18n("credits.toolchain.desc"));
credit("devkitPro", "7538897", NULL, "devkitPro", NULL, "devkitPro");
credit("Wintermute", "101194", NULL, "wintermute", NULL, NULL, "devkitPro.org");
credit("Fincs", "581494", "fincsdev", "fincs");
Expand All @@ -98,7 +97,7 @@ AboutScreen::AboutScreen(Get* get)
credit("exjam", "1302758", NULL, "exjam");
credit("brett19", "1621627", NULL, "brett19");

credHead("Homebrew Community Special Thanks", "Awesome people within the community whose work, words, or actions in some way inspired this program to exist in the manner it does.");
credHead(i18n("credits.extra"), i18n("credits.extra.desc"));

credit("Whovian9369", "5240754", NULL, NULL, "whovian9369");
credit("FIX94", "12349638", NULL, "FIX94");
Expand Down Expand Up @@ -138,7 +137,7 @@ AboutScreen::~AboutScreen()
}
}

void AboutScreen::credHead(const char* header, const char* blurb)
void AboutScreen::credHead(std::string& header, std::string& blurb)
{
auto head = creditHeads.emplace(creditHeads.end());

Expand Down
2 changes: 1 addition & 1 deletion gui/AboutScreen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AboutScreen : public ListElement
void removeEmptyFolders();
void wipeCache();
void launchFeedback();
void credHead(const char* header, const char* blurb);
void credHead(std::string& header, std::string& blurb);
void credit(const char* username,
const char* githubId,
const char* twitter = NULL,
Expand Down
41 changes: 24 additions & 17 deletions gui/AppDetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ AppDetails::AppDetails(Package& package, AppList* appList, AppCard* appCard)
, appCard(appCard)
, downloadProgress()
, download(getAction(&package), package.getStatus() == INSTALLED ? X_BUTTON : A_BUTTON, true, 30 / SCALER)
, cancel("Cancel", B_BUTTON, true, 30 / SCALER, download.width)
, cancel(i18n("details.cancel"), B_BUTTON, true, 30 / SCALER, download.width)
, details(getPackageDetails(&package).c_str(), 20, &white, false, 300)
, content(&package, appList->useBannerIcons)
, downloadStatus("Download Status", 30 / SCALER, &white)
, downloadStatus(i18n("details.status"), 30 / SCALER, &white)
{
// TODO: show current app status somewhere

Expand Down Expand Up @@ -121,31 +121,31 @@ std::string AppDetails::getPackageDetails(Package* package)
{
// lots of details that we know about the package
std::stringstream more_details;
more_details << "Title: " << package->getTitle() << "\n"
more_details << i18n("details.title") << " " << package->getTitle() << "\n"
<< package->getShortDescription() << "\n\n"
<< "Author: " << package->getAuthor() << "\n"
<< "Version: " << package->getVersion() << "\n"
<< "License: " << package->getLicense() << "\n\n"
<< "Package: " << package->getPackageName() << "\n"
<< "Downloads: " << package->getDownloadCount() << "\n"
<< "Updated: " << package->getUpdatedAt()<< "\n\n"
<< "Download size: " << package->getDownloadSize() << " KB\n"
<< "Install size: " << package->getExtractedSize() << " KB\n";
<< i18n("details.author") << " " << package->getAuthor() << "\n"
<< i18n("details.version") << " " << package->getVersion() << "\n"
<< i18n("details.license") << " " << package->getLicense() << "\n\n"
<< i18n("details.package") << " " << package->getPackageName() << "\n"
<< i18n("details.downloads") << " " << package->getDownloadCount() << "\n"
<< i18n("details.updated") << " " << package->getUpdatedAt()<< "\n\n"
<< i18n("details.size") << " " << package->getDownloadSize() << " KB\n"
<< i18n("details.installsize") << " " << package->getExtractedSize() << " KB\n";
return more_details.str();
}

const char* AppDetails::getAction(Package* package)
std::string AppDetails::getAction(Package* package)
{
switch (package->getStatus())
{
case GET:
return "Download";
return i18n("details.download");
case UPDATE:
return "Update";
return i18n("details.update");
case INSTALLED:
return "Remove";
return i18n("details.remove");
case LOCAL:
return "Reinstall";
return i18n("details.reinstall");
default:
break;
}
Expand Down Expand Up @@ -419,7 +419,14 @@ int AppDetails::updatePopupStatus(int status, int num, int num_total)
Package* package = popup->package;

if (status < 0 || status >= 5) return 0;
const char* statuses[6] = { "Downloading ", "Installing ", "Removing ", "Reloading Metadata", "Syncing Packages", "Analyzing Files" };
std::string statuses[6] = {
i18n("details.download.verb") + " ",
i18n("details.install.verb") + " ",
i18n("details.remove.verb") + " ",
i18n("details.reloading"),
i18n("details.syncing") + " ",
i18n("details.analyzing") + " "
};

statusText << statuses[status];

Expand Down
2 changes: 1 addition & 1 deletion gui/AppDetails.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AppDetails : public Element
~AppDetails();

std::string getPackageDetails(Package* package);
const char* getAction(Package* package);
std::string getAction(Package* package);
bool process(InputEvents* event);
void render(Element* parent);
bool launchFile(char* path, char* context);
Expand Down
27 changes: 17 additions & 10 deletions gui/AppList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,25 @@
#include <switch.h>
#endif

const char* AppList::sortingDescriptions[TOTAL_SORTS] = { "by most recent", "by download count", "alphabetically", "by size (descending)", "randomly" };
std::string AppList::sortingDescriptions[TOTAL_SORTS] = {
"listing.sort.recent",
"listing.sort.downloads",
"listing.sort.alpha",
"listing.sort.size",
"listing.sort.random"
};

CST_Color AppList::red = { 0xff, 0, 0, 0xff };
CST_Color AppList::lighterRed = { 0xef, 0x48, 0x48, 0xff };

AppList::AppList(Get* get, Sidebar* sidebar)
: get(get) // the main get instance that contains repo info and stuff
, sidebar(sidebar) // the sidebar, which will store the currently selected category info
, quitBtn("Quit", SELECT_BUTTON, false, 15)
, creditsBtn("Credits", START_BUTTON, false, 15)
, sortBtn("Adjust Sort", Y_BUTTON, false, 15)
, keyboardBtn("Toggle Keyboard", Y_BUTTON, false, 15)
, backspaceBtn("Del", B_BUTTON, false, 15)
, quitBtn(i18n("listing.quit"), SELECT_BUTTON, false, 15)
, creditsBtn(i18n("listing.credits"), START_BUTTON, false, 15)
, sortBtn(i18n("listing.adjustsort"), Y_BUTTON, false, 15)
, keyboardBtn(i18n("listing.togglekeyboard"), Y_BUTTON, false, 15)
, backspaceBtn(i18n("listing.delete"), B_BUTTON, false, 15)
, nowPlayingText(" ", 20, &HBAS::ThemeManager::textPrimary)
#if defined(MUSIC)
, nowPlayingIcon(RAMFS "res/nowplaying.png")
Expand Down Expand Up @@ -69,6 +75,7 @@ AppList::AppList(Get* get, Sidebar* sidebar)
};

// keyboard input callback
// keyboard.hasRoundedKeys = true;
keyboard.typeAction = std::bind(&AppList::keyboardInputCallback, this);
keyboard.preventEnterAndTab = true;
keyboard.width = SCREEN_HEIGHT - 20;
Expand All @@ -94,14 +101,14 @@ AppList::AppList(Get* get, Sidebar* sidebar)

if (!useBannerIcons) {
// applet mode, display a warning
nowPlayingText.setText("NOTICE: You are in Applet mode! Google \"Switch Applet Mode\" for more info.");
nowPlayingText.setText(i18n("listing.appletwarning").c_str());
nowPlayingText.setColor(myRed);
nowPlayingText.update();
}
#endif

#ifdef DEBUG_BUILD
nowPlayingText.setText("NOTICE: You are using a dev build! Update to a stable release if this is unintended.");
nowPlayingText.setText(i18n("listing.debugwarning").c_str());
nowPlayingText.setColor(myRed);
nowPlayingText.update();
#endif
Expand Down Expand Up @@ -461,7 +468,7 @@ void AppList::update()

// add the search type next to the category in a gray font
sortBlurb.position(category.x + category.width + 15, category.y + 12);
sortBlurb.setText(sortingDescriptions[sortMode]);
sortBlurb.setText(i18n(sortingDescriptions[sortMode]).c_str());
sortBlurb.update();
super::append(&sortBlurb);

Expand All @@ -484,7 +491,7 @@ void AppList::update()
// now playing icon, and position
nowPlayingText.setText(
std::string("") + title +
((artist != std::string("")) ? (std::string(" by ") + artist) : "") +
((artist != std::string("")) ? (std::string(" " + i18n("listing.by") + " ") + artist) : "") +
((album != std::string("")) ? (std::string(" - ") + album) : "")
);
super::append(&nowPlayingIcon);
Expand Down
2 changes: 1 addition & 1 deletion gui/AppList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class AppList : public ListElement

// the title of this category (from the sidebar)
static CST_Color black, gray, red, lighterRed;
static const char* sortingDescriptions[TOTAL_SORTS];
static std::string sortingDescriptions[TOTAL_SORTS];

TextElement sortBlurb;
TextElement category;
Expand Down
14 changes: 8 additions & 6 deletions gui/Feedback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

Feedback::Feedback(Package& package)
: package(&package)
, title((std::string("Leaving feedback for: \"") + package.getTitle() + "\"").c_str(), 25)
, title((std::string(i18n("feedback.leaving") + " \"") + package.getTitle() + "\""), 25)
, icon(package.getIconUrl().c_str(), []{ return new ImageElement(RAMFS "res/default.png"); })
, quit("Discard", Y_BUTTON, false, 20)
, send("Submit", X_BUTTON, false, 20)
, backspaceBtn("Del", B_BUTTON, false, 15)
, capsBtn("Caps", L_BUTTON, false, 15)
, response("If you need to send more detailed feedback, please email us at fight@fortheusers.org", 20, NULL, false, 460)
, quit(i18n("feedback.discard"), Y_BUTTON, false, 20)
, send(i18n("feedback.submit"), X_BUTTON, false, 20)
, backspaceBtn(i18n("feedback.delete"), B_BUTTON, false, 15)
, capsBtn(i18n("feedback.caps"), L_BUTTON, false, 15)
, response(i18n("feedback.help"), 20, NULL, false, 460)
{
title.position(50, 30);
super::append(&title);
Expand All @@ -31,6 +31,8 @@ Feedback::Feedback(Package& package)
#endif
super::append(&icon);

// keyboard.hasRoundedKeys = true;

keyboard.typeAction = std::bind(&Feedback::keyboardInputCallback, this);
keyboard.preventEnterAndTab = true;
keyboard.updateSize();
Expand Down
4 changes: 2 additions & 2 deletions gui/Sidebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Sidebar::Sidebar()
category[x].icon->position(30, 150 + x * 70 - 5);
super::append(category[x].icon);

category[x].name = new TextElement(cat_names[x], 25);
category[x].name = new TextElement(i18n(cat_names[x]), 25);
category[x].name->position(105, 150 + x * 70);
super::append(category[x].name);
}
Expand Down Expand Up @@ -265,7 +265,7 @@ void Sidebar::render(Element* parent)
std::string Sidebar::currentCatName()
{
if (this->curCategory >= 0 && this->curCategory < TOTAL_CATS)
return std::string(this->cat_names[this->curCategory]);
return i18n(this->cat_names[this->curCategory]);

return std::string("?");
}
Expand Down
4 changes: 2 additions & 2 deletions gui/Sidebar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class Sidebar : public ListElement
// list of human-readable category titles and short names from the json

#if defined(__WIIU__)
const char* cat_names[TOTAL_CATS] = { "Search", "All Apps", "Aroma-Ready", "Games", "Emulators", "Tools", "Advanced", "Misc" };
const char* cat_names[TOTAL_CATS] = { "sidebar.search", "sidebar.all", "Aroma", "sidebar.games", "sidebar.emulators", "sidebar.tools", "sidebar.advanced", "sidebar.misc" };
const char* cat_value[TOTAL_CATS] = { "_search", "_all", "aroma", "game", "emu", "tool", "advanced", "_misc" };
#else
const char* cat_names[TOTAL_CATS] = { "Search", "All Apps", "Games", "Emulators", "Tools", "Advanced", "Themes", "Misc" };
const char* cat_names[TOTAL_CATS] = { "sidebar.search", "sidebar.all", "sidebar.games", "sidebar.emulators", "sidebar.tools", "sidebar.advanced", "sidebar.themes", "sidebar.misc" };
const char* cat_value[TOTAL_CATS] = { "_search", "_all", "game", "emu", "tool", "advanced", "theme", "_misc" };
#endif

Expand Down
2 changes: 1 addition & 1 deletion libs/chesto
Binary file added resin/res/fonts/NotoSansSC-Regular.ttf
Binary file not shown.
Binary file added resin/res/fonts/OpenSans-Regular.ttf
Binary file not shown.
Binary file added resin/res/fonts/PTSerif-Regular.ttf
Binary file not shown.
Binary file added resin/res/fonts/UbuntuMono-Regular.ttf
Binary file not shown.
Binary file added resin/res/fonts/oldmono.ttf
Binary file not shown.
Binary file added resin/res/gray_sq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b22b249

Please sign in to comment.