Skip to contentSkip to conversation

Add i18n infra-structure.

PATCH New Carlos Maiolino 3 participants 4 messages May 31, 2011 – Jun 1, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add i18n infra-structure.

This patch adds some files, directories and changes in configure.ac and Makefile.am required to i18n support.

The previous patch missed changes in configure.ac and Makefile.am, this is the correct one

---
 Makefile.am            |    4 +-
 config.rpath           |  672 ++++++++++++++++++++++++++++++++++++++++++++++++
 configure.ac           |    6 +-
 po/Makefile.in.in      |  444 ++++++++++++++++++++++++++++++++
 po/Makevars            |   41 +++
 po/POTFILES.in         |    1 +
 po/Rules-quot          |   47 ++++
 po/boldquot.sed        |   10 +
 po/en at boldquot.header  |   25 ++
 po/en at quot.header      |   22 ++
 po/insert-header.sin   |   23 ++
 po/quot.sed            |    6 +
 po/remove-potcdate.sin |   19 ++
 13 files changed, 1317 insertions(+), 3 deletions(-)
 create mode 100755 config.rpath
 create mode 100644 po/Makefile.in.in
 create mode 100644 po/Makevars
 create mode 100644 po/POTFILES.in
 create mode 100644 po/Rules-quot
 create mode 100644 po/boldquot.sed
 create mode 100644 po/en at boldquot.header
 create mode 100644 po/en at quot.header
 create mode 100644 po/insert-header.sin
 create mode 100644 po/quot.sed
 create mode 100644 po/remove-potcdate.sin
Makefile.am +2 -2
index 688c350..8f98a8e 100644
@@ -1,4 +1,4 @@
-EXTRA_DIST		= autogen.sh
+EXTRA_DIST		= config.rpath m4/ChangeLog  autogen.sh
 
 AUTOMAKE_OPTIONS	= foreign
 
@@ -12,7 +12,7 @@ noinst_HEADERS		= make/copyright.cf
 
 ACLOCAL_AMFLAGS		= -I m4
 
-SUBDIRS			= group gfs2 doc
+SUBDIRS			= po intl group gfs2 doc
 
 install-exec-local:
 			$(INSTALL) -d $(DESTDIR)/$(LOGDIR)
config.rpath new file +672 -0

672 lines not on this page · raw message

configure.ac +5 -1
index 3fc02d0..aa7cc64 100644
@@ -16,6 +16,10 @@ AC_PROG_LIBTOOL
 
 AC_LANG([C])
 
+#i18n
+AM_GNU_GETTEXT
+AM_GNU_GETTEXT_VERSION([0.18])
+
 # Sanitize path
 
 if test "$prefix" = "NONE"; then
@@ -262,7 +266,7 @@ CPPFLAGS="$KERNEL_CPPFLAGS -I\$(top_builddir)/make -I\$(top_srcdir)/make \
 	  -I. $ENV_CPPFLAGS"
 LDFLAGS="$ENV_LDFLAGS"
 
-AC_CONFIG_FILES([Makefile
+AC_CONFIG_FILES([Makefile intl/Makefile po/Makefile.in
 		 group/Makefile
 		 group/libgfscontrol/Makefile
 		 group/gfs_control/Makefile
po/Makefile.in.in new file +444 -0

444 lines not on this page · raw message

po/Makevars new file +41 -0

41 lines not on this page · raw message

po/POTFILES.in new file +1 -0
new file mode 100644
index 0000000..667e27c
@@ -0,0 +1 @@
+# List of source files which contain translatable strings.
po/Rules-quot new file +47 -0

47 lines not on this page · raw message

po/boldquot.sed new file +10 -0
new file mode 100644
index 0000000..4b937aa
@@ -0,0 +1,10 @@
+s/"\([^"]*\)"/???\1???/g
+s/`\([^`']*\)'/???\1???/g
+s/ '\([^`']*\)' / ???\1??? /g
+s/ '\([^`']*\)'$/ ???\1???/g
+s/^'\([^`']*\)' /???\1??? /g
+s/??????/""/g
+s/???/???/g
+s/???/???/g
+s/???/???/g
+s/???/???/g
po/en at boldquot.header new file +25 -0
new file mode 100644
index 0000000..fedb6a0
@@ -0,0 +1,25 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
+# This catalog furthermore displays the text between the quotation marks in
+# bold face, assuming the VT100/XTerm escape sequences.
+#
po/en at quot.header new file +22 -0
new file mode 100644
index 0000000..a9647fc
@@ -0,0 +1,22 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
po/insert-header.sin new file +23 -0
new file mode 100644
index 0000000..b26de01
@@ -0,0 +1,23 @@
+# Sed script that inserts the file called HEADER before the header entry.
+#
+# At each occurrence of a line starting with "msgid ", we execute the following
+# commands. At the first occurrence, insert the file. At the following
+# occurrences, do nothing. The distinction between the first and the following
+# occurrences is achieved by looking at the hold space.
+/^msgid /{
+x
+# Test if the hold space is empty.
+s/m/m/
+ta
+# Yes it was empty. First occurrence. Read the file.
+r HEADER
+# Output the file's contents by reading the next line. But don't lose the
+# current line while doing this.
+g
+N
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
po/quot.sed new file +6 -0
new file mode 100644
index 0000000..0122c46
@@ -0,0 +1,6 @@
+s/"\([^"]*\)"/???\1???/g
+s/`\([^`']*\)'/???\1???/g
+s/ '\([^`']*\)' / ???\1??? /g
+s/ '\([^`']*\)'$/ ???\1???/g
+s/^'\([^`']*\)' /???\1??? /g
+s/??????/""/g
po/remove-potcdate.sin new file +19 -0
new file mode 100644
index 0000000..2436c49
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
Signature · 1 line
1.7.5.2
#1 lore raw

PATCH 1/1 Add i18n infra-structure.

Quoted 7 lines · Carlos Maiolino

This patch adds some files, directories and changes in configure.ac and Makefile.am required to i18n support.

The previous patch missed changes in configure.ac and Makefile.am, this is the correct one

---
 Makefile.am            |    4 +-
 config.rpath           |  672 ++++++++++++++++++++++++++++++++++++++++++++++++

Why do we need config.rpath? What does it do in this context?

Quoted 16 lines
configure.ac +4 -0
index 3fc02d0..aa7cc64 100644
@@ -16,6 +16,10 @@ AC_PROG_LIBTOOL
 
 AC_LANG([C])
 
+#i18n
+AM_GNU_GETTEXT
+AM_GNU_GETTEXT_VERSION([0.18])
+
 # Sanitize path
 
 if test "$prefix" = "NONE"; then

configure.ac CPPFLAGS="$KERNEL_CPPFLAGS -I\$(top_builddir)/make -I\$(top_srcdir)/make \ · line 272

Quoted 8 lines
configure.ac +1 -1
@@ -262,7 +266,7 @@ CPPFLAGS="$KERNEL_CPPFLAGS -I\$(top_builddir)/make -I\$(top_srcdir)/make \
 	  -I. $ENV_CPPFLAGS"
 LDFLAGS="$ENV_LDFLAGS"
 
-AC_CONFIG_FILES([Makefile
+AC_CONFIG_FILES([Makefile intl/Makefile po/Makefile.in
 		 group/Makefile
 		 group/libgfscontrol/Makefile
 		 group/gfs_control/Makefile

One per line, in alphabetical order please. Easier to track them.

Same applies to Makefile.am addition for SUBDIRS and EXTRA_DIST.

Is the build order important for po/intl vs code?

Fabio

#2 lore raw

PATCH 1/1 Add i18n infra-structure.

Hi,

Quoted 38 lines · Fabio M. Di Nitto
Quoted 7 lines · Carlos Maiolino

This patch adds some files, directories and changes in configure.ac and Makefile.am required to i18n support.

The previous patch missed changes in configure.ac and Makefile.am, this is the correct one

---
 Makefile.am            |    4 +-
 config.rpath           |  672 ++++++++++++++++++++++++++++++++++++++++++++++++

Why do we need config.rpath? What does it do in this context?

Quoted 16 lines
configure.ac +4 -0
index 3fc02d0..aa7cc64 100644
@@ -16,6 +16,10 @@ AC_PROG_LIBTOOL
 
 AC_LANG([C])
 
+#i18n
+AM_GNU_GETTEXT
+AM_GNU_GETTEXT_VERSION([0.18])
+
 # Sanitize path
 
 if test "$prefix" = "NONE"; then

configure.ac CPPFLAGS="$KERNEL_CPPFLAGS -I\$(top_builddir)/make -I\$(top_srcdir)/make \ · line 272

Quoted 8 lines
configure.ac +1 -1
@@ -262,7 +266,7 @@ CPPFLAGS="$KERNEL_CPPFLAGS -I\$(top_builddir)/make -I\$(top_srcdir)/make \
 	  -I. $ENV_CPPFLAGS"
 LDFLAGS="$ENV_LDFLAGS"
 
-AC_CONFIG_FILES([Makefile
+AC_CONFIG_FILES([Makefile intl/Makefile po/Makefile.in
 		 group/Makefile
 		 group/libgfscontrol/Makefile
 		 group/gfs_control/Makefile

One per line, in alphabetical order please. Easier to track them.

Quoted 6 lines

Same applies to Makefile.am addition for SUBDIRS and EXTRA_DIST.

Is the build order important for po/intl vs code?

Fabio

The build order between po and code is determined by the workflow, so what should happen is that the po files are updated by string changes from the code as code changes happen. So they need to be checked in at the same time as the code changes which also acts as a way to check that the code change isn't adding strings which are difficult to translate or near duplicates of existing strings (exact duplicates being preferred)

The installation phase of building should also create the .mo files and install them, based on the existing translations. There is a macro that we need to add to the spec file to pick those up correctly and last time I looked into it, it looked fairly straight forward.

The other part of the process comes via transifex, and I believe that the project already has the correct perms to allow addition of translations through this system direct to git. We should wait a bit though before requesting translations as we need to get the existing strings into a better state first. Once the strings are being built on a regular basis it should be easier to see what needs doing. We already know that there are a number of strings which are not translatable for various reasons and there are those which contain \r too.

Steve.

#3 lore raw

PATCH 1/1 Add i18n infra-structure.

In reply to Fabio M. Di Nitto

Hi,

Quoted 3 lines

Why do we need config.rpath? What does it do in this context?

the config.rpath file output some system dependent variables related to run time search paths of shared libs. It's required by the macro AM_GNU_GETTEXT added to configure.ac, required to implement i18n into the package.

Quoted 4 lines

One per line, in alphabetical order please. Easier to track them.

Is the build order important for po/intl vs code?

I'm not sure tbh, I don't think so.
I can test to see if we can change the order.

Signature · 7 lines
---

Best Regards

Carlos Eduardo Maiolino
Software Maintenance Engineer
Red Hat - Global Support Services