Saturday, January 24, 2009

Вы запах смешно - The Pain of Website Internationalization

Let's face it, internationalization is a pain in the ass. Zero fun. Often termed i18n and l10n, these two are God's punishment for trying to reach for the heavens.

I have recently started an effort of translating one of my sites http://www.dumpr.net to a range of languages, while maintaining a clean and loose code that can be later be put in use for other projects.

My plan is to make a 3-parts post. First, I will talk about what are my goals from the translation system. In a later post, we will review how technically other websites managed to both internationalizate and keep sanity. Third and last post will conclude: pitfalls you should know about, pains I've been going through and some tips for a better life.

As a rule of thumb, when I face with such a tremendous problem, I first head out and seek who has already achieved this goal. While there are plenty of websites that manage to translate several keywords a page (zooomr, photofunia,) there are two distinct websites I look up to: flickr und facebook.

I consider Flickr as the mother of all website architectures. In his bible book: "Building Scalable Websites", Cal Henderson explains lots of the architectural redesign and growing pains they had with Flickr. Nowadays Flickr supports a wide range of 8 languages, all left-to-right.

Facebook, on the other hand, has always impressed me with their amazing development framework and ability to adapt fast. They make sure their effort can then be helpful for other programmers. Their Translation application is so powerful and easy to use, that 20,000 people from France localized the entire website within 24 hours. (wow!) Also, Facebook supports right-to-left languages as well (ie, hebrew and arabic,) which also affect the website layout (completely mirrored.)

Drilling down, the following bullet points make up the bigger picture:

* Translating is done online. I have tried to maintain a csv or a google document for translating, it's just unbearable. Being a man-in-the-middle and transferring strings back and forth to translators is absolutely a no-no and can result in a brain damage.

* Strings list generated automatically. The gettext approach demands that the person in charge updates a list of translatable strings. Rapid development will be hurt and wounded if I have to update the same string in two places.

* No keywords or tagging, see what you are translating. It's hard to write and design an html with placeholders and copywriting is strictly impossible.

* No translation goes online without approval. Some authorization and permission-levels are required. Whether you are crowd-translating or using a hired professional, you still can't trust every person you meet on the internet. Facebook breaks this problem into finding the most fit translation (via voting,) and publishing the selected translation online.

* Person translating might not know html. Strings should not contain any markup text. Don't rely a 3rd party not to break your html compatibility.

* Rapid-translation (tm). Translators must find this task easy and fun. They should be able to see results in real-time, and not be dependent on anybody else.

Have you ever made your website appeal to other locales? Got tips to share? What problems did you face? I want to hear all about them! efterlade en kommentar!

Tower of Babel by fimoculous (cc).

Friday, January 16, 2009

Get Your Gig Going: Social Media For Entrepreneurs

eClub HUJI had a great speaker last night. Kfir Pravda of Pravda Media presented a kickass lecture titled "Social Media For Entrepreneurs".

Pravda laid out a list of dos and don'ts for using the latest buzz bingo term "Social Media" for your own gain. From using the available services to network with people in your field, through being accepted as an expert in the subject. This media can make or break your business, and it's very important for us entrepreneurs (and more importantly, solo-entrepreneurs) to learn how to utilize this for our needs.

The talk was taped, thanks to our friends at israelhightech.tv. I will post a link to the video when it's up online and narrated in English.

So what have I learned from this. Have you ever been in a situation when somebody tells you something, and it seems so goddamn obvious to you, and yet, you haven't done it yourself? This is how it felt. There is some kind of enlightenment when a respectable person not only reawaken your dead cells, but also gives proofs (again and again) and real life examples how these tricks have changed his business and life.

1. A Business Card Is Just The Beginning of a Relationship
More often than not, I'd visit a conference or a lecture, network with a bunch of interesting people, exchange cards and then shelf them for a time in need. Now, why would you do that? A person gave you his business card, she has done so because she is interested in hearing more from you. Go home now, take all of your business cards, and add each one to your Facebook friends, LinkedIn connections and Twitter friends. Cause you know what? A week after meeting her, she had probably forgotten and there goes a valuable contact.

And here is an example from my life: a while ago I was at the Amazon AWS Meetup In Tel Aviv. After the meetup, I started talking to this guy. Now, I consider myself a great listener, but I just couldn't get the guy to talk much. Eventually we parted after exchanging business cards. That same night, he added me on Facebook and LinkedIn.

