mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't store translated standard weight system names
For the names that we have in our "default set" we need to store the English name so Subsurface will "do the right thing" when opening the file in a different locale. With manually entered names in a local language there's not much we can do. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
81d91f2ce0
commit
43630cabd6
1 changed files with 10 additions and 1 deletions
|
@ -485,7 +485,16 @@ bool WeightModel::setData(const QModelIndex& index, const QVariant& value, int r
|
|||
case TYPE:
|
||||
if (!value.isNull()) {
|
||||
if (!ws->description || gettextFromC::instance()->tr(ws->description) != value.toString()) {
|
||||
ws->description = strdup(value.toString().toUtf8().constData());
|
||||
// loop over translations to see if one matches
|
||||
int i = -1;
|
||||
while(ws_info[++i].name) {
|
||||
if (gettextFromC::instance()->tr(ws_info[i].name) == value.toString()) {
|
||||
ws->description = ws_info[i].name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ws_info[i].name == NULL) // didn't find a match
|
||||
ws->description = strdup(value.toString().toUtf8().constData());
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue