• Welcome to KonaKart Community Forum. Please login or sign up.
 

konakart admin i18n for CE

Started by andrea.castelli, February 25, 2011, 10:53:13 am

Previous topic - Next topic

andrea.castelli

Hi guys,
I'm running the CE and I'm studying the konakart admin.
I know that the dynamical change of languages is not supported.  I set my browser to spanish and I was expecting to see the login panel in spanish but I always see it in english. Is this right for the CE?

If no, how can I set the l language of the konakartadmin?

I would like to traslate konakart to Italian.

Bye
Andrea

trevor

Take a look at http://www.konakart.com/docs/I18N.html .

I think that an Italian translation was contributed some time back : http://www.konakart.com/forum/index.php/topic,1159.0.html . May not be complete but you could use it as a starting point.

andrea.castelli

Thanks, but I'm not sure to understand the documentation.

Struts must be informed of the new language by calling the method setLocale() from within the Struts action. If Struts is passed a locale of en_GB, it looks for a message catalog called Messages_en_GB.properties. If it can't find that, it looks for Messages_en.properties. If it cannot find that, it defaults to Messages.properties which was set as the default in the struts-config.xml file.

So I should only replace Messages.properties (and AdminHelpMessages) with mine?

Are there other files, or something coming from DB to substitute?

Another OT question,  is the admin interface based on struts? Why I don't find any struts-*.xml under /webapps/konakartadmin/WEB-INF?

Andrea

trevor

If you look at the title for where it mentions struts, you will see that it says: Translating the KonaKart Application . If you then look below that, you'll see a section with title : Translating the KonaKart Admin Application. Since you talk about the Admin App, this is the section you should read.

The Admin App uses Google GWT technology http://www.konakart.com/product/administration/architecture .

costis

It seems that for the 5.2.0.0 version the internationalized AdminMessages.properties file has to be called AdminMessages_it_IT.properties otherwise KKE complains about it. Previous versions were satisfied with the AdminMessages_it.properties.

costis

Correction:

I was trying a greek Konakart 5.2.0.0 yesterday, and realized that administrator works correctly with an AdminMessages_el.properties file and no AdminMessages_el_GR.properties with just the following complaint:

PropertyFileFinder.findProperties() Could not find AdminMessages_el_GR.properties on the classpath


andrea.castelli

Thank you for your help.
Friday I was mixing the two things.

Andrea

costis

Here are is a small part of the AdminMessages_de.properties and below it one of AdminMessages_el.properties.
In the german file you can see Umlaut ans Es-Zet, used directly and unencoded.

In order to make the greek Administrator work, we must provide the \uNNN encoding. Why is there a difference?
This makes processing of the AdminMessages_el.properties impossible through the Administrator.

German

#--------------------------------------------------------------------------------------------------
# Admin Message Catalogue
#--------------------------------------------------------------------------------------------------

#--------------------------------------------------------------------------------------------------
# General
#--------------------------------------------------------------------------------------------------

application.title               = Shop - Administrationsoberfläche
language.dir                    = de

#--------------------------------------------------------------------------------------------------
# buttons
#--------------------------------------------------------------------------------------------------

button.add                      = Hinzufügen
button.add.var                  = Neu
button.add.group                = Gruppe
button.addPoints                = Add Points
button.addr                     = Addresses
button.addToProm                = Verwalte Sonderaktionen
button.api.calls                = Zeige API Aufrufe
button.back                     = Zurück
button.cancel                   = Abbrechen
button.clear                    = Löschen
button.close                    = Schließen



Greek

#--------------------------------------------------------------------------------------------------
# Admin Message Catalogue in Greek
#--------------------------------------------------------------------------------------------------

#--------------------------------------------------------------------------------------------------
# General
#--------------------------------------------------------------------------------------------------

application.title               = \u0395\u03c6\u03b1\u03c1\u03bc\u03bf\u03b3\u03ae \u0394\u03b9\u03b1\u03c7\u03b5\u03af\u03c1\u03b9\u03c3\u03b7\u03c2
language.dir                    = el

#--------------------------------------------------------------------------------------------------
# buttons
#--------------------------------------------------------------------------------------------------

