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

Re: Localization framework



On Wed, Apr 07, 2004 at 12:55:38AM +0200, Denis Barbier wrote:
> On Tue, Apr 06, 2004 at 03:40:16PM -0700, Martin Quinson wrote:
> > On Tue, Apr 06, 2004 at 10:35:30PM +0200, Denis Barbier wrote:
> [...]
> > > Consider a simple example: package foo-1.0-1 contains a xx.po file,
> > > which is not up-to-date.  Its translator commits a new version to the
> > > central SVN repository, but the maintainer saw a typo in this xx.po and
> > > fixed it before uploading foo-1.0-2.  Now there is a conflict between
> > > these 2 versions, how will you solve it?
> > 
> > Wouldn't msgmerge solve this conflict?  It would assign the lastest
> > translation to the lastest text, and mark it as fuzzy. Then the translator
> > can unfuzzy his translation, and reupload his work.
> > 
> > New package version:
> >  msgcat --use-first svn.po pkg.po > svn.po
> 
> Maintainer changes are lost here, this is not good communication between
> translators and maintainers ;)

The changes found in the package are lost, that's not exactly the same. The
maintainer would be free to change the svn version, too.

[...]

> And here is the secret plan: if this framework really eases translator's
> work, maintainers will be overloaded with lots of translations and will
> let translators manage their translations ;)

Nope, the secret plan is always the same: Becoming master of the universe.
You keep mixing up our goals.

Seriously. I think we should design the system to work better with
cooperative packager/maintainer, since there is a real bunch of them out
there. Let's make two distincts cases, depending on whether there is a
l10n.desc file somewhere in the source tree or not. This file would be the
config file of po4a, explaining which file are to be translated, their
format, where the translations are to be placed, and so on.

On package upload, we do:
 if [ -e debian/l10n.desc ] ; then
   # update
   if po4a based format; then
     cp svn.po svn.po.new
     po4a-updatepo svn.po.new
   else
     msgmerge svn.po pkg.pot -o svn.po.new
   fi
   # ignore changes consisting in only date change
   if [ "diff svn.po svn.po.new | grep '[<>]' | wc -l" -ne 2 ]; then 
        mv -f svn.po.new svn.po;
	svn ci -m "New package version"
   else
        rm -f svn.po.new;
   fi
 else # uncooperative package
   msgmerge -U svn.po pkg.pot
   msgresolve pkg.new.po pkg.old.po svn.po
   # same trick to avoid to commit unchanged svn.po
   svn ci -m "New package version"
 fi

the msgresolve here (still to be done) is a tool specific to our needs. 
For each msgid in pkg.new, it does:
 if msgstr(new)=msgstr(old) then 
   msgstr(out)=msgstr(svn)
 else 
   mark_fuzzy
   msgstr(out)="#### new\n". msgstr(new)."\n#### svn\n".msgstr(svn)
 fi
It allows to take any change done in the package without making the
translator life more complicated than needed.


The arguments to convince the packager to put this file may be:
 - gain someone to forward translation bugs to
 - integrating translation is as simple as calling a script (instead of
   dealing with bugs)
 - the fact that for now, only friendly package are handled by the svn since
   we are still in early stage of its design, and since msgresolve does not
   exist yet...

Bye, Mt.

-- 
It took me fifteen years to discover I had no talent for programming, 
but couldn't give it up because by that time I was too famous.
    --- Anonymous

Attachment: signature.asc
Description: Digital signature


Reply to: