Hi Oli.

I included your script into directory
dev/translation

I made minor changes to have it better: I revert logic by first reading the
primary language then after the secondary instead of the opposite. Doing
this allow us to have secondary files built with keys in same order than
primary file.
I also added option to be able to process and generate delta files in one
command.

I finally ran ths script for de_AT so now into github for the develop
branch you should have the de_AT containing only delta keys (there is an
exception for key starting with "Format" and "Separator" into main.lang
file. For this keys, we want/need them into all language code but o
modified script to also manage this.





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

> Hi Oli,
>
> Didn't test your work yet but it sure will be a nice addition to the
> translation toolbox. Congratulations!
>
> Developers scripts are usually stored under the "dev" directory at the
> Dolibarr's project root. I'd put your script into "dev/translation".
>
> A nice addition would be to also check all "primary" languages against the
> en_US reference language. I'm sure there are a bunch of errors there as
> well.
>
> Ultimately, we'd need a tool that understand the multiple "langs" calls in
> PHP files, extracts all the "translation keys", and check that the
> reference language have them. Add this to our CI server and we'd have the
> ultimate language verification toolbox!
>
> Cheers,
>
>
> 2014-05-16 23:12 GMT+02:00 Oli Sennhauser <oli.sennhau...@fromdual.com>:
>
>> Hello all
>>
>> I wrote a little PHP script to clean-up secondary language translations
>> (e.g. de_AT). It finds some nice errors in primary and secondary language
>> translations... :-)
>>
>> Task: Can you please test the clean-up script for your specific language
>> and give me your feedback (especially errors!)?
>>
>> Candidates to test are: de_AT, en_XX (XX != US), es_XX (XX != ES), fr_XX
>> (XX != FR) nl_XX (XX != ?) pt_XX (pt != PT), ru_XX (XX != RU?), zh_XX (XX
>> != ?).
>>
>> I tried to do it in a way that also non-latin languages should work.
>> Please let me know if there are problems (arabic, hebrew, cyrillic, JKC,
>> etc.)
>>
>> Question: where should this script be stored/kept? Would it be
>> interesting for other multi-lingual projects as well?
>>
>> Usage:
>>
>> ./strip_language_file.php langs/de_DE/admin_primary.lang
>> langs/de_AT/admin_secondary.lang
>> File langs/de_DE/admin.lang:
>> Key DispenseMontantLettres is redundant in file langs/de_DE/bills.lang
>> (line: 218).
>> ----
>> File langs/de_AT/admin.lang:
>> ERROR in file langs/de_AT/admin.lang, line 2: * Language code: de_AT
>> Key ModulesJob does NOT exist in primary language (line: 79).
>> Output can be found at langs/de_AT/admin.lang.delta.
>>
>> It might also be necessary that you clean-up your primary language as
>> well. So please study the error messages carefully
>>
>> Please let me know what you think about and the results...
>>
>> Regards,
>> Oli
>>
>> _______________________________________________
>> 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 à