[gcompris-devel] Re: Using some gcompris images.

Bruno Coudoin bruno.coudoin at free.fr
Thu Sep 4 12:56:05 UTC 2003


Le jeu 04/09/2003 à 19:19, stasZ a écrit :
> On 2003.09.04 00:32, Bruno Coudoin wrote:
> 
> > > Back to assetml.
> > >
> 
> > > Use a xml i18n parser (at run time?) to translate it.
> > > (like with gettext?, and why translate it?)
> > >
> > It's not at runtime, it's at package creation time (make install).
> > For example in geography, you will get the country in the description
> > field of assetml in the user locale.
> > So you could easily create a board that display a country and its name
> > in the correct locale without having anything to translate in your
> > application.
> Hmm, you take a piece of the translation out of the application and
> handle it in the assethtml piece, but you will still have to do some
> translation in the application.
> IMHO when you do translation in a application you better of to do all
> the translation in one place instead of doing it in different places.
> And what if you have two users with different locale settings?
> 
Let me clarify with an example. I already implemented the flag assetml
package. Here is what it contains:
<AssetML dataset="gcompris flags" rootdir="../gcompris/boards/flags/"
locale="">
  <Asset file="fr.png" mimetype="image/png">
   <Description>French</Description>
   <Description xml:lang="am">ፈሚንሳይኛ</Description>
   <Description xml:lang="ar">فرنسي</Description>
   <Description xml:lang="az">Fransızca</Description>
   <Description xml:lang="ca">FrancÚs</Description>
   <Description xml:lang="cs">Francouzština</Description>
   <Description xml:lang="de">Französisch</Description>
   <Description xml:lang="el">Γαλλικά</Description>
   <Description xml:lang="es">Francés</Description>
   <Description xml:lang="fr">Français</Description>
.... Sorry, it's UTF-8 encoded so we cannot read much by mail.

Now it's at parsing time the the application detects there is a
lang=<mylocale> and take the correct description. By default, the one
with no lang= is used.
It is the same way that .desktop menu files are managed. The one who
creates/maintains it is in charge of the i18n.

Now in your application, you can only translate what you know. With
assetml, you can browse and display an image just because it matches a
category. But you still want to provide a clear i18n description to your
users.


> > Now from a C program, you can use libassetml and link you to it.
> > libassetml does not requires gcompris at all.
> If it's to become a way for games to share these assets, the whole
> thing should be independent as possible.
> 
Sure, it's not related beside the fact that for now the libassetml in in
the gcompris source tree.
It will probably become hosted separatly at some point.

> > Why not.
> > let's say you parse xml files and search for music category and play
> > them one by one.
> > If the user grab the latest madonna.assetml package, he will have it
> > as
> > well, wherever the music are.
> OK, i can see your point.
> 
> > > Are there "assetml standard" rules on how the xml file should be
> > > formatted?
> > >
> > Yes, that the way it's documented.
> > One area still open is the categories. We should perhaps organise
> > categories in order to be able to be sure to discover files on the
> > fly.
> I think that there should be one or more that are mandatory
> and there's the rest.
> The mandatory categories should be : numbers or letters etc
> The rest are the ones describing the contents:
> <Category>Letters;capital;bold</Category>
> 
I agree. We could setup an open wiki page were people that makes assetml
packages could write in a tabular format:
- package name and url
- categorie

So that new user will reuse existing categories.

> BTW, is there some sort of validator for assetml?
> 
No, we could write an XML DTD that does that. To me, it's a too simple
format to need this.

> I was wondering why you choose as assetml root dir, /usr/share/pixmaps.
> I would think that /usr/share/assetml would be a better place,
> because the area where assetml could be used is much wider then pixmaps.
> Also the pixmaps directory is often included in icons search paths by 
> some window managers, and a lot of assetml files/dirs doesn't seem
> to be of much interest for a user looking for a icon.
> 
> I strongly belief that assetml deserves a directory of his own :-)
> Maybe we could set a enviroment variable to point to the root dir,
> this way assetml could be easily ported to different platforms,
> besides that hardcoding a path is the best thing to do.
> (of course /usr/share/.. should be the default)
> 
Correct, I already changed it. In the lates cvs, I uses
/usr/share/assetml (i am updating the online doc)
Now, /usr/share is platform dependant. In my code, I rely on the
autoconf {prefix}/{datadir} to get it.

> 
> 
> > Is you pick up the cvs now, you will be abble to build rpm assetml
> > packages for all sounds.
> I have, but seems to lack some build tools, when i have them i'll try.
> 
Well, you need autoconf2.5 the automake that goes with at least.

> > It works but I am not sure yet how to organize that, it's a lot of
> > packages.
> That is certainly something to think of before the number of packages
> makes it impossible ;-)
> 
Correct, it deserves a web site on its own.
Perhaps we should open a new sf project for that.

> I'll will think about it, and meanwhile start coding a pyassetml. :-)
> 
Great =-0

Bruno.






More information about the Gcompris-devel mailing list