Комбинированное использование Pro и Друпал
Apr 26, 2012 8:56 am by trotsak
Apr 26, 2012 8:56 am by trotsak
Я хотел бы скомбинировать две системы перевода - внутреннюю друпаловскую и автоматическую GPro.
сайт - http://pen4pals.com
Т.е. при выборе языка работает друпаловская система ручного выборочного перевода, а при нажатии Translator перевод всего текста.
как сделать, чтобы редирект GT был не на http://pen4pals.com/en (т.к. этот адрес идет на внутреннюю стстему перенвода), а на http://pen4pals.com/translation/en например?
Re: Комбинированное использование Pro и Друпал
Apr 26, 2012 9:44 am by Yana
Apr 26, 2012 9:44 am by Yana
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 .
Re: Комбинированное использование Pro и Друпал
Apr 26, 2012 10:09 am by trotsak
Apr 26, 2012 10:09 am by trotsak
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.?
# 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]
Re: Комбинированное использование Pro и Друпал
Apr 27, 2012 8:30 am by trotsak
Apr 27, 2012 8:30 am by trotsak
I made so:
# 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?
Re: Комбинированное использование Pro и Друпал
Apr 27, 2012 9:31 am by trotsak
Apr 27, 2012 9:31 am by trotsak
after several experiments I have gone to this modification:
# 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).
Re: Комбинированное использование Pro и Друпал
Apr 27, 2012 11:01 am by Yana
Apr 27, 2012 11:01 am by Yana
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
# 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]