[Bf-committers] Need some advice about some bug...

Campbell Barton ideasman42 at gmail.com
Fri Feb 8 11:10:30 CET 2013


On Fri, Feb 8, 2013 at 8:24 PM, Bastien Montagne <montagne29 at wanadoo.fr> wrote:
> Yes… Would even like to add a generic "flag" parameter to all ui func,
> actually, so that we can add more like these as needs arise. But the
> problem is that currently, this won't work, as 'text' is a "py
> translate" string prop, i.e. it is translated during conversion from py
> string to RNA string, at a parameter level (i.e. without any access to
> the other func parameters). I agree this needs to be changed, but would
> prefer the smallest intrusive solution for now, as 2.66 is imminent...
> Hence the (temporary of course) "raw_text" solution.

The translate option could be disabled, then if the translate boolean
is set, do a translate lookup without relying on RNA to do so, maybe
in practice not so simple, Will check on it.

> On 08/02/2013 10:18, Lukas Tönne wrote:
>> When using property buttons (layout.prop(...)) the RNA property name
>> can always be assumed to be translatable. The label function OTOH has
>> no means of distinguishing "raw" text from translatable common terms,
>> so it should not make that assumption.
>>
>> IMO best way to solve it would be to add a "translate" parameter to
>> the label() function:
>>
>> label(text="", icon='NONE', icon_value=0, translate=True)
>>
>> The default of True ensures that all current label functions work the
>> same way they do now and there is no need to update all occurrences.
>> Only where a user data string is used should this be set to False to
>> avoid unwanted translation. Seems better than adding another
>> text/raw_text parameter that would essentially be redundant.
>>
>> On Fri, Feb 8, 2013 at 9:48 AM, Bastien Montagne<montagne29 at wanadoo.fr>  wrote:
>>> Hi Devs,
>>>
>>> On bf-translations was reported a bug affecting new uilist
>>> (http://lists.blender.org/pipermail/bf-translations-dev/2013-February/000284.html).
>>> Problem is, when using python RNA UI API, texts (labels) are always
>>> translated... And uilists now use py api for their drawing code! So
>>> material/vgroups/textures/... names are translated (when a match is
>>> found in i18n catalog, of course). No good.
>>>
>>> I think we need a slight rework of this UI api (best way, if possible,
>>> would probably to have a sort of 'wrapper' func that would handle common
>>> ui func properties, like 'text' and 'icon'/'icon_value', to handle
>>> passing raw text, text to be translated, optional context, etc.).
>>> Anyway, we really need more flexibility here (I already proposed
>>> something about contexts some weeks ago, but the reviewer did not liked
>>> it ;) ). However, it's obviously too late for 2.66!
>>>
>>> So I wondered what would be best solution, live with this bug in 2.66,
>>> or add a nasty (but secure) hack, like adding another 'raw_text' param
>>> (that would never be translated!) to the label() function?
>>>
>>> Cheers,
>>> Bastien
>>> _______________________________________________
>>> Bf-committers mailing list
>>> Bf-committers at blender.org
>>> http://lists.blender.org/mailman/listinfo/bf-committers
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-committers
>>
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers



-- 
- Campbell


More information about the Bf-committers mailing list