dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] Dolibarr translations: a proposal for a better system


From: Lorenzo Novaro
Subject: Re: [Dolibarr-dev] Dolibarr translations: a proposal for a better system
Date: Fri, 3 May 2013 20:57:15 +0200
User-agent: KMail/1.13.7 (Linux/3.8-3.slh.2-aptosid-amd64; KDE/4.8.4; x86_64; ; )

In data venerdì 3 maggio 2013 14:11:31, Destailleur Laurent ha scritto:
> I think it may be interesting to use for every translator but first we must
> be ready to understand how it works and find a way to make things
> automatics.
I agree.

> so I had a look at client tutorial you provide, but i have still some
> question. I suggest to experiment an automation to understand how it can
> works.
> You help will be welcome to tell me if this way of working is correct :
> A) Someone (called X, it may be you or me) can run the tx init into the
> directory dolibarr that is a checkout of a git hub develop branch ?
I did tx init from the root directory of the git branch repo and configured the 
client. It works well now. You just have to create a directory named .tx in 
the root (where INSTALL and README are) and copy the config file attached to 
this email in the .tx directory.

I don't have write access to git branches, so it would be easier if you would 
be "X", or you could setup a i18n branch where I can push the files or give me 
some kind of access to some other branch.

> B) And then X run a tx push to push all existing language files of dolibarr
> to transiflex (what about language already declared into transiflex) ?
I think it will not be necessary. Existing files can be pushed when 
a new translation team (language) is created. But if you want to do it, you 
should first pull languages already on transifex (italian for sure, I worked on 
it in the last days) to update your local files and then push all lang files to 
the server. 

> C) Then translators edit into transiflex.
Correct. And admin/revisers can check the translations and approve them.

> D) Then X make a tx pull to get new files. This will change files into its
> local git repository and X has to make a git commit to valide (and solve
> conflict if some people has made fixes changes into languages files
> directly into git).
Yes, that's the bottom line.
There are also webhooks designed to connect a git/cvs/svn repository to 
trnasifex, but I don't know if they work well as I didn't look into it yet.

> Am i right ?
> If yes, can you help me to find exact command line for step A, B and D
> (tutorial provide example with po files but does it can works with dolibarr
> tree) ?
The strings are saved in the databse and are added to template files when the 
pull request is made. To pull files that are not .po you just have to specify 
which filetype you want.
In Dolibarr's case it's "type = MOZILLAPROPERTIES" (all entries in the 
attached config are also configured with this type)

To pull all translation files for every language you just have to type:
        tx pull -a

Pull for a specific language
        tx pull -l it_IT

add a -f if you want to download all files, no matter if they are empty and/or 
older than the ones you have on your local disk

To push all source files (the ones in en_US) just type
        tx push -s

to push only a specific source file (admin.lang for example)
        tx push -s -r dolibarr.admin 

to push all translation files (but I think we don't need that)
        tx push -t 

to push all translation files for a specific language (that's what I think we 
will do)
        tx push -t -l sv_SE

There is, however, a small problem when you push all translations within one 
language: the client stops if a resource is not found. That means that you 
need to ensure that every language contains all files before pushing.
For example: I tested the push with swedish (sv_SE), it stopped at cron.lang 
because it did'nt exist, when I created it (just a file containing only 
CHARSET=UTF-8) the client continued until dict.lang that was again missing.
It is not a big problem, because once we will need to push existing 
translations of new languages only one time, so...
 
The client is very simple to use, all the work is related to the config file 
and 
I already did it :-)
What you need to do is to add a new resource to the file every time a new .lang 
is needed.
For example:
[dolibarr.admin]
file_filter = htdocs/langs/<lang>/admin.lang
source_file = htdocs/langs/en_US/admin.lang
source_lang = en_US
type = MOZILLAPROPERTIES

Just change the resource name (it will be dolibarr.something) and filenames in 
file_filter and source_file, everything else is already fine, and you are good 
to 
go!

I tested all commands and they work correctly with current configuration, I 
also fixed a couple of typos in the english version of cron.lang and pushed it 
as a new source file.

Hope this long email is understandable. If I did not explain something 
clearly, please tell me.

Lorenzo.
-- 
Diciannove Soc. Coop.
Via Luccoli 14/8
16123 Genova

Attachment: config
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]