[gnome-cy] po file tools: msgconv



This note gives some info on this, in case it's helpful to others.

This and other tools are available in the gettext package, which likely comes 
with your distro.  The version with SuSE 8.0 was 0.10.40-111, which did not 
include several of the tools (eg the msgconv which was the reason for looking 
at it in the first place), so I downloaded 0.11.5-3 from the SuSE site.  
Gettext has a very good pdf manual included.

msgconv is "used to convert a translation catalog to a different encoding".  
To check your current encoding, run:
locale charmap
My PC is using ISO-8859-1.  The basic syntax for msgconv is:
msgconv inputfile -t UTF-8 -o outputfile
If -o outputfile is omitted, the inputfile will become the outputfile.  If -t 
UTF-8 is omitted, the conversion will be to the encoding used on the PC.

As pot files are imported into Kartouche, the header is rewritten.  The 
current version includes "charset=UTF-8" in that, on the grounds that this is 
what the file will be eventually.  But msgconv, sensibly, rejects this: it 
sees a UTF-8 header on a file that is not UTF-8, and says:
<location> invalid multibyte sequence
msgconv: found <n> errors
The header therefore has to read "charset=ISO-8859-1", and Kartouche's 
behaviour has been changed to reflect this.  This allows msgconv to do its 
stuff.

Additional functionality has also been added to Kartouche in the form of a 
frontend page to msgconv, which will read through a particular directory and 
apply UTF-8 encoding en masse to all files in that dir.  (Permissions on the 
files must of course allow the webserver to write to them.)  This will, 
hopefully, deal with the issue for the future.

Kevin 


_______________________________________________
gnome-cy mailing list
gnome-cy pengwyn linux org uk
http://pengwyn.linux.org.uk/mailman/listinfo/gnome-cy



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