vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Forum Display Enhancements - vB Enterprise Translator (https://vborg.vbsupport.ru/showthread.php?t=220886)

imported_silkroad 08-17-2009 08:03 AM

Hey NLP-er,

Here is our recommended translation service by one of our team members. They use it and say it is a much better translation than Google.

It costs $100 per one forum / blog.

Maybe you can contact them and work out a revenue sharing relationship? :)

Or, you can add the support as an option for free, up to you, but I recommend a "backup plan" so you /we / us don't have only one translation service.

I think this is easy for you to add to the mod:

http://taragana.com/products/transla...gold/software/

Cheers!

FYI, developer guide here:

http://taragana.com/products/transla...veloper-guide/

Lee G 08-17-2009 09:09 AM

Daft question, how and where do you get the google api key

imported_silkroad 08-17-2009 09:12 AM

Quote:

Originally Posted by Lee G (Post 1869052)
Daft question, how and where do you get the google api key

http://code.google.com/apis/ajaxsearch/signup.html

Lee G 08-17-2009 10:11 AM

Cheers for that and the other tip about the footer link :up:

Top man imported_silkroad

Im still getting the data base errors, even after uninstalling the previous version and installing the new version fresh.

The strange thing is

Even with the cache turned off, if you add any that you wanted cached, the errors still happen, but only on those with a tick in the box.

Even with the cache turned off, page loads are a lot faster with the new version :up:

The only two new data basses I can see that have been created are
vbenterprisetranslator_cache
and
vbenterprisetranslator_cache_short

Great little mod, with my own testing so far :up:

NLP-er 08-17-2009 10:25 AM

Quote:

Originally Posted by imported_silkroad (Post 1868933)
Impressive!

This mod rocks.

Also, you might advise people, just to be safe with the Google Translate TOS, to add a link at the bottom of their forums which says something like:

"Language Translations by Google"

That is what we do, because the Google Translate TOS requires giving credit when you use their services.

Cheers and Wow! Keep up the good work. I'll look at this in more detail soon!

Thanks for hint. I will make it configurable in next release (basing on phrases) :)

NLP-er 08-17-2009 10:26 AM

Quote:

Originally Posted by Lee G (Post 1869052)
Daft question, how and where do you get the google api key

You have link in option panel - just in param description :)

Everything to make your live easier :D

NLP-er 08-17-2009 10:34 AM

Quote:

Originally Posted by sensimilla (Post 1869018)
Any ideas how to make polish fonts beeing displayed correctly ?

demo : http://www.forum.simple-nlp.pl/?language=en

With the previous hack from the graveyard such problem didnt exist.

Hello - mod desn't translate content of html tags parameters.

And you are wrong - previous one had the same :) Also didn't translate parameters :)

That is why some parts are not translated. Translating those can crash whole site (I wil think about limited translation, for specific parameters in specific tags but it can decrase performance and is not critical).
Of course I can make not translated parts be shown correctly - like I did for translation save areas - so It will be in next release :)

NLP-er 08-17-2009 10:38 AM

Quote:

Originally Posted by imported_silkroad (Post 1869025)
Hey NLP-er,

Here is our recommended translation service by one of our team members. They use it and say it is a much better translation than Google.

It costs $100 per one forum / blog.

Maybe you can contact them and work out a revenue sharing relationship? :)

Or, you can add the support as an option for free, up to you, but I recommend a "backup plan" so you /we / us don't have only one translation service.

I think this is easy for you to add to the mod:

http://taragana.com/products/transla...gold/software/

Cheers!

FYI, developer guide here:

http://taragana.com/products/transla...veloper-guide/

Ok :) I will look on that and talk to the guys :)

imported_silkroad 08-17-2009 10:43 AM

On a different kind off-topic note :-)

We are thinking about changes this JQuery script to use GA to show which outbound links are clicked on, grouped by language:

http://www.carronmedia.com/extend-go...s-with-jquery/

We got an error in the script when we ran the example code, but it looks promising :)

NLP-er 08-17-2009 10:55 AM

Quote:

Originally Posted by Lee G (Post 1869070)
Cheers for that and the other tip about the footer link :up:

Top man imported_silkroad

Im still getting the data base errors, even after uninstalling the previous version and installing the new version fresh.

The strange thing is

Even with the cache turned off, if you add any that you wanted cached, the errors still happen, but only on those with a tick in the box.

Even with the cache turned off, page loads are a lot faster with the new version :up:

The only two new data basses I can see that have been created are
vbenterprisetranslator_cache
and
vbenterprisetranslator_cache_short

Great little mod, with my own testing so far :up:

You should have 3 cache tables - that is the problem and cause of errors. Have no idea why one didn't created (maybe some mysql version issues) - I could made research but for this I would need access to your admin cp, ftp, and mysql panel. So if you will be desperate enough just PM me ;)
Meantime - put creation code of medium cache table in mysql panel and see does some error messages occurs.
Code:

"CREATE TABLE " . TABLE_PREFIX . "vbenterprisetranslator_cache_medium (
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
serie BIGINT(14) UNSIGNED,
dateline int(10) UNSIGNED default 0,
tl VARCHAR(5),
originaltext VARCHAR(328),
translated VARCHAR(1000),
UNIQUE (originaltext, tl),
INDEX(serie)
) ENGINE = MYISAM, CHARACTER SET utf8 COLLATE utf8_bin"

Just change " . TABLE_PREFIX . " to tour table prefix value with dot. Let me know about results :)

About errors when cache disabled and checked for language - I found little bug (harmless - always can disable cache for language) and cache is working for 2nd languages group if enabled for language and disabled globally- will be corrected in next release :)

Page loads are really much faster even without cache :D There are lot less requests for translations to google (made several translations at once) - that's why it is so fast :D

Lee G 08-17-2009 11:22 AM

Now your talking scary stuff :D

So if I dont have a cached version of the pages

I dont break any Google TOS

My data base stays about the same size as it already is and dont expand by factor what ever over night. No need to upgrade my VPS plan to the size of the internet X 10

Its only the sitemap that has gone from 8 pages to 84

The translation page loads are almost as quick as if they were cached at present.

As the saying goes, if it aint broken, dont try fixing it

Even with the couple of hours of running this, the hits look very promising so far

This is a great little hack so far. Keep up the good work :up:

Aclikyano 08-17-2009 11:29 AM

doesnt work and shoots this error on top
Warning: Missing argument 3 for vbet_translateHTML(), called in [path]/includes/functions.php(5737) : eval()'d code on line 4 and defined in [path]/includes/vbenterprisetranslator_functions.php on line 385

imported_silkroad 08-17-2009 01:08 PM

Quote:

Originally Posted by Lee G (Post 1869106)
So if I dont have a cached version of the pages

I dont break any Google TOS

The Google TOS, strictly interpreted, says translated pages cannot be cached for over 15 days.

However, if you modify them (fix bad translations), etc. I don't think you should necessarily dump them.

Also, the intent of the TOS is to "Do No Harm" to Google, Google's customers, and The World. If you are keeping a cache longer than 15 days and are not doing any harm, then I don't think your are violating the spirit of the TOS.

For example, if you are running Google Adsense and your translations are generating a lot of traffic for Google, and good revenue for Google, I don't think Google will be unhappy with you, but of course they cannot publish such a policy.

On the other hand, if you are caching translations and using them to drive traffic to Google's big competition, then Google might care.

So, if you want to be on the safe side, just drop all translations in the database that are older than 15 days, and you will be in compliance with the most strict interpretation of the TOS.

Don't Worry. Be Happy. Do No Harm.

Lee G 08-17-2009 01:34 PM

Are you in any violation if you have your sitemap done with links to the new pages, even if the new pages are not stored in the cache?

My own forum might take a it of time to get indexed, since I now have over 1 million pages in the sitemap :D

Before using this mod

Total Indexed URLs: 177936
Total Processing Time: 217.41 seconds

After using this mod

Total Indexed URLs: 1663966
Total Processing Time: 1,738.03 seconds

And Im only using limited languages as per your earlier advice, plus dropped a load of pages I dont need indexed :up:

imported_silkroad 08-17-2009 01:42 PM

Quote:

Originally Posted by Lee G (Post 1869150)
Are you in any violation if you have your sitemap done with links to the new pages, even if the new pages are not stored in the cache?

Of course not.

Why would you "even" think that?

Please don't fabricate TOS violations out of "thin air" ... it is not good for the environment :-)

LoveStream 08-17-2009 04:33 PM

Quote:

Originally Posted by NLP-er (Post 1868895)
1.1.0 RELEASED :)

- Long texts are translated no matter how big those are
- Cache is working for chosen languages (you simply select for each language does translations should be cached)
- Option to add Google Translate API key for translation requests
- Configurable cache time to live and scheduled task which automatically remove old cache.
- Option to show flags only for guests
- Option to easily remove flags border (without any style changing)
- Option to not translate usernames
- During translation changes param lang in html tag
- Option to translate messages changed by vBSEO to JavaScript (it has such functionality for SEO purposes)

ENJOY! :D

Great Release!

Actually the long sentences were translated successfully.

Now I begin in service. :):up:

Yours.

NLP-er 08-17-2009 05:28 PM

Quote:

Originally Posted by Lee G (Post 1869106)
Now your talking scary stuff :D

So if I dont have a cached version of the pages

I dont break any Google TOS

My data base stays about the same size as it already is and dont expand by factor what ever over night. No need to upgrade my VPS plan to the size of the internet X 10

Its only the sitemap that has gone from 8 pages to 84

The translation page loads are almost as quick as if they were cached at present.

As the saying goes, if it aint broken, dont try fixing it

Even with the couple of hours of running this, the hits look very promising so far

This is a great little hack so far. Keep up the good work :up:

:D:D:D Magic ;)

NLP-er 08-17-2009 05:29 PM

Quote:

Originally Posted by Lee G (Post 1869106)
This is a great little hack so far. Keep up the good work :up:

And how about your issue with cache? You created mediu cahce table manually? It works for you now?

NLP-er 08-17-2009 05:33 PM

Quote:

Originally Posted by LoveStream (Post 1869261)
Great Release!

Actually the long sentences were translated successfully.

Now I begin in service. :):up:

Yours.

Heh... Long sentences - mean solid text over 1800 characters without any breaks, images, links. If you have any breaking line then in html you have <br/> and it means that this is not solid text anymore - all releases of this mod translates such text.

This release translates even texts over 1800 characters of solid text. No matter how long it is :)

NLP-er 08-17-2009 05:43 PM

Quote:

Originally Posted by Aclikyano (Post 1869110)
doesnt work and shoots this error on top
Warning: Missing argument 3 for vbet_translateHTML(), called in [path]/includes/functions.php(5737) : eval()'d code on line 4 and defined in [path]/includes/vbenterprisetranslator_functions.php on line 385

Strange. vbet_translateHTML is called only twice and in booth places there are 3 parametes (you can check it looking for vbet_translateHTML in includes/vbenterprisetranslator_functions.php and product file). Also I have other vB version cause my functions.php have empty line 5737. SO it is hard for me to help you.

1. Upload all files again.
2. If still happens give me code around line 5737 in your includes/functions.php

T2x 08-17-2009 05:44 PM

Hey guys, I decided to do some work and make this mod comply with vBSEO's link consensus idea.

What this will do is change all of the translation likes like so:

For example if a page.html is translated into danish, the url will normally be:

www.website.com/page.html?language=da

This will change the format to

www.website.com/da/page.html

This is much better for SEO so I am sure all of you with vBSEO will like this.

WARNING: this will only work properly if your forum is installed at the BASE of your domain, so something like www.website.com/index.php, if your forums are installed at www.website.com/forums/index.php some parts of my code will not work properly for you!!

All you need to do is open up your vbseo.php and add this code right BELOW error_reporting(0);

Make sure it is ABOVE the includes

Code:

if(isset($_GET['vbseourl']))
{
        $processuri = 0;
        if(preg_match('/^..(\/|$)/',$_GET['vbseourl']))
        {
                $processuri = 1;
                $_GET['language'] = substr($_GET['vbseourl'],0,2);
                $_GET['vbseourl'] = substr($_GET['vbseourl'],3);
        }
        else if(preg_match('/^\/..(\/|$)/',$_GET['vbseourl']))
        {
                $processuri = 1;
                $_GET['language'] = substr($_GET['vbseourl'],1,2);
                $_GET['vbseourl'] = substr($_GET['vbseourl'],3);
        }
        else if(substr($_GET['vbseourl'],0,5) == "zh-CN" || substr($_GET['vbseourl'],0,5) == "zh-TW")
        {
                $processuri = 1;
                $_GET['language'] = substr($_GET['vbseourl'],0,5);
                $_GET['vbseourl'] = substr($_GET['vbseourl'],6);
        }
        else if(substr($_GET['vbseourl'],1,5) == "zh-CN" || substr($_GET['vbseourl'],1,5) == "zh-TW")
        {
                $processuri = 1;
                $_GET['language'] = substr($_GET['vbseourl'],1,5);
                $_GET['vbseourl'] = substr($_GET['vbseourl'],6);
        }

        if($processuri == 1)
        {
                if(substr($_SERVER['REQUEST_URI'],0,2)=='//')
                        $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],1);
                $tempuri = isset($_SERVER['HTTP_X_REWRITE_URL']) ? $_SERVER['HTTP_X_REWRITE_URL'] :
                (isset($_SERVER['HTTP_X_ORIGINAL_URL']) ? $_SERVER['HTTP_X_ORIGINAL_URL'] :
                (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] :
                (isset($_ENV['REQUEST_URI']) ? $_ENV['REQUEST_URI'] : $_SERVER['SCRIPT_NAME']))
                );
                if (strstr($tempuri, 'vbseo.php') && $_GET['vbseourl'])
                        $tempuri = preg_replace('#vbseo\.php.*#', $_GET['vbseourl'] . ($_SERVER['QUERY_STRING']?'?'.$_SERVER['QUERY_STRING']:''), $tempuri);
                $tempuri = preg_replace('#\#.*$#', '', $tempuri);
                $_SERVER['REQUEST_URI'] = $tempuri;
                if(preg_match('/^\/..(\/|$)/',$_SERVER['REQUEST_URI']))
                        $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],3);
                else if(substr($_SERVER['REQUEST_URI'],1,5) == "zh-CN" || substr($_SERVER['REQUEST_URI'],1,5) == "zh-TW")
                        $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],6);
                $_SERVER['HTTP_X_REWRITE_URL'] = $_SERVER['REQUEST_URI'];
        }
}
else
{
        $processuri = 0;
        if(substr($_SERVER['REQUEST_URI'],0,2)=='//')
                $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],1);
        $tempuri = isset($_SERVER['HTTP_X_REWRITE_URL']) ? $_SERVER['HTTP_X_REWRITE_URL'] :
        (isset($_SERVER['HTTP_X_ORIGINAL_URL']) ? $_SERVER['HTTP_X_ORIGINAL_URL'] :
        (isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] :
        (isset($_ENV['REQUEST_URI']) ? $_ENV['REQUEST_URI'] : $_SERVER['SCRIPT_NAME']))
        );
        $tempuri = preg_replace('#\#.*$#', '', $tempuri);

        if(preg_match('/^..(\/|$)/',$tempuri))
        {
                $processuri = 1;
                $_GET['language'] = substr($tempuri,0,2);
        }
        else if(preg_match('/^\/..(\/|$)/',$tempuri))
        {
                $processuri = 1;
                $_GET['language'] = substr($tempuri,1,2);
        }
        else if(substr($tempuri,0,5) == "zh-CN" || substr($tempuri,0,5) == "zh-TW")
        {
                $processuri = 1;
                $_GET['language'] = substr($tempuri,0,5);
        }
        else if(substr($tempuri,1,5) == "zh-CN" || substr($tempuri,1,5) == "zh-TW")
        {
                $processuri = 1;
                $_GET['language'] = substr($tempuri,1,5);
        }

        if($processuri == 1)
        {
                $_SERVER['REQUEST_URI'] = $tempuri;
                if(preg_match('/^\/..(\/|$)/',$_SERVER['REQUEST_URI']))
                        $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],3);
                else if(substr($_SERVER['REQUEST_URI'],1,5) == "zh-CN" || substr($_SERVER['REQUEST_URI'],1,5) == "zh-TW")
                        $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],6);
                $_SERVER['HTTP_X_REWRITE_URL'] = $_SERVER['REQUEST_URI'];
        }
}


If you want to 301 all of your old pages to the new link format, you can put this in your .htaccess above all of your existing rules

Code:

RewriteCond %{QUERY_STRING} (hl=|language=)(zh-TW|zh-CN|..)
RewriteRule ^(.*)$ http://%{HTTP_HOST}/%2/$1? [L,R=301]

Please note that this code assumes you are running vBSEO.

This code will fix translation for the base of your website if you want the following format. www.website.com/de or www.website.com/de/ . this only applies to your main page.

Code:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?((zh-CN|zh-TW|..))/?$ vbseo.php?vbseourl=$1/index.php [L,QSA]

If you want to generate proper sitemaps with all of your new language urls, all you need to do is open up your vbseo_sitemap_functions.php in your vbseo_sitemap directory then:

find this code

Code:

}else
                                $freq = $vboptions['vbseo_sm_freq_t'];
                                   
                    vbseo_log_entry("[showthread] forum_id: $forumid, thread_id: $threadrow[threadid], total posts: $totalposts, pages: $totalpages, views: $threadrow[views] $prior");

                            for($p=1; $p<=$totalpages; $p++)
                            {

Add this code right after it:

Code:

$alanguages = array('ar', 'bg', 'zh-CN', 'zh-TW', 'hr', 'cs', 'da', 'nl', 'fi', 'fr', 'de', 'el', 'iw', 'hu', 'it', 'ja', 'ko', 'no', 'pl', 'pt', 'ro', 'ru', 'sr', 'sk', 'es', 'sv', 'th', 'tr');
                                        if(!$archived)
                                        foreach($alanguages as $hl) {
                                        $vbseo_stat['t']++;
                                        $currentthreadurl = vbseo_url_thread($threadrow, $p, $archived);
                                        $strlenhost = strlen($vbseo_vars['bburl']."/");
                                        vbseo_add_url(substr($currentthreadurl,0,$strlenhost).$hl."/".substr($currentthreadurl,$strlenhost), 0.3, $threadrow['lastpost'], $freq);
                                        }

make sure its before:

Code:

$vbseo_stat[$archived?'at':'t'] += vbseo_add_2urls(
                                    vbseo_url_thread($threadrow, $p, $archived),
                                    vbseo_url_thread($threadrow, $p, $archived, true),
                                    $prior,
                                    $threadrow['lastpost'],
                                        $freq
                            );
                               
                                }

                            if($showpost)
                            {

                    $getposts = $db->query("

If you notice there is an array in the code that looks like this
Code:

$alanguages = array('ar', 'bg', 'zh-CN', 'zh-TW', 'hr', 'cs', 'da', 'nl', 'fi', 'fr', 'de', 'el', 'iw', 'hu', 'it', 'ja', 'ko', 'no', 'pl', 'pt', 'ro', 'ru', 'sr', 'sk', 'es', 'sv', 'th', 'tr');
You should put the code of every language that you want added to your sitemap file in this array. Mine may differ from the languages you support so make sure you check it against your installation.


Just a note of caution: My fixes assume you are running a standard installation of apache with vBSEO. They may not work properly on some systems due to differences in the way that vBSEO handles some server variables. I recommend that you back up any files before editting them that way if you encounter problems you can restore your old versions.

I will be working on this code more so if any of you have issues please let me know and I will work on them.

If NLP-er would like he can provide a modified version of his flags in order to work with the new format or I will write up the code later today. This is necessary so that the flags show the proper links.

Anyway enjoy guys :D

NLP-er 08-17-2009 05:50 PM

Quote:

Originally Posted by imported_silkroad (Post 1869145)
The Google TOS, strictly interpreted, says translated pages cannot be cached for over 15 days.

However, if you modify them (fix bad translations), etc. I don't think you should necessarily dump them.

Also, the intent of the TOS is to "Do No Harm" to Google, Google's customers, and The World. If you are keeping a cache longer than 15 days and are not doing any harm, then I don't think your are violating the spirit of the TOS.

For example, if you are running Google Adsense and your translations are generating a lot of traffic for Google, and good revenue for Google, I don't think Google will be unhappy with you, but of course they cannot publish such a policy.

On the other hand, if you are caching translations and using them to drive traffic to Google's big competition, then Google might care.

So, if you want to be on the safe side, just drop all translations in the database that are older than 15 days, and you will be in compliance with the most strict interpretation of the TOS.

Don't Worry. Be Happy. Do No Harm.

That's why default value of cache time to live is 15. Every night mod automatically removes old cache. Everybody is happy :)

Sweeks 08-17-2009 06:04 PM

Quote:

Originally Posted by T2x (Post 1869296)
Hey guys, I decided to do some work and make this mod comply with vBSEO's link consensus idea.

What this will do is change all of the translation likes like so:

For example if a page.html is translated into danish, the url will normally be:

www.website.com/page.html?language=da

This will change the format to

www.website.com/da/page.html

This is much better for SEO so I am sure all of you with vBSEO will like this.

All you need to do is open up your vbseo.php and add this code right BELOW error_reporting(0);

Make sure it is ABOVE the includes

Code:

if(isset($_GET['vbseourl']))
{
        if(preg_match('/^..\//',$_GET['vbseourl']))
        {
                $_GET['language'] = substr($_GET['vbseourl'],0,2);
                $_GET['vbseourl'] = substr($_GET['vbseourl'],3);
        }
        else if(substr($_GET['vbseourl'],0,5) == "zh-CN" || substr($_GET['vbseourl'],0,5) == "zh-TW")
        {
                $_GET['language'] = substr($_GET['vbseourl'],0,5);
                $_GET['vbseourl'] = substr($_GET['vbseourl'],6);
        }

        if(preg_match('/^\/..\//',$_SERVER['REQUEST_URI']))
                $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],3);
        else if(substr($_SERVER['REQUEST_URI'],1,5) == "zh-CN" || substr($_SERVER['REQUEST_URI'],1,5) == "zh-TW")
                $_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],6);

}


