Re: Localization - Need help and want to contribute
Re: Localization - Need help and want to contribute
- Subject: Re: Localization - Need help and want to contribute
- From: Ramsey Gurley <email@hidden>
- Date: Mon, 15 Oct 2012 17:32:45 -0700
On Oct 15, 2012, at 5:16 PM, Flavio Donadio wrote:
> On 15/10/2012, at 19:02, Ramsey Gurley wrote:
>
>>> I also need to understand some stuff like @@indefiniteArticleForProperty@@. Is there, for example, an @@indefiniteArticleForEntity@@? This should be wonderful for me, because we have no "neutral" articles in Portuguese. A name, whatever it refers to, is either male or female. If I could specify, in my model (or somewhere else?), the correct article for my entities and properties, I could have perfect error messages! :)
>>
>> AFAIK, there's only a couple of rules for it in the ERD2W rule file...
>>
>> 10 : (propertyKey like 'a*' or propertyKey like 'e*' or propertyKey like 'u*' or propertyKey like 'i*' or propertyKey like 'o*' or propertyKey like 'u*') => indefiniteArticleForProperty = "an" [com.webobjects.directtoweb.Assignment]
>
> Interesting... One can come up with crazy rules, huh? So, where does the variable (or method?) indefiniteArticleForProperty comes from? I tried Google but can't find it. is there a way to search within code from all my imported projects on Eclipse? Though it would only show up if it's in the WOnder stuff...
That is where it comes from :-) The context. One of the methods on the localizer takes two objects as a source of the @@key@@ stuff. One of those objects is the D2WContext when using D2W.
>
>
>> So in English, you would want to say "an article" or "a hero". You wouldn't want to say "an hero" :-)
>>
>> Funny enough though, the correct value depends on the sound, not the letter of the word following it. For example, you could use "an SQL query" or "a SQL query" depending on whether you use "es que elle" or "sequel" when you speak it.
>>
>> So the rule is a rough approximation which is mostly correct, but may require some tweaking depending on your property keys. Ain't english fun? ;-)
>
> Yes, english is a lot of fun and I like it a lot more than portuguese! Serously... ;) Aside from phrasal verbs and the past of some irregular verbs (which also plague the portuguese language), english is kind of simple. Of course, I still have some problems with the "th" pronounce, but...
>
>
>> I guess for portuguese, since everything is male or female, you'd need a very different rule.
>
> I don't think I can do it with D2W rules. I thought I could set indefiniteArticleForProperty in the model... User Info, maybe? Or maybe I'm too obsessed... :D
That would be a good approach. You could extend that to english too :-) Just make a rule with a higher priority than 10 and it should override the default.
>
>
>>> After perfecting them, how can I contribute these localizations to Project WOnder?
>>
>> Create a branch on your public fork of wonder on github with your changes. Make a pull request from that branch to the main wonder repo.
>
> My lack of knowledge on versioning systems has come of age!
>
>
> Cheers,
> Flavio
Git is not nearly as hard as Kieran makes it look ;-)
Ramsey
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden