Комбинированное использование Pro и Друпал

Popular automatic website translation tool

Комбинированное использование Pro и Друпал

Postby trotsak » Thu Apr 26, 2012 12:56 pm

Я хотел бы скомбинировать две системы перевода - внутреннюю друпаловскую и автоматическую GPro.

сайт - http://pen4pals.com

Т.е. при выборе языка работает друпаловская система ручного выборочного перевода, а при нажатии Translator перевод всего текста.

как сделать, чтобы редирект GT был не на http://pen4pals.com/en (т.к. этот адрес идет на внутреннюю стстему перенвода), а на http://pen4pals.com/translation/en например?
trotsak
 
Posts: 51
Joined: Tue Mar 20, 2012 5:08 am

Re: Комбинированное использование Pro и Друпал

Postby Yana » Thu Apr 26, 2012 1:44 pm

Hi,
If you want to combine the GTranslate and the Drupal translator you should change gtranslate config lines in your .htaccess file and replace replace [a-z] with those language codes which you want to be handled by GTranslate . i.e de|fr|ru
And you can write the rewrite rule to redirect http://pen4pals.com/en to http://pen4pals.com/translation/en .
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4133
Joined: Thu Jan 12, 2012 6:21 pm

Re: Комбинированное использование Pro и Друпал

Postby trotsak » Thu Apr 26, 2012 2:09 pm

Where i have make correction if i want that GT translate was at http://pen4pals.com/english, http://pen4pals.com/german, http://pen4pals.com/russian and etc.?

Code: Select all
# gtranslate config
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|th|tr|uk|ur|vi|cy|yi)/(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|th|tr|uk|ur|vi|cy|yi)/(.*)$ /$1/$3 [R=301,L]
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|th|tr|uk|ur|vi|cy|yi)/(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|th|tr|uk|ur|vi|cy|yi)$ /$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|th|tr|uk|ur|vi|cy|yi)/(.*)$ /gtranslate/translate.php?lang=$1&force_translation=1&url=$2 [L,QSA]
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|th|tr|uk|ur|vi|cy|yi)$ /gtranslate/translate.php?lang=$1&force_translation=1 [L,QSA]
trotsak
 
Posts: 51
Joined: Tue Mar 20, 2012 5:08 am

Re: Комбинированное использование Pro и Друпал

Postby trotsak » Fri Apr 27, 2012 12:30 pm

I made so:

Code: Select all
# gtranslate config
#RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|th|tr|uk|ur|vi|cy|yi)/(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|th|tr|uk|ur|vi|cy|yi)/(.*)$ /$1/$3 [R=301,L]
#RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|th|tr|uk|ur|vi|cy|yi)/(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|th|tr|uk|ur|vi|cy|yi)$ /$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|th|tr|uk|ur|vi|cy|yi)/(.*)$ /gtranslate/translate.php?lang=$1&force_translation=1&url=$2 [L,QSA]
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|th|tr|uk|ur|vi|cy|yi)$ /gtranslate/translate.php?lang=$1&force_translation=1 [L,QSA]


Is it correct?
trotsak
 
Posts: 51
Joined: Tue Mar 20, 2012 5:08 am

Re: Комбинированное использование Pro и Друпал

Postby trotsak » Fri Apr 27, 2012 1:31 pm

after several experiments I have gone to this modification:

Code: Select all
# gtranslate config
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|en|sw|sv|th|tr|uk|ur|vi|cy|yi)/(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|en|sw|sv|th|tr|uk|ur|vi|cy|yi)/(.*)$ /$2/$3 [R=301,L]
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|en|es|sw|sv|th|tr|uk|ur|vi|cy|yi)/(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|en|sw|sv|th|tr|uk|ur|vi|cy|yi)$ /$2/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|sr|sk|sl|sw|sv|th|tr|uk|ur|vi|cy|yi)/(.*)$ /gtranslate/translate.php?lang=$1&force_translation=1&url=$2 [L,QSA]
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|sr|sk|sl|sw|sv|th|tr|uk|ur|vi|cy|yi)$ /gtranslate/translate.php?lang=$1&force_translation=1 [L,QSA]


I have RU ES EN DE in drupal translate system, when I choose other languages by translator is used GT.
One minus of this system that I am not able GT for translate to RU ES EN DE WHOLE page (drupal language choosing system is showed content with choosed language and content with neutral language).
trotsak
 
Posts: 51
Joined: Tue Mar 20, 2012 5:08 am

Re: Комбинированное использование Pro и Друпал

Postby Yana » Fri Apr 27, 2012 3:01 pm

You can choose which languages you want to redirect to GTranslate Pro. To do that you need to replace
af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|et|tl|fi|fr|gl|ka|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|sr|sk|sl|sw|sv|th|tr|uk|ur|vi|cy|yi
with the language codes you want to be directed to GTranslate Pro... In this example Japanese, Russian and French will be handled by GTranslate Pro
Code: Select all
# gtranslate config
RewriteRule ^(ja|fr|it)/(ja|fr|it)/(.*)$ /$1/$3 [R=301,L]
RewriteRule ^(ja|fr|it)/(ja|fr|it)$ /$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(ja|fr|it)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA]
RewriteRule ^(ja|fr|it)$ /gtranslate/translate.php?lang=$1 [L,QSA]
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4133
Joined: Thu Jan 12, 2012 6:21 pm


Who is online

Users browsing this forum: No registered users and 1 guest

2GLux
cron