Saturday, January 23, 2010

I18n based on english

on a website a found an interesting comment about wheater to translate
from a language like English as base language or not

About English being a a non-case language and the trouble with it
Now i faced the same problem with some words

Is there any __x() function to translate according to nominative,
accusative, dative, and genitive?
In Englisch they are usually the same

eng "3 Days (left)"
deu: "(Noch) 3 Tage"

BUT:
eng: "In 3 Days"
deu: "In 3 Tagen" (n!)

if we now have a time helper function we want to translate we cant
just concatenate the translated strings. we would need to translate
every single phrase itself
"In %s days" instead of just "In" + $days + "days"
"in %s hours
"In %s minutes"
and so one

same with just "%s unit" + any other combination like "%s unit before"

if there was a way to say
__genitive("days", true)
it could generate the correct "Tagen" instead of "Tage" which would be
the basic form.

but translating is a very complicated matter anway..
anybody who faced similar problems?

as of right now the cake time helper only translates
__n('day', 'days', $days, true);
without the ability to be case sensitive

thx

Source: http://www.codinghorror.com/blog/archives/001248.html

"I would even go so far as to claim that english and other non-case
languages hold an advantage for those who speak it, since it allows
for more flexible though patterns."

English is NOT a non-case language and in no case is a more flexible
language. Actually by having distinct word-forms based on case one has
more flexibility on the construction of the sentence, consider the
German language, it has 4 cases: nominative, accusative, dative, and
genitive. Depends in which case a pronoun/article is located it
changes its form:

English - German : Nominative Accusative Dative Genetive
the (masculine)der: der den dem des
the (femine) die: die die der der
the (neuter) das: das das dem des
the (plural) die: die die der der

Let's take the sentence: Er gab ihr den Stuhl (He gave her the chair).
Er = Nominative masculine 3rd person singular (nominative: er)
ihr = Dative feminine 3rd person singular (nominative: sie)
den Stuhl = Accusative masculine singular (nominative: der Stuhl)
Based on the distinct words one can build the following sentences with
exactly the same meaning (whether one would say that is another
story):
i. Er gab ihr den Stuhl
ii. Er gab den Stuhl ihr
iii. Ihr gab er den Stuhl
iv. Ihr gab den Stuhl er
v. Den Stuhl gab er ihr
vi. Den Stuhl gab ihr er
Try the same in English:
i. He gave her the chair
ii. He gave the chair her
iii. Her gave he the chair
iv. Her gave the chair he
v. The chair gave he her
vi. The chair gave her he
As you can see it is impossible in English to have the flexibility
base on "non-case". Because these different distinct forms do not
exists English heavily relies on the position of the sentence
elements, i.e. the object in before the verb is the "doer", the object
after the verb is the "receiver" of the action, the object after the
"receive" is the "acted upon" object of the sentence.

"Time flies like an arrow; Fruit flies like bananas"

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: