Thread: Major Additions - vB Enterprise Translator
View Single Post
  #2  
Old 01-07-2010, 01:54 PM
NLP-er's Avatar
NLP-er NLP-er is offline
 
Join Date: Aug 2008
Location: Wrocław
Posts: 1,353
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is FAQ
Questions:
What is required for this mod to work?
After translation I get blank page - what is wrong?
After translation all text disappear - what is wrong?
I have SEO translation links on, I use vBSEO and main page is not translating - what is wrong?
What to do, to have translations links good for SEO consensus?
I have indexed pages from old translator (with hl=) - what to do?
I have indexed pages from old links type (with language=) and want switch to SEO links- what to do?
How do you get back to default language after you click a flag?
I have warnings in safe mode - what to do?
Can I add translated pages to sitemap?

Answers:
What is required for this mod to work?
- You must install it and configure it appropriatelly (please read parameters descriptions carefully)
- You must have installed CURL in your php. Most servers already have it. Just install this mod and if it is not working then ask your server stuff to install CURL. In meantime you can disable mod or remove flags so users will not be affected. If you get blank page for translation pages (it will not affect your normal pages) it means that you don't have CURL installed - just install it
- You must have installed ICONV in your php. Most servers already have it. If not an error will occur or blank page for translations.

After translation I get blank page - what is wrong?
Just read answer for previous question

After translation all text disappear - what is wrong?
2 possibilities:
- You didn't fallow installation instructions. You MUST configure at least Forum language option and Yandex Translation API key. Just configure mod
- You set wrong Yandex API key - just set there appropriate value.

I have SEO translation links on, I use vBSEO and main page is not translating - what is wrong?
First, make sure that your .htaccess rules are OK - especially for forums with subdirectory in URL.

What to do, to have translations links good for SEO consensus?
You have to set appropriate option in Admin CP and change/create .htaccess file (NOTE: you can use SEO translation links even without vbSEO!)
for users without vbSEO
- If you don't have .htaccess file then use the one from do-not-upload directory in mod package - just upload it to your forum directory
- If you have .htaccess file, then add those lines there:
Code:
RewriteRule ^/?(af|sq|ar|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|de|el|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|zh-TW|th|tr|uk|vi|sq|ca|et|tl|gl|hi|id|lv|lt|mt|sl|uk|vi|cy|yi)/archive/index.php/(.*)?$ archive/index.php?/$2&language=$1 [L,QSA]
RewriteRule ^/?(af|sq|ar|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|de|el|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|zh-TW|th|tr|uk|vi|cy|yi)/$ index.php?language=$1 [L,QSA]
RewriteRule ^/?(af|sq|ar|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|de|el|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|zh-TW|th|tr|uk|vi|cy|yi)/(.*)?$ $2?language=$1 [L,QSA]
for vbSEO users
Edit .htaccess file:
Put those rules JUST BEFORE all rules to vbseo.php:
Code:
RewriteRule ^/?(af|sq|ar|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|de|el|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|zh-TW|th|tr|uk|vi|cy|yi)/$ vbenterprisetranslator_seo.php?vbet_lang=$1&redirected=/ [L,QSA]
RewriteRule ^/?(af|sq|ar|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|de|el|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|zh-TW|th|tr|uk|vi|cy|yi)/(.*)?$ vbenterprisetranslator_seo.php?vbet_lang=$1&redirected=/$2 [L,QSA]

RewriteCond %{REQUEST_URI} !(admincp/|modcp/|vbseo_sitemap/|cron)
RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbenterprisetranslator_seo.php [L,QSA]
Now - if your forum use subdirectory in URL, then change 2 first rules adding your forum directory with leading '/' just after redirected=. So i.e. if your forum is in forum directory then you will have redirected=/forum/ and redirected=/forum/$2

I have indexed pages from old translator (with hl=) - what to do?
Just set rewrite rule in .htaccess - Google will know that page have new place and will reindex it without any loss
Code:
RewriteCond %{QUERY_STRING} (hl=)(zh-TW|zh-CN|..)$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1\?language=%2 [L,R=301]
I have indexed pages from old links type (with language=) and want switch to SEO links- what to do?
First make SEO links available. After that add this rule to .htaccess (before SEO rules):
Code:
RewriteCond %{QUERY_STRING} (hl=|language=)(zh-TW|zh-CN|..)
RewriteRule ^(.*)$ http://%{HTTP_HOST}/%2/$1? [L,R=301]
Note that this rule will also handle redirections for links from old translator (with hl=)

How do you get back to default language after you click a flag?
If you have set tracking option on, then to go back to your default language you must just click flag for your default language

I have warnings in safe mode - what to do?
Just turn off save mode - it is DEPRECATED in php and not supported in future versions. See here for details:
http://us2.php.net/manual/en/ini.sec...#ini.safe-mode

Can I add translated pages to sitemap?
You can simply integrate vBET with vBSEO Sitemap Generator (it is free) to include links to translated pages into generated sitemap.

Please note that instructions below will allow you to add into your sitemap links for threads translated pages. Because of performance reason those links will not be translated - there will be only added language code. Google will find real page anyway since you will get 301 redirect. Please note that it is not best approach - Google prefers to have final links in sitemap not redirecting one, but forcing translation of thousands links in all languages in the same time could kill your server or be threated by Google as attack (if links are not cached yet).

If you have any PHP programming skills you can modify instructions below to support also other parts of sitemap - not only threads URLs. Solution below will add translated links only for first pages of threads.

Integration instructions:
You just have to edit one file: vbseo_sitemap_functions.php in vbseo_sitemap directory.

Find:
PHP Code:
vbseo_log_entry("[showthread] forum_id: $forumid, thread_id: $threadrow[threadid], total posts: $totalposts, pages: $totalpages, views: $threadrow[views] $prior"); 
And place AFTER it...

For SEO links
PHP Code:
//additional code 
$alanguages = array ('af','sq','ar','be','bg','ca','zh-CN','hr','cs','da','nl','en','pl','et','tl','fi','fr','gl','de','el','iw','hi','hu','is','id','ga','it','ja','ko','lv','lt','mk','ms','mt','no','fa','pt','ro','ru','sr','sk','sl','es','sw','sv','zh-TW','th','tr','uk','vi','cy','yi'); 
if(!
$archived) { 
  
$strlenhost strlen($vbseo_vars['bburl']."/"); 
  
$currentthreadurl vbseo_url_thread($threadrow1$archived);
  
$currentthreadurl_before substr($currentthreadurl,0,$strlenhost);
  
$currentthreadurl_after "/".substr($currentthreadurl,$strlenhost);
  
$lastpost =& $threadrow['lastpost'];
  
$vbseo_stat['t'] += sizeof($alanguages);
  foreach(
$alanguages as $language) { 
    
vbseo_add_url($currentthreadurl_before.$language.$currentthreadurl_after$prior$lastpost$freq); 
  } 
}   
//end additional code 
NOTE: REMOVE YOUR DEFAULT LANGUAGE CODE and not supported languages codes from $alanguages
Also if you disabled some languages in option panel you have to delete its codes too.

For links with language=
PHP Code:
//additional code
$alanguages = array ('af','sq','ar','be','bg','ca','zh-CN','hr','cs','da','nl','en','pl','et','tl','fi','fr','gl','de','el','iw','hi','hu','is','id','ga','it','ja','ko','lv','lt','mk','ms','mt','no','fa','pt','ro','ru','sr','sk','sl','es','sw','sv','zh-TW','th','tr','uk','vi','cy','yi');
if(!
$archived) {
  
$currentthreadurl vbseo_url_thread($threadrow1$archived) . '&language=';
  
$vbseo_stat['t'] += sizeof($alanguages);
  
$lastpost =& $threadrow['lastpost'];
  foreach(
$alanguages as $language) {
    
vbseo_add_url($currentthreadurl.$language$prior$lastpost$freq);
  } 
}  
//end additional code 
NOTE: REMOVE YOUR DEFAULT LANGUAGE CODE and not supported languages codes from $alanguages
Also if you disabled some languages in option panel you have to delete its codes too.

NOTE FOR SITEMAP INTEGRATION:
If you want to add to sitemap also links for other thread pages (if thread have several pages), then additional code must be added BEFORE:
PHP Code:
$vbseo_stat[$archived?'at':'t'] += vbseo_add_2urls
Also in additional code you have to change 1 to $p.


Piece of cake
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01702 seconds
  • Memory Usage 1,858KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code
  • (4)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete