Bug 5816 - language settings for submissions
language settings for submissions
Status: NEW
Product: OCS
Classification: Unclassified
Component: General
3.0
PC Windows 7
: P5 enhancement
Assigned To: PKP Support
: 4144 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-26 05:03 PDT by Bozana Bokan
Modified: 2012-09-21 15:59 PDT (History)
3 users (show)

See Also:
Version Reported In:
Also Affects:


Attachments
Patch against OJS pre-2.3.3 (36.19 KB, patch)
2010-08-26 18:49 PDT, Alec Smecher
Details | Diff
Additional patch against OJS pre-2.3.3 (2.58 KB, patch)
2010-09-17 15:31 PDT, Alec Smecher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bozana Bokan 2010-08-26 05:03:58 PDT
Language settings for submissions and forms are not functioning properly: no matter what are the settings for submissions, the settings for forms are considered and the result is the same.
 
For example:
Primary language is English.

1.  German is selected for forms:
Then the result is the same for both settings for submissions
a. German is selected for submissions,
b. German is not selected for submissions
In both cases there is the language pull-down in all forms (also in the submission forms in case b.) and all forms can not be saved if there is no data (filled in) in English.

2.  German is not selected for forms:
Then the result is the same for both settings for submissions
a. German is selected for submissions
b. German not selected for submissions
In both cases there is no language pull-down in any form (also not in the submission forms in case a.) and everything (filled in) is accepted (both for submission and other forms) and saved in/as English.

In general, the language settings for forms function like this:
If a language is selected for forms, there is the language pull-down in the forms and the form has to contain data (filled in) in the primary language.
If a language in not selected for forms, there is no language pull-down in the forms and the data (filled in) is always (also using this language in UI) accepted and saved in/as the primary language.

Either the language settings for submissions is considered totally separately from settings for forms (and would in this case behave like settings for forms in general, described above /* and 'submissions' means in this case author submissions, so that editors can change and correct the submission metadata later */) or at least the example 1b. should be considered differently (in order to avoid the problems that authors have when the error message appears and they are asked to fill the data in the primary language).

Regards,
Bozana
Comment 1 Alec Smecher 2010-08-26 18:49:20 PDT
Created attachment 3198 [details]
Patch against OJS pre-2.3.3

Completed separation of form locales from submission locales. (I thought I'd already finished this, but must've dreamed it.)
Comment 2 Alec Smecher 2010-08-26 18:49:59 PDT
Commit for PKP lib: http://github.com/pkp/pkp-lib/commit/c3f2c3edf57c6508ae5c57b908ebbdce386f8e3d

Needs porting to OCS and OMP.
Comment 3 bdgregg 2010-08-30 10:47:36 PDT
Alec,

Using this patch against 2.3.2-1 gave us the output below in a "dry-run", we have a couple of journals that are coming online and are now accepting submissions in various languages other than English and are very anxious to have the submission forms working just right.  Any idea when this patch will be included in a release? As this is a fairly large patch and obviously needs to be hand reviewed on our system pretty heavily is it ok to apply on a 2.3.2-1 system?  I also had to also remove the following lines to get the patch to fully work as "patch" reported it could not patch the directory /lib/pkp.  Please let me know.

<!-- BEGIN -->
diff --git a/lib/pkp b/lib/pkp
index bd9c2f1..c3f2c3e 160000
--- a/lib/pkp
+++ b/lib/pkp
@@ -1 +1 @@
-Subproject commit bd9c2f1aacdb55367d729e2034ca0e9e36380c9e
+Subproject commit c3f2c3edf57c6508ae5c57b908ebbdce386f8e3d
<!-- END -->

Thanks,
Brian Gregg


