Important: Please read the Qt Code of Conduct -

Should QTranslator load more specialized translations? (es_US if es_ES is missing)

  • Hey everyone,

    An user created an Spanish (American) (en_US) translation for me, stored as pext_es_US.qm. This is the only Spanish translation my application now has. I noticed is that if I set my locale to es_US, it will load that translation, but if I set it to es_ES it won't. The same happens for users with an es_US locale if I rename the translation file to pext_es_ES. Renaming the file to be simply pext_es.qm will load it for all Spanish users no matter what.

    I'm just wondering if this is intended behaviour? It seems incorrect to give a Spanish user from Spain the default English translation instead of the Spanish (American) translation because I would assume the Spanish (American) translation would be easier for them?

    Should I instead rename the file to pext_es.qm and treat it as a "general Spanish translation"? Should I do the same for the pext_zh_Hant.qm translation I currently have? What's the best practice here?

Log in to reply