9725N/A# CDDL HEADER START
9725N/A#
9725N/A# The contents of this file are subject to the terms of the
9725N/A# Common Development and Distribution License, Version 1.0 only
9725N/A# (the "License"). You may not use this file except in compliance
9725N/A# with the License.
9725N/A#
9725N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9725N/A# or http://www.opensolaris.org/os/licensing.
9725N/A# See the License for the specific language governing permissions
9725N/A# and limitations under the License.
9725N/A#
9725N/A# When distributing Covered Code, include this CDDL HEADER in each
9725N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9725N/A# If applicable, add the following below this CDDL HEADER, with the
9725N/A# fields enclosed by brackets "[]" replaced with your own identifying
9725N/A# information: Portions Copyright [yyyy] [name of copyright owner]
9725N/A#
9725N/A# CDDL HEADER END
9725N/A#
9725N/A#
9725N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
9725N/A# Use is subject to license terms.
9725N/A#
9725N/A
9725N/A
10319N/AWhat is the "SUN_BRANDING" tag
10319N/A==============================
10319N/A
10319N/A The purpose is to extract Sun specific messages on GUI.
10319N/A CLI warning messages don't have to be translated but we need
10319N/A translations with visible GUI.
10319N/A I'ld like to extract the Sun specific message strings when adding
10319N/A new strings and/or changing community strings for community packages.
10319N/A
10319N/A
10319N/ASupported file types
10319N/A====================
10319N/A
15593N/A .c, .h,
15593N/A .py,
10319N/A .desktop.in, .directory.in,
10319N/A .sh.in,
10319N/A .server.in,
10319N/A .kbd.in,
10319N/A .xml[.in],
10319N/A .shcemas.in,
10319N/A .glade [1]
10319N/A
10319N/A
10319N/AComment format per File type
10319N/A============================
10319N/A
15593N/A - .c, .h
10319N/A
10319N/A /* SUN_BRANDING
10319N/A This is a comment line. */
10319N/A _("C string");
10319N/A
15243N/A /* SUN_BRANDING
15243N/A This is a comment line. */
15243N/A function (_("C string"), /* SUN_BRANDING */ _("another string"));
15243N/A
15243N/A /* SUN_BRANDING
15243N/A This is a comment line. */ [2]
15243N/A _("This is a "
15243N/A "multiple lines.");
15243N/A
15243N/A /* SUN_BRANDING
15243N/A This is a comment line. */
15243N/A ngettext ("snapshot", "snapshots", i);
10319N/A
15593N/A
15593N/A - .py
15593N/A
15593N/A # SUN_BRANDING
15593N/A print _("Python string")
15593N/A
15593N/A # SUN_BRANDING [2]
15593N/A a = N_("This is a "
15593N/A "multiple lines.")
15593N/A
15593N/A
10319N/A - .desktop.in, .directory.in
10319N/A
10319N/A # SUN_BRANDING
10319N/A _Name=C string
10319N/A # SUN_BRANDING
10319N/A _Comment=C string
10319N/A
10319N/A
15243N/A - .sh.in [3]
10319N/A
10319N/A #!/bin/bash
10319N/A # SUN_BRANDING
10319N/A printf $"C string"
10319N/A
10319N/A
10319N/A - .server.in
10319N/A
10319N/A <!-- SUN_BRANDING
10319N/A This is a comment line. -->
10319N/A <oaf_attribute name="name" type="string" _value="C string"/>
10319N/A
10319N/A
10319N/A - .kbd.in
10319N/A
10319N/A <!-- SUN_BRANDING
10319N/A This is a comment line. -->
10319N/A <_GOK:label>C string</_GOK:label>
10319N/A
10319N/A
10319N/A - .xml[.in]
10319N/A
10319N/A <!-- SUN_BRANDING
10319N/A This is a comment line. -->
10319N/A <foo _name="C string">
10319N/A
10319N/A
10319N/A - .shcemas.in
10319N/A
10319N/A <locale name="C">
10319N/A <default><!-- SUN_BRANDING
10319N/A This is a comment line. -->C string</default>
10319N/A </locale>
10319N/A
10319N/A
10319N/A - .glade
10319N/A
10319N/A <property name="title" translatable="yes" comments="SUN_BRANDING">C string</property>
10319N/A
10319N/A
10319N/AFIXME:
10319N/A1. .theme and .icon files are not defined the comment "^#".
10319N/Ahttp://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
10319N/A2. Comments in .keys.in are not extracted by intltool-update.
10319N/A3. Need tests to work fine with comments in .cave and .soundlist files.
10319N/A
10319N/ARequirement: intltool 0.35.5 or later
10319N/A
10319N/A[1] Also works .in.in. files. e.g. desktop.in.in
15243N/A[2] Please do not use '+' to unite multiple lines in Python/C++ because
15243N/A intltool(xgettext) fails to extract whole strings.
15243N/A[3] It seem bash 3.0 i18n doesn't work on none UTF-8 so need to convert from UTF-8.
10319N/A
10319N/A
9725N/AHow to generate po tarballs
9725N/A===========================
9725N/A
9725N/A# cd po-sun
9725N/A# make clean
9725N/A# make
9725N/A# cp po-sun-tarballs/* %{_builddir}/SOURCES/.
20383N/A# pkgbuild --with-l10n -bp SUNWfoo.spec
9725N/A
9725N/A
9725N/AHow to add a new module
9725N/A=======================
9725N/A
9725N/A# module=foo
9725N/A# cd %{_builddir}/%{name}-%{version}/$module/po
9725N/A# intltool-update -m
9725N/A# cp POTFILES.in POTFILES.in.org
9725N/A# cat POTFILES.in.orig missing | env LANG=C sort > POTFILES.in
9725N/A# intltool-update -p
15593N/A# sed -e 's/#\. .*SUN_BRANDING/# SUN_BRANDING/' ${module}.pot \
9725N/A > ${module}-sun.pot
9725N/A# msggrep -C -e "SUN_BRANDING" ${module}-sun.pot -o ${module}-sun.pot
9838N/A# mkdir -p $SVN/trunk/po-sun/$module/po-sun
9838N/A# cp ${module}-sun.pot $SVN/trunk/po-sun/$module/po-sun/.
9725N/A# cd $SVN/trunk/po-sun
9725N/A# vi Makefile
9725N/A# diff Makefile.orig Makefile
9725N/A72a73
9725N/A> foo \
9725N/A79a81,83
9838N/A> foo_PAGES = foo/po-sun
9725N/A> foo.PAGES: $(foo_PAGES)
9725N/A>
9725N/A# make
9725N/A# bzcat po-sun-tarballs/foo-po-sun-*.tar.bz2 | tar tfv -
9725N/A
9725N/A
9725N/AHow to add/update translations
9725N/A==============================
9725N/A
9725N/APlease make sure 'make clean; make' and pkgbuild and commit your .po files
9725N/Ain the module dir.
9725N/A
9725N/A
9725N/AHow to update .spec files
9725N/A=========================
9725N/A
9725N/AModify spec-files/foo.spec
9725N/A--- spec-files/foo.spec.orig
9725N/A+++ spec-files/foo.spec
9725N/A@@ -7,6 +7,7 @@
9725N/A #
9725N/A # Owner: foo
9725N/A #
9725N/A+%include l10n.inc
9725N/A Name: foo
9725N/A License: GPL
9725N/A Group: System/GUI/GNOME
15243N/A@@ -20,6 +21,9 @@
9725N/A Source2: gfloppy.1.gz
9725N/A Source3: gnome-dictionary.1.gz
9725N/A Source4: gnome-screenshot.1.gz
15243N/A+%if %build_l10n
9725N/A+Source5: %{name}-po-sun-%{po_sun_version}.tar.bz2
15243N/A+%endif
9725N/A # date:2005-05-02 type:bug bugster:6222777 owner:mattman
9725N/A Patch1: gnome-utils-01-gfloppy-permission.diff
9725N/A # date:2006-04-05 type:branding owner:gman
9725N/A@@ -63,6 +65,10 @@ This package contains some essential uti
9725N/A
9725N/A %prep
9725N/A %setup -q
9725N/A+%if %build_l10n
9725N/A+bzcat %SOURCE5 | tar xf -
9725N/A+cd po-sun; make; cd ..
9725N/A+%endif
9725N/A %patch1 -p1
9725N/A %patch2 -p1
9725N/A %patch3 -p1
9725N/A@@ -159,3 +165,6 @@ done
9725N/A %{_libdir}/pkgconfig
9725N/A
9725N/A %changelog
9725N/A+* Thu Dec 28 2006 - foo@sun.com
9725N/A+- Add l10n tarball.
9725N/A+
9725N/A
9725N/A
9725N/AHow to delete Sun l10n tarball in .spec files
9725N/A=============================================
9725N/A
9725N/A1. Upstream foo.diff
9725N/A2. Remove foo-po-sun*.tar.bz2 from .spec files
9725N/A