diff --git a/app/gui/oven_control/cookbook.cpp b/app/gui/oven_control/cookbook.cpp index eb1213e..d655de8 100644 --- a/app/gui/oven_control/cookbook.cpp +++ b/app/gui/oven_control/cookbook.cpp @@ -3,6 +3,8 @@ #include #include +#include "config.h" + static QErrorMessage *errorDialog = NULL; static void showError(QString errorMessage) { @@ -54,6 +56,23 @@ CookBook::CookBook(Define::CookType type) return; } + int cookNameSection; + Define::language_type lang = (Define::language_type) Config::getConfigValue(Define::config_language).d32; + switch (lang) + { + case Define::language_kr: + cookNameSection = 1; + break; + case Define::language_en: + cookNameSection = 2; + break; + case Define::language_ch: + cookNameSection = 3; + break; + default: + cookNameSection = 1; + } + int lineCount = 0; while (!file.atEnd()) { @@ -75,7 +94,7 @@ CookBook::CookBook(Define::CookType type) continue; } - QString cookname = line.section(',', 1, 1).trimmed(); + QString cookname = line.section(',', cookNameSection, cookNameSection).trimmed(); if (cookname.isEmpty()) { showError(errorMessage.arg("Cook name is missed"));