Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64416

Allow user of QTranslator::load(...) to know file that was actually selected and loaded for translation

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • None
    • Core: Locales (i18n)
    • None

      Would it be possible to have a getter to return the filename that

      (bool) QTranslator::load(const QLocale &locale, const QString &filename, const QString &prefix = QString(), const QString &directory = QString(), const QString &suffix = QString())

      or more specifically

      (bool) QTranslatorPrivate::do_load(const QString &realname, const QString &directory)
      

      in qtbase.git/tree/src/corelib/kernel/qtranslator.cpp actually uses - I am I18ning a project that will not have a full set of translations available immediately and for debugging purposes (at least) I think it would be useful to be able to determine exactly which file (including an internal resource in some situations) the public QTranslator::load(...) methods use, especially when the version taking a

      const QLocale &

      as the first argument is used.

      It looks as though it ought to be possible to catch and store the (QString) QFile::fileName() that was successfully loaded in that do_load method...

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            buddenha Oswald Buddenhagen
            slysven Stephen Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes