I am looking into creating a 1:1 multi-language site which also uses Merchello. Is there any way that I can retrieve the product properties in the other languages? I realise I can use: product.SpecifyCulture(languageISO); but that seems to set the culture for the product itself and I need to unset at the end of the partial view which isn't really going to work too well.
You should not need to use product.SpecifyCulture if the language is set via the Umbraco back office (e.g. typical multi-lingual trees). Is that not working?
Thanks for your reply. I got back from my Easter holiday and I have created a standard multi-national site as far as I can tell. This is not what I want in the long term but I thought I'd go back to basics to get that working first.
I have the site in English and French. The UK site is set with a culture and hostnames of http://localhost/en and language en-GB. The FR site is set with a culture and hostnames of http://localhost/fr and language of fr-FR.
My standard English and French pages are showing the correct body text. I am using extended content in the products and have set the English and French body text accordingly. I have set the merchello.config to:
I have one product. I set the URL Slug for the French version of the extended product data in the render tab to frtestproduct and the English version to testproduct.
When I go to localhost/en/testproduct I see the product page in English text.
When I go to localhost/fr/frtestproduct (or localhost/fr/testproduct) I see the product page in English text and not French.
Am I missing something / doing something wrong / misunderstood how this is meant to work?
I've been holding off coming back with an answer until I knew what was going on. It does work with SpecifyCulture but setting that is causing all kinds of problems.
My content finder is working but I can see that having to set SpecifyCulture in my product view is having odd effects on the content finder itself. Ideally what I want is for MerchelloHelper().TypedProductContentBySlug(slug); to be able to accept a culture and for it only to return the product if there is a slug name that matches in that culture. At the moment I can add the English product name to the end of my French Url and the content finder will return the product even though that product slug is not valid in that culture.
I'll keep working on it. I have removed the Merchello content finder from the content finder collection to ensure that is not conflicting. Incidentally, we think there is an issue with the PrepareSlug function in that it appears to remove the prefix throughout the slug and not just from the beginning. e.g. /fr/test-product-french seems to be returning test-product-ench.
Hey Steve - sorry for the late reply. I'm out of town this week.
I like the idea of having the TypedContentProductBySlug accept the culture. The issue is going to be somewhat complex to completely fix now that IProductContent is cached since any modification will changed the cached version. Maybe doing something like they do in Umbraco's new caching stuff where the object is cloned on the way in and out would help here. Alternatively proxies could be set up and cached for each culture specified - which might be the easiest change until we can do a more comprehensive refactoring in a later major version.
I'll have to look again, but I think the extension method AsProductContent may be setting the culture to the default culture as well. This might need an overload that accepts the culture.
I am new in Merchello, How to implement multi languages and Multiple currencies in Merchello, Is this possible? please provide me some code samples. I am stuck on this.
Merchello with 1:1 Multi-language site
Hi,
I am looking into creating a 1:1 multi-language site which also uses Merchello. Is there any way that I can retrieve the product properties in the other languages? I realise I can use: product.SpecifyCulture(languageISO); but that seems to set the culture for the product itself and I need to unset at the end of the partial view which isn't really going to work too well.
Thank you,
Best regards,
Steve
Hi Steve,
You should not need to use
product.SpecifyCulture
if the language is set via the Umbraco back office (e.g. typical multi-lingual trees). Is that not working?Hi Rusty,
Thanks for your reply. I got back from my Easter holiday and I have created a standard multi-national site as far as I can tell. This is not what I want in the long term but I thought I'd go back to basics to get that working first.
I have the site in English and French. The UK site is set with a culture and hostnames of http://localhost/en and language en-GB. The FR site is set with a culture and hostnames of http://localhost/fr and language of fr-FR.
My standard English and French pages are showing the correct body text. I am using extended content in the products and have set the English and French body text accordingly. I have set the merchello.config to:
route cultureName="en-GB" productSlugPrefix="en" route cultureName="fr-FR" productSlugPrefix="fr"
I have one product. I set the URL Slug for the French version of the extended product data in the render tab to frtestproduct and the English version to testproduct.
When I go to localhost/en/testproduct I see the product page in English text. When I go to localhost/fr/frtestproduct (or localhost/fr/testproduct) I see the product page in English text and not French.
Am I missing something / doing something wrong / misunderstood how this is meant to work?
Best regards,
Steve
Hey Steve - does it work if you do use the
SpecifyCulture
method?I just had a quick look and it appears that a caching revision may be at fault here - not confirmed but it needs to be tested.
I added an issue here http://issues.merchello.com/youtrack/issue/M-1317
Hi Steve,
did you get the languages to work in the end?
Thanks, Edi
Hi Rusty,
I've been holding off coming back with an answer until I knew what was going on. It does work with SpecifyCulture but setting that is causing all kinds of problems.
My content finder is working but I can see that having to set SpecifyCulture in my product view is having odd effects on the content finder itself. Ideally what I want is for MerchelloHelper().TypedProductContentBySlug(slug); to be able to accept a culture and for it only to return the product if there is a slug name that matches in that culture. At the moment I can add the English product name to the end of my French Url and the content finder will return the product even though that product slug is not valid in that culture.
I'll keep working on it. I have removed the Merchello content finder from the content finder collection to ensure that is not conflicting. Incidentally, we think there is an issue with the PrepareSlug function in that it appears to remove the prefix throughout the slug and not just from the beginning. e.g. /fr/test-product-french seems to be returning test-product-ench.
Cheers,
Steve
Hey Steve - sorry for the late reply. I'm out of town this week.
I like the idea of having the
TypedContentProductBySlug
accept the culture. The issue is going to be somewhat complex to completely fix now that IProductContent is cached since any modification will changed the cached version. Maybe doing something like they do in Umbraco's new caching stuff where the object is cloned on the way in and out would help here. Alternatively proxies could be set up and cached for each culture specified - which might be the easiest change until we can do a more comprehensive refactoring in a later major version.I'll have to look again, but I think the extension method
AsProductContent
may be setting the culture to the default culture as well. This might need an overload that accepts the culture.Hi Rusty / Steve,
I am new in Merchello, How to implement multi languages and Multiple currencies in Merchello, Is this possible? please provide me some code samples. I am stuck on this.
Hi guys ,
Did you figure out how to implement multiple languages to merchello ? I just cant ..
is working on a reply...