Category Archives: Hacks

Home » Blog » Archive by category “Hacks”

Bulk text resizing in PowerPoint 2011

When Japanese is translated into English, the translated text generally occupies more space than the original. This can sometimes be a problem. For example, if you use a translation tool like OmegaT to perform an in-situ translation of a Japanese PowerPoint presentation, the English text is probably not going to fit properly. What you need is some sort of bulk text resizing tool. PowerPoint doesn’t allow you to perform operations on all the slides in a presentation, like scaling down the font size of every text box. (As far as I can tell, it only allows you to select multiple text boxes and set them all to the same font size, one slide at a time.) However, it does support AppleScript, which can do the job for you. The following script will adjust every text box in the entire presentation. It won’t do a perfect job because text boxes that contain text of different sizes will be resized to a single font size. However, it can save a lot of time when you have a large translated file with broken [More…]

Posted in Hacks, Localisation | Tagged | Comments Off on Bulk text resizing in PowerPoint 2011

WordPress login failures

Back in January I started noticing a lot of failed attempts to log into this website’s admin section, presumably in an attempt to hijack the website and use it to send spam, host illegal content or join some sort of botnet. It seems that many other websites are being affected in the same way. I’m not particularly worried about this. All of these attempts have so far used the default WordPress user name of “admin”, which doesn’t exist here, and nobody has yet realised that this website is configured to only accept logins over secure connections (i.e., https, not http). Even if they did get that right, it would still take about a billion years to crack the password by brute force. (Well, OK. Perhaps not quite as long as that. But still…) Anyway, I wrote a script to monitor these failed logins and disable logins altogether from repeat offenders. Since January it’s caught quite a few. Here’s the list of IP addresses that have tried 10 or more times to log in to the non-existent admin account. (Note: This [More…]

Posted in Hacks | Comments Off on WordPress login failures

Converting zenkaku to hankaku

For historical reasons, Chinese, Japanese and Korean word processors allow certain characters (including the Roman alphabet and Arabic numerals) to be entered using wide variants called fullwidth (zenkaku; 全角) characters instead of — or rather, in addition to — the ordinary halfwidth (hankaku; 半角) characters used by everyone else. When preparing Japanese text for translation in CAT tools like OmegaT, it often helps to convert zenkaku characters to their hankaku equivalents. The Japanese version of Microsoft Word has a built-in feature that will do this, but it’s a little bit annoying because it also converts katakana characters. All I really want to do is convert the non-Japanese characters. Here’s a Perl script I’ve been using to do this inside TextWrangler: #!/usr/bin/perl -w # File: ZtoH.pl # Author: Phil Ronan, japanesetranslator.co.uk # Convert zenkaku to hankaku # Prepare Japanese UTF-8 plain-text files for translation by # converting full-width (zenkaku) characters to their half-width # (hankaku) counterparts. Katakana characters are not converted. # This script was written for use as a TextWrangler plugin, but # can also be used as a command line tool — [More…]

Posted in Hacks, Translation | Tagged | 2 Comments

OmegaT + Google Translate v2 + Mac OS X

OmegaT is a free, open-source, cross-platform computer-assisted translation tool. One of its useful features is an interface to the Google Translate API that enables it to provide a (somewhat helpful) machine translation of each chunk of text as it is being translated. Earlier this year, Google announced that its free translation API is to be replaced with a paid service, and will stop altogether on 1st December 2011. Providing an API key Recent versions of OmegaT are compatible with the paid service (Google Translate v2), but before you can use it you have to set up an account with Google and give them your credit card details. In return, you’ll get an identification code called an API key that OmegaT will need when interacting with Google. However, the OmegaT developers haven’t yet made it very easy to enter this key. Windows users can provide this information by adding the following line to the OmegaT.l4J.ini configuration file (replacing “xxxx” with your actual API key): -Dgoogle.api.key=xxxx On other operating systems, the API key has to be provided as a command line argument when the OmegaT Java application [More…]

Posted in Hacks, Translation | Tagged | 1 Comment


Header image: The three wise monkeys (三匹の猿) at Tōshō-gū shrine in Nikkō (日光東照宮), said to be the origin of the saying “Hear no evil, see no evil, speak no evil”. Photo: Frank Gualtieri.

Powered by WordPress