A while later, I attended the Facebook Developer Garage meetup, and there he was again. Just this time, he was accompanied with other important people from the field. Having me as his friend on these platforms, he checked my cv, updated on what I'm doing and realized the potential. He introduced me (now he did all the talking) to his partners in such an enthusiastic manner, that I was blushing immediately. Now I'm friends with important contacts closer to what I am doing.

2. LinkedIn Answers Is Your Greatest Tool
LinkedIn Answers has been there for quite a while. From time to time, I'd get these questions on my email. Basically, it's a platform for LinkedIn users to ask their peers a question. The question is published publicly, and other people can participate. I always answer the questions that I receive.

After Kfir's talk (and again, proving how important it is for his business,) I decided to give it a try. I asked a question in Startups And Small Businesses category. I have to admit I was stunned. It took 45 seconds for the first answer to arrive, and from a person I have never known before. It has been less than 12 hours, than I already got 15 different replies. It is really an amazing tool, not only to get help with decisions, but also to find people who are interesting and influential in your field of expertise.

3. Get Your Story Straight, Kiddo
There is a distinct different between, "what's your story" and "what's your job". I have learned this the hard way. If you were to ask me 5 years ago, who are you, I would reply "Gil Megidish: Programmer". Ask me the same question today, and I would tell you "I'm an entrepreneur filled with motivation and creative ideas. I am a proud owner of dumpr.net, a hobby that turned into a successful business. I am very open about my work, I share my knowledge with others and help other startups get on their feet".

With all modesty, I must say that the later answer invokes more questions and interested.

Kfir lectures quite often (and all over the world), so make sure you follow him on twitter and maybe attend his upcoming talks.

Saturday, December 13, 2008

A Programmers Guide to Outsourcing

Outsourcing needs no introduction -- it has been covered by news media extensively for the past couple of years. Everybody's doing it, and at some point in life, you figured it's worth a try.

But it's not all shine and glamor. Outsourcing your programming tasks can be a real headache and even a burden. This guide is here to help you identify the pitfalls before you're even making the first step. It's all based on experience and I'm sure many of the readers will agree what what is said here.

There are two types of outsourcing: one-shot (projects) and continual (semi-hired programmer.) Projects are posted on sites such as Elance, where freelancers send you quote for your consideration. Semi-hiring programmers can be done through oDesk, where you get to interview programmers and share svn access.

1. It might take 3 hours to explain a 10 minutes task
When you figure it would take you several hours to explain, listen, pack sources and then merge back the results, ask yourself this question: is it worth it?. When you're outsourcing a single task with no further interaction with that specific programmer, then the answer is simply: no. The only reason that you would do such a thing, is to educate your programmer (semi-hiring freelancers.) Add task, send bug reports, review code, integrate. The more you iterate this, the shorter it will become, so don't lose your head prematurely.

2. It's mentally difficult if you can do it yourself
The person who knows my framework and setup best is me. Moreover, I love my coding conventions, my automatic tests and how well my new code fits with the existing code base. It's awfully hard to look at somebody else's code and not go "I would have done this better." I'm sure you would. The easiest tasks I have outsourced are translating and copywriting. Why? Because I know I'm weak there and I can easily assess other's work. Learn to accept other people's code or shape them as needed.

3. Language barrier is no fun
Not everybody speaks English, and not everybody speak the same English. During my trial-and-error period, I have hired East Asians (India and China) programmers. I know I'm making a bad generalization here, but all of my projects failed. I received code that was either useless or had absolutely nothing to do with my requirements. Bouncing emails back and forth for a long time concluded this as hopeless and as awful as it sounds, I choose not to work with programmers from these countries again. It goes without saying that the same problem might happen with people from other nations as well. It helps to talk to the person, ask her questions about the weather or sports, just to get an idea how well you two communicate.

Here are a few tips I have picked up along the way. They help me calm down and do this process (more) smoothly:

1. When posting a project, make sure the price offers are sealed (hidden from the eyes of other freelancers.) I have noticed the second bidder base their price by the first bidder. Sealing it will make freelancers think and bid as they see fit, without the competition against other programmers.

2. Start small. It's easy to get hooked with the infinite opportunities. Don't shell out more than you can afford, and don't handle more than one task at the time. Use the first few projects for learning from mistakes. They will happen, there is no way around it.

3. Remember why you are outsourcing in the first place. The reason why you are reading this article is because you are not scalable. You are a very talent and creative person, but there is only one of you. Your to-do list is 10 pages long, but you only have one pair of hands. The sooner you realize this, the faster you will get around all of the above and start getting productive.

Got something to tell? I am very interested in your opinion and story. Learning from other people's mistakes is definitely a bonus. I'd be more than happy if you could share your experience. What worked and what didn't.

