Internationalization - MODX Community Forums https://forums.modx.com/board/?board=104 <![CDATA[multilingual website without babel or migxmultilang]]> https://forums.modx.com/thread/101523/multilingual-website-without-babel-or-migxmultilang#dis-post-559649
Several years ago I implemented a multilingual website following the "gateway" tutorial:

https://docs.modx.com/revolution/2.x/administering-your-site/contexts/using-one-gateway-plugin-to-manage-multiple-domains

My implementation was working fine but today there are new plugins such as Babel or MigxMultiLang

I try to avoid to have too many plugins on my websites

Is it really worth installing Babel or MigxMultiLang? Are there pro and cons regarding these plugins compared with the gateway method ?

Thank you and I wish you all a happy New Year ! smiley]]>
https://forums.modx.com/thread/101523/multilingual-website-without-babel-or-migxmultilang#dis-post-559649 Tue, 17 Jul 2018 01:05:17 +0000 https://forums.modx.com/thread/101523/multilingual-website-without-babel-or-migxmultilang#dis-post-559649
<![CDATA[LangRouter working with Babel]]> https://forums.modx.com/thread/103389/langrouter-working-with-babel#dis-post-559511
The links for home pages in any of the languages are not working, but for error pages or the wrong specified paths are.

For configuring babel i was following this tutorial: https://anyscreensize.com/blog/modx-multilingual/ , for langRouter I was going through the official documentation: http://jako.github.io/LangRouter/usage/

Friendly URL and use_alias_path are enabled, gateway plugin is disabled, because I read somewhere that it is not recommended to have two plugins running at the same time.

Example:
localhost/modx/en/ not working
localhost/modx/en/blabla working

.htaccess
RewriteEngine On
RewriteBase /modx

# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
#RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
#
# or for the opposite domain.com -> www.domain.com use the following
# DO NOT USE BOTH
#
#RewriteCond %{HTTP_HOST} !^$
#RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteCond %{HTTP_HOST} (.+)$
#RewriteRule ^(.*)$ https://www.%1/$1 [R=301,L] .


# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
# https://www.domain.com when your cert only allows https://secure.domain.com
#RewriteCond %{SERVER_PORT} !^443
#RewriteRule (.*) https://example-domain-please-change.com/$1 [R=301,L]

# Redirect the manager to a specific domain - don't rename the ht.access file
# in the manager folder to use this this rule
#RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com$ [NC]
#RewriteCond %{REQUEST_URI} ^/manager [NC]
#RewriteRule ^(.*)$ https://example-domain-please-change.com/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(en|de)/favicon.ico$ favicon.ico [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(en|de)/assets(.*)$ assets$2 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|de)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]

]]>
https://forums.modx.com/thread/103389/langrouter-working-with-babel#dis-post-559511 Thu, 12 Jul 2018 09:45:05 +0000 https://forums.modx.com/thread/103389/langrouter-working-with-babel#dis-post-559511
<![CDATA[Multilanguage with user sessions]]> https://forums.modx.com/thread/103765/multilanguage-with-user-sessions#dis-post-558146
I have a site where i have two languages. English is the main one. In the site i have logins for my users. Everything is working fine for changing language the way i have it, but if the user logs in and the language is english then if Greek doesnt work and vice versa.

What is the best way to achieve that? So when a user login in the site on the /en to be able to change it to the other language for example /de and work. Anybody has done this before? The way i have it now is to login as english and if you want to change it to login again, but this is not good.

Thanks in advance]]>
https://forums.modx.com/thread/103765/multilanguage-with-user-sessions#dis-post-558146 Sat, 21 Apr 2018 08:19:36 +0000 https://forums.modx.com/thread/103765/multilanguage-with-user-sessions#dis-post-558146
<![CDATA[Modx babel, all links link to the default context and not the relative one]]> https://forums.modx.com/thread/96240/modx-babel-all-links-link-to-the-default-context-and-not-the-relative-one#dis-post-554731 I'm currently setting up a modx multilingual with modx.

Everything is working fine except that a specific context like /fr/ keep linking to all / resources.

Exemple
http://aikidomontreux.com/fr/horizontal-menu/aikido/

click on aikido and you will be redirected to
http://aikidomontreux.com/horizontal-menu/aikido/

instead of :
http://aikidomontreux.com/fr/horizontal-menu/aikido/

Here is my config :
modx : MODX Revolution 2.2.6-pl (traditional)
babel 2.2.5

gateway plugin :
<?php
if($modx->context->get('key') != "mgr"){
                /* grab the current langauge from the cultureKey request var */
                switch ($_REQUEST['cultureKey']) {
                    case 'fr':
                        /* switch the context */
                        $modx->switchContext('fr');
                        break;
                    case 'de':
                        /* switch the context */
                        $modx->switchContext('de');
                        break;
                    default:
                        /* Set the default context here */
                        $modx->switchContext('web');
                        break;
                }
                /* unset GET var to avoid
                 * appending cultureKey=xy to URLs by other components */
                unset($_GET['cultureKey']);
            }


.htaccess :
RewriteEngine On
RewriteBase /



# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^aikidomontreux\.com [NC]
RewriteRule (.*) http://aikidomontreux.com/$1 [R=301,L]
#
# or for the opposite domain.com -> www.domain.com use the following
# DO NOT USE BOTH
#
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
#RewriteRule (.*) http://www.example-domain-please-change.com/$1 [R=301,L]



# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
# https://www.domain.com when your cert only allows https://secure.domain.com
#RewriteCond %{SERVER_PORT} !^443
#RewriteRule (.*) https://example-domain-please-change.com/$1 [R=301,L]





# redirect all requests to /de/favicon.ico and /fr/favicon.ico
# to /favicon.ico
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(en|fr|de)/favicon.ico$ favicon.ico [L,QSA]

# redirect all requests to /de/assets* and /fr/assets* to /assets*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(en|fr|de)/assets(.*)$ assets$2 [L,QSA]

# redirect all other requests to /de/* and /fr/*
# to index.php and set the cultureKey parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|fr|de)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]


contexts :
web
base url : /
culture key : en
site url : http://aikidomontreux.com/
fr
base url : /fr/
culture key : fr
site url : http://aikidomontreux.com/fr/
de
base url : /de/
culture key : de
site url : http://aikidomontreux.com/de/]]>
https://forums.modx.com/thread/96240/modx-babel-all-links-link-to-the-default-context-and-not-the-relative-one#dis-post-554731 Mon, 23 Oct 2017 05:01:31 +0000 https://forums.modx.com/thread/96240/modx-babel-all-links-link-to-the-default-context-and-not-the-relative-one#dis-post-554731
<![CDATA[Babel - Switching between languages without loading the whole template]]> https://forums.modx.com/thread/102847/babel---switching-between-languages-without-loading-the-whole-template#dis-post-554073 https://anyscreensize.com/blog/modx-multilingual/ ), everything works great like it has to.

Right now I have 4 language pages and every page will contain two subpages, so I have 3 templates for each page. I have created home pages for other languages by duplicating the main page(web) and then put it under the appropriate language tree, like you see on the picture:

https://imgur.com/a/6a1GV

Right now i have a Content field for each language page, which has too much of a html code inside of it.

QUESTION: How to load the pages so only the text in the pages will refresh without loading the whole template again if I switch between the languages?

Thank you for your help, Miha.]]>
https://forums.modx.com/thread/102847/babel---switching-between-languages-without-loading-the-whole-template#dis-post-554073 Sat, 23 Sep 2017 04:26:54 +0000 https://forums.modx.com/thread/102847/babel---switching-between-languages-without-loading-the-whole-template#dis-post-554073
<![CDATA[Avoiding duplicate pages in muti-language site]]> https://forums.modx.com/thread/50942/avoiding-duplicate-pages-in-muti-language-site#dis-post-548481
1) Is there a way to post the same page in two languages?
2) is there a way to have a template for each language on the same page/document?

I could use the getfield snippet but this needs to be easy to administrate as well as duplicate. I don’t want to leave too much thinking for the client to deal with.

I was able to work out some duplicate content issues by using ditto and custom tpl for each language. This worked fine with simple content but will not work with this more complex page structure.]]>
https://forums.modx.com/thread/50942/avoiding-duplicate-pages-in-muti-language-site#dis-post-548481 Thu, 02 Feb 2017 12:54:17 +0000 https://forums.modx.com/thread/50942/avoiding-duplicate-pages-in-muti-language-site#dis-post-548481
<![CDATA[Different parent for resource list tv (in manager) based on context]]> https://forums.modx.com/thread/96615/different-parent-for-resource-list-tv-in-manager-based-on-context#dis-post-547802
Problem is that I have a container with widgets for each language. However, in the resource list tv I can only set one ID, so for each language the widgets from that language are shown.

Is there a way to make the parent in the resource list tv dynamic, and have it changed based on the context in which the resource that is being edited is in? I know how to get the context in the frontend, but I don't know if it's possible to get it in the backend, since it's always 'manager' there.]]>
https://forums.modx.com/thread/96615/different-parent-for-resource-list-tv-in-manager-based-on-context#dis-post-547802 Thu, 05 Jan 2017 04:33:35 +0000 https://forums.modx.com/thread/96615/different-parent-for-resource-list-tv-in-manager-based-on-context#dis-post-547802
<![CDATA[unlink resource translate with babel]]> https://forums.modx.com/thread/101308/unlink-resource-translate-with-babel#dis-post-546633
I want unlink DE link traslation:

The result is:

is wrong! Are you have the same problem ?]]>
https://forums.modx.com/thread/101308/unlink-resource-translate-with-babel#dis-post-546633 Wed, 23 Nov 2016 10:54:24 +0000 https://forums.modx.com/thread/101308/unlink-resource-translate-with-babel#dis-post-546633
<![CDATA[Revolution Translation and Translation Tool]]> https://forums.modx.com/thread/91796/revolution-translation-and-translation-tool#dis-post-546225
Anyone is now welcome to contribute to the translations via Crowdin, however, acceptance and integration is the responsibility of Proofreaders.

Current Translation Poofreaders:

Before you get started at Crowdin, you'll need an account to be a translator (it's free). To get one, use this invite link. You have two choices when it comes to translations. You can choose one or both, however, the in-context editing makes things like setup and transactional message strings less likely to see.

Method A: Crowdin Oline Translation

  1. Go to https://crowdin.net/project/modx-revolution
  2. Pick a language you want to translate
  3. Select the file you want to translate (status bar shows progress: grey - not translated, blue - suggestions sent, green - suggestions approved)
  4. Translate (items with red bullet have no suggestion, you should focus on them)

Method B: In-Context Translation

  1. Request the login credentials for in-context editing from help [at] modx [dot] com
  2. Go to http://c1291.paas2.tx.modxcloud.com/manager/ (Firefox freezes on this page, try to use other browser)
  3. Login with your crowdin account in the dialog and pick a language you want to translate
  4. Login to the MODX manager with the credentials from step 1

If you have any questions about translations or contributing, please email help [at] modx [dot] com.]]>
https://forums.modx.com/thread/91796/revolution-translation-and-translation-tool#dis-post-546225 Mon, 07 Nov 2016 09:44:32 +0000 https://forums.modx.com/thread/91796/revolution-translation-and-translation-tool#dis-post-546225
<![CDATA[Babel - BabelLinks adds "?html=" to the link]]> https://forums.modx.com/thread/101188/babel---babellinks-adds-html-to-the-link#dis-post-546156
I'm using the latest Babel-Version and the latest MODx-install.

Everything is working fine, except the BabelLinks are adding a strange

?html=


to the link.

This is what's gappening:

Default-context: www.site.com
EN-context: www.site.com/en/?html=
BR-context: www.site.com/br/?html=

However, the links are working fine, all links are going to the correct page etc. But I'd like to get rid off this strange "?html="-thing.]]>
https://forums.modx.com/thread/101188/babel---babellinks-adds-html-to-the-link#dis-post-546156 Thu, 03 Nov 2016 11:32:00 +0000 https://forums.modx.com/thread/101188/babel---babellinks-adds-html-to-the-link#dis-post-546156
<![CDATA[Ex Yu forums (Serbian, Croatian, Macedonian, Bosnian, Montenegro)]]> https://forums.modx.com/thread/100304/ex-yu-forums-serbian-croatian-macedonian-bosnian-montenegro#dis-post-542539 https://forums.modx.com/thread/100304/ex-yu-forums-serbian-croatian-macedonian-bosnian-montenegro#dis-post-542539 Fri, 17 Jun 2016 01:27:55 +0000 https://forums.modx.com/thread/100304/ex-yu-forums-serbian-croatian-macedonian-bosnian-montenegro#dis-post-542539 <![CDATA[404 Error after installing babel on MODXCloud]]> https://forums.modx.com/thread/97143/404-error-after-installing-babel-on-modxcloud#dis-post-541952 http://designfromwithin.com/blog/modx-multilingual

I'm getting a 404 error after doing everything from the htaccess, plugin, babel and the site_start value. I only have one language, /cn/. I already created a cn sample page with the right start_value. I have lots of page already and my start page is 297. But when I go to www.website.com/cn/index.html, Page Not Found Error.

Here's my .htacess. Changed the domain name of my company to website.com for privacy. I cannot show any codes but here's my htacess

RewriteEngine On
RewriteBase /

# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
#RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
#
# or for the opposite domain.com -> www.domain.com use the following
# DO NOT USE BOTH
#
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.website\.com [NC]
RewriteRule (.*) http://www.website.com/$1 [R=301,L]



# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
# https://www.domain.com when your cert only allows https://secure.domain.com
#RewriteCond %{SERVER_PORT} !^443
#RewriteRule (.*) https://example-domain-please-change.com/$1 [R=301,L]



# redirect all requests to /de/favicon.ico and /nl/favicon.ico
# to /favicon.ico
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(en|cn)/favicon.ico$ favicon.ico [L,QSA]
						  
# redirect all requests to /de/assets* and /nl/assets* to /assets*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(en|cn)/assets(.*)$ assets$2 [L,QSA]
						 
# redirect all other requests to /de/* and /nl/*
# to index.php and set the cultureKey parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|cn)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]



and here's my gateway plugin

if($modx->context->get('key') != "mgr"){
			/* grab the current langauge from the cultureKey request var */
			switch ($_REQUEST['cultureKey']) {
				case 'cn':
					/* switch the context */
					$modx->switchContext('Chinese');
					break;
				default:
					/* Set the default context here */
					$modx->switchContext('web');
					break;
			}
			/* unset GET var to avoid
			 * appending cultureKey=xy to URLs by other components */
			unset($_GET['cultureKey']);
		}


Chinese context looks like this:

]]>
https://forums.modx.com/thread/97143/404-error-after-installing-babel-on-modxcloud#dis-post-541952 Fri, 27 May 2016 06:10:52 +0000 https://forums.modx.com/thread/97143/404-error-after-installing-babel-on-modxcloud#dis-post-541952
<![CDATA[l10ntag fallback language?]]> https://forums.modx.com/thread/100137/l10ntag-fallback-language#dis-post-541465 ]]> https://forums.modx.com/thread/100137/l10ntag-fallback-language#dis-post-541465 Fri, 13 May 2016 01:11:06 +0000 https://forums.modx.com/thread/100137/l10ntag-fallback-language#dis-post-541465 <![CDATA[Babel+getResources menu doesn't switch across the context]]> https://forums.modx.com/thread/99697/babel-getresources-menu-doesn-t-switch-across-the-context#dis-post-539246
I'm pretty new to MODx, especially to multilangual part, sorry for the newbish qustion.

I've installed Babel, everything works perfectly except one thing - when I switch to another context, my menu links do not change, they are the same. It's very frustrating, as I've tried nearly everything that was in google, now I hope I can find help here.

My current menu snippet call looks like this:

[[!getResources? &parents=`[[++site_start]]` &limit=`5` &tpl=`menu_tpl`]]


site_start is a context setting, that indicates parent ID for the context, as it described in tutorials.

I've tried [[++parents]] for &parents, and also I've tried:

[[!getResources? &parents=`[[BabelTranslation? &contextKey=`[[++cultureKey]]`]]` &limit=`5` &tpl=`menu_tpl`]]


Nothing helps. For example, I've made a doc called "test", and it's english version "testen". When I'm on the main page of the site and switch to English context, everything changes to English language, even the menu title changes from "test" to "testen", but when I click on the link it still leads to test.html, not en/test.html

I'm using nginx, if's important.]]>
https://forums.modx.com/thread/99697/babel-getresources-menu-doesn-t-switch-across-the-context#dis-post-539246 Sat, 05 Mar 2016 06:59:48 +0000 https://forums.modx.com/thread/99697/babel-getresources-menu-doesn-t-switch-across-the-context#dis-post-539246
<![CDATA[Nginx + revo + babel + gallery issue with phpthumbs [solved]]]> https://forums.modx.com/thread/97289/nginx-revo-babel-gallery-issue-with-phpthumbs-solved#dis-post-537862
We recently decided for performance purpose to move to nginx + php-fpm on our plesk 12 server.

we faced an issue with the assets path and url rewrite.

First thing was to create new nginx rules for rewrite purpose we started with :


if (!-e $request_filename){
    rewrite ^/(fr|en)?/?(.*)$ /index.php?cultureKey=$1&q=$2 last;
}

expires 7d;
add_header X-UA-Compatible IE=edge,chrome=1;
gzip_proxied any;

gzip on;


It was far from perfect and we added new rules at the begining :


rewrite ^/(fr|en)/assets(.*)$ /assets$2 break;

rewrite ^/(fr|en)/assets/main/css(.*)$ /assets/main/css$2 break;

rewrite ^/(fr|en)/assets/main/js(.*)$ /assets/main/js$2 break;

rewrite ^/(fr|en)/assets/img(.*)$ /assets/img$2 break;

if (!-e $request_filename){
    rewrite ^/(fr|en)?/?(.*)$ /index.php?cultureKey=$1&q=$2 last;
}

expires 7d;
add_header X-UA-Compatible IE=edge,chrome=1;
gzip_proxied any;

gzip on;


everything was nice, BUT we had trouble with the english version of the site where the gallery thumbs were not displayed.

this was due to :

<img class="gal-item" src="/assets/components/gallery/connector.php?action=web/phpthumb&ctx=wen&w=100&h=100&zc=1&far=C&q=90&src=%2Fen%2F%2Fassets%2Fgallery%2F3%2F62.jpg" title="2_Le_domaine_1.jpg">


If you look at the src parameter, you will see it throw a /en//assets/....

I tried evereything in my mind, asked Menno Pietersen for ideas, dig again and found a quick and dirty fix.

I created an output filter as this :

$output='';
$t = $input;
$output = ereg_replace("%2Fen%2F", "", $t);
return $output;


and changed my gallery item thumbs template from :

<a href="[[+image_absolute]]" title="[[+description]]"><img class="[[+cls]]" src="[[+thumbnail]]" alt="[[+name]]" /></a>

to :
<a href="[[+image_absolute]]" title="[[+description]]"><img class="[[+cls]]" src="[[+thumbnail:trim2F]]" alt="[[+name]]" /></a>


This is doing the trick for me as an interim solution.

I am interrested in any idea on how to properly fix it.

Have fun !

Philippe]]>
https://forums.modx.com/thread/97289/nginx-revo-babel-gallery-issue-with-phpthumbs-solved#dis-post-537862 Thu, 04 Feb 2016 09:34:36 +0000 https://forums.modx.com/thread/97289/nginx-revo-babel-gallery-issue-with-phpthumbs-solved#dis-post-537862
<![CDATA[Add a news Lexicon entry using ModX as API from an external script]]> https://forums.modx.com/thread/99313/add-a-news-lexicon-entry-using-modx-as-api-from-an-external-script#dis-post-537208 To retrieve a lexicon value, I can use $modx->lexicon->load but how can I update or create a lexicon entry for a specific language? $modx->lexicon->set with as described on http://api.modx.com/revolution/2.2/db_core_model_modx_modlexicon.class.html ?

$modx->getService('lexicon','modLexicon');
$modx->lexicon->set('mykey',myvalue');

is it the right way or must I use another way?
]]>
https://forums.modx.com/thread/99313/add-a-news-lexicon-entry-using-modx-as-api-from-an-external-script#dis-post-537208 Tue, 19 Jan 2016 11:14:59 +0000 https://forums.modx.com/thread/99313/add-a-news-lexicon-entry-using-modx-as-api-from-an-external-script#dis-post-537208
<![CDATA[Using MIGXmultilang for internationalization]]> https://forums.modx.com/thread/98001/using-migxmultilang-for-internationalization#dis-post-532511
I'm starting a new thread echoing this one that may be misplaced :
http://forums.modx.com/thread/88554/babel-or-migxmultilang?page=3#dis-post-529206

There are some questions about using MIGXmultilang

  1. Is it possible for a translator to access only the translated part of a resource in the manager ?
    For example, dutch people only access the dutch part that concerns them.
  2. Is it possible for MIGXMultilang to switch between languages by IP using something like GeoIP ?
    For example, someone coming from Netherlands gets the right translation even if he was calling the general .com ?
  3. In the same way, is it possible to switch between languages via a select option ?
  4. How would you do to serve dedicated datas from a custom table based on the language ?
  5. And last but not the least, is it possible to not fallback to the default language for specified resources ? There are cases where some resources would not be published at all in a specified language.

