README revision 10319
70N/A# CDDL HEADER START
70N/A#
286N/A# The contents of this file are subject to the terms of the
70N/A# Common Development and Distribution License, Version 1.0 only
70N/A# (the "License"). You may not use this file except in compliance
70N/A# with the License.
70N/A#
70N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
70N/A# or http://www.opensolaris.org/os/licensing.
70N/A# See the License for the specific language governing permissions
70N/A# and limitations under the License.
70N/A#
70N/A# When distributing Covered Code, include this CDDL HEADER in each
70N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
70N/A# If applicable, add the following below this CDDL HEADER, with the
70N/A# fields enclosed by brackets "[]" replaced with your own identifying
70N/A# information: Portions Copyright [yyyy] [name of copyright owner]
70N/A#
70N/A# CDDL HEADER END
70N/A#
70N/A#
70N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
70N/A# Use is subject to license terms.
70N/A#
70N/A
70N/A
70N/AWhat is the "SUN_BRANDING" tag
70N/A==============================
70N/A
70N/A The purpose is to extract Sun specific messages on GUI.
525N/A CLI warning messages don't have to be translated but we need
70N/A translations with visible GUI.
70N/A I'ld like to extract the Sun specific message strings when adding
70N/A new strings and/or changing community strings for community packages.
359N/A
359N/A
359N/ASupported file types
98N/A====================
321N/A
493N/A .c, .h, .py,
321N/A .desktop.in, .directory.in,
213N/A .sh.in,
304N/A .server.in,
425N/A .kbd.in,
425N/A .xml[.in],
325N/A .shcemas.in,
493N/A .glade [1]
456N/A
320N/A
332N/AComment format per File type
501N/A============================
231N/A
523N/A - .c, .h, .py
98N/A
347N/A /* SUN_BRANDING
525N/A This is a comment line. */
463N/A _("C string");
493N/A
425N/A
493N/A - .desktop.in, .directory.in
472N/A
324N/A # SUN_BRANDING
347N/A _Name=C string
310N/A # SUN_BRANDING
316N/A _Comment=C string
474N/A
290N/A
332N/A - .sh.in [2]
464N/A
332N/A #!/bin/bash
509N/A # SUN_BRANDING
332N/A printf $"C string"
210N/A
493N/A
128N/A - .server.in
414N/A
484N/A <!-- SUN_BRANDING
326N/A This is a comment line. -->
493N/A <oaf_attribute name="name" type="string" _value="C string"/>
335N/A
493N/A
493N/A - .kbd.in
425N/A
370N/A <!-- SUN_BRANDING
70N/A This is a comment line. -->
400N/A <_GOK:label>C string</_GOK:label>
294N/A
435N/A
98N/A - .xml[.in]
434N/A
505N/A <!-- SUN_BRANDING
277N/A This is a comment line. -->
433N/A <foo _name="C string">
356N/A
289N/A
326N/A - .shcemas.in
439N/A
501N/A <locale name="C">
469N/A <default><!-- SUN_BRANDING
290N/A This is a comment line. -->C string</default>
424N/A </locale>
286N/A
90N/A
475N/A - .glade
295N/A
70N/A <property name="title" translatable="yes" comments="SUN_BRANDING">C string</property>
299N/A
262N/A
455N/AFIXME:
277N/A1. .theme and .icon files are not defined the comment "^#".
332N/Ahttp://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
332N/A2. Comments in .keys.in are not extracted by intltool-update.
493N/A3. Need tests to work fine with comments in .cave and .soundlist files.
70N/A
70N/ARequirement: intltool 0.35.5 or later
319N/A
280N/A[1] Also works .in.in. files. e.g. desktop.in.in
319N/A[2] It seem bash 3.0 i18n doesn't work on none UTF-8 so need to convert from UTF-8.
359N/A
493N/A
70N/AHow to generate po tarballs
98N/A===========================
98N/A
414N/A# cd po-sun
98N/A# make clean
493N/A# make
493N/A# cp po-sun-tarballs/* %{_builddir}/SOURCES/.
70N/A# pkgbuild --with-build-l10n -bp SUNWfoo.spec
493N/A
493N/A
493N/AHow to add a new module
=======================
# module=foo
# cd %{_builddir}/%{name}-%{version}/$module/po
# intltool-update -m
# cp POTFILES.in POTFILES.in.org
# cat POTFILES.in.orig missing | env LANG=C sort > POTFILES.in
# intltool-update -p
# sed -e 's/#\. SUN_BRANDING/# SUN_BRANDING/' ${module}.pot \
> ${module}-sun.pot
# msggrep -C -e "SUN_BRANDING" ${module}-sun.pot -o ${module}-sun.pot
# mkdir -p $SVN/trunk/po-sun/$module/po-sun
# cp ${module}-sun.pot $SVN/trunk/po-sun/$module/po-sun/.
# cd $SVN/trunk/po-sun
# vi Makefile
# diff Makefile.orig Makefile
72a73
> foo \
79a81,83
> foo_PAGES = foo/po-sun
> foo.PAGES: $(foo_PAGES)
>
# make
# bzcat po-sun-tarballs/foo-po-sun-*.tar.bz2 | tar tfv -
How to add/update translations
==============================
Please make sure 'make clean; make' and pkgbuild and commit your .po files
in the module dir.
How to update .spec files
=========================
Modify spec-files/foo.spec
--- spec-files/foo.spec.orig
+++ spec-files/foo.spec
@@ -7,6 +7,7 @@
#
# Owner: foo
#
+%include l10n.inc
Name: foo
License: GPL
Group: System/GUI/GNOME
@@ -20,6 +21,7 @@
Source2: gfloppy.1.gz
Source3: gnome-dictionary.1.gz
Source4: gnome-screenshot.1.gz
+Source5: %{name}-po-sun-%{po_sun_version}.tar.bz2
# date:2005-05-02 type:bug bugster:6222777 owner:mattman
Patch1: gnome-utils-01-gfloppy-permission.diff
# date:2006-04-05 type:branding owner:gman
@@ -63,6 +65,10 @@ This package contains some essential uti
%prep
%setup -q
+%if %build_l10n
+bzcat %SOURCE5 | tar xf -
+cd po-sun; make; cd ..
+%endif
%patch1 -p1
%patch2 -p1
%patch3 -p1
@@ -159,3 +165,6 @@ done
%{_libdir}/pkgconfig
%changelog
+* Thu Dec 28 2006 - foo@sun.com
+- Add l10n tarball.
+
How to delete Sun l10n tarball in .spec files
=============================================
1. Upstream foo.diff
2. Remove foo-po-sun*.tar.bz2 from .spec files