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

Konakart 2.2.6, Internationalization

Started by hasalem, October 01, 2008, 10:46:07 pm

Previous topic - Next topic

hasalem

Hi,

I used Konakart 2.2.2.0 for arabic site. I localized it without any big issues.

Now when I tried to use 2.2.6.0, I found the following problem with arabic. "Really, I've tested with western languages like deutch, and I haven't this problem":

The application works fine for everything except when I try to use arabic names for categories tree, or localizing the key of "Category" in the properties file. I can't use the select product link

http://127.0.0.1:8780/konakart/SelectProd.do?prodId=29&manufacturer=Canon&category=,(F)&name=,(F)&model=,(F)


as you can see in the link , the category name is not the encoded UTF-8  URL of the arabic name, "It should be something like %A8...."

I've tried to play a little with ShowProductDetailsAction to encode the URL, but I haven't a lot of luck.

Also, I noticed that this action was not changed from Version 2.2.2.0. I think 2.2.6.0 has a problem in another place regarding the eastern language, or UTF-8.

Any help will be highly appreciated.

Best Regards
Hatem Salem

hasalem

Hi all,

I think I found the issue, the issue is related to ShowProductDetailsAction

in Konakart 2.2.2.0, this class was checking the following
            if (request.getParameter("redir") != null)
to check the SEO redirect

while in Konakart 2.2.6.0, this class is checking the following instead
            if (selectedProd != null && selectedCat != null && selectedProd.getId() == prodIdInt
                    && request.getParameter(Constants.seoName) != null)


I was localized these keys in Messages.properties
seo.product.category=category
seo.product.manufacturer=product
seo.product.name=name
seo.product.model=model

to use arabic values instead of english

where Constants.seoName is the value of seo.product.name

I think there's an issue in the encoding of the parameters.

I did a dirty fix, and I don't know what are its side effects. The dirty fix is
1- roll back the localization for the seo.* keys in Messages.properties.
2- in  ShowProductDetailsAction
   use the following structure to append the parameter values

unfortunately, the seo parameters are passed as question marks till now. I will be thankful if anyone could help in this topic.

Best Regards
Hatem Salem

pete

Hi,

The SEO data is appended to the URL in the action classes. This data isn't required by KonaKart and is only added to make your products more visible to search engines.

For example in ShowProductDetailsAction.java there is a section near the bottom that does it. What you could do is to either:


  • Leave seo.product, seo.product.manufacturer, seo.product.name and seo.product.model empty in the messages.properties file so that this data doesn't get appended to the URL.

  • Modify the code to URL Encode the names that are added. i.e. change code such as url.append(cat.getName());
    to url.append(URLEncoder.encode(cat.getName(), "UTF-8"));