Files
Upsilon/apps/settings/sub_menu/localization_controller.cpp
Gabriel Ozouf df6383d2d8 [apps/i18n] Added default country for languages
After choosing a language at onboarding, the country menu now has a
specific country selected by default (Spain for Spanish, Italy for
Italian...)
Default countries are specified in apps/language_preferences.csv

Change-Id: Ia6392aceb9bebf7e62a692c5a79eb8c4d7b71a9d
2020-11-04 15:11:45 +01:00

22 lines
627 B
C++

#include "localization_controller.h"
#include <apps/global_preferences.h>
namespace Settings {
int LocalizationController::indexOfCellToSelectOnReset() const {
return mode() == Mode::Language ?
static_cast<int>(GlobalPreferences::sharedGlobalPreferences()->language()) :
IndexOfCountry(GlobalPreferences::sharedGlobalPreferences()->country());
}
bool LocalizationController::handleEvent(Ion::Events::Event event) {
if (Shared::LocalizationController::handleEvent(event) || event == Ion::Events::Left) {
static_cast<StackViewController *>(parentResponder())->pop();
return true;
}
return false;
}
}