README.po2i18n
author nathan
Sun, 22 Feb 2009 21:02:54 +0800
branchtrunk
changeset 29 a0f32201f466
parent 23 3c10fdd8ccce
permissions -rw-r--r--
add italian translations
nathan@23
     1
        
nathan@23
     2
                  po2i18n - Converter for po files
nathan@23
     3
nathan@23
     4
nathan@23
     5
Written by:              Udo Richter <udo_richter@gmx.de>
nathan@23
     6
Project's homepage:      http://www.udo-richter.de/vdr/scripts.html#po2i18n
nathan@23
     7
                         http://www.udo-richter.de/vdr/scripts.en.html#po2i18n
nathan@23
     8
nathan@23
     9
nathan@23
    10
nathan@23
    11
About
nathan@23
    12
--------------------------------------------------------------------------
nathan@23
    13
po2i18n is a perl script that generates an i18n.c file compatible to the i18n
nathan@23
    14
system of VDR 1.2.0 - VDR 1.5.6, based on the .po files of VDR 1.5.7. This
nathan@23
    15
allows plugins to transit to the translation system of VDR 1.5.7 while 
nathan@23
    16
maintaining compatibility to earlier versions. The script can be used manually
nathan@23
    17
or automatically as part of the Makefile.
nathan@23
    18
nathan@23
    19
nathan@23
    20
Use
nathan@23
    21
--------------------------------------------------------------------------
nathan@23
    22
po2i18n.pl is a filter and can be used manually like this:
nathan@23
    23
nathan@23
    24
  ./po2i18n.pl < i18n-template.c > i18n.c
nathan@23
    25
  
nathan@23
    26
The filter reads all relevant ./po/*.po files and writes the i18n strings
nathan@23
    27
into the template file. Strings will be added between the following two lines:
nathan@23
    28
nathan@23
    29
  // START I18N
nathan@23
    30
  // END I18N
nathan@23
    31
nathan@23
    32
See also the sample i18n.h and i18n-template.c file. Note that the phrases data
nathan@23
    33
structure is encapsulated in #if VDRVERSNUM < 10507, so the i18n strings won't 
nathan@23
    34
be in the plugin file after 1.5.7. The call to RegisterI18n() of your plugin 
nathan@23
    35
should also be encapsulated like this.
nathan@23
    36
nathan@23
    37
po2i18n can also generate the i18n.c file on the fly while compiling. The 
nathan@23
    38
changes to the Makefile are demonstrated by the included Makefile.diff sample.
nathan@23
    39
With these changes, the i18n.c file will be generated on VDR up to 1.5.6, and
nathan@23
    40
the whole gettext conversion is skipped. From 1.5.7 on, the i18n-template.c 
nathan@23
    41
file will be simply copied as a dummy, and the new locale system will run.
nathan@23
    42
nathan@23
    43
As a drawback, the automatic .dependencies for i18n.c won't work.
nathan@23
    44