button.add                      = \u03a0\u03c1\u03bf\u03c3\u03b8\u03ae\u03ba\u03b7
button.addToProm                = \u0394\u03b9\u03b1\u03c7\u03b5\u03af\u03c1\u03b9\u03c3\u03b7 \u03c4\u03c9\u03bd Promotions
button.api.calls                = \u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03ba\u03bb\u03ae\u03c3\u03b5\u03c9\u03bd API
button.back                     = \u03a0\u03af\u03c3\u03c9
button.cancel                   = \u0391\u03ba\u03c5\u03c1\u03bf
button.clear                    = \u039a\u03b1\u03b8\u03b1\u03c1\u03b9\u03c3\u03bc\u03cc\u03c2
button.close                    = \u039a\u03bb\u03b5\u03af\u03c3\u03b9\u03bc\u03bf
button.coupons                  = \u0394\u03b5\u03bb\u03c4\u03af\u03b1
button.delete                   = \u0394\u03b9\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae
button.deleteOption             = \u0394\u03b9\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae \u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae\u03c2
button.deleteOptionValue        = \u0394\u03b9\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae \u03c4\u03b9\u03bc\u03ae\u03c2 \u03c4\u03b7\u03c2 \u03b5\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae\u03c2

greg

I'm not sure what the problem is?

Is the problem that you can't edit your Greek properties file correctly using the Admin App although the properties file that you've defined (with the standard \uxxxx encoding) works fine?

In v5.2.0.0 the code treats properties file as having "ISO-8859-1" encoding.

Is the problem that when you edit your Greek properties files through the Admin App you see the \uxxxx values but you wanted to see the real characters?


costis

For all previous KonaKart i had to use for greek UTF-8. In order to convert i had to either use ascii2native filter or the property file editor of NetBeans in order to "i18nize" my Administrator.
Should i convert the messages to ISO-8859-7 (greek) and try to use them straight away? If this works then the file should be editable throught the Administrator editor.


greg

You can try but I don't think you'll be able to edit an ISO-8859-7 file (with the Greek characters)  using the Admin App because it will be read as an ISO-8859-1 stream.

I would still expect your encoded file to work OK - just not editable except using the \unnnn codes.

costis

Thank you very much. The funny thing with 5.2.0.0 is that i managed to get it to work OK in Windows-XP with the \u characters in the Messages file.
The switch from English to Greek works only after a reboot. I Ubuntu it doesn't work at all. It just shows the status words in Greek in the "My Store Status" page,
but these come from the database. Like that:

My Store Status
   
Άκυρη Πληρωμή Orders               0
Ακυρώθηκε Orders                     0
Απεστάλει Orders                       0
Απεστάλει Μερικά Orders             0   
Πληρωμή Ολοκληρώθηκε Orders   0   
Σε Αναμονή Orders                    0   
Σε Αναμονή Πληρωμής Orders      0   
Σε Επεξεργασία Orders               0   
Number of Customers                 4   
Number of Products                   0   
Number of Manufacturers            1

greg

encoding is a black art  :(

depending on what you are doing the System.getProperty("file.encoding") will affect what you see.  Maybe this is different between your Ubuntu and Windows systems (I expect so).

costis

Yeah! Tell me about it...  :) 

Have tried a few things:
1. AdminMessages_el.properties with ISO-8859-7. Did not work either.
2. I moved the AdminMessages_el.properties (with \uNNN encoding) to AdminMessages.properties and everything started working.
3. I moved the AdminMessages_el.properties with ISO to AdminMessages.properties and it displayed garbage.

For some mysterious reason, although the necessary XML files are all updated and correct, the Admin-app does not switch locale automatically.
I will have to stopkonakart, move the file and startkonakart again. I can certainly live with that, since nobody needs to change the language
of admin very often. Still i remember the times (around version 2.2.x.x and 4) when i could switch the locale from "Languages" and only needed to log-out.



JamesC

Character encoding was invented by Satan himself to test us  >:(

Try adding -Dfile.encoding=UTF-8 (or whatever) to the JAVA_OPTS of your server startup script - assuming you have access to this, of course. (Depending on the server the environment variable may have another name...)