[Y-devel] comment: XML interface description
Iain Jackson iain_thekillermunchkin at yahoo.co.uk
Wed Feb 25 23:16:11 GMT 2004
Can't you use Style Sheets with XML to do something similar, send the
XML for the interface and the style sheet specifying the localised info.
Iain
On Wed, 2004-02-25 at 19:44, Ben Farrell wrote:
> Hi,
>
> good idea, I also have a few things to add to this:
>
> 1) Could be a good idea to define a common message catalog with common
> strings like 'OK' 'Cancel' 'Exit' (etc..) and reference them a 'hash'
> (or what ever) to say you want the to use the common catalog (this
> could be stored on the Y-Server side in a separate library). An example:
>
> <y:label id="2" message="#1" />
>
> 2) I think it would be better to send the message catalog separate to the actual layout. (maybe send one catalog, but more than one layout ?)
>
> 3) Another thing too look is using binary XML to encode the data. For this to work, its necessary to have a unique integer value for every tag (preferable only one byte). so, something like:
>
> <example>abc</example> might become (in hex):
>
> 01 03 61 62 53 FF
>
> where:
> 01 <example> tag
> 03 Length of data between tags in bytes
> 61 62 63 UTF-8 / ASCII encoding
> FF Close Tag
> 01 <example> tag (closed by last byte).
>
> Things get a bit more complex when you have to start encoding options within the tags :o)
>
> Maybe, stick with using plain XML but allow a mime-type to be transmitted along with the data that passed around, allowing for some optimization like above in the future.
>
> Ben
>
>
>
> Rupert Mazzucco wrote:
>
> >While I understand that the XML fragment on p. 51 serves
> >only as illustration, I want to point out a flaw with the
> >design of this piece:
> >
> >In the light of possible internationalisation, text should
> >probably never be hardcoded into the widget description, but
> >always via a message catalog that can then be changed according
> >to the desired language. (Same goes for attached sound bits.)
> >
> >Maybe like
> >
> ><y:interface>
> > <y:gobjects>
> > ...
> > <y:label id="2" message="1" />
> > ...
> > </y:gobjects>
> > <y:message_catalog lang="C">
> > <y:message id="1" text="Testing" />
> > ...
> > </y:message_catalog>
> ></y:interface>
> >
> >or something like that. If the appliation is notified of a
> >locale change, it could send another message catalog, and the
> >server would then change everything accordingly.
> >
> >Regards,
> >Rupert
> >
> >
> >
> >
> >
> >
>
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved