I’ve been writing code lately. Makes me feel young, again. Unfortunately, something terrible happened.
For some reason (and thereby hangs a tale), I decided to write the application in Brazillian Portuguese. You know, localized for pt-BR only.
Based on my Smalltalk days, I decided to write the “Check for Updates” code first. (A Smalltalk programmer would write a one line app that did nothing, and then change it until it did what they wanted. If they had to quit and restart just because they had changed something, they lost a point. I guess thereby hangs another tale). I figured the modern equivalent was to release an app that didn’t do anything except automatically check for updates and update itself. Then, one could release, and add functionality as needed — losing a point, of course, every time somebody needed to re-install manually. But, I digress
So, obviously, the first method (I’m using Cocoa on a Mac) I needed to write was buscaAtualização. That’s Portuguese for “fetchUpdate”.
That’s not a valid identifier name in Objective-C. Or more precisely, it might theoretically be a valid name, but gcc doesn’t implement universal character names.
Programming languages, it turns out, aren’t localizable. Or localized. If you want to write something in a computer language, you need to write English. I should have suspected something the minute I launched XCode. The menubar had a File (instead of Arquivo) menu. Development tools don’t seem to be localized either. Not much point, really, since you’d have to write in English anyway.
Even if I could have named my method buscaAtualização, what is the Portuguese localization of
[[NSURLConnection alloc] initWithRequest: aRequest delegate: self ]? Well, it turns out that all the library and framework classes, methods, functions, variables, macros, etc. are in English. And none of it is localized.
Even something as ancient as strerror(3) returns the POSIX error messages in English. No localized Portuguese error messages here.
This is terrible. I’ve been such a great fan of Literate Programming for so many years — it never occurred to me that for most of the world, even literate programs must necessarily be written in a foreign language.
Even as modern a language as Haskell wouldn’t accept buscaAtualização as a valid identifier.
This is awful. We’re much farther from using programming languages as a form of communication than I had thought. I’ll need some time to digest the implications.
Does anybody have any suggestions on how to write a program in Portuguese?