PKP Bugzilla – Bug 4645
ABNT citation has location hardcoded
Last modified: 2012-06-28 09:43:36 PDT
I thought this came up before and was already fixed, but all I can find is bug 3837; and this is still an issue in CVS. The ABNT citation format has the location "North America" hardcoded to appear regardless; a citation will always look like Jaik T.. Stetistical approaches for Development. International Stetistical Journal, North America, 14, mar. 2009. Available at: http:myserver.com/journal/J2. Date accessed: 17 Aug. 2009. Should the location be either removed; changed to be dynamically set; or hand-set in the locale file by the JM? The latter is really a workaround only, and would have to be done for each supported locale file (and a hassle to maintain. I've CC'd Ramon as he's provided assistance for this citation type in the past. Ramon, any comments? (Courtesy of http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=4861&p=18942#p18942)
Maybe a locale key in the ABNT citation format plugin's locale file would be the best place -- it would be nice to have a setup field for this, but that's hard to justify just for ABNT. We could also add a plugin settings form specifically for ABNT. In any case, I think it's too late for 2.3.
(In reply to comment #1) > Maybe a locale key in the ABNT citation format plugin's locale file would be > the best place -- it would be nice to have a setup field for this, but that's > hard to justify just for ABNT. We could also add a plugin settings form > specifically for ABNT. In any case, I think it's too late for 2.3. Sounds good, deferring.
Assigning this to 2.3.1 as we've had another request (http://pkp.sfu.ca/support/forum/viewtopic.php?f=3&t=5598&p=21237#p21237). Any thoughts, perhaps especially from Florian wrt upcoming citation/metadata updates?
I commented directly in the forum, see http://pkp.sfu.ca/support/forum/viewtopic.php?f=3&t=5598&p=21237#p21339
Got a request about this bug on #pkp today. Same problem.
Rescheduling -- this depends on the internal metadata work.
I think that now that I'm on OMP it makes sense to fix that one with a simple translation string. Otherwise we'd have to wait for implementation of #5156. It's such a small change. Needs a translation string so it can only be fixed in 2.3.4. I missed that one for 2.3.3 because it appeared in 2.x. Sorry for that. :-( I've scheduled this to the 2.3.x line now.
Created attachment 3806 [details] ABNT plugin improvements Hi, We at Lepidus Tecnologia have updated the ABNT citation format plugin in order to make it more standard compliant, and we're giving the changes back to PKP. We're open to any comments/suggestions to improve this patch and have it included in the next OJS release. Note: this patch was created on top of ojs-stable-2_3 branch. The changes we've made are: * Removed the location translation string. * Settings page to change the journal's location. * Per journal location setting. * Internationalized location. In case a journal's location is not defined in some language, the journal's location in the default language is used. * If no location is defined, it is used "[S.l.]" (ABNT standard says so). * Issue volume and number are shown only if enabled in "Issue identification" setting. * English and Portuguese translations to the ABNT plugin settings page. ABNT related changes: * Issue volume prefixed with "v." * Issue number prefixed with "n." * Included page number, prefixed with "p." (eg. "p. 10-12") * Journal ISSN after date. * Journal DOI at the end of the citation, if exists. * Author names separated by ";" * Author names are not abbreviated * When there are more than three authors, only the first author's name is included followed by "et al." * Fixed a bug with accented chars in surname. Using mb_strtoupper() instead of strtoupper() to convert surnames to uppercase.
Giovani, thanks for your contribution. I'm scheduling it against the next release of OJS for consideration. A few points for consideration: - The modification appears to depend on mb_... string-manipulation functions; those aren't always available. It would be better to use String::strtoupper. - There appear to be some missing |escape modifiers e.g. for author name parts: {$author->getFirstName()} should be {$author->getFirstName()|escape} to avoid XSS risks. (This looks like it was already a flaw but worth fixing at the same time.) - Some of the existing code headers have their copyrights reassigned; those should stay (c) 2003-2012 John Willinsky. - The newly added code is (c) 2012 Lepidus Tecnologia. We are in the process of forming a legal PKP entity, and when that is finished, we would like to transfer all copyrights to that. (It will remain GPL-licensed FOSS and non-commercial in the same senses that it is today.) To avoid complicating the transfer we would like to keep the copyrights consistent. Would it be OK to (c) 2003-2012 John Willinsky for the new code? We would be happy to add a "contributed by" line to the code header just below the copyright to credit your group.
Created attachment 3807 [details] ABNT plugin improvements Thanks for the feedback, Alec. Here is a patch with changes based on the comments. Some comments: - We depended on mb_... string-manipulation function because it is commonplace in Brazil to people have accented chars in their surname. Thus, strtoupper does not suffice. Look at this examples: php5 -r 'echo mb_strtoupper("Luís Vaz de Camões\n");' LUÍS VAZ DE CAMÕES php5 -r 'echo strtoupper("Luís Vaz de Camões\n");' LUíS VAZ DE CAMõES Note how the "í" and "õ" are not converted to uppercase. As a workaround, I've added a fall back to strtoupper() if mb_strtoupper() is not available. Does this solve the problem? - We included the |escape modifier in all places that didn't have it. At the author first name (which was already missing), and in some code that we included (regarding DOI, location, pages). - No problem regarding the copyright. We replaced our copyright by a "Contributed by" entry as suggested. Feel free to adjust these "Contributed by" entries to your needs. We reassigned the copyright of all files that were changed to "(c) 2003-2012 John Willinsky", hope we didn't miss any.
Hi Giovani, Alec will probably have more to say here, but I just wanted to clarify what he meant when he suggested that you use the strtoupper() function. He's referring to the core String class that is included with OJS, not the standard PHP function. So, use String::strtoupper() instead of strtoupper(). The OJS class includes mb_ functionality automatically if it is enabled on the server. The class is located in lib/pkp/classes/core/String.inc.php Regards, Jason
Created attachment 3808 [details] ABNT plugin improvements I see, Jason. Thanks. I didn't know about this String class in OJS. I changed the patch to register this function in smarty instead of mb_strtoupper.
Giovani, thanks for contributing and also for being so accommodating! I've committed these to our master branch with just a few tweaks (almost all in code documentation). For the two modified files, I changed "Contributed By" to "With Contributions From"; otherwise the contribution line is as you provided. This will be released with OJS 2.4.0 late in the summer.
ABNT location contributions by Lepidus Tecnologia https://github.com/pkp/ojs/commit/09078ebb40bd94e5da5a57a30eddd2174bcae943
You're welcome, Alec. We, here at Lepidus, are happy to have contributed. We're going to tell the news to OJS users here in Brazil.