OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



translation: Track

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

Translation plugin

Postby ramon » Fri Sep 21, 2007 7:24 am

Alec,

Does the translation plugin work in OCS?
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: translation: Track

Postby asmecher » Fri Sep 21, 2007 10:45 am

Hi Ramón,

I haven't tested it with OCS 2.0, but it should work OK. If you do try it and have any trouble, please let me know. Note that the translation plugin was written with translation maintenance in mind, not translation creation, so you may find that a manual process is better suited e.g. to the main locale file, since it's so large.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8815
Joined: Wed Aug 10, 2005 12:56 pm

Re: translation: Track

Postby ramon » Fri Sep 21, 2007 10:55 am

Alec,

The idea is to have someone registered just to translate, so it doesn't matter if it's large.
At least they won't need to look at an XML file and probably make more mistakes...

I'll give it a try and let you know of any problems or success.
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Translation plugin

Postby ramon » Fri Sep 21, 2007 11:21 am

Alec,

OCS installation went well except for this error
"Warning: Missing argument 3 for getsetting() in /home/www/pkp/ocs/ocs2/classes/plugins/Plugin.inc.php on line 118"

I just copied ojs2/plugins/generic/translator to ocs2/plugins/generic/
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: translation: Track

Postby asmecher » Fri Sep 21, 2007 2:23 pm

Hi Ramón,

That jogs my memory. There are a few things you'll need to change to get this plugin to work in OCS. Calls to getSetting will need to be changed from e.g.:
Code: Select all
$this->getSetting(0, 'enabled')
...to...
Code: Select all
$this->getSetting(0, 0, 'enabled')
Likewise, calls to updateSetting need to have a new 2nd parameter, value 0, added.

You'll also need to change calls to Request::redirect and Request::url to add a new 2nd parameter, value null.

Off the top of my head, that should get things working.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8815
Joined: Wed Aug 10, 2005 12:56 pm

Re: translation: Track

Postby ramon » Mon Sep 24, 2007 1:23 pm

Alec,

Are these parameters changed only in the Translator Plugin Files?
All in the TranslatorPlugin.inc.php or also in TranslatorHandler.inc.php?

I changed both files, and only the TranslatorPlugin.inc.php, but could not make it work.

After I made the changes only in TranslatorPlugin.inc.php, it worked once, but could not enable it.

Then I altered TranslatorHandler.inc.php, but there are many calls with more than 2 parameters already.. (like Request::redirect(null, null, 'index');)
So I gave that a try, changing them to Request::redirect(null, null, null, 'index'); or Request::url(null, null, null, 'index');
After that, it caused an unrecoverable error,
Unable to import() 'help/PluginHelpMappingFile.inc.php'.

from which I could only recover by undoing everything to go back to the first error (Warning: Missing argument 3 for getsetting() in /home/www/pkp/ocs/ocs2/classes/plugins/Plugin.inc.php on line 118)
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Translator Plugin

Postby ramon » Wed Sep 26, 2007 7:00 am

Alec,

Not sure if I should add this here or post it in the Development section...

Anyway, I made a few changes and it worked (at least could access OCS again!).

I commented
Code: Select all
function addHelpData($locale = null) {
      if ($locale == '') $locale = Locale::getLocale();
      $help =& Help::getHelp();
      //import('help.PluginHelpMappingFile');
      //$pluginHelpMapping = & new PluginHelpMappingFile($this);
      //$help->addMappingFile($pluginHelpMapping);
      return true;
   }


This enabled OCS again.

I created the pt_BR folders, but when I went in to check, it returned the following:
Code: Select all
Notice: Only variable references should be returned by reference in /home/www/pkp/ocs/ocs2/classes/plugins/PluginRegistry.inc.php on line 133


It is now showing the locale fields, but I cannot save any changes...

Any ideas??
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Translator Plugin

Postby ramon » Wed Sep 26, 2007 7:10 am

Alec et ali,

I chmod OCS 2 to 777 (since it's a development area, without external access).
It's saving the data now, so I can translate, but the notice from the previous post is still showing.

I could disable it, but maybe there's something that needs to be fixed.
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: translation: Track

Postby asmecher » Wed Sep 26, 2007 9:00 am

Hi Ramón,

Are you using a CVS version of OCS2, or the stock 2.0 release?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8815
Joined: Wed Aug 10, 2005 12:56 pm

Translation Plugin

Postby ramon » Wed Sep 26, 2007 2:22 pm

Alec,

I'm using the stock OCS 2 version, not CVS for this.
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: translation: Track

Postby asmecher » Wed Sep 26, 2007 2:33 pm

Hi Ramón,

Try applying http://pkp.sfu.ca/cvs/cvsweb.cgi/ocs2/classes/plugins/PluginRegistry.inc.php.diff?r1=1.9;r2=1.10; it's a work-around for a bug that appears in some versions of PHP.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8815
Joined: Wed Aug 10, 2005 12:56 pm

Re: translator plugin [SOLVED]

Postby ramon » Wed Sep 26, 2007 3:51 pm

Thanks Alec,

The notice is now gone...
I tried something similar, but didn't think of creating a variable to return, as the patch does...

I'm already in page 36 of 83 (876 - 900 of 2070 items to translate), for the ocs2/locale/pt_BR/locale.xml.

Hopefully, by the end of the week, the main locale file will be done...
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: translation: Track

Postby asmecher » Wed Sep 26, 2007 4:25 pm

Hi Ramón,

Excellent! Since you're using unreleased code (i.e. the translation plugin), please make sure you back up your partial translation frequently and double-check to make sure it's looking like it should.

As always, thanks for contributing!

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8815
Joined: Wed Aug 10, 2005 12:56 pm

Re: translation: Track

Postby ramon » Thu Sep 27, 2007 8:59 am

Alec,

I noticed that the translator plugin does cut off some of the content previously saved...
I'm going through it and checking everyghing again...
ramon
 
Posts: 931
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: translation: Track

Postby asmecher » Thu Sep 27, 2007 9:14 am

Hi Ramón,

Could you describe the sort of data that's getting cut off?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8815
Joined: Wed Aug 10, 2005 12:56 pm

PreviousNext

Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest