William Davis Sure, I'll report back in a bit. Give me a nudge if I forget...
We're using the paid version of GTranslate, the sub-directory version. The Sub-domain version was too problematic. This does not work well with Miva out of the box but hopefully they have it figured out now. For example cart contents would get cached causing all kinds of problems. Disable cache when an item is added to cart...
GTranslate does have some basic analytics. You'll need to create some custom events, etc., for GA4 based on language selection which will require some js foo.
GTranslate does update canonical urls and also updates the html lang="en" based on language selected. You also have the ability to edit on site translations directly from your web browser which is pretty slick.
So far, as far as SEO is concerned, it seems to have increased our visibility for the alternate language. I haven't seen any negative issues. We have our setup limited to English/Spanish only.
Announcement
Collapse
No announcement yet.
Detecting current Language
Collapse
X
-
Ron Frigon, we've been contemplating implementing such a solution. Could you please report back a few months from now and let us know how it worked out for you?Originally posted by Ron Frigon View PostThank you for the help guys. All makes sense.
Also, is there any analytics involved to determine which traffic is seeing what and order placed?
Leave a comment:
-
Exactly. If you can't do what you need via JS (which you might), then check if:Originally posted by Kent Multer View PostIt looks to me like a timing problem.
Template code runs in the server, before the page is sent to the browser. Javascript runs in the browser, after the template has been completely rendered. So you can't use an mvt:if to check the value of a variable that won't have a value until after the template has been rendered.
&mvt:system:http_accept_language; or &mvt:system:miva_language; is coming from the customer's browser or an internal variable miva uses. (don't know--never used).
Leave a comment:
-
It looks to me like a timing problem.
Template code runs in the server, before the page is sent to the browser. Javascript runs in the browser, after the template has been completely rendered. So you can't use an mvt:if to check the value of a variable that won't have a value until after the template has been rendered.
Leave a comment:
-
Detecting current Language
We recently added a translate widget to our site. I'm trying to switch some content based on the current language selected.
I was provided with this script sample.
This should get me the current language. Now I want to do something like:Code:var current_lang = document.getElementsByTagName('html')[0].getAttribute('lang');
I'm just spinning my wheels. Seems like it should be simple...Code:<mvt:if expr="'es' IN g.current_lang"> // do this <mvt:else> // do something else </mvt:if>
Tags: None
Leave a comment: