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

QTranslator::load returns false for empty translation-files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.12.0 Alpha
    • 5.0.2, 5.1.0 , 5.4.1
    • Core: Locales (i18n)
    • None
    • QtBase 5.1 (stable branch)
      QtTools 5.0.2
    • 9146432dc66d41f22548bbb425b61458d241d28e

    Description

      Change https://codereview.qt-project.org/21710 introduced a behavioral change in QTranslator.
      If you have a valid .qm-file with no translations QTranslator::load now returns false. Before it would return true.
      It now checks if the filesize is <= the size of the magic header.

      It is probably a good thing to not load it, because you have to check less QTranslator objects for a matching context, but it would be nice to be able to see if a translation couldn't be found.

      Perhaps an extra check if the filesize is equal to the size of the magic buffer, which then returns true?
      Although it could be a bit strange to have a load() function return true when it hasn't loaded anything.

      edit:
      Some of the .qm-file are 16 bytes and some are 23 bytes in size.
      The files with 23 bytes don't get loaded either.
      They contain the following additional data: 88 - 00 00 00 02 - 01 01
      which is of type "NumerusRules"

      Attachments

        Issue Links

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

          Activity

            People

              kkohne Kai Köhne
              mkrems Marcel Krems
              Votes:
              4 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes