vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Miscellaneous Hacks - vB Global Translator - Multiply your indexed pages & put search traffic on autopilot (https://vborg.vbsupport.ru/showthread.php?t=216218)

NLP-er 06-25-2009 10:14 PM

And another problem - my site is in polish, I set $fl = 'pl'; but when hitting polish flag instead going to same page it translates it :eek: From polish to polish - it looks awful and also polish special letters disappears (i see rectangles instead).

NLP-er 06-25-2009 10:16 PM

Sorry for spamming - I have 1st at night right now and it's hard to think ;)

But it's best time to do things like installing your mod ;)

So next thing - is it possible to also translate vbSEO links?
Why after translation main page all links goes to normal languege? Can you make those going to actual language?

Dave Hybrid 06-25-2009 10:17 PM

Quote:

Originally Posted by NLP-er (Post 1837439)
Installed :)

But have a problem - with special letters. In Polish we have ąęśćł?żź an words with those are not translated, just appears without this letters.

So "Społeczność" is shown as "Spoeczno" instead of beeing translated to "Society" or "Community".

I'm pretty sure that google should translate it, and I think that this is some encoding issue. Any solution?

So your base language is Polish and when transalting to all other languages some polish words are skipped, correct.

What about on my test site going from english to polish, are the words correct?

http://www.blogboost.org/showthread.php?t=1&hl=pl

Thanks.

Dave Hybrid 06-25-2009 10:18 PM

Quote:

Originally Posted by NLP-er (Post 1837447)
Sorry for spamming - I have 1st at night right now and it's hard to think ;)

But it's best time to do things like installing your mod ;)

So next thing - is it possible to also translate vbSEO links?
Why after translation main page all links goes to normal languege? Can you make those going to actual language?

No, and there is no need, this has been discussed before.

If the script did that it would translate your registration, login everything and that would cause problems.

This translates pages for bots and traffic, not users.

Dave Hybrid 06-25-2009 10:21 PM

Quote:

Originally Posted by NLP-er (Post 1837441)
And next thing - when we solve this how to flush all the cache, so it will be translated again but correctly??

The script does this automatically.

I have noted all your other issues and agree, they will be fixed in next update, after we finish improving the database speed for large sites.

NLP-er 06-25-2009 10:29 PM

Quote:

Originally Posted by Dave Hybrid (Post 1837448)
So your base language is Polish and when transalting to all other languages some polish words are skipped, correct.

What about on my test site going from english to polish, are the words correct?

http://www.blogboost.org/showthread.php?t=1&hl=pl

Thanks.

Not some words ony those which have special letters like ąęśćł?żź. Many languages has such.

I also sow in code that actual language is skipped during translation, but still something goes wrong - special letters disappears and result is like in wrong encoding, so I think that even skipped encoding is changes - maybe in headers. It should be just same link under flag without hl parameter and then we will have no problem with that. But still with translation of words with special letters.

Speed is really awful, but I still think that its good idea - after cache it will give better places in google (i think so:)) and maybe better clicks in advertisements, because I will not have to cut off links about same theme - in other countries it's not my competition :P So there will be more good advertise in adSense.

Great job and waiting for fast bug correction :up:

NLP-er 06-25-2009 10:33 PM

Quote:

Originally Posted by Dave Hybrid (Post 1837448)
What about on my test site going from english to polish, are the words correct?

http://www.blogboost.org/showthread.php?t=1&hl=pl

It's correct.

As I wrote I think there is encoding problem. You have everything in UTF8 so it is ok to show any language. But when someone starts i.e. from ISO-8859-2 and You send it to Google telling that it's in utf8 then its gibberish for google and such strange thing happens... It should recognize correctly start encoding.

Also this is probablu cuse of strange behaviour with translation fomr polih to polish - translation is skilled, byt encoding written as utf8 even if it was not parsed to utf8, but stayed in ISO-8859-2...

Correction in meta is still charset=ISO-8859-2, so I suppose that not everything is skipped during translation... I will look in code, but suppose that it translates to utf8, but in meta stays charset=ISO-8859-2 and thats the problem...

NLP-er 06-25-2009 11:14 PM

I solved my problem with translation from polish to polish - simply edited translateflags.php and removed all " . '?hl=pl'".

If you make $fl global and import translate.php to translateflags.php you could check and don't add param hl for default language - this solves the problem in generic way.

After all I just removed whole polish flag - all links are pushing back to polish so what for?...

NLP-er 06-25-2009 11:46 PM

And that's why we have problem with translation from polish to polish - even if it's skipped:

Code:

// Enable UTF-8 characters
if(isset($_GET['hl']))
{
header ('Content-type: text/html; charset=utf-8');
}

From vB Global Translator - you hange encoding, and then skip translation in callback() - you can also here check does hl != fl (assuming that fl will be global) and only then do your things. Now even when translation is skipped some other things happens - reminders for style and script...

NLP-er 06-26-2009 12:27 AM

Hie hie - I solved problem for you - where is avard :D

To solve problem with translate words with national signs like ąęśćł... you have to reencode it first to utf8 before send to google. So it is enough to set global variable i.e. $defEncoding and then change in translate.php this line:

Code:

@curl_setopt($ch, CURLOPT_URL, "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&langpair=".urlencode($fl.'|'.$tl)."&q=".urlencode($text));
To this one:
Code:

@curl_setopt($ch, CURLOPT_URL, "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&langpair=".urlencode($fl.'|'.$tl)."&q=".urlencode(iconv($defEncoding, 'utf-8', $text)));
iconv($defEncoding, 'utf-8', $text) instead of $text

Of course this works assuming that all pages have same encoding - if not it must be parsed from meta.

Now - sleep it's 3:27 at night in my place :eek:


All times are GMT. The time now is 05:04 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.01300 seconds
  • Memory Usage 1,751KB
  • 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
  • (3)bbcode_code_printable
  • (5)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
  • (10)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