Good luck!

Thursday, December 4, 2008

Amazon AWS Meetup in Tel Aviv

Boy, was that awesome or what! Amazon AWS team from Luxembourg invited us tiny start-ups to an introduction (and networking) meet-up in Tel Aviv. Prior to that, there was a 2-day convention about grid computing with folks from AWS, eBay, Yahoo! and others.

After socializing for over an hour with plenty of new upcoming startups (lots of interesting things are going on right now!,) we were gathered for an evangelistic talk with Martin Buhr (@tallmartin) and Simone Brunozzi (@simon). When asked, almost everybody in the room raised hands for already trying out/working with Amazon's web services. It's quite amazing that it has become a common use among startups and based companies.

Following their talk, Guy Nirpaz of Gigaspaces introduced their incredible framework over EC2, and handed out free try-out coupons for everybody who was interested in hands-on trial of their service.

Were you there?


Martin Buhr at AWS Meetup TLV
Martin is explaining about AWS EMEA


Simone Brunozzi at AWS Meetup TLV
Simone is answering a million and one questions

Wednesday, October 29, 2008

$83.58 Discount on Pingdom!


Saving $83.58 on Pingdom!


My server just got to 100% iowait again. Luckily I have friends who are constantly visiting dumpr to see what's new, so I got a cellphone notification (ie- phone call) that the site isn't working.

Those manual human techniques, time for an upgrade!

I just signed up for pingdom. It's a pretty sweet service. They have tons of servers scattered all over the planet, and they ping your configured server every few minutes to see that it's alive. You define what alive means. For me, it's a special php on my server that returns OK or FAIL. In case of FAIL, I get an SMS to my cellphone, telling me to rush into the nearest public telephone booth and change to my Superman costume -> website is down.

One thing I noticed just now on pingdom, is that you can save $83.58 (yearly) easily! I'm not affiliated with them, I'm just bootstrapping like most of you guys. On the index page, if you start immediately with a Pingdom Basic package, it costs you $119.40 (yearly.) It's a good price for such a terrific service, but if I can have it for less, why not. I discovered by mistake, that if you start with a 30-days Free Basic plan, you get a 70% discount if you upgrade within that month. The new upgrade plan box shows a yearly use of pingdom will now cost $35.82, that's $83.58 in pure savings!

Now, that's an upgrade!

Monday, October 20, 2008

All This CSRF Nonsense

There is a lot of discussion lately about Cross-Site Request Forgery. Honestly, it's just an old and well known problem getting some media attention.

Consider the following example. It's known that YouTube uses ajax to add a video to the currently-logged-in-user's favorites. For the sake of simplicity, say the endpoint url is: http://www.youtube.com/fave?id=1. Now let's say I'm an underdog director with a killer new indie movie that I want to promote. I go through flickr's explore pages and shove <img src="http://www.youtube.com/fave?id=1" width="1" height="1" /> as a comment to all popular photos. The next day I'm on YouTube's top directors, and the road to Hollywood is shorter than ever.

Of course the example above can be put to banking transactions, election votes and befriending strangers on social networks.

Working with POST instead of GET does not fix the problem, as javascript can create a form and submit it without user interaction.

So, how do you solve it?


global $user_id; # currently logged in user
global $video_id; # currently watched video

# a secret that is not shared outside the server
$secret = "here-be-a-secret-nobody-knows";

# url to be sent to browser
$auth = base64(sha1($secret . $user_id . $video_id));
$add_fave_url = "/fave?id=" . $video_id . "&uid=" . $user_id . "&auth= " . $auth;


When processing the ''fave'' request itself, just check that the auth signature matches the string you reconstruct from the parameters $user_id, $video_id and the server $secret. If they don't match, you have encountered an attempt of forgery.

By adding the id of the user that this url will affect, you are eliminating the possibility that Bob will add his video to other users' favorites but his own. You might also consider adding expiration (such as time()+86400) to your request, making it void after a certain period.

And an apology for all rising indie movie directors. You will just have to work harder. :)

Saturday, October 4, 2008

Apple Lifting Strict NDA Restrictions!

In an anti-big-brotherish act, Apple has finally lifted the why-was-it-there-in-the-first-place strict NDA restrictions preventing from iPhone developers in discussing about the SDK, App Store approval process, and to participate in forums.

What seemed like a silly code of silence has now been removed when tight competition from Google and Nokia arrived. God bless them.

iPhone developers rejoice! Now, I need help with AudioQueue..

"Buy this new thing, suckers" photo by Jarod_Uses_Film