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

Locale problem - version 2.2.6.0

Started by ByDcc, April 04, 2009, 11:47:55 pm

Previous topic - Next topic

ByDcc

   Hi all,
   I'm using konakart admin application in spanish and some texts in the application seems to be hard coded. I'm sending a file attached with an example. See red retangles.

   I think I can change java files like Flat.java in the next code:

        configs[i++] = new KKConfiguration("Enable Flat Shipping", "MODULE_SHIPPING_FLAT_STATUS",
                "True", "Do you want to offer flat rate shipping?", 6, 0, "",
                "tep_cfg_select_option(array('True', 'False'),", now);
        configs[i++] = new KKConfiguration("Shipping Cost", "MODULE_SHIPPING_FLAT_COST", "5.00",
                "The shipping cost for all orders using this shipping method.", 6, 0, "", "", now);
        configs[i++] = new KKConfiguration("Tax Class", "MODULE_SHIPPING_FLAT_TAX_CLASS", "0",
                "Use the following tax class on the shipping fee.", 6, 0,
                "tep_get_tax_class_title", "tep_cfg_pull_down_tax_classes(", now);
        configs[i++] = new KKConfiguration("Shipping Zone", "MODULE_SHIPPING_FLAT_ZONE", "0",
                "If a zone is selected, only enable this shipping method for that zone.", 6, 0,
                "tep_get_zone_class_title", "tep_cfg_pull_down_zone_classes(", now);
        configs[i++] = new KKConfiguration("Sort Order", "MODULE_SHIPPING_FLAT_SORT_ORDER", "0",
                "Sort order of display.", 6, 0, "", "", now);


and use this.getMsgs().getString("My Key") to make these texts mulilanguage.

   My questions are:
* Is this the best place to change these texts?
* Could I have any bad behaviour with the application if I change these texts? ("Enable Flat Shipping", "Shipping Cost", "Shipping Zone", etc).

   Thank you in advance.

heidi

Yes you can change the Strnigs in Flat.java.


Not sure what you mean by :

Quotethis.getMsgs().getString("My Key") to make these texts mulilanguage.


This is not how you use them.

The Strings in Flat.java, that you show, become configuration values in the database.

ByDcc

   Hi Heidi,
   thank you for your reply.

   As you say these values come from database:

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES (nextval for configuration_seq, 'Shipping Cost', 'MODULE_SHIPPING_FLAT_COST', '5.00', 'The shipping cost for all orders using this shipping method.', 6, 0, current timestamp);

   But Shipping Cost and all of the other values that you see in the attached file appear in the GUI so I need to see "Gastos de Transporte" instead of Shipping Cost.

   In Flat.java, Table.java, etc, I've seem I can get a reference to a Resource Bundle with this.getMsgs(). I suppose I will be able to put several key, values in that file in order to show the right String. If the browser has a Spanish locale ("Gastos de Transporte") or a English locale (Shipping Cost). With this.getMsgs().getString("shipping.cost.label"), for example.

   Thank you again.

ByDcc

   Hi,
   it's not working.

   I changed to the next code in Flat.getConfigs():

        String enableFlatShip = this.getMsgs().getString("module.shipping.flatshipping");
        String costShip = this.getMsgs().getString("module.shipping.cost");
        String taxClass = this.getMsgs().getString("module.shipping.taxclass");
        String zoneShip = this.getMsgs().getString("module.shipping.zone");
        String order = this.getMsgs().getString("module.shipping.order");
       
        int i = 0;
        configs[i++] = new KKConfiguration(enableFlatShip, "MODULE_SHIPPING_FLAT_STATUS",
                "True", "Do you want to offer flat rate shipping?", 6, 0, "",
                "tep_cfg_select_option(array('True', 'False'),", now);
        configs[i++] = new KKConfiguration(costShip, "MODULE_SHIPPING_FLAT_COST", "5.00",
                "The shipping cost for all orders using this shipping method.", 6, 0, "", "", now);
        configs[i++] = new KKConfiguration(taxClass, "MODULE_SHIPPING_FLAT_TAX_CLASS", "0",
                "Use the following tax class on the shipping fee.", 6, 0,
                "tep_get_tax_class_title", "tep_cfg_pull_down_tax_classes(", now);
        configs[i++] = new KKConfiguration(zoneShip, "MODULE_SHIPPING_FLAT_ZONE", "0",
                "If a zone is selected, only enable this shipping method for that zone.", 6, 0,
                "tep_get_zone_class_title", "tep_cfg_pull_down_zone_classes(", now);
        configs[i++] = new KKConfiguration(order, "MODULE_SHIPPING_FLAT_SORT_ORDER", "0",
                "Sort order of display.", 6, 0, "", "", now);


   In my debug session (attached file) you can see the values in spanish for the property configs , but the GUI is showing the values in english again (see flat_ship_properties.png).

   Is there a place where I can configure these values?, or is it impossible?

   Thank you in advance.

heidi

The Admin App gets these values from the database which is loaded when you install a module.

You will have to remove the module before installing a different module - or change the db values directly.

Remember to refresh your browser.