Configuration of Messages

With KonaKart you can store application messages either in the database or in files. The default is to use files (sometimes called message catalogs or message properties files).

A configuration variable (called "USE_DB_FOR_MESSAGES") defines whether the messages are stored in the database or in files. This can be set in the Admin App under Configuration >> Admin App Configuration.

Switching to Database Messages

By default, no messages will be loaded into the database. A utility called kkMessages is provided to load messages from your own message properties files. Once loaded you can switch to database messages by simply changing the "USE_DB_FOR_MESSAGES" configuration variable to "true".

Once loaded into the database the messages can be maintained on the Messages panel of the Admin App.

KKMessages Utility

A utility called "kkMessages" is provided to assist with the migration of messages from files to the database.

The kkMessages utility can be found under the utils directory wherever you installed KonaKart (from v5.2.0.0 only). Some sample scripts are provided to make the kkMessages utility easy to use. A number of functions are supported as can be seen by calling the utility with the "-?" parameter:


mike@luton:~/konakart/utils/kkMessages$ ./kkMessages.sh -?
=============================================================================================
KonaKart Messages Utility
=============================================================================================

Usage: KKMessages
     -i  file                   - import a file of messages                
    [-en file encoding]         - file encoding (default is ISO-8859-1)
    [-ce console encoding]      - console encoding (default is utf-8)
     -r                         - when importing first remove all existing 
                                  messages with the specified type and     
                                  locale (default is not to remove them)   
     -x  file                   - export messages to a file                
     -q  file                   - export messages as SQL to a file that can
                                  be used to import the messages elsewhere 
     -l  locale                 - locale (eg en_GB)                        
     -t  (1|2|3)                - message type                             
                                    1 = Application Message                
                                    2 = Admin App Message                  
                                    3 = Admin App Help Message             
     -ll                        - print a list of the current langauges    
     -lm                        - print a list of the current messages     
    [-u  username]              - username                                 
    [-p  password]              - password                                 
    [-s  storeId]               - storeId                                  
    [-e  (0|1|2)]               - engine mode                              
    [-c]                        - shared customers - default is not shared 
    [-ps]                       - shared products - default is not shared  
    [-ae adminengine classname] - default is com.konakartadmin.bl.KKAdmin  
    [-?]                        - shows this usage information             

You need to load messages for each of the 3 types (type 1 (storefront application messages), 2 (Admin App messages) and 3 (Admin App Help Messages)) for every locale you wish to support. It is important that all of your language records contain a locale definition and this locale is used to define the messages for that locale. You can verify that all your languages have a locale defined by using the kkMessages utility to list your languages with the "-ll" option (see example below). You can update the locale for each language using the Languages panel of the Admin App.

A few example scripts demonstrating the usage of the kkMessages utility are provided. See kkMessages_Load_en_GB.sh, kkMessages_Load_en_GB.bat, kkMessages_Load_Defaults.sh and kkMessages_Load_Defaults.bat.

With a default installation of KonaKart where the following languages are defined:


mike@luton:~/konakart/utils/kkMessages$ ./kkMessages.sh -ll
=============================================================================================
KonaKart Messages Utility
=============================================================================================
Languages:
  ID   Name         Code     Locale  
  1    English      en       en_GB   
  2    Deutsch      de       de_DE   
  3    Español      es       es_ES   
  4    Português    pt       pt_BR              

With a default installation you can run the kkMessages_Load_Defaults script ("sh" or "bat" versions depending on your platform) to load the 3 message types for the 4 default languages.