Skip to content

Commit

Permalink
Fix untranslatable authentication string, use service name when host …
Browse files Browse the repository at this point in the history
…is missing
  • Loading branch information
nirvn committed Nov 10, 2024
1 parent 978b1fe commit a53996b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/core/qfieldappauthrequesthandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,14 @@ QString QFieldAppAuthRequestHandler::getCredentialTitle( const QString &realm )
if ( uri.database().isEmpty() )
return realm;

return "Please enter credentials for database <b>" + uri.database() + "</b> at host <b>" + uri.host() + ".</b>";
QString title = tr( "Please enter credentials for database" ) + QStringLiteral( " <b>%1</b> " ).arg( uri.database() );
if ( !uri.host().isEmpty() )
{
title += tr( "at host" ) + QStringLiteral( " <b>%1</b> " ).arg( uri.host() );
}
else if ( !uri.service().isEmpty() )
{
title += tr( "at service" ) + QStringLiteral( " <b>%1</b> " ).arg( uri.service() );
}
return title;
}

1 comment on commit a53996b

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.