If you want to 301 all of your old pages to the new link format, you can put this in your .htaccess above all of your existing rules

Code:

RewriteCond %{QUERY_STRING} (language=)(..|zh-TW|zh-CN)$
RewriteRule ^(.*)$ http://www.YOURWEBSITEHERE.com/%2/$1? [L,R=301]

Just make sure to put the domain of your website instead of YOURWEBSITEHERE. Please note that this code assumes you are running vBSEO.

If you want to generate proper sitemaps with all of your new language urls, all you need to do is open up your vbseo_sitemap_functions.php in your vbseo_sitemap directory then:

find this code

Code:

}else
                                $freq = $vboptions['vbseo_sm_freq_t'];
                                   
                    vbseo_log_entry("[showthread] forum_id: $forumid, thread_id: $threadrow[threadid], total posts: $totalposts, pages: $totalpages, views: $threadrow[views] $prior");

                            for($p=1; $p<=$totalpages; $p++)
                            {

Add this code right after it:

Code:

$alanguages = array('ar', 'bg', 'zh-CN', 'zh-TW', 'hr', 'cs', 'da', 'nl', 'fi', 'fr', 'de', 'el', 'iw', 'hu', 'it', 'ja', 'ko', 'no', 'pl', 'pt', 'ro', 'ru', 'sr', 'sk', 'es', 'sv', 'th', 'tr');
                                        if(!$archived)
                                        foreach($alanguages as $hl) {
                                        $vbseo_stat['t']++;
                                        $currentthreadurl = vbseo_url_thread($threadrow, $p, $archived);
                                        $strlenhost = strlen($vbseo_vars['bburl']."/");
                                        vbseo_add_url(substr($currentthreadurl,0,$strlenhost).$hl."/".substr($currentthreadurl,$strlenhost), 0.3, $threadrow['lastpost'], $freq);
                                        }

make sure its before:

Code:

$vbseo_stat[$archived?'at':'t'] += vbseo_add_2urls(
                                    vbseo_url_thread($threadrow, $p, $archived),
                                    vbseo_url_thread($threadrow, $p, $archived, true),
                                    $prior,
                                    $threadrow['lastpost'],
                                        $freq
                            );
                               
                                }

                            if($showpost)
                            {

                    $getposts = $db->query("

If you notice there is an array in the code that looks like this
Code:

$alanguages = array('ar', 'bg', 'zh-CN', 'zh-TW', 'hr', 'cs', 'da', 'nl', 'fi', 'fr', 'de', 'el', 'iw', 'hu', 'it', 'ja', 'ko', 'no', 'pl', 'pt', 'ro', 'ru', 'sr', 'sk', 'es', 'sv', 'th', 'tr');
You should put the code of every language that you want added to your sitemap file in this array. Mine may differ from the languages you support so make sure you check it against your installation.


Just a note of caution: My fixes assume you are running a standard installation of apache with vBSEO. They may not work properly on some systems due to differences in the way that vBSEO handles some server variables. I recommend that you back up any files before editting them that way if you encounter problems you can restore your old versions.

I will be working on this code more so if any of you have issues please let me know and I will work on them.

If NLP-er would like he can provide a modified version of his flags in order to work with the new format or I will write up the code later today. This is necessary so that the flags show the proper links.

Anyway enjoy guys :D

It isnt working for us:

Teen Forums

Any ideas?

NLP-er 08-17-2009 06:12 PM

New in faq:

1. I have indexed pages from old translator (with hl=) - what to do?
Thanks for solution to T2x :)
Just set rewrite rule in .htaccess - google will know that page have new place and will reindex it withaout any loss :)
Code:

RewriteCond %{QUERY_STRING} (hl=)(..|zh-TW|zh-CN)$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1\?language=%2 [L,R=301]


NLP-er 08-17-2009 06:14 PM

Quote:

Originally Posted by Sweeks (Post 1869301)
It isnt working for us:

Teen Forums

Any ideas?

Also dont works on my forum - Page not found.

But thanks anyway - for now I have solition for redirect translations from old translator with hl= to new ones - see FAQ :)

Sweeks 08-17-2009 06:15 PM

I was getting this:

/a/

Invalid Forum specified. If you followed a valid link, please notify the administrator

jaconi 08-17-2009 06:53 PM

Quote:

Originally Posted by NLP-er (Post 1868895)
1.1.0 RELEASED :)

Thanks man :up:

just did the update and usernames where not translated :up: :up:

t.uzuner 08-17-2009 09:28 PM

hi;
i am not using vbseo but
1)click flag open same page example english
2) click another link page automatically web site original language. how is this.

www.okulonceciyiz.biz

Sweeks 08-17-2009 09:44 PM

Quote:

Originally Posted by t.uzuner (Post 1869403)
hi;
i am not using vbseo but
1)click flag open same page example english
2) click another link page automatically web site original language. how is this.

www.okulonceciyiz.biz

Use the tracking option in this mods options :)

Aclikyano 08-17-2009 10:44 PM

Quote:

Originally Posted by NLP-er (Post 1869293)
Strange. vbet_translateHTML is called only twice and in booth places there are 3 parametes (you can check it looking for vbet_translateHTML in includes/vbenterprisetranslator_functions.php and product file). Also I have other vB version cause my functions.php have empty line 5737. SO it is hard for me to help you.

1. Upload all files again.
2. If still happens give me code around line 5737 in your includes/functions.php

// parse PHP include ##################
($hook = vBulletinHook::fetch_hook('global_complete')) ? eval($hook) : false;


AFTER # signs starts line 5737
did what you said still got the errors...

LoveStream 08-18-2009 03:04 AM

Quote:

Originally Posted by NLP-er (Post 1869283)
Heh... Long sentences - mean solid text over 1800 characters without any breaks, images, links. If you have any breaking line then in html you have <br/> and it means that this is not solid text anymore - all releases of this mod translates such text.

This release translates even texts over 1800 characters of solid text. No matter how long it is :)

Thanks for your instruction.

TheLastSuperman 08-18-2009 03:51 AM

Quote:

Originally Posted by NLP-er (Post 1868469)
Please PM me DB errors :) Cache is to use it and dissable should be an option not necessary. So I will gladly see what happens so in next release it will works for everyone :)

Pleae give me URL to your form so I will be ble to see what you are writing about this Forum Home tabs. 1 hint - does tabs are texts or images? It will not translate images ;) Also values of html tags attrubites are not translated (it would crasch whole site) - but I can make specific things be translated in next release. First - give me URL so I will see it :)

About not translating index with Tabbed Forum Home - also let me look first :)

sorry off on a tangent as usual lol..

Hmm let's enable db caching and copy/paste the error hold tight...

Code:

Database error in vBulletin 3.8.4:

Invalid SQL:
SELECT cache.originaltext as originaltext, cache.translated as translated FROM vbenterprisetranslator_cache_medium help, vbenterprisetranslator_cache_medium cache WHERE help.originaltext='2142 Tournament C7: Aug 23rd, Battle #5 Map Downloads.' AND help.tl='sq' AND cache.serie=help.serie;

MySQL Error  : Table 'dbnamewashere.vbenterprisetranslator_cache_medium' doesn't exist
Error Number  : 1146
Request Date  : Monday, August 17th 2009 @ 09:15:19 PM
Error Date    : Monday, August 17th 2009 @ 09:15:20 PM
Script        : http://www.tournamentgamingworld.com/online/index.php?language=sq
Referrer      : http://www.tournamentgamingworld.com/online/index.php
IP Address    : hey hey now :p
Username      : [TGW]GA|TheLastSuperman
Classname    : vB_Database
MySQL Version : 4.1.22-max-log

Ok so I think it might be this conflicting w/ the cache:

https://vborg.vbsupport.ru/showthread.php?t=219874

As some of the originaltext in the error above is code I just added to that in the forumhome template to be one of the rotating content seen below the normal navbar location.

I'll try this in the morning, wife is home so time to get off computer :p

<!--START vBET NOT TRANSLATED AREA--> and <!--END vBET NOT TRANSLATED AREA-->
_____________________

The Tabs mod... I used images instead of the standard CSS but the tabs mod is here:

https://vborg.vbsupport.ru/showthread.php?t=175687

The forum I'm using this on is here:
http://www.tournamentgamingworld.com

Thanks for ANY help you can provide.

S-MAN

T2x 08-18-2009 04:05 AM

Quote:

Originally Posted by Sweeks (Post 1869301)
It isnt working for us:

Teen Forums

Any ideas?

Can you tell me what version of apache you are running?

Edit: I have edited my above post with modified code for vbseo.php, this should fix any issues you have due to different server configuration :]

imported_silkroad 08-18-2009 08:02 AM

Quote:

Originally Posted by T2x (Post 1869543)
Can you tell me what version of apache you are running?

Edit: I have edited my above post with modified code for vbseo.php, this should fix any issues you have due to different server configuration :]

FYI, we installed both versions of the vBSEO updated code (not the 301 code), just for testing, and neither worked for us.

We are running:

Code:

# apache2 -v
Server version: Apache/2.2.8 (Ubuntu)

Edit: Logfiles show 301 redirects (but does not redirect to the translated pages correctly...)

Example from logs:

Code:

.... /es/index.php HTTP/1.1" 301 - "-" "Opera/9.64 (Macintosh; PPC Mac OS X; U; en) Presto/2.1.1"

Note: We are still running the old "hl" code, so I changed "language" to "hl" in the vBSEO code ( _GET['language'] to _GET['hl'] )

Please reply via PM, if you like, since we are running the old "hl" code..... but I am not sure "it matters" since the logfile show the 301 redirects as above.

imported_silkroad 08-18-2009 12:33 PM

NLP-er,

Here is another TO-DO on the feature request list, regarding:

Quote:

Translation URL's tracking - if page is translated then links are changed to keep translation (it is smart – it will not change links going outside your forum, or links to images)
In the future, it might be good to have a simple JavaScript Popup (optional of course) that pops up when a user from a translated page referral arrives that says, in effect:

Quote:

This page has been automatically translated by Google. If you would like to continue in this language, press here. If you would like to continue in English, press here
.

(or something like that)

Not sure how that would effect search engines.... maybe it would not be good in that case!

Megatr0n 08-18-2009 01:13 PM

I think this plugin is heaps better than Dave's. Has many more features than what he included.

woffie 08-18-2009 01:50 PM

Installed on my test forum and worked perfectly. Installed on my real forum and I get a blank page on the index. No links or text visible, just the graphics. It is conflicting with something, just not sure what. Had to uninstall.

yahoooh 08-18-2009 02:33 PM

NLP plz read pm i donate for this great work
thank u for this wondeful work

yahoooh 08-18-2009 02:39 PM

Quote:

Originally Posted by imported_silkroad (Post 1869750)
NLP-er,

Here is another TO-DO on the feature request list, regarding:



In the future, it might be good to have a simple JavaScript Popup (optional of course) that pops up when a user from a translated page referral arrives that says, in effect:

.

(or something like that)

Not sure how that would effect search engines.... maybe it would not be good in that case!

it should be not javascript popup because may affect the crawler of se
it should be just text under flags as notice this page translated by google and may not be fully understood
something like that
and also optionally

NLP-er 08-18-2009 02:57 PM

Quote:

Originally Posted by t.uzuner (Post 1869403)
hi;
i am not using vbseo but
1)click flag open same page example english
2) click another link page automatically web site original language. how is this.

www.okulonceciyiz.biz

Do you have tracking URLs on?


All times are GMT. The time now is 04:37 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02472 seconds
  • Memory Usage 1,957KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (18)bbcode_code_printable
  • (27)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete