[ 
https://issues.apache.org/jira/browse/OFBIZ-4412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13104711#comment-13104711
 ] 

mz4wheeler commented on OFBIZ-4412:
-----------------------------------

It is fairly easy to create a multi-language site in OFBiz using a SINGLE 
store.  The user can easily change the language by either clicking a flag icon 
or selecting a drop-down.  I also discovered that if you set the defaultLocale 
in the store to blank, then the users default locale can actually auto-select 
the correct locale if the language is supported by the OFBiz installation.  

So far so good.  Now try to get Google to index the products in anything other 
than the store's default locale.  You can't.

So if you want to support 5 languages, you MUST set up 5 completely independent 
stores.  Using the above method, you can setup multiple webapp clones (easy), 
and google and/or other crawler can correctly index your SINGLE store in as 
many languages as you want.  Also, once it is indexed, and a user clicks the 
URL, the users locale will automatically be set to the locale of the page.


> Set initial ecommerce Locale/Currency based on mount point specified in 
> specialpurpose/ecommerce/ofbiz-component.xm
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4412
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4412
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: specialpurpose/ecommerce
>    Affects Versions: Release Branch 10.04, Release Branch 11.04, SVN trunk
>         Environment: Not specific
>            Reporter: mz4wheeler
>            Priority: Trivial
>              Labels: patch
>             Fix For: Release Branch 10.04, Release Branch 11.04, SVN trunk
>
>         Attachments: OFBIZ-4412.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Using the specified patch, it is now possible to set a users initial Locale 
> (and even currency) based on the webapp mount point.  This works with a 
> single store, and does not require the use virtual hosts.  This is especially 
> useful when setting up sitemap.xml, which allows crawlers (like google) to 
> correctly locate and traverse products and services in multiple languages.
> Here is an example where "ecomclone" has been modified to Locale=fr with a 
> mount point of "/fr".
> specialpurpose/ecommerce/ofbiz-component.xml:
> <!--  <init-param name="Currency" value="EUR"/> -->
>     <webapp name="ecommerce"
>         title="eCommerce"
>         server="default-server"
>         location="webapp/ecommerce"
>         mount-point="/ecommerce"
>         app-bar-display="false">
>     </webapp>
>     <webapp name="ecomclone"
>         title="eCommerce Clone"
>         server="default-server"
>         location="webapp/ecomclone"
>         mount-point="/fr"            <------- SPECIFY MOUNT
>         app-bar-display="false">
>         <init-param name="Locale" value="fr"/>  <------- SPECIFY LOCALE
>     </webapp>
> The below sitemap.xml would allow products with the "/fr" path to be indexed 
> in french.
> <?xml version="1.0" encoding="UTF-8"?>
> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9";>
> <url><loc>http://ofbizsite.com/ecommerce/products/10002/p_1001TANGRAMPUZ</loc></url>
> <url><loc>http://ofbizsite.com/fr/products/10002/p_1001TANGRAMPUZ</loc></url>
> </urlset>
> The patch:
> The attached patch modifies setDefaultStoreSettings in ProductEvents.java, 
> which is called once during the initial session creation.  
> After a user enters the URL, they are still free to modify the language, as 
> long as the page supports it (like the default demo store).  The patch also 
> allows the Currency to be forced as well, and it does appear to work, but 
> should be more throughly tested.
> Although this patch bypasses the requirement for multiple stores, there may 
> be issues with other aspects of the store, like emails.  However, it is no 
> different than a user who enters your English-based ecommerce store, selects 
> "french", and attempts a checkout.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to