Page 1 of 1

Internationalisation (i18n)

Posted: Mon 13. Aug 2012, 17:16
by breitsch
is there any chance to:

- include the translations (4 Languages) into the search engine?
- have a language-switch on the site nevertheless the scripts uses the browser language, so I can still choose the language on the site?

Re: Internationalisation (i18n)

Posted: Wed 15. Aug 2012, 09:55
by breitsch
...
and what happens with Google Search?

Re: Internationalisation (i18n)

Posted: Wed 15. Aug 2012, 16:04
by update
I think that probably almost no one got the meaning of your question. Is possible at least...
The second part of your question couls be answered with yes (in case I got it right), because the browser language could be injected in any case and is therefore quite independent.

Re: Internationalisation (i18n)

Posted: Wed 15. Aug 2012, 18:08
by breitsch
OK another try:

I have a website, default language is german (the content in the DB is in german).
Now I activate the i18n feature and translate the content in the files (folder: template_lang) for english, french, italian.
Everything works fine in my browser.

Now my questions:
1. When I enter an english expression (that exists in my website) into the search field in my website, the phpwcms-search-engine won't find anything (because the expression is not in the database, just in the internationalisation files), is there a workaround for this issue?

2. although my browser language shows me the correct language I would like to have a language-switch on the website, so I can still switch to another language than my browser-language.

3. Does Google find my english, french, italian content? The DB contains only german content, default language is german. Does Google crawl my site with different language HTTP_ACCEPT_LANGUAGE settings? I guess not. And even if; when i click a link to my site in Google Search Listings which refers to english content on my site I may end up in the italian translation for that site when my browser language is italian.

Point 3 actually is crucial for the whole concept.

Re: Internationalisation (i18n)

Posted: Wed 15. Aug 2012, 21:23
by update
ad 1: This I don't know, never thought about it.
ad 2: a language switch based upon levels? This would always work together with browser / doctype lang: Force it like so (example):

Code: Select all

<?php
//$phpwcms['DOCTYPE_LANG'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$level_id = isset($GLOBALS['LEVEL_ID'][1]) ?  $GLOBALS['LEVEL_ID'][1] : 0;
$id = 0;
if ($level_id == 8 ) {// === [SHOP] Seiten
$phpwcms['DOCTYPE_LANG'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
if ($level_id == 123 ) {// === [FORUM] Seiten
$phpwcms['DOCTYPE_LANG'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
if ($level_id == 11 ) {// === [DE] Beispiel-Seiten
$phpwcms['DOCTYPE_LANG'] = 'de-de';
$phpwcms['i18_lang'] = 'de';
}
//...and so on
?>
ad 3: If the different languages are only provided by i18n files I doubt if google can find the content. But for what are the HTTP_ACCEPT_LANGUAGE settings if not for telling a browser/search engine what to accept?
So my conclusion: Arrange the different langs in different levels even if with i18n files only, tell the document which lang to serve and the browser what to accept.

But this sounds very complicated...
Tell me if I'm totally wrong or getting you wrong still.... ;)

Re: Internationalisation (i18n)

Posted: Wed 15. Aug 2012, 22:39
by Oliver Georgi
The search is for content while the i18n thing is for templating — nothing else! Do not mix that although it is possible.

Re: Internationalisation (i18n)

Posted: Thu 16. Aug 2012, 11:12
by update
Oliver Georgi wrote:the i18n thing is for templating
Ah, yes, I use it for this purpose, but breitsch's question has been so challenging ;)