🚧 This instance is under construction; expect occasional downtime. Runners available in /repos. Questions? Ask in #wikimedia-gitlab on libera.chat, or under GitLab on Phabricator.

Unverified Commit 271b46a5 authored by Samwilson's avatar Samwilson Committed by GitHub
Browse files

Merge pull request #27 from samwilson/image-not-found

Fix typo in error message (and make it translatable)
parents 22ea66eb 7b0e666f
......@@ -7,6 +7,7 @@
"diagrams-extensionname": "Diagrams",
"diagrams-desc": "Render Graphviz, Mscgen, and PlantUML diagrams in wiki pages.",
"diagrams-error-no-response": "Diagrams error: no response received from remote service.",
"diagrams-error-image-not-found": "Image not found: $1",
"diagrams-error-returned-0": "Diagrams service error:",
"diagrams-error-bad-format": "Diagrams service error: format '$1' was not returned.",
"diagrams-error-generic": "Diagrams error (with $1 command):"
......
......@@ -7,6 +7,7 @@
"diagrams-extensionname": "{{name}}",
"diagrams-desc": "{{desc|name=Diagrams|url=https://www.mediawiki.org/wiki/Extension:Diagrams}}",
"diagrams-error-no-response": "Error message displayed when no response is received from the web service.",
"diagrams-error-image-not-found": "Error message displayed in DOT graphs when an image could not be found on the wiki. $1 is the image name.",
"diagrams-error-returned-0": "Error message label for errors returned by the web service.",
"diagrams-error-bad-format": "Error message label for when the web service doesn't return the requested format.",
"diagrams-error-generic": "Error message label for errors that don't have a more specific message. $1 is the command name."
......
......@@ -50,7 +50,8 @@ class Dot {
$imageName = trim( $matches[1], '"' );
$file = MediaWikiServices::getInstance()->getRepoGroup()->findFile( $imageName );
if ( !$file || !$file->exists() ) {
return "label=\"Diagrams error: mage not found: $imageName\"";
$msg = wfMessage( 'diagrams-error-image-not-found', $imageName );
return 'label="' . str_replace( '"', '\"', $msg ) . '", fontcolor="red"';
}
/*
// Create a new tmp file to save the thumbnail to.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment