Support for multilanguage sites, Internationalization (I18N) - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13) +--- Thread: Support for multilanguage sites, Internationalization (I18N) (/showthread.php?tid=1221) |
RE: Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2013-04-10 (2013-04-10, 02:10:43)TeeJay Wrote: Hello everyone If you don't encode the language in the URL, the language will default to the user's prefered language from his browser settings. If none of the languages matches, it will default to the default language (the pages without _xx in the slug). (2013-04-10, 02:10:43)TeeJay Wrote: 2) When using these custom permalinks showing all the languages, to the admin panel I wrote Please ask this question in the News Manager thread. I don't know the News manager and its support for multiple languages. (2013-04-10, 02:10:43)TeeJay Wrote: 3) When using custom permalinks showing only the secondary language, in the admin panel I wrote Looks fine. (2013-04-10, 02:10:43)TeeJay Wrote: In this case, everything was wrong. On the title page, it was okay and Czech, correctly switchable into both languages back and forth. However, after clicking onto any menu tab or submenu tab, the language changed into English and couldn't be changed even with my language switching menu (which is: If you are using Chrome, you need to have a favicon.ico in your root directory (see first post in this thread). Otherwise I can't tell without a link to your site. RE: Support for multilanguage sites, Internationalization (I18N) - TeeJay - 2013-04-10 (2013-04-10, 04:47:21)mvlcek Wrote: If you don't encode the language in the URL, the language will default to the user's prefered language from his browser settings. If none of the languages matches, it will default to the default language (the pages without _xx in the slug).Well, despite the fact that I'm Czech I use English Windows 7 and English Opera. Ok, thanks for the explanation. Maybe I'll try if it really works right on "Czech" computers. (2013-04-10, 04:47:21)mvlcek Wrote: Please ask this question in the News Manager thread. I don't know the News manager and its support for multiple languages.I will. (2013-04-10, 04:47:21)mvlcek Wrote: Looks fine.I'm using Opera. I added the icon, I was about to put it there anyway. The site is under a password in a deep folder structure. To eliminate the chance that this would make it not work, I moved it onto a free hosting into root where my personal website was. I set up everything as it should be - as I mentioned as the point #3. Please, look at the site and its behaviour: http://tomas-janecek.php5.cz . Thanks for your time, I don't really know what's wrong. I think you won't have any problems differencing Czech from English, I don't think you understand Czech. Furthermore, you can see the flag of the current language highlighted in the top right corner. Don't look at the design, it's just a demo to make all the needed functions work. And yes, the FancyBox gallery stopped working, don't bother with it, it can be for some other reason. To revise my setup: The Base URL in the admin panel is Code: http://tomas-janecek.php5.cz/ Code: %nondefaultlanguage%/%parent%/%slug%/ And this is my whole .htaccess Code: AddDefaultCharset UTF-8 If needed, here is my plugin list (I tried to disable all I could - everything but I18N plugins, no difference) FancyBoxPlugin, Innovation Theme Plugin, Send Anonymous Data, Czechoslovak Transliteration, I18N Base, I18N, News Manager, Create Post shortcut (News Manager), News Manager RSS, News Manager Title, p01-contact. The problem is obvious - you visit the site, everything is Czech. You click onto any link (no matter if it's in the horizontal tab menu or vertical submenu) and the site switches to English (and yes, it will move onto the page you want, however, not in the desired language). You can't switch it to Czech if you're not on the index (title) page. Thank you, I appreciate your will to help. RE: Support for multilanguage sites, Internationalization (I18N) - TeeJay - 2013-04-11 Here is my reply to end this http://get-simple.info/forums/showthread.php?tid=3972&pid=35334#pid35334 Thank you for your effort. Just look at the bottom part of my post in NM thread, the point 4) is still what I don't understand and the same problem mentioned above. However, custom permalink structure of I18N is not a friend of News Manager. In link above there is a comment where I describe all reasonable options how to use both I18N and NM plugins. Tom RE: Support for multilanguage sites, Internationalization (I18N) - TeeJay - 2013-04-18 Hello once more, a fast question only this time. Is there a way to make the last entry in the breadcrumbs a plain text instead of a hyperlink? It looks nicer and more logical to have the current site as a plain text. This is my breadcrumbs code in the template Code: <p class="breadcrumbs" > Thanks for any ideas RE: Support for multilanguage sites, Internationalization (I18N) - TeeJay - 2013-04-22 (2013-04-10, 04:47:21)mvlcek Wrote:(2013-04-10, 02:10:43)TeeJay Wrote: 3) When using custom permalinks showing only the secondary language, in the admin panel I wrote Found the problem. It was the last line which is ending with "en", but it has to be ending with the standard language code which is "cs" for me. It would be nice to emphasize this fact, it can be easily overlooked. However I need some special rewrite rules for the News Manager now, because the posts of the NM don't seem to work in the second language with /en/ in the address. When there is nothing it works. I have already asked in my topic about this problem. http://get-simple.info/forums/showthread.php?tid=4659 What could be interesting for you maybe is that adding the second version of NM rewrite rules for the secondary langauge (English) Code: RewriteRule ^clanky/tag/([^/.]+)/?$ index.php?id=clanky&tag=$1 [L] If you knew what to do, it would be nice. Thank you. RE: Support for multilanguage sites, Internationalization (I18N) - maggit - 2013-04-25 is there a way to solve the problem with %language% and %nondefaultlanguage% in sitemap? I suppose there mvlcek did something cool, but it's not working for me ----------------------------------- UPD: its work fine, if we have more then 1 language. If it's only one lang, then we shouldn't add %language% and %nondefaultlanguage% in Custom Permalink Structure Setting. Didn't know that RE: Support for multilanguage sites, Internationalization (I18N) - Carlos - 2013-04-30 A suggestion: If you need/want to use I18N (base) in a one-language site, it would be nice to be able to not display (or hide) this in the page manager: Code: If you want to add a new language, just create a page with a slug/URL ending with underscore and the language code (e.g. "index_de" for German). Maybe with a gsconfig setting? RE: Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2013-04-30 I18N version 3.0.7:
Code: define('I18N_SINGLE_LANGUAGE', true); RE: Support for multilanguage sites, Internationalization (I18N) - pavel9 - 2013-05-01 A simple question, you can create a voice separator in the menu, forcing the slug with "#" does not work because is overwritten with default. Thanks RE: Support for multilanguage sites, Internationalization (I18N) - Carlos - 2013-05-01 Maybe this is a known issue. With fancy urls disabled and no custom permalink structure, I get this in Settings (above User settings): Quote:Warning: SimpleXMLElement::addChild() [simplexmlelement.addchild]: unterminated entity reference lang=en in [...]\plugins\i18n_base\sitemap.class.php on line 54 I imagine it's related to Sitemap generation. I've tried disabling it in gsconfig (GSNOSITEMAP, 3.2+) but I suppose I18N doesn't support that (yet). RE: Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2013-05-03 I18N version 3.1:
RE: Support for multilanguage sites, Internationalization (I18N) - Kida - 2013-05-03 hm, for some reason, this doesn't seem to work for me... I have pages created in german and now created a "news_en.xml" version of my "news.xml"... but I can't get to view this. Even when I type /news/?lang=en in the browser, it still shows me the german version (same as lang=de)... same with /de/news and /en/news ... any ideas what the problem might be? Did I forget something? I'm using i18n_header and i18n_navigation already RE: Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2013-05-03 (2013-05-03, 20:28:11)Kida Wrote: hm, for some reason, this doesn't seem to work for me... Did you set the default language (on pages view in adminstration) correctly to "de"? RE: Support for multilanguage sites, Internationalization (I18N) - graphiclunch - 2013-05-03 Hi mvlcek, I building a new site and as usual am I using your plugin. But this time I got these errors: Warning: copy(/home/dan28884/public_html/2013/plugins/i18n_common/loadext.php) [function.copy]: failed to open stream: No such file or directory in /home/dan28884/public_html/2013/plugins/i18n_common/common.php on line 62 Warning: Cannot modify header information - headers already sent by (output started at /home/dan28884/public_html/2013/plugins/i18n_common/common.php:62) in /home/dan28884/public_html/2013/admin/inc/cookie_functions.php on line 23 Warning: Cannot modify header information - headers already sent by (output started at /home/dan28884/public_html/2013/plugins/i18n_common/common.php:62) in /home/dan28884/public_html/2013/admin/inc/cookie_functions.php on line 24 I am using the latest version of GS and of your plugin. Have you any idea what went wrong..? The site in questtion: www.egotag.dk/2013 Best regards, Lasse RE: Support for multilanguage sites, Internationalization (I18N) - Kida - 2013-05-04 (2013-05-03, 20:52:15)mvlcek Wrote:I did... but only after I created all pages. Before it was set to "en"... is that a problem? After I set it to "de" I created a completely new page as test with it's english twin, and it didn't work either...(2013-05-03, 20:28:11)Kida Wrote: hm, for some reason, this doesn't seem to work for me... RE: Support for multilanguage sites, Internationalization (I18N) - Vega - 2013-05-04 (2013-05-03, 21:26:17)graphiclunch Wrote: Hi mvlcek, I have the same problem. Can anybody help ? Thanks. RE: Support for multilanguage sites, Internationalization (I18N) - Kida - 2013-05-05 I figured out where my problem is... instead of get_page_content I use (and have to use) returnPageContent('slug')... and as the slug for both versions is news (intead of "news" and "news_en") I always get the german (news) version. I know a quick fix is adding _en if the get-parameter lang is set to en, but that's not really nice... also because I guess there is a cookie set after the language was switched, right? Therefore it's be better to work with the right slug (including the _en) all along... get_page_slug() returns it without the ending sadly Is there a way to get the slug WITH the language end?? RE: Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2013-05-05 (2013-05-05, 02:33:51)Kida Wrote: I figured out where my problem is... instead of get_page_content I use (and have to use) returnPageContent('slug')... and as the slug for both versions is news (intead of "news" and "news_en") I always get the german (news) version. Why don't you use I18N's get_i18n_content(slug_without_lang)? RE: Support for multilanguage sites, Internationalization (I18N) - Kida - 2013-05-05 because I need a function, that returns the content to me and not prints it out directly I guess, I'll have to try writing my own return_i18n_content or sth... ... okay, done. that was quite simple actually now I have a return_i18n_content RE: Support for multilanguage sites, Internationalization (I18N) - yojoe - 2013-05-05 I found an odd behaviour of find_i18n_url function in GS 3.2.1 with furls enabled. Example code I use: Code: find_i18n_url('samplepage',$language); Code: http://website/en/en/samplepage Looking at a backup based on GS 3.2 same problem occur. Tried with i18n 3.05 and latest 3.1. Might it be a problem with custom rewrite rules ? I've got also two more questions: 1. Is there also a way of getting rid of getting a link containing default language switch in this function ? Because links will be duplicated when using custom url structure with %nondefaultlanguage% ... 2. I wanted to get a standalone link to parent (in respective language), and show it on all its slugs. Is there maybe a builtin' function for this, rather than using below sample code ? Code: $bc = return_i18n_breadcrumbs(return_page_slug()); RE: Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2013-05-05 (2013-05-05, 03:11:15)Kida Wrote: because I need a function, that returns the content to me and not prints it out directly You can use the following to return the pages's XML and get the content using a $slug without language: Code: $xml = I18nFrontend::getPageData($slug); (2013-05-05, 12:12:16)yojoe Wrote: The second parameter should be the parent or null. In your case it outputs the current language and the parent (both 'en'). (2013-05-05, 12:12:16)yojoe Wrote: 2. I wanted to get a standalone link to parent (in respective language), and show it on all its slugs. Your code gives a link to top-most ancestor (if you are on third level or below) - and the second parameter to find_i18n_url is wrong again. In general you don't need to specify the language, if it should not change. To get a link to the parent, you can also use Code: get_i18n_link(get_parent(false)); RE: Support for multilanguage sites, Internationalization (I18N) - yojoe - 2013-05-05 (2013-05-05, 15:37:16)mvlcek Wrote: The second parameter should be the parent or null. In your case it outputs the current language and the parent (both 'en'). Ohhh gracias, that explains all the problems I experienced. Without 2nd parameter I was getting warning with missing argument 2, and I assumed it cannot be just ... NULL. It's not always possible to know the parent when pages are being moved. (disabling error reporting with @ prefix is - you know ... not the way of fixing anything) (2013-05-05, 12:12:16)yojoe Wrote: 2. I wanted to get a standalone link to parent (in respective language), and show it on all its slugs.Yes, the code was supposed to always show top parent in a tree of nested pages, regardless of currently visited slug, and also while visiting the parent page. get_i18n_link only shows parent of current slug if the slug has any. (2013-05-05, 15:37:16)mvlcek Wrote: If you use fancy urls, use the newest plugin version 3.1.1. Updated, everything works fine. Thanks again RE: Support for multilanguage sites, Internationalization (I18N) - mvlcek - 2013-05-06 I18N version 3.2:
RE: Support for multilanguage sites, Internationalization (I18N) - Oleg06 - 2013-05-06 I just had an orgasm RE: Support for multilanguage sites, Internationalization (I18N) - Draxeiro - 2013-05-06 (2013-05-06, 03:21:19)mvlcek Wrote: I18N version 3.2: Just gave it a test run on a site in development (which is still using GS 3.2.0, haven't updated yet to 3.2.1.) but when selecting an link to a local page in the editor %language% or %nondefaultlanguage% (depending on which of the two solutions is used) is still shown in the link instead of the language code (say 'en' or 'de'). Or was I wrongly assuming the 'supports all placeholders also when selecting a page link in the editor' is a solution for the previously brought up and replied upon point by yojoe (around august last year)? See quote below: (2012-08-24, 17:22:59)mvlcek Wrote:yojoe Wrote:While using i18n v3.0.2 with custom link structure %language%/%parent%/%slug% every time I try to insert a link I get a %language% inside the url, which isn't being parsed into language abbeviation. Basically what I've done is use the %language%/%parent%/%slug%/ custom url structure, update the .htaccess file as per the instructions on mvlcek's great documentation site and now updated the plugin to 3.2. So I think I did everything correctly. |