Unsolved How to update the translation if the text is in a list and shown by model
-
Hi
I found my text list can not update the translations.
e.g.
# I'm using tr() to append the text into the stringlist append(QString(tr( ))); # then I think the list will be like this: (english),(english),(english), ...... ,(chinese),(chinese),(chinese) *...... : change the translation
Must I replace the text in the list when I change the translation?
-
@Mihan said in How to update the translation if the text is in a list and shown by model:
Must I replace the text in the list when I change the translation?
Yes.
-
@JonB Thanks
Do you have a convenient way to do that? -
@Mihan
If you are maintaining your ownQStringList
by appending texts you must alter it for the appropriate language.
If when your question title mentions "the text is in a list and shown by model" you get the texts from the model'sdata()
method you can do the translation in what that returns. -
@Mihan if you're working with a class, that has QWidget at it's core, you can listen the language changed event and use the signal to recreate your list