Mostly about my amusement

Tag: machine translation (page 1 of 1)

.htaccess fix for machine translation

The current version of ATPP is 5.1 and it works really well. But occasionally I get speed bumps from Babelfish and Google translation engines so I end up turning it off for a while.

Without the plugin, when someone goes to the translated version of a posting, they get redirected to the home page.

For example the German pages for Andre’s trip to Disneyland is

http://blog.dembowski.net/2008/01/30/andres-trip-to-disneyland/de/

When I turn off the plugin users get sent to

http://blog.dembowski.net/

Here is where .htaccess comes to the rescue. By adding lines at the top of my .htaccess file I can send the request for a translated post to the English version:

RewriteRule ^de/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^zh/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^ko/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^ja/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^pt/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^it/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^es/ http://blog.dembowski.net/ [R=302,L]
RewriteRule ^(.*)/de/ http://blog.dembowski.net/$1/ [R=302,L]
RewriteRule ^(.*)/zh/ http://blog.dembowski.net/$1/ [R=302,L]
RewriteRule ^(.*)/ko/ http://blog.dembowski.net/$1/ [R=302,L]
RewriteRule ^(.*)/ja/ http://blog.dembowski.net/$1/ [R=302,L]
RewriteRule ^(.*)/pt/ http://blog.dembowski.net/$1/ [R=302,L]
RewriteRule ^(.*)/it/ http://blog.dembowski.net/$1/ [R=302,L]
RewriteRule ^(.*)/es/ http://blog.dembowski.net/$1/ [R=302,L]

The request from /some/url/here/de/ results in the Apache server sending back a 302 temporarily moved to the same URL minus the two letter language code.

If I have to turn off the ATPP plugin for an extended time, I can do so knowing that search engine visitors will still find the original post.

Update: added portion for languages off of the root i.e. http://blog.dembowski.net/es/ becomes http://blog.dembowski.net/

Okay I think I got ATPP working

I think I’ve gotten the machine translation working to a point of good stability. Meaning my MySQL config is not killing the box with requests, caching seems to be working fine.

Right now I have 65 translated pages in my database. When I encounter one that is munged (meaning the database timed out) I manually delete that page in the ATPP cache and only that page. So fare so good.

I combined ATPP with WP-CACHE and all seems right in the world.

Problems with machine translation

The machine translation I am using is giving me problems.  More accurately Google thinks my server is a compromised machine with spyware and BabelFish changed something so my pages are not being translated.

I’m not complaining because both service are free and reminds me of why some people really dislike machine translation.

For now I’ll turn off the plugin.  the translated URL’s (http://blog.dembowski.net/de/ for example) takes the user to the original article, so this is not really a big deal.