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: Tue, 16 Oct 2012 08:42:01 -0700
On Oct 15, 2012, at 6:57 PM, Flavio Donadio wrote:
>
> On 15/10/2012, at 21:32, Ramsey Gurley wrote:
>
>>> 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.
>
> Now I think I got it. Is it possible to use @@keypath@@ or only keys will work?
Keypath will work too.
>
>
>>> 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.
>
> I think I wasn't clear before. By "model", I meant "EOModel". I could set a key named indefiniteArticleForEntity (for the entities) and indefiniteArticleForProperty (for the attributes) in the EOModel and then fetch it with @@Entity.userInfo.indefiniteArticleForEntity@@. And a D2W rule to deal with a null value (unset key).
>
> I'll try this after I finish the translation. If it works, I'll expand the idea with definite articles, which are also male and female in portuguese. In english "the" is THE DEFINITE ARTICLE! :D
>
> Monday isn't a bad day at all...
>
>
> Cheers,
> Flavio
Yes but you still need a rule if you're using d2w :-) Something like
20: propertyType = 'a' and smartAttribute.userInfo.indefiniteArticles.count > 0 and session.localizer.languageCode = 'en' => indefiniteArticle = smartAttribute.userInfo.indefiniteArticles.en [ERDKeyValueAssignment]
Or just put together a custom assignment, since this approach would result in at least two rules per language.
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