2020-10-05 01:59:46 +01:00
|
|
|
#include "language_option_page.hpp"
|
2020-10-05 23:53:12 +01:00
|
|
|
|
2020-10-05 01:59:46 +01:00
|
|
|
#include <cstdio>
|
2020-10-05 23:53:12 +01:00
|
|
|
namespace i18n = brls::i18n;
|
|
|
|
using namespace i18n::literals;
|
2020-10-05 01:59:46 +01:00
|
|
|
|
|
|
|
//this page is for language page
|
|
|
|
|
|
|
|
LanguageOptionPage::LanguageOptionPage() : AppletFrame(true, true)
|
2020-10-05 03:03:45 +01:00
|
|
|
{
|
2020-10-05 23:53:12 +01:00
|
|
|
/* this->setTitle("menus/Language_Option"_i18n );
|
2020-10-05 01:59:46 +01:00
|
|
|
list = new brls::List();
|
|
|
|
|
|
|
|
English = new brls::ListItem("English");
|
|
|
|
English->getClickEvent()->subscribe([&](brls::View* view){
|
|
|
|
|
|
|
|
nlohmann::json json_file;
|
|
|
|
json_file["language"]=(int)lang::Language::English;
|
2020-10-05 16:14:10 +01:00
|
|
|
std::ofstream o(APP_LANG);
|
2020-10-05 01:59:46 +01:00
|
|
|
o<<std::setw(4)<<json_file<<std::endl;
|
|
|
|
|
|
|
|
brls::StagedAppletFrame* stagedFrame = new brls::StagedAppletFrame();
|
|
|
|
stagedFrame->addStage(
|
2020-10-05 23:53:12 +01:00
|
|
|
new ConfirmPage(stagedFrame, "menus/reset_machine"_i18n , true)
|
2020-10-05 01:59:46 +01:00
|
|
|
);
|
|
|
|
brls::Application::pushView(stagedFrame);
|
|
|
|
|
|
|
|
});
|
|
|
|
list->addView(English);
|
|
|
|
Chinese = new brls::ListItem("中文");
|
|
|
|
Chinese->getClickEvent()->subscribe([&](brls::View* view){
|
|
|
|
nlohmann::json json_file;
|
|
|
|
json_file["language"]=(int)lang::Language::Chinese;
|
2020-10-05 16:14:10 +01:00
|
|
|
std::ofstream o(APP_LANG);
|
2020-10-05 01:59:46 +01:00
|
|
|
o<<std::setw(4)<<json_file<<std::endl;
|
|
|
|
|
|
|
|
brls::StagedAppletFrame* stagedFrame = new brls::StagedAppletFrame();
|
|
|
|
stagedFrame->addStage(
|
2020-10-05 23:53:12 +01:00
|
|
|
new ConfirmPage(stagedFrame, "menus/reset_machine"_i18n , true)
|
2020-10-05 01:59:46 +01:00
|
|
|
);
|
|
|
|
brls::Application::pushView(stagedFrame);
|
|
|
|
});
|
|
|
|
list->addView(Chinese);
|
2020-10-05 16:14:10 +01:00
|
|
|
|
|
|
|
French = new brls::ListItem("Français");
|
|
|
|
French->getClickEvent()->subscribe([&](brls::View* view){
|
|
|
|
nlohmann::json json_file;
|
|
|
|
json_file["language"]=(int)lang::Language::French;
|
|
|
|
std::ofstream o(APP_LANG);
|
|
|
|
o<<std::setw(4)<<json_file<<std::endl;
|
|
|
|
|
|
|
|
brls::StagedAppletFrame* stagedFrame = new brls::StagedAppletFrame();
|
|
|
|
stagedFrame->addStage(
|
2020-10-05 23:53:12 +01:00
|
|
|
new ConfirmPage(stagedFrame, "menus/reset_machine"_i18n , true)
|
2020-10-05 16:14:10 +01:00
|
|
|
);
|
|
|
|
brls::Application::pushView(stagedFrame);
|
|
|
|
});
|
|
|
|
list->addView(French);
|
2020-10-05 23:53:12 +01:00
|
|
|
this->setContentView(list); */
|
2020-10-05 01:59:46 +01:00
|
|
|
}
|