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 85bdf99 commit 4253d38
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;
}

0 comments on commit 4253d38

Please sign in to comment.