125 if (locale.isEmpty()) |
125 if (locale.isEmpty()) |
126 locale = QLocale::system().name(); |
126 locale = QLocale::system().name(); |
127 |
127 |
128 QSettings descSettings(QString("physfs://Maps/%1/desc.txt").arg(map), QSettings::IniFormat); |
128 QSettings descSettings(QString("physfs://Maps/%1/desc.txt").arg(map), QSettings::IniFormat); |
129 descSettings.setIniCodec("UTF-8"); |
129 descSettings.setIniCodec("UTF-8"); |
130 desc = descSettings.value(locale, QString()).toString().replace("|", "\n").replace("\\,", ","); |
130 desc = descSettings.value(locale, QString()).toString(); |
131 // If not found, try with lanague-only code |
131 // If not found, try with lanague-only code |
132 if (desc.isEmpty()) |
132 if (desc.isEmpty()) |
133 { |
133 { |
134 QString localeSimple = locale.remove(QRegExp("_.*$")); |
134 QString localeSimple = locale.remove(QRegExp("_.*$")); |
135 desc = descSettings.value(localeSimple, QString()).toString().replace("|", "\n").replace("\\,", ","); |
135 desc = descSettings.value(localeSimple, QString()).toString(); |
136 } |
136 } |
|
137 desc = desc.replace("_n", "\n").replace("_c", ",").replace("__", "_"); |
137 } |
138 } |
138 |
139 |
139 // detect if map is dlc |
140 // detect if map is dlc |
140 QString mapDir = PHYSFS_getRealDir(QString("Maps/%1/map.cfg").arg(map).toLocal8Bit().data()); |
141 QString mapDir = PHYSFS_getRealDir(QString("Maps/%1/map.cfg").arg(map).toLocal8Bit().data()); |
141 dlc = !mapDir.startsWith(datadir->absolutePath()); |
142 dlc = !mapDir.startsWith(datadir->absolutePath()); |