multilanguage switch without Javascript

I was wondering why the language selector uses Javascript?
`

Dutch (The Netherlands)

`
Search engines can never index multilanguage pages that way.
I do sumbit the multilang sitemap but untill now nothing of my lingo efforts show up in the SERP's!

I am now changing to just:
`

Dutch (The Netherlands)

`
It's the same thing right?
So why the JS??

Comments

  • acrylian Administrator, Developer
  • Yes acrylian, several times.

    Search engines
    To make search engines aware of different language versions of your site you need to do the following:

    Enable the seo_locale plugin which provides language change via URL
    Enable the sitemap-extended plugin
    Submit the sitemap generated to Google
    All checked.
    I am just wondering why the javascript? The crawler will not be able to follow the links..
    And I did submit my multilang sitemap to Google Webmaster and put the link in robots.txt
    But again no sign of indexing pages other than the default English.
  • acrylian Administrator, Developer
    Ok, just wanted to be sure. The dynamic locale javascript is actually not of interest to the crawler. It should follow the links in your site map that you either submit directly or via your robots.txt.

    The site map should contain different links to different language versions. Zenphoto itself does not really care about the url regarding that as the language setting is stored in cookies foreach visitor.

    If Google does not follow that I have no idea right now... Porbably the url part of the seo-locale needs to be there anytime if enabled. Will have to talk with sbillard about that.
  • acrylian Administrator, Developer
  • Yeah I am telling, I have some very specific keywords that should instantly show up in the SERP's but nothing.
    On the big multilanguage sites the locale is always in the URI like

    mysite.com/fr/some-folder
    mysite.com/en/some-folder

    which is how I would prefer as well.

    What happens right now with ZP with these links? The locale is written to the cookie?
    I don't see any rewrite rule for these locales in the .htaccess
  • acrylian Administrator, Developer
    As said the selected language is stored in a cookie for each visitor.

    You can use the locale in every link if the seo_locale plugin is enabled, although Zenphoto does not need it.

    However there is no way to enable this locale in the url permanently as nothing generates it.

    sbillard is the author of thte seo_locale plugin so he later surely will respond on the technical possibilities. As always if any change will be in 1.4.3 earliest anyway.
  • seo locale only process links on the input. It does not generate links.
  • acrylian Administrator, Developer
    The next nightly build will contain an extension to the canonical url option of the html_meta_tags plugin to print alternate language links in the header. It's undocumented in the trunk but the seo_locale plugin must be enabled.
  • That's good news acrylian.
    I hereby confirm that my multi language pages are NOT indexed by Google, even if my sitemap and robots.txt are submitted correctly. Google can't find the pages.

    If I do a Google search for:
    `my-other-language-keyword site:mysite.com`
    I get zero results..
  • acrylian Administrator, Developer
    Ok, please try with the html_meta_data addition for the alternate languages and report what happens when Google re-indexes.

    Changing the language handling would be a quite major thing and result in a lot of incompatibilities.
  • I'll do!
    Just out of curiosity, a major thing rewriting the URL's the mysite/fr/folder/ way?
    What about sub domains like in the Google examples you pointed out like fr.mysite/folder/
  • acrylian Administrator, Developer
    Zenphoto can only be run via either a folder or the root, not both as the htaccess needs one rewrite base. (folder that would be "/folder", root that is "/").

    Zenphoto's urls are not language dependent, the seo locale adds that for switching. Zenphoto stores that in a cookie/session. If you want to have fixed urls for each language the whole url generation internally would have to be change which would make a lot of custom usages in custom themes or plugins possibly.

    Just doing this via htaccess will not really work as that does not "know" about any ZP related settings (for example what languages you actually use).

    We will try to solve this conveniently for all sides. Sbillard is actually the expert on this.

    We made this for users conveniently not machines...;-) Strange is, that no one ever complained before! Either no one uses the multilingual feature or they all don't care...
  • And in addition, much extra overhead since when you supply the language id in the url it must store the cookie and redirect to the proper url.
  • Strange is, that no one ever complained before! Either no one uses the multilingual feature or they all don't care...
    I think it's just that no one really tested the indexing of multi language pages acrylian...
    I was reading some Google documentation and with the `site:somesite.com` search for your keywords you can see if the page is really indexed.

    btw I also found a multilanguage issue using the sitemap plugin..
    I have the "Google image and video extension" enabled
    but when looking in the sitemap-zenphoto-albums-1.xml
    I see that the multilanguage captions and titles are not ported.

    for example the photo on the page `mysite.com/surfing/surf-7279.jpg.php`
    in English has
    title: "Surfen 7196"
    description: "Surf session on 05/12/2011"

    in Dutch
    title: "Surfen 7196"
    description: "Surf sessie op 05/12/2011"

    here is what the sitemap rendered:
    `
    ...

    http://mysite.com/en_US/surfing
    2012-02-14T17:18:48Z
    daily
    0.8

    http://mysite.com/cache/surfing/surf-7279_900_logo.jpg
    Surf 7279
    Surf session on 05/12/2011
    http://mysite.com/pages/copyright-notice-and-license
    mytown, Italy



    http://mysite.com/nl_NL/surfing
    2012-02-14T17:18:48Z
    daily
    0.8

    http://mysite.com/cache/surfing/surf-7279_900_logo.jpg
    Surf 7279
    Surf session on 05/12/2011
    http://mysite.com/pages/copyright-notice-and-license
    mytown, Italy


    ...
    `
  • acrylian Administrator, Developer
    I think it's just that no one really tested the indexing of multi language pages acrylian...
    That's what I mean. We appreciate that you tested this so extensively.

    Regarding the site map: Thanks, that's indeed a bug!
  • acrylian Administrator, Developer
    The site map issue at least should be fixed in tonight's nightly.
  • Note that the locale may be set with a query parameter to the URI: `locale=xx`.

    So, if you can get your .htaccess to deal with the `fr.domain.com` redirection to add the `locale=fr` to the rewritten URI quiry parameters then all will work.
  • acrylian Administrator, Developer
    But would that help if Google & Co indeed cannot index multilingual content with the alternate links?

    But maybe htaccess tricks help us here.
  • acrylian, just a quick note, I downloaded the html_meta_tags.php extensions from the nightlys and it seems you forgot to close the alternate link tags.

    in line 291
    `$meta .= ''."\n";`
  • acrylian Administrator, Developer
    Oops, indeed! Fixed for tonight's nightly.
  • Oops :-) I also had to comment out line 250
    `// $lang = strtr($lang, '_','-');`

    because the links language is with underscores as from the foreach loop.
    that will also add the current active language to the alternate links.

    btw... I am just reading on Google Webmaster
    http://support.google.com/webmasters/bin/answer.py?hl=en&answer=182192&topic=2370587&ctx=topic

    Keep the content for each language on separate URLs. Don’t use cookies to show translated versions of the page.

    URL parameters like site.com?loc=de Not recommended.

    sbillard, any more help with subdomain rewrites would be very appreciated..
    I am a noob when it comes to .htaccess and rewrite rules.
  • Sorry, .htaccess is also not a forte of mine. I do not have a way to make that work. Just noting that if someone knows how to rewrite such a link then things will be fine.
  • acrylian Administrator, Developer
    Oops :-) I also had to comment out line 250
    // $lang = strtr($lang, '_','-');
    I have to look, actually I had to add something like that so this didn't happen actually. In the urls you need locales like "en-En" while the translation - in urls as well - uses "en_EN". Maybe something got confused but I was sure I did test that the current is not included specifically...

    I did read that his is written on the Google webmaster. As said we made it for people instead of machines and this is not easily changed.

    I am sadly no htaccess expert either but I am not sure this will really help since Zenphoto does not care for the url. Once you are within the language it is nowhere added.
  • acrylian Administrator, Developer
    You were right with the underscore. The issue should be fixed now, hopefully...:-)
  • If your host does equate `fr.domain.com` with `domain.com` or if you can make a subdomain `fr.domain.com` to point to the zenphoto installation then you can try out the developement nightly build. There we will select the language from the `fr`.

    My site naturally passes these subdomains to the closest defined subdomain, so all works. But other sites may require that you set up a specific subdomain foreach language.
  • whoa sbillard so you are saying you got it to work?!
    Sweeeet! I need to try it out this week.
    I don't know yet how I can make subdomains with my MAMP install to try, but I'll give it a try..

    acrylian, so the current active language should not be included in the alternate links than?
    I am getting the nightly!

    Thanks guys!
  • acrylian Administrator, Developer
    For using domains or virtual hosts you need to buy MAMP Pro I think.

    Yes, it should now work as expected. If not just let me know..:-)
  • sbillard, I just tested the DEV version on my MAMP install and it works!
    Great achievement, thanks so much!

    The dynamic-locale plugin to switch the languages still dominates over the subdomain but I think that would not be to difficult to get it to work.
    I was thinking what else needs to be changed.. any references to the ?locale variable.
    RSS feeds, the sitemap plugin, acrylian's HTML canonical & alternate language meta's,.. Anything else?
    Could you maybe tell me where the guts of the code reside?
    [EDIT, ok I am just leraning about the Trac, it's here right? http://www.zenphoto.org/trac/changeset/9290]
    Could I port them over to my current 1.4.2.1 release?
    Are you planning this feature in a future update?

    Anyway, just for reference for anyone wanting to add subdomains in a local MAMP install:

    1) Edit Mac hosts file
    open Terminal and type `sudo pico /etc/hosts`
    enter password at the prompt
    use the arrow keys to scroll down to the end of the hosts file and add the following lines:
    `
    127.0.0.1 nl.localhost
    127.0.0.1 fr.localhost
    127.0.0.1 it.localhost
    `
    edit entries to match the domain and sub-domains you want to create
    add as many sub-domains as needed, now or later
    save the file and exit by typing Ctrl+O, Enter, and then Ctrl+X.

    2) Edit Apache config file
    open /Applications/MAMP/conf/apache/httpd.conf in a text editor and scroll down to the line that says "# NameVirtualHost *"
    replace that line with the following code:
    `
    NameVirtualHost *

    ServerName localhost
    ServerAlias localhost *.localhost
    DocumentRoot "/Applications/MAMP/htdocs/"

    Options Indexes FollowSymLinks Includes
    AllowOverride All
    Order allow,deny
    Allow from all


    `
    save the file and then restart Apache by clicking “Stop” and then “Start” in the MAMP control panel
Sign In or Register to comment.