# /usr/local/bin/patch -p1 --dry-run < /usr/local/journals/OJS-PATCHES/5816.patch 
patching file classes/author/form/submit/AuthorSubmitForm.inc.php
patching file classes/author/form/submit/AuthorSubmitStep1Form.inc.php
Hunk #1 succeeded at 22 (offset 2 lines).
patching file classes/author/form/submit/AuthorSubmitStep2Form.inc.php
patching file classes/author/form/submit/AuthorSubmitStep3Form.inc.php
Hunk #1 FAILED at 20.
Hunk #2 succeeded at 120 (offset 1 line).
1 out of 2 hunks FAILED -- saving rejects to file classes/author/form/submit/AuthorSubmitStep3Form.inc.php.rej
patching file classes/author/form/submit/AuthorSubmitStep4Form.inc.php
patching file classes/author/form/submit/AuthorSubmitStep5Form.inc.php
patching file classes/author/form/submit/AuthorSubmitSuppFileForm.inc.php
Hunk #1 FAILED at 33.
1 out of 2 hunks FAILED -- saving rejects to file classes/author/form/submit/AuthorSubmitSuppFileForm.inc.php.rej
patching file classes/submission/common/Action.inc.php
Hunk #1 FAILED at 54.
Hunk #2 FAILED at 76.
2 out of 2 hunks FAILED -- saving rejects to file classes/submission/common/Action.inc.php.rej
patching file classes/submission/form/MetadataForm.inc.php
Hunk #1 succeeded at 33 (offset 2 lines).
Hunk #2 succeeded at 68 with fuzz 2 (offset 2 lines).
patching file classes/submission/form/SuppFileForm.inc.php
patching file pages/author/SubmitHandler.inc.php
Hunk #2 succeeded at 44 with fuzz 2.
Hunk #3 succeeded at 59 with fuzz 2 (offset -1 lines).
Hunk #4 succeeded at 69 with fuzz 2 (offset -1 lines).
Hunk #5 succeeded at 77 (offset -1 lines).
Hunk #6 succeeded at 109 (offset -1 lines).
Hunk #7 succeeded at 143 (offset -1 lines).
Hunk #8 FAILED at 170.
Hunk #9 succeeded at 186 (offset -5 lines).
Hunk #10 FAILED at 197.
Hunk #11 FAILED at 217.
Hunk #12 FAILED at 241.
4 out of 12 hunks FAILED -- saving rejects to file pages/author/SubmitHandler.inc.php.rej
patching file pages/author/TrackSubmissionHandler.inc.php
Hunk #2 succeeded at 203 with fuzz 2.
Hunk #4 succeeded at 340 with fuzz 1.
patching file pages/copyeditor/SubmissionCopyeditHandler.inc.php
Hunk #1 FAILED at 249.
1 out of 1 hunk FAILED -- saving rejects to file pages/copyeditor/SubmissionCopyeditHandler.inc.php.rej
patching file pages/layoutEditor/SubmissionLayoutHandler.inc.php
Hunk #2 succeeded at 115 with fuzz 1.
Hunk #3 FAILED at 132.
Hunk #4 succeeded at 357 (offset -3 lines).
Hunk #5 succeeded at 371 with fuzz 2 (offset -3 lines).
Hunk #6 succeeded at 379 (offset -3 lines).
Hunk #7 FAILED at 399.
Hunk #8 FAILED at 424.
3 out of 8 hunks FAILED -- saving rejects to file pages/layoutEditor/SubmissionLayoutHandler.inc.php.rej
patching file pages/proofreader/SubmissionProofreadHandler.inc.php
patching file pages/reviewer/SubmissionReviewHandler.inc.php
patching file pages/sectionEditor/SubmissionEditHandler.inc.php
Hunk #1 succeeded at 821 with fuzz 1 (offset -19 lines).
Hunk #2 FAILED at 1216.
Hunk #3 FAILED at 1240.
Hunk #4 FAILED at 1285.
Hunk #5 FAILED at 1309.
Hunk #6 succeeded at 1413 (offset -23 lines).
Hunk #7 succeeded at 1422 (offset -23 lines).
Hunk #8 FAILED at 1746.
5 out of 8 hunks FAILED -- saving rejects to file pages/sectionEditor/SubmissionEditHandler.inc.php.rej
Comment 4 Alec Smecher 2010-08-30 12:14:48 PDT
Brian, this will be difficult to back-port to previous versions. Fortunately we're just working on final testing and translation of OJS 2.3.3 and these changes will be released in that version. I'd suggest waiting until it's available sometime in September; if you're able to help testing the pre-release code, that would be very helpful.
Comment 5 Alec Smecher 2010-08-30 12:15:43 PDT
See bug #5830 for a fix to attachment #3198 [details].
Comment 6 bdgregg 2010-08-30 12:53:47 PDT
Alec,

