Home | History | Annotate | Download | only in po-sun
      1 # CDDL HEADER START
      2 #
      3 # The contents of this file are subject to the terms of the
      4 # Common Development and Distribution License, Version 1.0 only
      5 # (the "License").  You may not use this file except in compliance
      6 # with the License.
      7 #
      8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9 # or http://www.opensolaris.org/os/licensing.
     10 # See the License for the specific language governing permissions
     11 # and limitations under the License.
     12 #
     13 # When distributing Covered Code, include this CDDL HEADER in each
     14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15 # If applicable, add the following below this CDDL HEADER, with the
     16 # fields enclosed by brackets "[]" replaced with your own identifying
     17 # information: Portions Copyright [yyyy] [name of copyright owner]
     18 #
     19 # CDDL HEADER END
     20 #
     21 #
     22 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     23 # Use is subject to license terms.
     24 #
     25 
     26 
     27 What is the "SUN_BRANDING" tag
     28 ==============================
     29 
     30         The purpose is to extract Sun specific messages on GUI.
     31         CLI warning messages don't have to be translated but we need
     32         translations with visible GUI.
     33         I'ld like to extract the Sun specific message strings when adding 
     34         new strings and/or changing community strings for community packages.
     35 
     36 
     37 Supported file types
     38 ====================
     39 
     40         .c, .h, .py,
     41         .desktop.in, .directory.in,
     42         .sh.in,
     43         .server.in,
     44         .kbd.in,
     45         .xml[.in],
     46         .shcemas.in,
     47         .glade [1]
     48 
     49 
     50 Comment format per File type
     51 ============================
     52 
     53         - .c, .h, .py
     54 
     55           /* SUN_BRANDING
     56              This is a comment line. */
     57           _("C string");
     58 
     59 
     60         - .desktop.in, .directory.in
     61 
     62           # SUN_BRANDING
     63           _Name=C string
     64           # SUN_BRANDING
     65           _Comment=C string
     66 
     67 
     68         - .sh.in [2]
     69 
     70           #!/bin/bash
     71           # SUN_BRANDING
     72           printf $"C string"
     73 
     74 
     75         - .server.in
     76 
     77           <!-- SUN_BRANDING
     78                This is a comment line. -->
     79           <oaf_attribute name="name" type="string" _value="C string"/>
     80 
     81 
     82         - .kbd.in
     83 
     84           <!-- SUN_BRANDING
     85                This is a comment line. -->
     86           <_GOK:label>C string</_GOK:label>
     87 
     88 
     89         - .xml[.in]
     90 
     91           <!-- SUN_BRANDING
     92                This is a comment line. -->
     93           <foo _name="C string">
     94 
     95 
     96         - .shcemas.in
     97 
     98           <locale name="C">
     99             <default><!-- SUN_BRANDING
    100                           This is a comment line. -->C string</default>
    101           </locale>
    102 
    103 
    104         - .glade
    105 
    106           <property name="title" translatable="yes" comments="SUN_BRANDING">C string</property>
    107 
    108 
    109 FIXME: 
    110 1. .theme and .icon files are not defined the comment "^#".
    111 http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
    112 2. Comments in .keys.in are not extracted by intltool-update.
    113 3. Need tests to work fine with comments in .cave and .soundlist files.
    114 
    115 Requirement: intltool 0.35.5 or later
    116 
    117 [1] Also works .in.in. files. e.g. desktop.in.in
    118 [2] It seem bash 3.0 i18n doesn't work on none UTF-8 so need to convert from UTF-8.
    119 
    120 
    121 How to generate po tarballs
    122 ===========================
    123 
    124 # cd po-sun
    125 # make clean
    126 # make
    127 # cp po-sun-tarballs/* %{_builddir}/SOURCES/.
    128 # pkgbuild --with-build-l10n -bp SUNWfoo.spec
    129 
    130 
    131 How to add a new module
    132 =======================
    133 
    134 # module=foo
    135 # cd %{_builddir}/%{name}-%{version}/$module/po
    136 # intltool-update -m
    137 # cp POTFILES.in POTFILES.in.org
    138 # cat POTFILES.in.orig missing | env LANG=C sort > POTFILES.in
    139 # intltool-update -p
    140 # sed -e 's/#\. SUN_BRANDING/# SUN_BRANDING/' ${module}.pot \
    141   > ${module}-sun.pot
    142 # msggrep -C -e "SUN_BRANDING" ${module}-sun.pot -o ${module}-sun.pot
    143 # mkdir -p $SVN/trunk/po-sun/$module/po-sun
    144 # cp ${module}-sun.pot $SVN/trunk/po-sun/$module/po-sun/.
    145 # cd $SVN/trunk/po-sun
    146 # vi Makefile
    147 # diff Makefile.orig Makefile
    148 72a73
    149 > 	foo				\
    150 79a81,83
    151 > foo_PAGES = foo/po-sun
    152 > foo.PAGES: $(foo_PAGES)
    153 > 
    154 # make
    155 # bzcat po-sun-tarballs/foo-po-sun-*.tar.bz2 | tar tfv -
    156 
    157 
    158 How to add/update translations 
    159 ==============================
    160 
    161 Please make sure 'make clean; make' and pkgbuild and commit your .po files 
    162 in the module dir.
    163 
    164 
    165 How to update .spec files
    166 =========================
    167 
    168 Modify spec-files/foo.spec
    169 --- spec-files/foo.spec.orig
    170 +++ spec-files/foo.spec
    171 @@ -7,6 +7,7 @@
    172  #
    173  # Owner: foo
    174  #
    175 +%include l10n.inc
    176  Name:         foo
    177  License:      GPL
    178  Group:        System/GUI/GNOME
    179 @@ -20,6 +21,7 @@
    180  Source2:      gfloppy.1.gz
    181  Source3:      gnome-dictionary.1.gz
    182  Source4:      gnome-screenshot.1.gz
    183 +Source5:      %{name}-po-sun-%{po_sun_version}.tar.bz2
    184  # date:2005-05-02 type:bug bugster:6222777 owner:mattman
    185  Patch1:       gnome-utils-01-gfloppy-permission.diff
    186  # date:2006-04-05 type:branding owner:gman
    187 @@ -63,6 +65,10 @@ This package contains some essential uti
    188  
    189  %prep
    190  %setup -q
    191 +%if %build_l10n
    192 +bzcat %SOURCE5 | tar xf -
    193 +cd po-sun; make; cd ..
    194 +%endif
    195  %patch1 -p1
    196  %patch2 -p1
    197  %patch3 -p1
    198 @@ -159,3 +165,6 @@ done
    199  %{_libdir}/pkgconfig
    200  
    201  %changelog
    202 +* Thu Dec 28 2006 - foo (a] sun.com
    203 +- Add l10n tarball.
    204 +
    205 
    206 
    207 How to delete Sun l10n tarball in .spec files
    208 =============================================
    209 
    210 1. Upstream foo.diff
    211 2. Remove foo-po-sun*.tar.bz2 from .spec files
    212 
    213