OJS 3.0.2 Submission's Artwork components: unit system


I am testing the submission system on our freshly upgraded OJS 3.0.2 system.
At the submission stage, authors have the possibility of uploading submission files, for which they have to select the kind of component matching their files.
Among the available component types that we have customized (Settings > Workflow > Components), we allow to upload “Artworks”.
When uploading their files as Artwork, authors can add metadata to the uploaded file, with many more possibilities than when uploading a regular “document” type component. (which is a great feature)
For instance, the system automatically recognizes the pixel size of the artwork, no matter what the format, but also the printable size at 300 DPI/PPI. (which is a great feature by the way! I suggest it is extended to the “document” component type, for word count for instance!).
Pitty that this printing size is provided by OJS in US customary units (ie. in inches), and that the rest of the world uses the International System of Units, which is metric. I could find no place where I could set up the unit system of our installation.
The place where this is happening is (found in locale/en_US/common.xml and in templates/controllers/wizard/fileUpload/form/uploadedFileSummary.tpl)

message key=“common.dimensionsInches”

Where could I customize this to provide an output say in Centimeters or Millimeters?
Thank you

Hi @afisher,

We’re based in Canada, which also uses the metric system – but lamentably certain large neighbouring countries of ours have forced us to remain Imperial in certain fields, and this is a reflection of that.

We don’t use DPI in calculations that wouldn’t be equally applicable to centimeters, so you should be able to convert over to metric by simply changing the locale keys that refer to Imperial units. I agree that a selectable metric would be the best solution, but for the moment it’s a low priority – if it’s something you’re willing to tackle I’d be more than happy to review a pull request.

Feel free to post your changes e.g. on Github so that other interested users can make use of it!

Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thank you for your explanation and encouragements.
Here is the fix, I don’t know how to post my changes on Github (and don’t really want to, as I’m not a developper, and will probably stop pulling codes once my installation satisfies my needs).
You have to change file templates/controllers/wizard/fileUpload/form/uploadedFileSummary.tpl (this file may have been moved to lib/pkp/templates/controllers/wizard/fileUpload/form/uploadedFileSummary.tpl during installation), where there is a string stating:

			<span class="print">
				{translate key="common.dimensionsInches" width=$submissionFile->getPhysicalWidth(300) height=$submissionFile->getPhysicalHeight(300) dpi=300}

Change the value (300) to (118) [but keep ‘dpi=300’] should make the trick.
However, you also have to change the units from "(called by &Prime) to cm in file locale/en_US/common.xml, at string 127 (and any other local/{your locale(s)}/common.xml):

<message key="common.dimensionsInches"><![CDATA[{$width}&Prime;&times;{$height}&Prime; at {$dpi} DPI/PPI]]></message>

Which would become (pay attention to the deleted semi-colons too and added non-breaking spaces nbsp for a cleaner output!):

<message key="common.dimensionsInches"><![CDATA[{$width}cm&nbsp;&times;&nbsp;{$height}cm at {$dpi} DPI/PPI]]></message>

Obviously, a much cleaner solution would involve changing the message key to common.dimensionsCentimeters in all occurrences throughout OJS, but I avoided that by keen ignorance.
As far as i’m concerned, this is satisfying.


1 Like