We are very willing to do some testing here on at least one our test instance since we have roughly 6 journals with multiple languages setup.  And we have one that is VERY anxious to move along with getting this fixed.  Each of our journals is setup in a separate installation of OJS so that we can do code upgrades/updates/patches/hacks/etc. per journal separately.  This allows us to throw new ones up quickly as well.  Apache Virtual hosts help us a lot. ;-)

I did see some code changes in the patch that are not in the stock 2.3.1.2 so I wasn't too optimistic about the existing patch working out of the box.  And after some testing it actually doesn't ;-) so I'll be rolling back the code here in a few minutes.

Let us know about testing the code for you.

Thanks,
Brian Gregg.
Comment 7 Alec Smecher 2010-08-30 13:03:46 PDT
Excellent, Brian. If you're handy with Git, there are instructions for checking out a fresh copy at http://pkp.sfu.ca/wiki/index.php/HOW-TO_check_out_PKP_applications_from_git -- this is the best way to work with pre-release code as it'll be easy for you to update your install with any code that changes as a result of this discussion.

We're very interested in getting these changes right, and are working on it right now, so if you have a chance to get us feedback in the next few days (!!) it would be very timely.

Thanks!
Comment 8 bdgregg 2010-08-30 13:34:11 PDT
Alex,

I'm not personally very familiar with git, but using git and your instructions, I have "cloned" my forked copy of ojs to our server here.  I'll look about getting it tested here sometime soon if possible.  There is a little overhead needed to get a new DNS CNAME added to the machine through our network group here.  Once added I should be able to bring a 'git' copy up and running quickly so that we can, so to say,  'git-r-done'.  ;-)

If we are not able to test it and let you know ASAP, I'll let you know.

Thanks,
Brian Gregg.
Comment 9 bdgregg 2010-08-31 08:15:35 PDT
Alec,

After some quick testing we found that in step #3 of a author submission, that the systems still wants Titles and Abstracts in English (which is the Primary Language) on the site, however the author has chosen French.  So I guess the system is insisting on making sure that there is a "copy" in English.  Is there a way to allow submission without forcing the system to have a "Primary Language" "copy"?  In one of our journals they wish to allow submission in French or English so both are considered "Primary Languages".

Also, we noticed that by default the "Indexing" also was defaulting to "en" instead of using the author's chosen language "fr".  Is there a way for that to be selected automatically per the author submission as well as obviously if they are using the French form they most likely are entering French metadata, thus switching the indexing to French makes sense.

Thoughts?

Anything else we should know or if we need to make some system changes to get the above to work, let me know.

Thanks,
Brian Gregg.
Comment 10 Alec Smecher 2010-08-31 09:36:25 PDT
Brian, (and Bozana, of course), thanks for the effort you're putting into this -- I'll have time today and tomorrow to refine it further and appreciate your help with testing and suggestions.

Brian, check your journal's language settings and see what you've allowed under "Submissions" -- those are the languages from which the author can choose a submission language at the beginning of the submission process. Once that language is chosen, they are required to enter necessary fields (e.g. Title) in that language, though others may also optionally be supplied too.

I've corrected the language field's default to use the locale specified at the beginning of the submission process; in a future release we should consider removing that field entirely in favour of the value chosen from the pull-down, but I'd rather not introduce that change so late in the testing process for this release.
Comment 11 bdgregg 2010-08-31 09:51:51 PDT
Alec,

I checked on our Journal's Language Settings, and under Home->User->Journal Management-> Languages we have set the following:

Primary Locale: English
Supported Locales
English   UI(checked) Submissions(checked) Forms(checked)
Francais  UI(checked) Submissions(checked) Forms(checked)

So what I think should happen is that by default the web site should be in English, then upon selection of the user it can be shown/used in French.

It should also then allow either submissions in English OR French with no requirement for English needed (which is currently not the case).  This could be desired in some journals but not others as I can see some journals requiring an English or other language version regardless.  But the selection should be a setup choice for the journal.

I feel that there should be a "Required" check box under supported locales for the "Submissions" for each language (to require a submission in that language) in addition to there also being an option to be able to submit under "Any" language meaning at least one the selected languages must be used.  

I hope this helps.

