Re[3]: [PEAR-DEV] Translation2 ...
| From: | Lorenzo Alberton | Date: | Wed, 25 Feb 2004 22:08:13 +0000 |
| Subject: | Re[3]: [PEAR-DEV] Translation2 ... | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-25870@lists.php.net to get a copy of this message | ||
On Wed, 25 Feb 2004 09:24:48 +0100, Nicolas Hoizey wrote:
>>> 1. String retrival process
>>> --------------------------
>>> When I set a pageId and try to get a value for a key that is
>>> not defined with that pageId but is defined with a NULL pageId,
>>> I think Translation2 should return that value instead of the
>>> general fallback string.
>>
>> there's a subtle syntax difference here, as explained in the
>> "HANDLE CONFLICTS" section of the example.
>>
>> ============================
>> //call #1
>> $tr->get('conflicting')); //pageID defaults to null => get
>> current pageID
>> //call #2
>> $tr->get('conflicting', '')); //pageID='' => get
>> strings with
>> no pageID (i.e. the one with a "NULL" in the pageID field
>> //call #3
>> $tr->get('conflicting', 'in_page')); // => force pageID
>> ============================
>>
>> what you want is #2, I guess...
>
> No, that's not what I want. I have set a pageId in the beginning of
> the script, and I just call the get() method with its first
> parameter where I need it.
>
> What I want seems then to be #1, but with a different fallback
> method.
>
> Your method is the following:
> 1. pageId parameter is null, so you get current pageId.
> 2. there is no string for current pageId, so you get global
> fallback string.
>
> The method I would like to have is:
> 1. pageId parameter is null, so you get current pageId.
> 2. there is no string for current pageId, so you try with no
> pageId. 3. there is no string either for no pageId, so you get
> global fallback string.
I see. Anyway, if I manage to build what I have in mind,
everything will be customizable.
>>> 2. Language parameters
>>> ----------------------
>> Right now, you can serialize your extra fields and put the
>> serialized value in the meta field.
>
> Why not just use as many fields as wanted?
because I haven't thought about that yet! :-)
>>> 3. Fallback languages
>>> ---------------------
>>> It should be possible to use lists of fallback languages
>>> instead of just one, with fallback mechanism in the order of
>>> the list. [...]
>>
>> I think that having a fallback language is *really* useful, [...]
>> OTOH, having more than one could led to serious performance
>> issues.
>
> Maybe, yes.
without the "maybe", trust me :)
>> thanks for your feedback
>
> I use it, so I give feedback... ;)
so I hope to hear you again, then!
Best regards,
Lorenzo