Bug report #20561

.qgs translation: ts-file empty

Added by David Signer over 1 year ago. Updated over 1 year ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Project Loading/Saving
Affected QGIS version:3.5(master) Regression?:Yes
Operating System:Linux and Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:28381

Description

If there is a TS-File created, the only content is:

<!DOCTYPE TS>
<TS sourcelanguage="en_US"/>

It's because the translatable object cannot be collected. This connection is never set up.

if ( QgsApplication::instance() )
connect( QgsApplication::instance(), &QgsApplication::requestForTranslatableObjects, this, &QgsProject::registerTranslatableObjects );

Seems, like it cannot get an instance of the QgsApplication. Possible QgsProject is created before the QgsApplication, what it hasn't before?

Associated revisions

Revision f3943f58
Added by David Signer over 1 year ago

do not write logs before QgsApplication instace

because otherwise it creates a QgsProject without a QgsApplication
and translation won't work anymore because it cannot connect the signal to the slot

this fixes #20561

Revision d3d5d7e5
Added by David Signer over 1 year ago

do not write logs before QgsApplication instace

because otherwise it creates a QgsProject without a QgsApplication
and translation won't work anymore because it cannot connect the signal to the slot

this fixes #20561

(partly copied from 8e7d37e37a035d7300663205ba9587f542f30732)

History

#1 Updated by David Signer over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF