[DEBUG] correct the language translation error
This commit is contained in:
parent
ccaf9e4bba
commit
adbc99df96
@ -104,7 +104,6 @@ namespace ewol {
|
|||||||
*/
|
*/
|
||||||
void forceRedrawAll();
|
void forceRedrawAll();
|
||||||
|
|
||||||
// TODO : Later ...
|
|
||||||
/**
|
/**
|
||||||
* @brief This is to transfert the event from one widget to another one
|
* @brief This is to transfert the event from one widget to another one
|
||||||
* @param source the widget where the event came from
|
* @param source the widget where the event came from
|
||||||
|
@ -145,6 +145,7 @@ class LocalInstanceTranslation {
|
|||||||
if (m_translateLoadad == true) {
|
if (m_translateLoadad == true) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
EWOL_VERBOSE("Load Translation MAJOR='" << m_major << "' LANG='" << m_language << "' default=" << m_languageDefault );
|
||||||
// start parse language for Major:
|
// start parse language for Major:
|
||||||
auto itMajor = m_listPath.find(m_major);
|
auto itMajor = m_listPath.find(m_major);
|
||||||
if (itMajor != m_listPath.end()) {
|
if (itMajor != m_listPath.end()) {
|
||||||
@ -237,7 +238,35 @@ const std::string& ewol::translate::getLanguage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ewol::translate::autoDetectLanguage() {
|
void ewol::translate::autoDetectLanguage() {
|
||||||
EWOL_INFO("Auto-detect language of system");
|
EWOL_VERBOSE("Auto-detect language of system");
|
||||||
|
std::string nonameLocalName = std::locale(std::locale(), new std::ctype<char>).name();
|
||||||
|
std::string userLocalName = std::locale("").name();
|
||||||
|
std::string globalLocalName = std::locale().name();
|
||||||
|
|
||||||
|
EWOL_VERBOSE(" The default locale is '" << globalLocalName << "'");
|
||||||
|
EWOL_VERBOSE(" The user's locale is '" << userLocalName << "'");
|
||||||
|
EWOL_VERBOSE(" A nameless locale is '" << nonameLocalName << "'");
|
||||||
|
|
||||||
|
std::string lang = nonameLocalName;
|
||||||
|
if ( lang == "*"
|
||||||
|
|| lang == "") {
|
||||||
|
lang = userLocalName;
|
||||||
|
}
|
||||||
|
if ( lang == "*"
|
||||||
|
|| lang == "") {
|
||||||
|
lang = globalLocalName;
|
||||||
|
}
|
||||||
|
if ( lang == "C"
|
||||||
|
|| lang == ""
|
||||||
|
|| lang.size() < 2) {
|
||||||
|
lang = "EN";
|
||||||
|
}
|
||||||
|
lang = std::string(lang.begin(), lang.begin()+2);
|
||||||
|
lang = etk::toupper(lang);
|
||||||
|
EWOL_INFO("Select Language : '" << lang << "'");
|
||||||
|
getInstanceTranslation().setLanguage(lang);
|
||||||
|
return;
|
||||||
|
// dead code ...
|
||||||
#if defined(__TARGET_OS__Linux)
|
#if defined(__TARGET_OS__Linux)
|
||||||
char *s = getenv("LANG");
|
char *s = getenv("LANG");
|
||||||
if (s == nullptr || strlen(s) < 2) {
|
if (s == nullptr || strlen(s) < 2) {
|
||||||
@ -251,6 +280,7 @@ void ewol::translate::autoDetectLanguage() {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
EWOL_INFO("Can not auto-detect language ...");
|
EWOL_INFO("Can not auto-detect language ...");
|
||||||
|
getInstanceTranslation().setLanguage("EN");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ void ewol::widget::Manager::focusKeep(ewol::WidgetShared _newWidget) {
|
|||||||
// nothing to do ...
|
// nothing to do ...
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
EWOL_VERBOSE("focusKeep=" << _newWidget->getId() );
|
EWOL_DEBUG("focusKeep=" << _newWidget->getId() );
|
||||||
//elog::displayBacktrace();
|
//elog::displayBacktrace();
|
||||||
auto focusWidgetCurrent = m_focusWidgetCurrent.lock();
|
auto focusWidgetCurrent = m_focusWidgetCurrent.lock();
|
||||||
if (_newWidget == focusWidgetCurrent) {
|
if (_newWidget == focusWidgetCurrent) {
|
||||||
|
@ -49,7 +49,7 @@ void appl::MainWindows::init() {
|
|||||||
externSubBind(m_composer, ewol::widget::Button, "appl-move", signalPressed, sharedFromThis(), &appl::MainWindows::onCallbackMove);
|
externSubBind(m_composer, ewol::widget::Button, "appl-move", signalPressed, sharedFromThis(), &appl::MainWindows::onCallbackMove);
|
||||||
|
|
||||||
externSubBind(m_composer, ewol::widget::Button, "appl-full-screen", signalValue, sharedFromThis(), &appl::MainWindows::onCallbackFullScreen);
|
externSubBind(m_composer, ewol::widget::Button, "appl-full-screen", signalValue, sharedFromThis(), &appl::MainWindows::onCallbackFullScreen);
|
||||||
m_listConnection.push_back(getObjectManager().periodicCall.connect(this, &appl::MainWindows::forceFocusCall));
|
//m_listConnection.push_back(getObjectManager().periodicCall.connect(this, &appl::MainWindows::forceFocusCall));
|
||||||
keepFocus();
|
keepFocus();
|
||||||
//shortCutAdd("F12", "menu:reloade-shader");
|
//shortCutAdd("F12", "menu:reloade-shader");
|
||||||
//signalShortcut.connect(sharedFromThis(), &appl::MainWindows::onCallbackShortCut);
|
//signalShortcut.connect(sharedFromThis(), &appl::MainWindows::onCallbackShortCut);
|
||||||
@ -118,6 +118,6 @@ bool appl::MainWindows::onEventEntry(const ewol::event::Entry& _event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void appl::MainWindows::forceFocusCall(const ewol::event::Time& _event) {
|
void appl::MainWindows::forceFocusCall(const ewol::event::Time& _event) {
|
||||||
keepFocus();
|
//keepFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user