You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Christian Geisert <ch...@isu-gmbh.de> on 2012/05/04 16:52:35 UTC

i18n

Hi,

I just noticed that the InvoiceItemTypes are not localized on the Edit
Invoice Items Screen
(see
https://demo-trunk.ofbiz.apache.org/accounting/control/listInvoiceItems?invoiceId=8010
)

I fixed this with the following code:


<drop-down allow-empty="false">
-   <list-options list-name="invoiceItemTypes"
key-name="invoiceItemTypeId" description="${description}"/>
+    <list-options list-name="invoiceItemTypes"
key-name="invoiceItemTypeId"
description="${groovy:uiLabelMap.get('InvoiceItemType.description.'+invoiceItemTypeId)}"/>
</drop-down>


Is this the recommended way do it?

Christian

Re: i18n

Posted by Christian Geisert <ch...@isu-gmbh.de>.
Nicolas Malin schrieb:
> Christian I correct a similary problem on calendrarForms.xml
> (https://issues.apache.org/jira/browse/OFBIZ-4770)
> On other thread "Why some invoice Type use hard code to retreive
> associate invoice item type" I ask why we use a groovy to retreive list
> invoice Type. If not needed, it's possible to use only an entity-option
> on the drop-down.

I thought that invoiceItemTypeMap is just for converting from
OrderItemType to InvoiceItemType, but there is code in
GetInvoiceItemTypes.groovy which uses it for "unknown" InvoiceTypes
I'll reply on the other thread (if I find some time...)

> Maybe an other possibility would be add a new UEL function to resolve
> the probleme : description="${str:label('description',
> invoiceItemTypeId, InvoiceItemType)}"

This sounds good but I don't know if it's possible/makes sense in UEL.

I'll commit the groovy solution for now..

Christian

> Le 07/05/2012 10:24, Jacques Le Roux a écrit :
>> From: "Christian Geisert" <ch...@isu-gmbh.de>
>>> I know (and the entity InvoiceItemTypes has
>>> default-resource-name="AccountingEntityLabels"), but this works only
>>> with <entity-options> and not with <list-options> in a dropdown, right?
>>
>> AFAIK, with <list-options> you may add your own specific options  (can
>> be on-fly, for instance) , so I think you are right Christian
>>
>> Jacques
>>
>>> In this case the InvoiceItemTypes are filterd in
>>> GetInvoiceItemTypes.groovy.
>>>
>>> Christian
>>>
>>>
>>> Adrian Crum schrieb:
>>>> Use the "default-resource-name" attribute of the <entity> element.
>>>> There
>>>> are examples of this in the project.
>>>>
>>>> -Adrian
>>>>
>>>> On 5/4/2012 3:52 PM, Christian Geisert wrote:
>>>>> Hi,
>>>>>
>>>>> I just noticed that the InvoiceItemTypes are not localized on the Edit
>>>>> Invoice Items Screen
>>>>> (see
>>>>> https://demo-trunk.ofbiz.apache.org/accounting/control/listInvoiceItems?invoiceId=8010
>>>>>
>>>>>
>>>>> )
>>>>>
>>>>> I fixed this with the following code:
>>>>>
>>>>>
>>>>> <drop-down allow-empty="false">
>>>>> -<list-options list-name="invoiceItemTypes"
>>>>> key-name="invoiceItemTypeId" description="${description}"/>
>>>>> +<list-options list-name="invoiceItemTypes"
>>>>> key-name="invoiceItemTypeId"
>>>>> description="${groovy:uiLabelMap.get('InvoiceItemType.description.'+invoiceItemTypeId)}"/>
>>>>>
>>>>>
>>>>> </drop-down>
>>>>>
>>>>>
>>>>> Is this the recommended way do it?
>>>>>
>>>>> Christian
>>>>
>>>
>>>
> 
> 







Re: i18n

Posted by Jacques Le Roux <ja...@les7arts.com>.
I did some work on this at revision: 1527171  
More is needed on labels for this cases

There  are 99 <list-options, I did not check them all

Jacques


Nicolas Malin wrote:
> Christian I correct a similary problem on calendrarForms.xml
> (https://issues.apache.org/jira/browse/OFBIZ-4770)
> On other thread "Why some invoice Type use hard code to retreive
> associate invoice item type" I ask why we use a groovy to retreive list
> invoice Type. If not needed, it's possible to use only an entity-option
> on the drop-down.
> 
> Maybe an other possibility would be add a new UEL function to resolve
> the probleme : description="${str:label('description',
> invoiceItemTypeId, InvoiceItemType)}"
> 
> Nicolas
> 
> Le 07/05/2012 10:24, Jacques Le Roux a écrit :
>> From: "Christian Geisert" <ch...@isu-gmbh.de>
>>> I know (and the entity InvoiceItemTypes has
>>> default-resource-name="AccountingEntityLabels"), but this works only
>>> with <entity-options> and not with <list-options> in a dropdown, right?
>> 
>> AFAIK, with <list-options> you may add your own specific options  (can
>> be on-fly, for instance) , so I think you are right Christian
>> 
>> Jacques
>> 
>>> In this case the InvoiceItemTypes are filterd in
>>> GetInvoiceItemTypes.groovy.
>>> 
>>> Christian
>>> 
>>> 
>>> Adrian Crum schrieb:
>>>> Use the "default-resource-name" attribute of the <entity> element.
>>>> There
>>>> are examples of this in the project.
>>>> 
>>>> -Adrian
>>>> 
>>>> On 5/4/2012 3:52 PM, Christian Geisert wrote:
>>>>> Hi,
>>>>> 
>>>>> I just noticed that the InvoiceItemTypes are not localized on the Edit
>>>>> Invoice Items Screen
>>>>> (see
>>>>> https://demo-trunk.ofbiz.apache.org/accounting/control/listInvoiceItems?invoiceId=8010
>>>>> 
>>>>> 
>>>>> )
>>>>> 
>>>>> I fixed this with the following code:
>>>>> 
>>>>> 
>>>>> <drop-down allow-empty="false">
>>>>> -<list-options list-name="invoiceItemTypes"
>>>>> key-name="invoiceItemTypeId" description="${description}"/>
>>>>> +<list-options list-name="invoiceItemTypes"
>>>>> key-name="invoiceItemTypeId"
>>>>> description="${groovy:uiLabelMap.get('InvoiceItemType.description.'+invoiceItemTypeId)}"/>
>>>>> 
>>>>> 
>>>>> </drop-down>
>>>>> 
>>>>> 
>>>>> Is this the recommended way do it?
>>>>> 
>>>>> Christian

Re: i18n

Posted by Nicolas Malin <ma...@librenberry.net>.
Christian I correct a similary problem on calendrarForms.xml 
(https://issues.apache.org/jira/browse/OFBIZ-4770)
On other thread "Why some invoice Type use hard code to retreive 
associate invoice item type" I ask why we use a groovy to retreive list 
invoice Type. If not needed, it's possible to use only an entity-option 
on the drop-down.

Maybe an other possibility would be add a new UEL function to resolve 
the probleme : description="${str:label('description', 
invoiceItemTypeId, InvoiceItemType)}"

Nicolas

Le 07/05/2012 10:24, Jacques Le Roux a écrit :
> From: "Christian Geisert" <ch...@isu-gmbh.de>
>> I know (and the entity InvoiceItemTypes has
>> default-resource-name="AccountingEntityLabels"), but this works only
>> with <entity-options> and not with <list-options> in a dropdown, right?
>
> AFAIK, with <list-options> you may add your own specific options  (can 
> be on-fly, for instance) , so I think you are right Christian
>
> Jacques
>
>> In this case the InvoiceItemTypes are filterd in
>> GetInvoiceItemTypes.groovy.
>>
>> Christian
>>
>>
>> Adrian Crum schrieb:
>>> Use the "default-resource-name" attribute of the <entity> element. 
>>> There
>>> are examples of this in the project.
>>>
>>> -Adrian
>>>
>>> On 5/4/2012 3:52 PM, Christian Geisert wrote:
>>>> Hi,
>>>>
>>>> I just noticed that the InvoiceItemTypes are not localized on the Edit
>>>> Invoice Items Screen
>>>> (see
>>>> https://demo-trunk.ofbiz.apache.org/accounting/control/listInvoiceItems?invoiceId=8010 
>>>>
>>>>
>>>> )
>>>>
>>>> I fixed this with the following code:
>>>>
>>>>
>>>> <drop-down allow-empty="false">
>>>> -<list-options list-name="invoiceItemTypes"
>>>> key-name="invoiceItemTypeId" description="${description}"/>
>>>> +<list-options list-name="invoiceItemTypes"
>>>> key-name="invoiceItemTypeId"
>>>> description="${groovy:uiLabelMap.get('InvoiceItemType.description.'+invoiceItemTypeId)}"/> 
>>>>
>>>>
>>>> </drop-down>
>>>>
>>>>
>>>> Is this the recommended way do it?
>>>>
>>>> Christian
>>>
>>
>>


-- 
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/


Re: i18n

Posted by Jacques Le Roux <ja...@les7arts.com>.
From: "Christian Geisert" <ch...@isu-gmbh.de>
>I know (and the entity InvoiceItemTypes has
> default-resource-name="AccountingEntityLabels"), but this works only
> with <entity-options> and not with <list-options> in a dropdown, right?

AFAIK, with <list-options> you may add your own specific options  (can be on-fly, for instance) , so I think you are right Christian

Jacques

> In this case the InvoiceItemTypes are filterd in
> GetInvoiceItemTypes.groovy.
>
> Christian
>
>
> Adrian Crum schrieb:
>> Use the "default-resource-name" attribute of the <entity> element. There
>> are examples of this in the project.
>>
>> -Adrian
>>
>> On 5/4/2012 3:52 PM, Christian Geisert wrote:
>>> Hi,
>>>
>>> I just noticed that the InvoiceItemTypes are not localized on the Edit
>>> Invoice Items Screen
>>> (see
>>> https://demo-trunk.ofbiz.apache.org/accounting/control/listInvoiceItems?invoiceId=8010
>>>
>>> )
>>>
>>> I fixed this with the following code:
>>>
>>>
>>> <drop-down allow-empty="false">
>>> -<list-options list-name="invoiceItemTypes"
>>> key-name="invoiceItemTypeId" description="${description}"/>
>>> +<list-options list-name="invoiceItemTypes"
>>> key-name="invoiceItemTypeId"
>>> description="${groovy:uiLabelMap.get('InvoiceItemType.description.'+invoiceItemTypeId)}"/>
>>>
>>> </drop-down>
>>>
>>>
>>> Is this the recommended way do it?
>>>
>>> Christian
>>
>
>

Re: i18n

Posted by Christian Geisert <ch...@isu-gmbh.de>.
I know (and the entity InvoiceItemTypes has
default-resource-name="AccountingEntityLabels"), but this works only
with <entity-options> and not with <list-options> in a dropdown, right?

In this case the InvoiceItemTypes are filterd in
GetInvoiceItemTypes.groovy.

Christian


Adrian Crum schrieb:
> Use the "default-resource-name" attribute of the <entity> element. There
> are examples of this in the project.
> 
> -Adrian
> 
> On 5/4/2012 3:52 PM, Christian Geisert wrote:
>> Hi,
>>
>> I just noticed that the InvoiceItemTypes are not localized on the Edit
>> Invoice Items Screen
>> (see
>> https://demo-trunk.ofbiz.apache.org/accounting/control/listInvoiceItems?invoiceId=8010
>>
>> )
>>
>> I fixed this with the following code:
>>
>>
>> <drop-down allow-empty="false">
>> -<list-options list-name="invoiceItemTypes"
>> key-name="invoiceItemTypeId" description="${description}"/>
>> +<list-options list-name="invoiceItemTypes"
>> key-name="invoiceItemTypeId"
>> description="${groovy:uiLabelMap.get('InvoiceItemType.description.'+invoiceItemTypeId)}"/>
>>
>> </drop-down>
>>
>>
>> Is this the recommended way do it?
>>
>> Christian
> 



Re: i18n

Posted by Adrian Crum <ad...@sandglass-software.com>.
Use the "default-resource-name" attribute of the <entity> element. There 
are examples of this in the project.

-Adrian

On 5/4/2012 3:52 PM, Christian Geisert wrote:
> Hi,
>
> I just noticed that the InvoiceItemTypes are not localized on the Edit
> Invoice Items Screen
> (see
> https://demo-trunk.ofbiz.apache.org/accounting/control/listInvoiceItems?invoiceId=8010
> )
>
> I fixed this with the following code:
>
>
> <drop-down allow-empty="false">
> -<list-options list-name="invoiceItemTypes"
> key-name="invoiceItemTypeId" description="${description}"/>
> +<list-options list-name="invoiceItemTypes"
> key-name="invoiceItemTypeId"
> description="${groovy:uiLabelMap.get('InvoiceItemType.description.'+invoiceItemTypeId)}"/>
> </drop-down>
>
>
> Is this the recommended way do it?
>
> Christian