127 // load description (if applicable) |
127 // load description (if applicable) |
128 if (isMission) |
128 if (isMission) |
129 { |
129 { |
130 // get locale |
130 // get locale |
131 QSettings settings(datamgr.settingsFileName(), QSettings::IniFormat); |
131 QSettings settings(datamgr.settingsFileName(), QSettings::IniFormat); |
132 QString locale = settings.value("misc/locale", "").toString(); |
132 QString locale = QLocale().name(); |
133 if (locale.isEmpty()) |
|
134 locale = QLocale::system().name(); |
|
135 |
133 |
136 QSettings descSettings(QString("physfs://Maps/%1/desc.txt").arg(map), QSettings::IniFormat); |
134 QSettings descSettings(QString("physfs://Maps/%1/desc.txt").arg(map), QSettings::IniFormat); |
137 descSettings.setIniCodec("UTF-8"); |
135 descSettings.setIniCodec("UTF-8"); |
138 desc = descSettings.value(locale, QString()).toString(); |
136 desc = descSettings.value(locale, QString()).toString(); |
139 // If not found, try with lanague-only code |
137 // If not found, try with language-only code |
140 if (desc.isEmpty()) |
138 if (desc.isEmpty()) |
141 { |
139 { |
142 QString localeSimple = locale.remove(QRegExp("_.*$")); |
140 QString localeSimple = locale.remove(QRegExp("_.*$")); |
143 desc = descSettings.value(localeSimple, QString()).toString(); |
141 desc = descSettings.value(localeSimple, QString()).toString(); |
|
142 // If still not found, use English |
|
143 if (desc.isEmpty()) |
|
144 desc = descSettings.value("en", QString()).toString(); |
144 } |
145 } |
145 desc = desc.replace("_n", "\n").replace("_c", ",").replace("__", "_"); |
146 desc = desc.replace("_n", "\n").replace("_c", ",").replace("__", "_"); |
146 } |
147 } |
147 |
148 |
148 // detect if map is dlc |
149 // detect if map is dlc |