Supporting translation of extrafields label is clearly a new feature.

It needs a new table called
llx_extrafields_lang working on same way than is working llx_product_lang.
So user can enter several translation for each field.

Of course, this new table and new screen to edit it should be visible only
if user enabled the option multilang.




2014-05-23 17:00 GMT+02:00 Doursenaud, Raphaël <rdoursen...@gpcsolutions.fr>
:

> Hey Christophe, I understand your position perfectly, please read my
> previous message again.
> I think you should pursue fixing the root problem anyway by, at least,
> opening a task and leaving a comment on your hack to remove it and use the
> correct feature when available.
> Don't you think so?
>
> Cheers,
>
>
> 2014-05-23 16:11 GMT+02:00 Christophe Battarel <
> christophe.batta...@altairis.fr>:
>
>
>> you may find this quick fix dirty, but it has the advantaging of working
>> right now (even maybe from 3.3 release).
>>
>> the problem for a module developer when he faces something like that is
>> that he cannot say to his customer, well we will have to wait until 3.7
>> release because the extrafields label are not using translation system and
>> it is not considered as a bug by the core team...
>>
>>
>>
>>
>> Le 23/05/2014 15:17, Doursenaud, Raphaël a écrit :
>>
>> Wow, what a hack !
>> I can't figure why in the world you need javascript for that.
>> I understand you want to use a quick and dirty fix like that to get the
>> feature right now, but please try to fix the root problem so we can all
>> benefit from this.
>> If you don't want to do it right now, fine, just open a task in Doliforge
>> ;)
>>
>>  @fhenry, the extrafield usage from module descriptor looks like a legit
>> use to me. Would you mind opening a task on Doliforge?
>>
>>
>> 2014-05-23 14:39 GMT+02:00 Christophe Battarel <
>> christophe.batta...@altairis.fr>:
>>
>>> Finally , i have found a way to skirt the problem with some jquery and a
>>> hook; i give you the code below if you face the same problem :
>>>
>>>     function formObjectOptions($parameters, $object, $action)
>>>     {
>>>
>>>         // translate extrafields labels
>>>         print '<script type="text/javascript">
>>>
>>>             $(document).ready(function() {
>>>                 $("input[name^=options_").each(function() {
>>>                     var labelCell = $(this).parent("td").prev("td");
>>>                     // get the translation with an ajax call
>>> $.get("'.dol_buildpath('/mymodule/',1).'ajax/translate.php", {text:
>>> $(labelCell).text(), langfile: "mymodule@mymodule"}, function(data) {
>>> $(labelCell).html(data); }, "html");
>>>                 });
>>>             });
>>>             </script>';
>>>     ...
>>>     }
>>>
>>> and here is the ajax translate.php program :
>>>
>>> <?php
>>>
>>> $res=@include("../../main.inc.php");                    // For root
>>> directory
>>> if (! $res) $res=@include("../../../main.inc.php");        // For
>>> "custom" directory
>>>
>>> $langfile = GETPOST('langfile');
>>> $text = GETPOST('text');
>>>
>>> $langs->load($langfile);
>>> print $langs->trans($text);
>>> ?>
>>>
>>>
>>> Le 23/05/2014 14:39, Philippe Grand a écrit :
>>>
>>>  Le 23/05/2014 14:35, Florian HENRY a écrit :
>>>>
>>>>> About that extrafield define and use by extranal module it can be nice
>>>>> to be able to define them into module descriptor rather than play with SQL
>>>>> request to create them, but it's another story.
>>>>>
>>>> I rather see what you mean ;-)
>>>> and agree one hundred times with you
>>>>
>>>>
>>>
>>>
>>>   _______________________________________________
>>> Dolibarr-dev mailing list
>>> Dolibarr-dev@nongnu.org
>>> https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
>>>
>>
>>
>>
>>  --
>>  *Raphaël Doursenaud*
>> Directeur technique (CTO)
>>  Expert certifié en déploiement Google 
>> Apps<https://gpcsolutions.fr/raphael-doursenaud-google-apps-certified-deployment-specialist>
>> +33 (0)5 35 53 97 13 - +33 (0)6 68 48 20 10
>>
>>  <http://gpcsolutions.fr>
>> http://gpcsolutions.fr
>>  Technopole Hélioparc
>> 2 avenue du Président Pierre Angot
>> 64053 PAU CEDEX 9
>> SARL GPC.solutions au capital de 7 500 € - R.C.S. PAU 528 995 921
>> <https://www.google.com/a/partnersearch/#partner?partner_id=46687933_a0n60000000sqpWAAQ><http://wiki.dolibarr.org/index.php/Dolibarr_suppliers_France#GPC.solutions>
>>
>>
>> _______________________________________________
>> Dolibarr-dev mailing 
>> listDolibarr-dev@nongnu.orghttps://lists.nongnu.org/mailman/listinfo/dolibarr-dev
>>
>>
>>
>> --
>> Christophe Battarel
>> Responsable technique
>> sarl altairis
>> Informatique et Web en Grésivaudan
>> 33 Grande Rue
>> 38570 Goncelin
>> 09 52 71 70 96 (appel local)contact@altairis.frhttp://www.altairis.fr
>>
>>
>> _______________________________________________
>> Dolibarr-dev mailing list
>> Dolibarr-dev@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
>>
>>
>
>
> --
> *Raphaël Doursenaud*
> Directeur technique (CTO)
>  Expert certifié en déploiement Google 
> Apps<https://gpcsolutions.fr/raphael-doursenaud-google-apps-certified-deployment-specialist>
> +33 (0)5 35 53 97 13 - +33 (0)6 68 48 20 10
>
>  <http://gpcsolutions.fr>
> http://gpcsolutions.fr
> Technopole Hélioparc
> 2 avenue du Président Pierre Angot
> 64053 PAU CEDEX 9
> SARL GPC.solutions au capital de 7 500 € - R.C.S. PAU 528 995 921
> <https://www.google.com/a/partnersearch/#partner?partner_id=46687933_a0n60000000sqpWAAQ><http://wiki.dolibarr.org/index.php/Dolibarr_suppliers_France#GPC.solutions>
>
> _______________________________________________
> Dolibarr-dev mailing list
> Dolibarr-dev@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
>
>


-- 
Laurent Destailleur (alias Eldy)
------------------------------------------------------------------------------------
Social networks of my OpenSource projects:
Dolibarr Google+: https://plus.google.com/+DolibarrOrg/
Dolibarr Facebook: https://www.facebook.com/dolibarr
Dolibarr Twitter: http://www.twitter.com/dolibarr
AWStats Google+: https://plus.google.com/+AWStatsOrgPoject/
AWStats Facebook: https://www.facebook.com/awstats.org
AWStats Twitter: http://www.twitter.com/awstats_project
_______________________________________________
Dolibarr-dev mailing list
Dolibarr-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

Répondre à