Hi James,
While I completely agree with you that internationalization is hard and localization is even harder, I do not think you are portraying a fair scenario above.
We are not talking about full automatic translation. No one is suggesting creating message files containing:
this=This
belongs=belongs
to=to
And expecting
Messages("{0} {1} {2} {3} {4}.", i18n.this, object.name, i18n.belongs, i18n.to, person.name) to produce "This book belongs to John." across all spoken languages, given a proper messages file. The entire sentence is still to be translated wholesale by a human:
message=This {0} belongs to {1}.Usually, dynamic substitution of placeholders works reasonably well because often most placeholders are nouns. The problems are limited then to properly handling number (plurals) and gender and the impact they have on surrounding articles, adjectives, verbs, and pronouns.
That is not, by any means, an easy and simple task, no doubt about it. But it is also nowhere near the complexity of something as difficult as full automatic translation of human languages. And it does not imply that languages could be translated by word mapping. The problem of number and gender agreement is much more limited in scope.
Of course, languages have all kinds of bizarre nuances. For instance, in English the possessive pronoun agrees with the subject, while in Portuguese (and maybe in French and Spanish, too?) it agrees with the object. Yes, as weird as it may sound, in some languages inanimate objects have gender, too:
A girl and
her book. A girl and
her bike.
A boy and
his book. A boy and
his bike.
A garota e
seu livro. A garota e
sua bicicleta.
O garoto e
seu livro. O garoto e
sua bicicleta.
There is no way to handle this scenario without knowing both subject and object genders and using language-specific conjugation engines, even if one of the pairs girl-boy or book-bike isn't a dynamic placeholder. No messages file format and i18n engine I know of is expressive enough to handle such cases.
Of course, the list of problems and weirdness goes on and on. Think about "
her book" and "I like
her". Even though they are spelled the same, "her" and "her" are technically two different words. The first is equivalent to "
his book", the second to "I like
him".
My best piece of non-technical advice is: learn grammar. And learn it well, pretty well. Understanding how your own native language works is the fundamental first step to good i18n. And if you can, try to also learn a second language as best as you can.
(My apologies if I didn't get all grammar technical terms right, I'm still trying to learn English as best as I can.)