OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Localisation email-templates

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

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

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

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.

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 OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Localisation email-templates

Postby johmue » Mon Mar 12, 2012 1:13 pm

Hi,

I am setting up an OJS-site for a journal in Esperanto. Now I am facing some problems with the localisation. I set up directories ../locale/eo_EO and put in the *.xml files and translated the message keys. This works fine.

The email templates turn out to be more difficult, as it seems that emailTemplates.xml put into ../locale/eo_EO is not found.

I can of course translate the email template using the OJS interface itself, but then the translated email templates are in the data base and not in files which can be copied and edited easily. Moreover OJS is sending blank e-mails when there is no translated version in the data base. Is there a way to tell the system to use the english version, when there is no translated one.

Another problem is, that when I disable any locales but Esperanto, the links to the email templates disappear. Only the link to add a new template or to reset the templates remain.

So what is the best solution to translate all the needed email templates to a new language?

Thanks

Johannes
johmue
 
Posts: 24
Joined: Sun Mar 11, 2012 2:32 am

Re: Localisation email-templates

Postby ramon » Tue Mar 13, 2012 9:07 am

Hello Johannes,

Once you have created your new language and the email locale file, use the "reset" to original button in the email template.
This will bring the content from the XML file back, used in case you have customized the email template and want to revert it to its original value.
ramon
 
Posts: 926
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: Localisation email-templates

Postby johmue » Tue Mar 13, 2012 1:55 pm

Hi ramon,

thanks for your answer, I will try it out.
johmue
 
Posts: 24
Joined: Sun Mar 11, 2012 2:32 am

Re: Localisation email-templates

Postby johmue » Wed Mar 14, 2012 2:20 pm

This did not work out ...

I have two locales activated: en_US and eo_EO. Now I did the following:

* I put a file emailTemplates.xml to .../locale/eo_EO

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE email_texts SYSTEM "../../lib/pkp/dtd/emailTemplateData.dtd">
<!--
* Email templates for Esperanto
-->
<email_texts locale="eo_EO">
<email_text key="NOTIFICATION">
<subject>Nova sciigo de {$siteTitle}</subject>
<body>Vi ricevis novan sciigon de {$siteTitle}:

{$notificationContents}

Ligilo: {$url}

{$principalContactSignature}</body>
<description>The email is sent to registered users that have selected to have this type of notification emailed to them.</description>
</email_text>
...
</email_texts>

* I clicked "Reset all templates"

Result: The English versions are still there, the Esperanto versions are empty.
If I switch to Esperanto language using the language selector in the side bar, there are no email templates at all.
johmue
 
Posts: 24
Joined: Sun Mar 11, 2012 2:32 am

Re: Localisation email-templates

Postby ramon » Fri Mar 16, 2012 6:45 am

Hello Johannes,

How did you add that XML file?
Did you use the Translator Plugin or added the file manually?

If you created the file manually, check file permissions and ownership.

Again, I would recommend using the Translation Plugin, which checks for missing files and translations.
It doesn't check if the translation is correct, though.
This is why starting with the plugin is better, as you can create the files as you go and translate everything through the interface.
It's a bit cumbersome and time consuming at first, but it is a bit more reliable.
ramon
 
Posts: 926
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: Localisation email-templates

Postby johmue » Sat Mar 17, 2012 4:49 am

Hello Ramon,

I added the file manually and the permissions where correct, i.e. they where world-readable just as locale.xml, editor.xml etc. that were found correctly.

No I tried the Translator Plugin. It finds all my translations in emailTemplates.xml. I can edit them in the webbrowser and when I do the emailTemplates.xml on the server is modified accordingly. When I get back later to the concerning template the changes are still there.

However OJS still does not use the translations. Only Translator Plugin sees them, but not OJS.

I think I will reinstall OJS today and update to 2.3.7 and then retry.

Thanks for your help

Johannes
johmue
 
Posts: 24
Joined: Sun Mar 11, 2012 2:32 am

Re: Localisation email-templates

Postby ramon » Wed Mar 21, 2012 6:38 am

Hello Johannes,

Sorry for the delay.
Did you restore the email template in the Emails administration panels?
Again, your database fields for the email templates should be empty, as they did not exist prior to installation.
You will have to go into each email template in the Journal Administration pages to "restore" it to the value now available in the template.
I hope that was clear enough.

If that doesn't work, can you create a new journal and see if the e-mail templates show up?
ramon
 
Posts: 926
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: Localisation email-templates

Postby johmue » Sun Mar 25, 2012 11:06 am

Hello Ramon,

thank you for your help.

Still I'm stuck. I now created a new journal and for the new language no email templates show up in the email template administration board. The emailTemplates.xml is in place and the TranslatorPlugin finds it. If I switch to English locale, the Esperanto fields in the email template administration boards are empty.

Johannes
johmue
 
Posts: 24
Joined: Sun Mar 11, 2012 2:32 am

Re: Localisation email-templates

Postby johmue » Sun Mar 25, 2012 11:16 am

Oh, I forgot to mention, that if I restore an email template by the reset button or the reset all button, the Esperanto templates remain empty.
johmue
 
Posts: 24
Joined: Sun Mar 11, 2012 2:32 am

Re: Localisation email-templates

Postby ramon » Tue Mar 27, 2012 5:44 am

Hello Johannes,

I sent you a PM message.
We've checked how the email template editing works.
If you are within the email template form, the restore button/link will only work if you haven't saved the form.
Otherwise, you'll have to use the links to restore defaults outside of the email template editing form, which should restore all email templates (including English, which may override any changes you've made...).

Also, have you tried clearing your dataase?
This post is a bit old, I think, but you can try to clear your database data and restore again to see if it does the trick.
I'm not sure if they implemented the script mentioned in a post above the one I linked to.
ramon
 
Posts: 926
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: Localisation email-templates

Postby johmue » Tue Apr 03, 2012 12:41 pm

Sorry for the delay, I hadn't time to more investigation.

One more "datapoint":

When I go to the Email templates page in the journal administration tool using English locale, I can see a four page list of email templates. Each of them have an English version and an Esperanto version, which is empty by default and on reset.

When I go to the same page in Esperanto locale, the list of email templates is empty. If I click the ##MANAGER.EMAILS.CREATEEMAIL## button, and create a new email template, say for the key "NOTIFICATION", the list remains empty. If I try to add a template of the same key I get an error message about a duplicate key.

Thanks for you help

Johannes
johmue
 
Posts: 24
Joined: Sun Mar 11, 2012 2:32 am

Re: Localisation email-templates

Postby johmue » Tue May 01, 2012 5:22 am

Hi Ramon and all ...

It seems that I've found a solution: After hitting "Reload locale" on "Home > User > Site Administration > Languages" the translated email-templates appeared in "Home > Journal Management > Prepared Emails".

@Ramon: Thanks again for your help.


Johannes
johmue
 
Posts: 24
Joined: Sun Mar 11, 2012 2:32 am

Re: Localisation email-templates

Postby ramon » Tue May 01, 2012 8:20 am

Hello Johannes,

I'm relieved to know you found the solution, and I'm sorry it skipped me.
Good luck with your journal!
ramon
 
Posts: 926
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil


Return to OJS Technical Support

Who is online

Users browsing this forum: Google [Bot] and 5 guests