Thanks for your help
]]>
https://forums.modx.com/thread/98001/using-migxmultilang-for-internationalization#dis-post-532511 Wed, 30 Sep 2015 12:04:39 +0000 https://forums.modx.com/thread/98001/using-migxmultilang-for-internationalization#dis-post-532511
<![CDATA[Babel Links with resource group]]> https://forums.modx.com/thread/97102/babel-links-with-resource-group#dis-post-528763
babel links is working fine for me but not for member pages where a user group is checked under "resource groups". Is there an $modx->getOption to show "member pages" which can be used to extend babel with an &showResourceGroups like option?


Best,

Mike]]>
https://forums.modx.com/thread/97102/babel-links-with-resource-group#dis-post-528763 Wed, 22 Jul 2015 03:50:37 +0000 https://forums.modx.com/thread/97102/babel-links-with-resource-group#dis-post-528763
<![CDATA[redirect loop in the pages with babel]]> https://forums.modx.com/thread/97507/redirect-loop-in-the-pages-with-babel#dis-post-527235
My modx project is in the wamp/www/ of my server (wamp server)

RewriteEngine On
RewriteBase /babelmodx/



# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^localhost/babelmodx [NC]
#RewriteRule (.*) http://localhost/babelmodx/$1 [R=301,L]





i've also uncomment the 3 lasts lines but doesn't work ... sad




# The Friendly URLs part
# detect language when requesting the root (/)
RewriteCond %{HTTP:Accept-Language} !^de [NC]
RewriteRule ^$ en/ [R=301,L]
RewriteRule ^$ de/ [R=301,L]
 

# redirect all requests to /en/favicon.ico and /de/favicon.ico
# to /favicon.ico
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(en|nl)/favicon.ico$ favicon.ico [L,QSA]

 

# redirect all requests to /en/assets* and /de/assets* to /assets*
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(en|nl)/assets(.*)$ assets$2 [L,QSA]
 
# redirect all other requests to /en/* and /de/*
# to index.php and set the cultureKey parameter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|nl)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]




My Babel Plugin :


<?php
if($modx->context->get('key') != "mgr")
{
  /* grab the current langauge from the cultureKey request var */
  switch ($_REQUEST['cultureKey']) {
    case 'nl':
      /* switch the context */
      $modx->switchContext('nl');
      break;
    default:
      /* Set the default context here */
      $modx->switchContext('web');
      break;
}
/* unset GET var to avoid
 * appending cultureKey=xy to URLs by other components */
unset($_GET['cultureKey']);
}




Sorry about my bad english and thanks you]]>
https://forums.modx.com/thread/97507/redirect-loop-in-the-pages-with-babel#dis-post-527235 Sun, 21 Jun 2015 03:59:11 +0000 https://forums.modx.com/thread/97507/redirect-loop-in-the-pages-with-babel#dis-post-527235
<![CDATA[BabelLinks not showing up in Babel 3.0.0Beta4]]> https://forums.modx.com/thread/97142/babellinks-not-showing-up-in-babel-3-0-0beta4#dis-post-525848 When updating to Babel 3.0.0Beta4 the BabelLinks are gone.
o Language (context) switching with manually adjusting the site address is working fine.
o Adding this Babel code for the active link in the template is giving the expected response for the active context (a single language item).
<li><a href="[[+url]]" class="[[++cultureKey]][[+active:notempty=` [[+active]]`]]">[[%babel.language_[[++cultureKey]]? &topic=`default` &namespace=`babel`]]</a></li>

Just the complete menu called with [[BabelLinks]] is missing.

I have been following the "Step by Step instructions" in this document http://www.multilingual-modx.com/blog/2011/seo-friendly-multilingual-websites-with-modx-and-babel.html

Do you have a suggestion where to continue looking?]]>
https://forums.modx.com/thread/97142/babellinks-not-showing-up-in-babel-3-0-0beta4#dis-post-525848 Thu, 21 May 2015 04:03:26 +0000 https://forums.modx.com/thread/97142/babellinks-not-showing-up-in-babel-3-0-0beta4#dis-post-525848