qt: bugfix unsupported QLocale languages #19001

pull 10xcryptodev wants to merge 1 commits into bitcoin:master from 10xcryptodevforks:202005-bugfix-qlocale changing 1 files +31 −10
  1. 10xcryptodev commented at 9:39 PM on May 17, 2020: contributor

    fix #17047

    Some languages are not supported by QLocale eo was already fixed in Qt 5.12 https://bugreports.qt.io/browse/QTBUG-57802?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&showAll=true

    Based on the bug comments: "QLocale cannot deal with a language which is not associated with a particular country"

  2. DrahtBot added the label GUI on May 17, 2020
  3. in src/qt/optionsdialog.cpp:108 in ae4bee1318 outdated
     101 | +        {"ku_IQ", "Kurdish - Iraq"},
     102 | +        {"la", "Latin"},
     103 | +        {"pam", "Kapampangan"},
     104 | +        {"szl", "Silesian"},
     105 | +    };
     106 | +
    


    hebasto commented at 5:56 AM on May 18, 2020:

    Instead of commenting the code you could use QT_VERSION macro like here:

    https://github.com/bitcoin/bitcoin/blob/dc5333d31f280e09bb1e8cdacfbe842f4ab9e69b/src/qt/guiutil.cpp#L885-L892


    10xcryptodev commented at 8:12 PM on May 18, 2020:

    thanks @hebasto added your suggestion


    10xcryptodev commented at 3:18 AM on June 3, 2020:

    @jonasschnelli @hebasto about the TODO we have this review. TODO or not TODO :) Use QT_VERSION_CHECK and the comment seems good?

  4. hebasto commented at 5:57 AM on May 18, 2020: member

    Concept ACK.

  5. 10xcryptodev force-pushed on May 18, 2020
  6. hebasto commented at 11:05 AM on May 20, 2020: member

    @10xcryptodev Did you see #16808 that addressed the same issue? That pull created some amount of controversy. So other devs' conceptual opinions are needed :)

  7. 10xcryptodev commented at 8:03 PM on May 20, 2020: contributor

    @hebasto yes, i saw that and followed @laanwj suggestions

    Agreed, it's good to see other opinions

  8. in src/qt/optionsdialog.cpp:122 in f0ab6b8e35 outdated
     124 | +        if (locale.nativeLanguageName().isEmpty()) {
     125 | +            std::map<std::string, std::string>::const_iterator it = language_names.find(langStr.toStdString());
     126 | +            if (it != language_names.end()) {
     127 | +                /** display language strings as "native language (locale name)", e.g. "Deutsch (de)" */
     128 | +                ui->lang->addItem(QString(it->second.c_str()) + QString(" (") + langStr + QString(")"), QVariant(langStr));
     129 | +            }
    


    laanwj commented at 10:55 AM on May 26, 2020:

    There needs to be an else() clause here, displaying a fallback for languages for which the name cannot be found so that they don't entirely disappear from the list.


    10xcryptodev commented at 10:29 PM on May 26, 2020:

    @laanwj thanks, added the else condition

  9. 10xcryptodev force-pushed on May 26, 2020
  10. za-kk commented at 12:21 PM on May 31, 2020: contributor

    Concept NACK - as mentioned in #16808, an upstream fix for this would seem more suitable to me, rather than hard coding a fix into this project.

    However I would defer to someone else who has a better understanding of Qt and the overall project than myself.

    ku_IQ seems to work correctly for me. Meaning the only missing languages were la, pam and szl when running with Qt version 5.12.8

  11. qt: bugfix unsupported QLocale languages c0cd88b14e
  12. 10xcryptodev force-pushed on Jun 1, 2020
  13. 10xcryptodev commented at 3:02 AM on June 1, 2020: contributor

    @za-kk thanks for testing with Qt 5.12 updated the ku_IQ to check the version

    IMHO it's better to have this fix until Qt solves all the cases and the codebase moves the minimum Qt version (now is 5.5.1), it's not so easy to bump Qt default versions and the codebase has other fixes like this one

  14. jonasschnelli commented at 1:03 PM on June 2, 2020: contributor

    meh on specifically handling languages due to an upstream issue. I guess if we are going to do this, at least a TODO/reminder when to remove this code (after which QT version – if possible) would be nice.

  15. fanquake commented at 3:12 PM on July 9, 2020: member

    ~0. Agree that this is similar to #16808, and ideally not the kind of thing that we'd have to patch/handle ourselves. In any case, given that this is GUI-only, I'm going to suggest re-opening it in the gui repo: https://github.com/bitcoin-core/gui.

  16. fanquake closed this on Jul 9, 2020

  17. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 03:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me