qt: Missing translations #8782

issue MarcoFalke opened this issue on September 21, 2016
  1. MarcoFalke commented at 9:50 PM on September 21, 2016: member

    It seems the strings in qt/bitcoin.cpp are not translated.

    E.g. qt/bitcoin-qt -lang=cz -datadir=/tmp/a2 gives me a warning in English that the datadir does not exist.

  2. MarcoFalke added the label GUI on Sep 21, 2016
  3. laanwj commented at 2:23 AM on September 22, 2016: member

    Where did you set the language?

    I don't think the problem here is that that string, or others in qt/bitcoin.cpp is untranslated. It appears in the ts files.

    However the startup of bitcoind, and even more the GUI is a complex multi-stage process with settings that are fetched from different sources at different times. Before locating the data directory (which is very early) it may not have found your language setting yet.

  4. laanwj commented at 2:26 AM on September 22, 2016: member

    E.g. qt/bitcoin-qt -lang=cz -datadir=/tmp/a2 gives me a warning in English that the datadir does not exist.

    Oh, -lang, yes that should have been picked up by then. Weird.

  5. paveljanik commented at 5:23 AM on September 22, 2016: contributor

    Czech language is code cs, not cz.

  6. MarcoFalke commented at 8:56 AM on September 22, 2016: member

    I tried different language codes, all failed. Could someone try really quick with qt/bitcoin-qt -lang=fr -datadir=/tmp/a2

    It appears in the ts files.

    But when you change the string, it is no longer picked up by xgettext?

  7. laanwj commented at 9:01 AM on September 22, 2016: member

    But when you change the string, it is no longer picked up by xgettext?

    I'm not sure what exact steps you're using, but xgettext does nothing with the qt files, it's only used to read strings from the core for bitcoinstrings.cpp to be picked up by qt's tools. Do you do make translate?

  8. MarcoFalke commented at 10:20 AM on September 22, 2016: member

    @laanwj What I mean is that locale/bitcoin_en.ts is not updated on make translate, it seems:

    git checkout bitcoin/master && cd src/ && make translate && git commit -a -m "bump translations" && git apply < /tmp/patch-1 && make translate && git diff -U1
    

    gives only this (the cpp change is from /tmp/patch-1, the ts change is from make translate)

    diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
    index 430e6dd..c6e249a 100644
    --- a/src/qt/bitcoin.cpp
    +++ b/src/qt/bitcoin.cpp
    @@ -588,3 +588,3 @@ int main(int argc, char *argv[])
             QMessageBox::critical(0, QObject::tr(PACKAGE_NAME),
    -                              QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"])));
    +                              QObject::tr("Error: Data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"])));
             return 1;
    diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
    index 444e35d..fa38770 100644
    --- a/src/qt/guiutil.cpp
    +++ b/src/qt/guiutil.cpp
    @@ -134,3 +134,3 @@ void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
         // and this is the only place, where this address is supplied.
    -    widget->setPlaceholderText(QObject::tr("Enter a Bitcoin address (e.g. %1)").arg(
    +    widget->setPlaceholderText(QObject::tr("Enter address (e.g. %1)").arg(
             QString::fromStdString(DummyAddress(Params()))));
    diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts
    index 2dce780..490de2d 100644
    --- a/src/qt/locale/bitcoin_en.ts
    +++ b/src/qt/locale/bitcoin_en.ts
    @@ -1705,3 +1705,3 @@
             <location filename="../guiutil.cpp" line="+135"/>
    -        <source>Enter a Bitcoin address (e.g. %1)</source>
    +        <source>Enter address (e.g. %1)</source>
             <translation type="unfinished"></translation>
    

    Maybe this is expected, but I don't understand either why the existing translations (e.g. fr, de, ...) of those strings are not picked up.

  9. laanwj commented at 11:38 AM on September 25, 2016: member

    Maybe this is expected, but I don't understand either why the existing translations (e.g. fr, de, ...) of those strings are not picked up.

    Translations in Qt have a 'context' which needs to match as well as the string, for the translation to appear. This may be what is throwing you off track.

  10. MarcoFalke commented at 3:03 PM on October 9, 2016: member

    Possibly related: #8900

  11. fanquake commented at 9:56 AM on October 13, 2016: member

    Should be fixed by #8911

  12. fanquake closed this on Oct 13, 2016

  13. MarcoFalke commented at 11:42 AM on January 2, 2017: member

    Reopening.

    The regression was never fixed.

  14. MarcoFalke reopened this on Jan 2, 2017

  15. laanwj commented at 12:47 PM on January 2, 2017: member

    Are you sure? This wasn't fixed by #8911?

    Which ones specifically are you missing? The wallet ones are in there, at least:

    src/qt/addressbookpage.cpp:        case SendingTab: setWindowTitle(tr("Choose the address to send coins to")); break;
    src/qt/locale/bitcoin_en.ts:        <source>Choose the address to send coins to</source>
    
  16. MarcoFalke commented at 2:31 PM on January 2, 2017: member

    Two examples:

    $ git grep 'Specified data directory' src/qt/|grep 'does not exist'
    src/qt/bitcoin.cpp:                              QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(GetArg("-datadir", ""))));
    
    $ git grep 'This is a pre-release test build' src|grep -v 'src/qt/locale/'
    src/warnings.cpp:        strStatusBar = "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications";
    src/warnings.cpp:        strGUI = _("This is a pre-release test build - use at your own risk - do not use for mining or merchant applications");
    

    See #9457 for a possible fix

  17. MarcoFalke added this to the milestone 0.14.0 on Jan 3, 2017
  18. laanwj closed this on Jan 4, 2017

  19. MarcoFalke locked this on Sep 8, 2021

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-13 18:15 UTC

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