Brian.
Comment 12 Alec Smecher 2010-08-31 10:02:40 PDT
Brian, what you describe in comment #11 is how things should currently function -- on Step 1 you can choose a submission locale from a pull-down (i.e. English or French), regardless of the current UI language. That should define the "required" language for fields like "title". If it's not working that way, could you check the "locale" field of the "articles" table for that submission and tell me what it is? Also make sure your git checkout is current, i.e. run "git pull official master" in both the OJS directory and the lib/pkp subdirectory. (You may need to also run "php tools/upgrade.php upgrade" after running the git update.)
Comment 13 bdgregg 2010-08-31 13:59:39 PDT
(In reply to comment #12)
> Brian, what you describe in comment #11 is how things should currently function
> -- on Step 1 you can choose a submission locale from a pull-down (i.e. English
> or French), regardless of the current UI language. That should define the
> "required" language for fields like "title". If it's not working that way,
> could you check the "locale" field of the "articles" table for that submission
> and tell me what it is? Also make sure your git checkout is current, i.e. run
> "git pull official master" in both the OJS directory and the lib/pkp
> subdirectory. (You may need to also run "php tools/upgrade.php upgrade" after
> running the git update.)

Alec,

Newest code download seems to have fixed the issue with author submission, however, note that while in step#3 submitting the "Browse" button was only in English, while the "Upload" button was in the chosen language (in our case French).  Also there was one additional text on Step#1 that wasn't defined: ##author.submit.submissionLocale## 

I hope this helps.  Let me know if you have any other questions.

Thanks,
Brian Gregg.
Comment 14 Alec Smecher 2010-08-31 14:07:19 PDT
Thanks, Brian. The missing locale key is OK -- we're currently waiting on French language updates -- and the "Browse" button's label is fixed by the browser, unless we go to something like a Flash-based file upload widget. Glad to hear it's working OK otherwise. One tweak I will make: the form language pulldown will default to the locale chosen on the first submission step.
Comment 15 Alec Smecher 2010-09-17 15:31:18 PDT
Created attachment 3223 [details]
Additional patch against OJS pre-2.3.3

Improved default selection for the form locale. Brian and Bozana, would you be able to run this through a final test to see if it'll be less confusing for authors etc.? I'll do some testing here as well.
Comment 16 bdgregg 2010-09-19 18:28:35 PDT
(In reply to comment #15)
> Created attachment 3223 [details]
> Additional patch against OJS pre-2.3.3
> 
> Improved default selection for the form locale. Brian and Bozana, would you be
> able to run this through a final test to see if it'll be less confusing for
> authors etc.? I'll do some testing here as well.

Alec,

I'll give a look when I get back to the office Tuesday or Wednesday.
Thanks,
Brian.
Comment 17 bdgregg 2010-09-21 07:54:53 PDT
(In reply to comment #16)
> (In reply to comment #15)
> > Created attachment 3223 [details] [details]
> > Additional patch against OJS pre-2.3.3
> > 
> > Improved default selection for the form locale. Brian and Bozana, would you be
> > able to run this through a final test to see if it'll be less confusing for
> > authors etc.? I'll do some testing here as well.
> 
> Alec,
> 
> I'll give a look when I get back to the office Tuesday or Wednesday.
> Thanks,
> Brian.

Alec,

This should be applied to like a 2.3.1.2 system and not a GIT version correct?

Let me know,
Thanks,
Brian.
Comment 18 Alec Smecher 2010-09-21 11:49:10 PDT
Brian, this would be a current git checkout -- the 2.3.2 version is sufficiently far behind that it'd be difficult to bring it up to date with patches.
Comment 19 bdgregg 2010-09-21 12:50:57 PDT
Alec,

It seems to be working as expected.  We ran through a submission and languages stuck where they were supposed to and when switching between languages the content changed as well.

Hope this helps.
Brian.
Comment 20 Alec Smecher 2010-09-21 15:20:13 PDT
Excellent -- thanks for all the help, Brian and Bozana. Leaving open for back-porting to other apps. (Note also bug #5907.)
Comment 21 James MacGregor 2011-10-31 10:51:54 PDT
Is Bug 4144 effectively a dupe of this one? We haven't yet ported over the "submissions" multilingual distinction to OCS (or probably OMP) yet, IIRC.
Comment 22 Alec Smecher 2011-10-31 10:59:24 PDT
James, this entry is a better solution to the same issue discussed in bug #4144. It does still need porting to OCS.
Comment 23 James MacGregor 2011-10-31 11:02:19 PDT
*** Bug 4144 has been marked as a duplicate of this bug. ***