Let's use this property group as a sample:
Code: Select all<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.0//EN"
"http://www.openkm.com/dtd/property-groups-2.0.dtd">
<property-groups>
<property-group label="Consulting" name="okg:consulting">
<input label="Name" type="text" name="okp:consulting.name"/>
<input label="Date" type="date" name="okp:consulting.date" />
<checkbox label="key.consulting.important" name="okp:consulting.important"/>
<textarea label="key.consulting.comment" name="okp:consulting.comment"/>
</property-group>
</property-groups>
I have combined labels with direct translation and labels with keys ( last 2, key.*.* ).
Should be added in translations the keys, for example in english ( same for other languages ):
Code: Select allINSERT INTO OKM_TRANSLATION (TR_MODULE, TR_KEY, TR_TEXT, TR_LANGUAGE) VALUES ('frontend', 'key.consulting.important', 'Important', 'en-GB');
INSERT INTO OKM_TRANSLATION (TR_MODULE, TR_KEY, TR_TEXT, TR_LANGUAGE) VALUES ('frontend', 'key.consulting.comment', 'Comment', 'en-GB');
Then I suggest modify class FormManager.java, look for each time is called the method named getLabel() in this class ( really referenced a lot of times in serveral widgets, buttons, inputs, lists etc... ). I think the easiest is convert the code like :
Code: Select allButton transButton = new Button(gWTButton.getLabel());
into
Code: Select allButton transButton = new Button(Main.i18n(gWTButton.getLabel()));
If you take a look into the logic of method i18n you'll see if the translation for the key does not exist, it returns the key, than means:
- case try translation for term "Name" what not exist, name will be returned
- case try translation for term "key.consulting.comment" what exist, will be returned the translation.
As you can see there're a lot of getLabel() to be changed, but it's really easy change it and I think should going right. Keep us updated about if all has gone right and in case positive we can introduce by default into OpenKM code.