Question about V2 .lang file format

2006-09-20 Thread Andrew Hart

Hi folks,

I'm in the midst of writing a utility to build .voice files using the
new V2 lang file format.
I have the parser written and can now read and write .lang files; I
don't yet have code for loading and saving comments in .lang files
(comments are read, but ignored at the moment) and there is still
probably some work to do on recovering from syntax errors and user 
stupidity in .lang files, etc.,

but it works fine with english.lang from cvs.

I've looked on the Rockbox site for info about the .lang file format and
found the docs about updating language files which gives a description
of the .lang file format.
However, it does not explain the user: lines that appear in phrases.
For instance, you'll often see

phrase
  id:  LANG_SOME_MESSAGE_ID
  desc: an example phrase declaration
  user:
  source
*: The message id of a target string
  /source
  ...
/phrase

but there are many examples in english.lang where user: does not
appear in a phrase declaration.

So, I'm wondering what does it mean?  Do I need to do anything with it?
 I have not encountered a user: keyword accompanied by any text at
all.  Does it merely indicate that the source, dest and voice tags that
generally follow it are user editable?

Oh, and while I'm at it, what encoding is used for the quoted strings in 
.lang files?  Is it ASCII, UTF8, another flavour of Unicode or code-page 
dependent?  I haven't played with any non-english .lang files yet to see 
if Visual Basic's internal string  and file i/o mangles the text or not. 
 As far as I am aware, VB is supposed to use Unicode for string 
representation though.


Cheers,
Andrew.



Re: Question about V2 .lang file format

2006-09-20 Thread Daniel Stenberg

On Wed, 20 Sep 2006, Andrew Hart wrote:


I'm in the midst of writing a utility to build .voice files using the
new V2 lang file format.


Uh, genlang -o was made just to let you use the old scripts without having to 
do this!



I've looked on the Rockbox site for info about the .lang file format and
found the docs about updating language files which gives a description
of the .lang file format.
However, it does not explain the user: lines that appear in phrases.


There's some additional info to read in my original description of the plan:

http://daniel.haxx.se/rockbox/langv2

But to take it short, the 'user:' field is not used yet. It is meant to 
describe if the phrase is for the core or for a (named) plugin.


Oh, and while I'm at it, what encoding is used for the quoted strings in 
.lang files?  Is it ASCII, UTF8, another flavour of Unicode or code-page 
dependent?


UTF8 I believe

--
 Daniel Stenberg -- http://www.rockbox.org/ -- http://daniel.haxx.se/