Updated paragraph checker messages
authorThierry Florac <thierry.florac@onf.fr>
Fri, 09 Feb 2018 17:48:14 +0100
changeset 391 6cd4434612f5
parent 390 beac02490657
child 392 8fc847d83992
Updated paragraph checker messages
src/pyams_content/shared/imagemap/paragraph.py
--- a/src/pyams_content/shared/imagemap/paragraph.py	Fri Feb 09 16:53:00 2018 +0100
+++ b/src/pyams_content/shared/imagemap/paragraph.py	Fri Feb 09 17:48:14 2018 +0100
@@ -79,20 +79,22 @@
                     output.append(translate(MISSING_LANG_VALUE).format(field=field_title, lang=lang))
         field_title = translate(IImageMapParagraph['reference'].title)
         if not self.context.reference:
-            output.append(translate(ERROR_VALUE).format(field=field_title,
-                                                        message=translate(_("internal reference is not defined"))))
+            output.append(translate(ERROR_VALUE).format(
+                field=field_title,
+                message=translate(_("no selected image map"))))
         else:
             target = self.context.get_target()
             if target is None:
-                output.append(translate(ERROR_VALUE).format(field=field_title,
-                                                            message=translate(_("internal reference target can't be "
-                                                                                "found"))))
+                output.append(translate(ERROR_VALUE).format(
+                    field=field_title,
+                    message=translate(_("image map '{0}' can't be found")).reference(self.context.reference)))
             else:
                 workflow = IWorkflow(target, None)
                 if workflow is not None:
                     workflow_state = IWorkflowState(target)
                     if workflow_state.state not in workflow.published_states:
-                        output.append(translate(ERROR_VALUE).format(field=field_title,
-                                                                    message=translate(_("internal reference target "
-                                                                                        "is not published"))))
+                        output.append(translate(ERROR_VALUE).format(
+                            field=field_title,
+                            message=translate(_("image map '{0}' is not published")).format(
+                                II18n(target).query_attribute('title', request=request))))
         return output