OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Questions about plugins and translating

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.

Questions about plugins and translating

Postby habibseif » Fri Feb 11, 2011 11:52 am

Hello dear friends,

Hoping I write to the right list, I have 3 questions about OCS:

1) I cannot find some strings such as the title of login page or
the title of account page in the locale files. Therefore, I cannot
translate these strings to any language. Am I correct in translating
these strings?

2) I cannot install any plugin, encountering "version.xml file
not found" message. I searched the forum and found I should create one manually and put in the zip file. but why does not the plugin itself have any? How can create one and what content should it have?

3) How can OCS use different stylesheets for different languages?

Cheers,
Habib Seifzadeh
habibseif
 
Posts: 4
Joined: Thu Feb 10, 2011 9:56 pm

Re: Questions about plugins and translating

Postby jmacgreg » Tue Feb 15, 2011 12:53 pm

Hi Habib,

1) I cannot find some strings such as the title of login page or
the title of account page in the locale files. Therefore, I cannot
translate these strings to any language. Am I correct in translating
these strings?


How are you translating these strings -- are you translating the locale files, or are you translating using the Translator plugin? More information on translating OCS can be found here: http://pkp.sfu.ca/wiki/index.php/Translating_OxS. Also, to which language are you translating OCS? We would greatly appreciate it if you were to contribute your translation to the larger community for others to use, and would be happy to publicly acknowledge your contribution to our software.

2) I cannot install any plugin, encountering "version.xml file
not found" message. I searched the forum and found I should create one manually and put in the zip file. but why does not the plugin itself have any? How can create one and what content should it have?


Older plugins did not require a version.xml file -- that is a new requirement for plugins in OCS 2.3+. Here is an example version.xml file for a generic plugin (in this case, the Static Pages plugin):
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE version SYSTEM "../../../lib/pkp/dtd/pluginVersion.dtd">

<!--
  * version.xml
  *
  * Copyright (c) 2000-2011 John Willinsky
  * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
  *
  * Plugin version information.
  -->
<version>
   <application>staticPages</application>
   <type>plugins.generic</type>
   <release>1.2.0.0</release>
   <date>2009-07-13</date>
   <lazy-load>1</lazy-load>
   <class>StaticPagesPlugin</class>
</version>


You should be able to copy this and change the values to what makes sense for your plugin.

3) How can OCS use different stylesheets for different languages?


This isn't currently possible -- you would have to create a custom development of your own, possibly a plugin, in order to do this. If you have development experience, you should take a look at the technical documentation and start playing around -- please let us know if you need any tips.

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: Questions about plugins and translating

Postby asmecher » Tue Feb 15, 2011 2:49 pm

Hi all,

Actually, there is a feature for this -- if you add a stylesheet="path/to/stylesheet.css" to a <locale> element in registry/locales.xml, then that stylesheet will be loaded when using the specified locale. Note that this is not intended for general-purpose styling -- it's intended to provide low-level language-specific styling, such as for languages that use right-to-left formatting.

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

Re: Questions about plugins and translating

Postby habibseif » Thu Feb 17, 2011 4:31 am

Thanks for your replies dear James and Alec,

According to the translation, I have not been noticed of "lib/pkp/locales/" folder. Several strings such as the title of "Log in" page are there, not in "locale/" folder which is located in the root. I'm currently translating OCS to persian by editing xml files. I would be glad if it can be helpful to any other person. I surely submit the files when the translation is completed. The site I have set up is: www.iauncc.ir

Also, the version.xml worked! Thanks a lot. But how can I find the class name of a plugin?

With respect to different stylesheets for different languages, with thanks to Alec response, this is exactly what I was looking for. Could you please give an example showing how I can add the stylesheet to the locale file. Should it be set as the attribute of the desired locale or it should be added as a separate line under the desired locale?

Cheers,
Habib
habibseif
 
Posts: 4
Joined: Thu Feb 10, 2011 9:56 pm

Re: Questions about plugins and translating

Postby asmecher » Thu Feb 17, 2011 9:49 am

Hi Habib,

We don't have a working example of this yet, but it shouldn't be too complicated. Find your entry in registry/locales.xml, i.e. for English:
Code: Select all
<locale key="en_US" name="English" iso639-2b="eng" />
Add the new stylesheet attribute:
Code: Select all
<locale key="en_US" name="English" iso639-2b="eng" stylesheet="locale/en_US/stylesheet.css" />
Put your language-specific styles in the file locale/en_US/stylesheet.css; the stylesheet should be added immediately.

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


Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests