Software localization and internationalization

Hello!

I'm from Russia and I'm interesting of this software. Is there a way to do localization?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Software localization and internationalization

Yes this software can be localized 

there are projects setup to help with localising various tax issues already.   You would need to assess your requirements and either develop them yourself and submit them for commitment to the code base or alternatively request that the lead developer here submit a costing back to you for the development. 

The actually language just needs translating to russion.  I have attached a example of someone starting to translate part of the file to french so you can see how it would be done...

 

Feel free to translate the message properties file and submit it back for code inclusion. the files have had .txt added to get past the spam prevention here.

 

Cheers

Ben

AttachmentSize
messages_fr.propertie.txt 40.19 KB
messages.propertie.txt 55.74 KB
Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Software localization and internationalization

Thanks for your reply!

And how do I select another language in OPENVPMS? Or I just need to replace this file in folder?

Re: Software localization and internationalization

Here is the file with some translation.

I keep doing translation :)

AttachmentSize
messages_ru.propertie.txt 57.75 KB

Re: Software localization and internationalization

In OpenVPMS 1.7, you can place the properties file in <TOMCAT_HOME>/webapps/openvpms/WEB-INF/classes/localisation/

You'll probably need to restart Tomcat to see the changes.

Note that this is not a permanent solution. You'll need to do this each time you deploy a new version of OpenVPMS. If you contribute your changes back, we can include them in the release.

Also see http://www.openvpms.org/project/openvpms-internationalization

Re: Software localization and internationalization

Hi,

I have translated this file. It's an attachment. After that I replaced the original file and restart Tomcat but nothing changes. What I need to do to get it work?

Kind regards,

Alexey.

AttachmentSize
messages_ru.properties.txt 117.53 KB

Re: Software localization and internationalization

I have had a play with your Russian version.

To check the basic functionality, I simply renamed it to messages.properties (after renaming my own to message-tim.properties) and then restarted Tomcat.  To my surprise, things remained in English. I then looked at your file - looked OK except that most lines had a tab prior to the end of line character. I did not think that this would have any effect but removed them anyway.  However, no change.

So something very peculiar is going on.  I checked the openvpms-full.log - nothing relevant.

Tim A - I have no idea what the problem is.  I know that altering stuff in messages.properties works - because we use a number of adjustments (eg replacing Find by Find/Refresh) and that works.  However, even if I change the Russion version to have english text 'Tim Test' for button.find it still shows as 'Find'.

I suspect that we also have a documentation problem - I am unsure whether the localised file should be named messages_XX.properties or messages-XX.properties.

Note also that I found the post http://www.openvpms.org/search/node/messages-fr which indicates that at one stage there was indeed a problem picking up the localised version.  However, that does not explain why replacing messages.properties with the Russian version does not work.

Regards, Tim G

Re: Software localization and internationalization

You file must be named messages.properties

Check the tomcat logs for errors - it may be a parsing error on that file. make sure its saved as UTF8

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Software localization and internationalization

Aside from that I will jira this and get your translation included in the base distribution 

 

Thanks

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Software localization and internationalization

Tim A - your 'make sure it is saved as UTF8' did the trick.  The editor I use allows one to save as 'utf8 - no BOM' - I did this and restarted Tomcat and got:

So - I assume that I should adjust the CSH text at http://www.openvpms.org/documentation/csh/1.7/reference/setup/localisation to remove the reference to i18n support and just say to put your version in messages.properties.

Note also that I checked the complete <TOMCAT_HOME>/logs folder for references to 'message' but there is nothing there - ie whatever is going wrong in the parsing of messages.properties is no showing up in the logs.

Regards, Tim G

Re: Software localization and internationalization

I edited removing all the tabs and reencoded it to UTF8 with no BOM

 

AttachmentSize
messages_ru.properties.txt 64.1 KB
Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Software localization and internationalization

Note the immediate code change when displayed on the server....

When viewed in my notepage editor the characters look fine - however now in UT8 they are incorrect when displayed in the webbrowser, but that is the browsers encoding not the servers.

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Software localization and internationalization

Looking briefly at the OPENVPMS html it doesnt declare a charset -

in fact in web.xml it declares

<?xml version="1.0" encoding="ISO-8859-1"?>

for that file it shouldnt matter but we need to tell the browser to use UTF8 not ISO-8859-1

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Software localization and internationalization

Looks like we need to implement encoding deep in openvpms code or in ther web.xml file.

http://www.satollo.net/tomcat-and-accentedcyrillicchinese-characters-cha...

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Software localization and internationalization

I was wrong I think tomcat does return a charset in the header and it is UTF-8...

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Software localization and internationalization

Tim, you need to update your browser configuration to adjust the encoding from ISO-xxxxxx to UTF-8

You may also want to ensure the default fonts accept UTF-8 characters.

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Software localization and internationalization

Resource bundles need to be encoded as ISO-8859-1.

You can do this by running your file through the native2ascii tool included in the JDK. Your file is encoded using UTF-16LE, so the command is:

native2ascii -encoding utf-16LE messages_ru.properties somedir/messages_ru.properties

The file somedir/messages_ru.properties is the file you copy to <TOMCAT_HOME>/webapps/openvpms/WEB-INF/classes/localisation/

Re: Software localization and internationalization

Following the advice from Tim A I have recreated your files using the netbeans IDE to generate the correct encoding.

This is the file converted...

 

AttachmentSize
messages_ru_RU.properties.txt 91.89 KB
Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Software localization and internationalization

Thank you!

It's works!

Re: Software localization and internationalization

Where can I translate this? For example I tried to find "Last Name" but nothing found.

Re: Software localization and internationalization

The display names of fields are held in the archetypes. Below is the result of setting the display name of the lastName field in the archetype party.customerPerson (this is from my anonymised database and hence the obscured names)

I did this by editing the archetype as follows:

A better way to do this is to use a suitable text editor to edit the archetype .adl files in <OPENVPMS_HOME>\update\archetypes\org\openvpms\archetype

See also http://www.openvpms.org/documentation/csh/1.7/admin/archetype

if you look at party.customerPerson.adl it looks lile the following. Note that for the majority of the fields, the Display Name is not explicitly set - because the archetype loader is capable of translating a field named say 'lastName' into the Display Name 'Last Name'. Only for the field named 'referral' is there an explicit Display Name set.

So for the translation we need to set the Display Names for each field that is not hidden. So we end up with something like:

However, now I am stuck - I cannot figure out what encoding is necessary for the above file.  If I use the native2ascii translation I end up with a file with a leading \ufeff which the Administration|Archetype|Import does not like.  If I use utf8 no BOM, I get

Help !!

Regards, Tim G

Re: Software localization and internationalization

Tim you should ensure your browser is decoding pages correctly ...

The encoding error you see is because the browser is interpretting the codepage as windows-1252 (which is similar to iso - xxx) 

Almost all files in OPENVPMS are UTF-8 EXCEPT the properties files which java requires to be ISO .

(learnt that yesterday - boggles me that SUN/Oracle hasnt changed that.)

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Software localization and internationalization

Ben - the situation is a little mnore complicated.

a) the browser will happily display utf-8 - eg http://www.fileformat.info/info/unicode/block/cyrillic/utf8test.htm which comes out as:

Note that if you look at this page source you see an explicit declaration of utf-8, ie

whereas if you look at the OpenVPMS page source, there is no explicit utf-8 definition, ie we have

(But I have no idea as to whether this has anything to do with the problem.)

Now if I edit the archetype using Administration|Archetypes and simply cut and paste from the google translate page (I do not speak or read Russian), then things work well and I get:

However, if I export the archetype, the cryllic characters get set to ???? - here is the file opened in binary mode:

So what showed as cryllic in the archetype as shown below

gets exported as ?????

So we appear to have an export/import problem with non-western characters.

Regards, Tim G

Re: Software localization and internationalization

You'll need to update to the latest 1.8 snapshot. This has support for UTF-8 encoded archetype descriptors.

You can get the latest snapshot here: https://www.dropbox.com/s/olim5qleu8aftq7/openvpms-release-1.8-SNAPSHOT.zip

-Tim A

Re: Software localization and internationalization

Tim - I grabbed this snapshot and put it on my Win 7 machine running the previous 1.8 snapshot.

When I ran the archload I got:

Unknown column 'nodedescri0_.description' in 'field list'
0 [main] ERROR org.hibernate.util.JDBCExceptionReporter  - Unknown column 'nodedescri0_.description' in 'field list'
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'archetypeDescriptorCache' defined in file [C:\OpenVPMS\Current-release\bin\..\conf\applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.openvpms.component.business.service.archetype.descriptor.cache.ArchetypeDescriptorCacheDB]: Constructor threw exception; nested exception is org.openvpms.component.business.dao.im.common.IMObjectDAOException: Failed to find IMObjects for class org.openvpms.component.business.dao.hibernate.im.archetype.ArchetypeDescriptorDO with shortName: descriptor.* and instanceName: null.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'archetypeDescriptorCache' defined in file [C:\OpenVPMS\Current-release\bin\..\conf\applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.openvpms.component.business.service.archetype.descriptor.cache.ArchetypeDescriptorCacheDB]: Constructor threw exception; nested exception is org.openvpms.component.business.dao.im.common.IMObjectDAOException: Failed to find IMObjects for class 

etc

Is this my fault (because I am trying to install this snapshot over the previous version) or what?

Regards, Tim G

Re: Software localization and internationalization

You'll need to re-run the migrate-1.7-to-1.8.sql migration script.

 

 

Re: Software localization and internationalization

AHAH - did the trick. I assumed that because I had (for the prior snapshop) previously run the migration script that I did not have to this time.

I repeated the above tests - ie used Google Translate to get the Russion equivalents of First Name, Last Name, Title, Company Name and entered these using Administration|Archetypes.  Customers|Information is as expected. I then exported the party.customerPerson and looked at the resuling adl - looks good - have Russian text where expected. Then re-imported - works OK - except that the field order got scrambled.  Probably my fault for exporting with the field order set to order by field name.

Conclusion - the 'cannot export/import utf8' problem is fixed - in the 1.8 snapshot.

I think that we owe Mr Karopka some advice on whether he should grab the 1.8 snapshot and start work editing the Display Names in its archetypes - ie is this snapshot stable enough for him to be able to continue the localisation work.

Regards, Tim G

Re: Software localization and internationalization

1.8 is not ready for production but there is no reason why it cannot be localised.

Care will need to be taken to ensure that any archetype changes are also applied to the localised versions. The http://www.openvpms.org/project/archetype-internationalisation project would simplify this to a great extent.

Re: Software localization and internationalization

Hello, Tim.
I noticed that if I use cyrillic symbols for input into an any fields (for ex. Last Name = "Иванов") I get "??????" after saving. It is very sad :(
What can you suggest to solve this problem?

Best regards, Alexey.

Re: Software localization and internationalization

Alexey - something peculiar here.  In my 1.7.1 system I do not see the same problem - I get the following (don't worry about the HK and HKID - these result from the fact that this system is a clone of the one I look after in Hong Kong):

The same happens with the 1.8 prerelease - which supports setting the Display Names of fields to cryllic. (Don't worry about the field order - this was due to my not ordering the fields correctly):

Note also that in the Hong Kong system, we use Chinese characters in the drug label text - for example:

So the underlying system does not have a problem using non-western characters in the data fields.

I admit that I am at the limit of my knowledge, however I suspect that the problem is due to two things: a) OpenVPMS does not have a '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' to explicitly set the character set on each page; b) your Tomcat is using a different default character set to mine - see for example https://blog.oio.de/2010/12/31/solving-tomcat-encoding-problems-in-utf-8...

Tim A/Ben C - perhaps you can clarify the above.

Regards, Tim G

Re: Software localization and internationalization

Tomcat returns the encoding in the Headers...just not the HTML.  You need to look at the header request and response to see the encoding being declared...which is UTF8 by the way.  

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Software localization and internationalization

Ahah - Ben you are correct - I was not looking in the correct place - if I use Firefox's Tools|Page Info I get

Given this, I reckon that Tim A's 'check the database' suggestion below is the way to go.  Regards, Tim G

Re: Software localization and internationalization

Database configured to UTF-8 as well as Tomcat, but I still have this problem :(

UDP: I have fixed the problem by editing my.ini:

default-character-set=utf8

Problem is gone!

Re: Software localization and internationalization

One other thing to check is to ensure that the database has been set up with the correct character set. In MySQL, run the following SQL:

SHOW CREATE DATABASE openvpms;

It should display:

openvpms
CREATE DATABASE `openvpms` /*!40100 DEFAULT CHARACTER SET utf8 */

Re: Software localization and internationalization

Hello, I'm sorry that lingered.

my database configured to UTF-8 as well as Tomcat, but I still have the same problem.

Maybe I need to look somewhere else?

See attachment.

UDP: I have fixed the problem by editing my.ini:

default-character-set=utf8

Problem is gone!

AttachmentSize
Creating cirilic name 51.02 KB
Press button to choose customer (alredy having ????) 47.47 KB
Cirilic name became ???? 52.52 KB
page properties: UTF-8 65.11 KB
Tomcat configured to UTF-8 34.79 KB

Re: Software localization and internationalization

I assume you mean your Mysql my.ini file? 

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au
Syndicate content