[PATCH 4/4] Include ui, liveinst, and lang-table strings in po updates (#515411)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We were losing strings from liveinst/liveinst.desktop.in, ui/*.glade,
and lang-table whenever update-po would run.  Expand the po/ Makefiles
with Rules-lang-table, Rules-glade, and Rules-liveinst.  These files add
targets that generate the source files that the main po Makefile targets
will read.  Use intltool-extract to generate these source files from the
glade files and the liveinst files.  For lang-table, construct a source
file manually.

Modify scripts/getlangnames.py to open *.gmo files instead of *.mo
files.

In the ui/ and liveinst/ subdirs, add the *.h files to CLEANFILES so a
'make clean' operation will clear them out.
---
 .gitignore              |    3 +++
 liveinst/Makefile.am    |    2 +-
 po/POTFILES.in          |   36 ++++++++++++++++++++----------------
 po/Rules-glade          |   11 +++++++++++
 po/Rules-lang-table     |    8 ++++++++
 po/Rules-liveinst       |   11 +++++++++++
 scripts/getlangnames.py |    2 +-
 ui/Makefile.am          |    2 ++
 8 files changed, 57 insertions(+), 18 deletions(-)
 create mode 100644 po/Rules-glade
 create mode 100644 po/Rules-lang-table
 create mode 100644 po/Rules-liveinst

diff --git a/.gitignore b/.gitignore
index d5d9f22..430e245 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,7 +28,9 @@ configure
 depcomp
 install-sh
 lang-names
+lang-table.h
 libtool
+liveinst/*.desktop.in.h
 loader/dirbrowser
 loader/keymaps-override-*
 ltmain.sh
@@ -51,5 +53,6 @@ po/stamp-po
 py-compile
 stamp-h1
 tags
+ui/*.glade.h
 xutils.la
 xutils_la-xutils.lo
diff --git a/liveinst/Makefile.am b/liveinst/Makefile.am
index 7bcf1a2..2f51dfa 100644
--- a/liveinst/Makefile.am
+++ b/liveinst/Makefile.am
@@ -31,7 +31,7 @@ endif
 
 EXTRA_DIST = README liveinst.desktop.in
 
-CLEANFILES = liveinst.desktop
+CLEANFILES = liveinst.desktop *.h
 
 MAINTAINERCLEANFILES = Makefile.in
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 846c9b9..99a9040 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -100,21 +100,25 @@ textw/welcome_text.py
 textw/zipl_text.py
 
 # liveinst source files
-liveinst/liveinst.desktop.in
+liveinst/liveinst.desktop.in.h
 
 # Glade definition files
-ui/GroupSelector.glade
-ui/account.glade
-ui/adddrive.glade
-ui/addrepo.glade
-ui/anaconda.glade
-ui/autopart.glade
-ui/blwhere.glade
-ui/detailed-dialog.glade
-ui/instkey.glade
-ui/iscsi-config.glade
-ui/lukspassphrase.glade
-ui/netconfig.glade
-ui/network.glade
-ui/tasksel.glade
-ui/zfcp-config.glade
+ui/GroupSelector.glade.h
+ui/account.glade.h
+ui/adddrive.glade.h
+ui/addrepo.glade.h
+ui/anaconda.glade.h
+ui/autopart.glade.h
+ui/blwhere.glade.h
+ui/detailed-dialog.glade.h
+ui/fcoe-config.glade.h
+ui/instkey.glade.h
+ui/iscsi-config.glade.h
+ui/lukspassphrase.glade.h
+ui/netconfig.glade.h
+ui/network.glade.h
+ui/tasksel.glade.h
+ui/zfcp-config.glade.h
+
+# lang-table
+lang-table.h
diff --git a/po/Rules-glade b/po/Rules-glade
new file mode 100644
index 0000000..b117c4e
--- /dev/null
+++ b/po/Rules-glade
@@ -0,0 +1,11 @@
+UI_SRCS = $(wildcard $(top_srcdir)/ui/*.glade)
+UI_HDRS = $(UI_SRCS:.glade=.glade.h)
+
+%.glade.h: %.glade
+	@cd $(top_builddir)/ui ; \
+	intltool-extract -q --type=gettext/glade -l $< ; \
+	mv tmp/*h . ; \
+	rmdir tmp
+
+mostlyclean-glade:
+	rm -f $(UI_HDRS)
diff --git a/po/Rules-lang-table b/po/Rules-lang-table
new file mode 100644
index 0000000..76c4692
--- /dev/null
+++ b/po/Rules-lang-table
@@ -0,0 +1,8 @@
+$(top_builddir)/lang-table.h: $(top_srcdir)/lang-table
+	@rm -f $(top_builddir)/lang-table.h
+	@cat $(top_srcdir)/lang-table | cut -f 1 | while read lang ; do \
+		echo "char *s = N_(\"$${lang}\")" >> $(top_builddir)/lang-table.h ; \
+	done
+
+mostlyclean-lang-table:
+	rm -f $(top_builddir)/lang-table.h
diff --git a/po/Rules-liveinst b/po/Rules-liveinst
new file mode 100644
index 0000000..c2888b3
--- /dev/null
+++ b/po/Rules-liveinst
@@ -0,0 +1,11 @@
+LIVEINST_SRCS = $(top_srcdir)/liveinst/liveinst.desktop.in
+LIVEINST_HDRS = $(top_builddir)/liveinst/liveinst.desktop.in.h
+
+%.desktop.in.h: %.desktop.in
+	@cd $(top_builddir)/liveinst ; \
+	intltool-extract -q --type=gettext/keys -l $< ; \
+	mv tmp/*h . ; \
+	rmdir tmp
+
+mostlyclean-glade:
+	rm -f $(LIVEINST_HDRS)
diff --git a/scripts/getlangnames.py b/scripts/getlangnames.py
index b81d26d..b25db83 100644
--- a/scripts/getlangnames.py
+++ b/scripts/getlangnames.py
@@ -29,7 +29,7 @@ for k in langs.localeInfo.keys():
     found = False
     for l in language.expandLangs(k):
         try:
-            f = open("po/%s.mo" %(l,))
+            f = open("po/%s.gmo" %(l,))
         except (OSError, IOError):
             continue
         cat = gettext.GNUTranslations(f)
diff --git a/ui/Makefile.am b/ui/Makefile.am
index 9e4978d..39e1c56 100644
--- a/ui/Makefile.am
+++ b/ui/Makefile.am
@@ -21,3 +21,5 @@ uidir = $(datadir)/$(PACKAGE_NAME)/ui
 dist_ui_DATA = *.glade
 
 MAINTAINERCLEANFILES = Makefile.in
+
+CLEANFILES = *.h
-- 
1.6.2.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux