Skip to contentSkip to conversation

Translate or not?

PATCH In review Petr Lautrbach 2 participants 4 messages Apr 1, 2022 – Apr 6, 2022 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hello,

the translations in this project wasn't really updated since 2013. There was only a minor French translation update in 2016.

OTOH Fedora project still provides translations which are used there
https://translate.fedoraproject.org/projects/selinux/

Also there's was a split back in 2016 which moved gui, python and sandbox out of policycoreutils.

The following patch splits also the translations. And there's second patch available in my github repository which updates the translations from
https://translate.fedoraproject.org/projects/selinux/ and which is too big for this list:

https://github.com/bachradsusi/SELinuxProject-selinux/commit/afa35aea4a95089d9c99504e627fb573d836f7e8

Thanks,

Petr

#1 lore raw

PATCH 1/1 Split po/ translation files into the relevant sub-directories

When policycoreutils was split into policycoreutils/ python/ gui/ and sandbox/ sub-directories, po/ translation files stayed in policycoreutils/.

This commit splits original policycoreutils translations to policycoreutils, selinux-python, selinux-gui, and selinux-sandbox.

See original Fedora issue https://github.com/fedora-selinux/selinux/issues/43

---
 gui/Makefile                                 |  4 +
 gui/booleansPage.py                          |  2 +-
 gui/domainsPage.py                           |  2 +-
 gui/fcontextPage.py                          |  2 +-
 gui/loginsPage.py                            |  2 +-
 gui/modulesPage.py                           |  2 +-
 gui/po/Makefile                              | 84 +++++++++++++++++++
 gui/po/POTFILES                              | 17 ++++
 gui/polgengui.py                             |  2 +-
 gui/portsPage.py                             |  2 +-
 gui/semanagePage.py                          |  2 +-
 gui/statusPage.py                            |  2 +-
 gui/system-config-selinux.py                 |  2 +-
 gui/usersPage.py                             |  2 +-
 policycoreutils/po/Makefile                  | 72 ++---------------
 policycoreutils/po/POTFILES                  |  9 +++
 python/Makefile                              |  2 +-
 python/chcat/chcat                           |  2 +-
 python/po/Makefile                           | 85 ++++++++++++++++++++
 python/po/POTFILES                           | 10 +++
 python/semanage/semanage                     |  2 +-
 python/semanage/seobject.py                  |  2 +-
 python/sepolgen/src/sepolgen/sepolgeni18n.py |  2 +-
 python/sepolicy/sepolicy.py                  |  2 +-
 python/sepolicy/sepolicy/__init__.py         |  2 +-
 python/sepolicy/sepolicy/generate.py         |  2 +-
 python/sepolicy/sepolicy/gui.py              |  2 +-
 python/sepolicy/sepolicy/interface.py        |  2 +-
 sandbox/Makefile                             |  3 +
 sandbox/po/Makefile                          | 84 +++++++++++++++++++
 sandbox/po/POTFILES                          |  1 +
 sandbox/sandbox                              |  2 +-
 32 files changed, 324 insertions(+), 89 deletions(-)
 create mode 100644 gui/po/Makefile
 create mode 100644 gui/po/POTFILES
 create mode 100644 policycoreutils/po/POTFILES
 create mode 100644 python/po/Makefile
 create mode 100644 python/po/POTFILES
 create mode 100644 sandbox/po/Makefile
 create mode 100644 sandbox/po/POTFILES
gui/Makefile +4 -0
index ca965c942912..4035fb21b8c9 100644
@@ -22,6 +22,7 @@ system-config-selinux.ui \
 usersPage.py
 
 all: $(TARGETS) system-config-selinux.py polgengui.py
+	(cd po && $(MAKE) $@)
 
 install: all
 	-mkdir -p $(DESTDIR)$(MANDIR)/man8
@@ -54,7 +55,10 @@ install: all
 		install -m 644 sepolicy_$${i}.png $(DESTDIR)$(DATADIR)/icons/hicolor/$${i}x$${i}/apps/sepolicy.png; \
 	done
 	install -m 644 org.selinux.config.policy $(DESTDIR)$(DATADIR)/polkit-1/actions/
+	(cd po && $(MAKE) $@)
+
 clean:
+	(cd po && $(MAKE) $@)
 
 indent:
 
gui/booleansPage.py +1 -1
index 7849bea26a06..dd12b6d6ab86 100644
@@ -38,7 +38,7 @@ DISABLED = 2
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/domainsPage.py +1 -1
index bad5140d8c59..6bbe4de5884f 100644
@@ -30,7 +30,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/fcontextPage.py +1 -1
index d26aa1b405a9..52292cae01d2 100644
@@ -47,7 +47,7 @@ class context:
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/loginsPage.py +1 -1
index b67eb8bc42af..cbfb0cc23f65 100644
@@ -29,7 +29,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/modulesPage.py +1 -1
index 0584acf9b3a4..35a0129bab9c 100644
@@ -30,7 +30,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/po/Makefile new file +84 -0

84 lines not on this page · raw message

gui/po/POTFILES new file +17 -0
new file mode 100644
index 000000000000..1795c5c1951b
@@ -0,0 +1,17 @@
+../booleansPage.py
+../domainsPage.py
+../fcontextPage.py
+../loginsPage.py
+../modulesPage.py
+../org.selinux.config.policy
+../polgengui.py
+../polgen.ui
+../portsPage.py
+../selinux-polgengui.desktop
+../semanagePage.py
+../sepolicy.desktop
+../statusPage.py
+../system-config-selinux.desktop
+../system-config-selinux.py
+../system-config-selinux.ui
+../usersPage.py
gui/polgengui.py +1 -1
index d284ded65279..01f541bafae8 100644
@@ -63,7 +63,7 @@ def get_all_modules():
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/portsPage.py +1 -1
index 30f58383bc1d..a537ecc8c0a1 100644
@@ -35,7 +35,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/semanagePage.py +1 -1
index 4127804fbbee..5361d69c1313 100644
@@ -22,7 +22,7 @@ from gi.repository import Gdk, Gtk
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/statusPage.py +1 -1
index 766854b19cba..a8f079b9b163 100644
@@ -35,7 +35,7 @@ RELABELFILE = "/.autorelabel"
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/system-config-selinux.py +1 -1
index 3f70122b87e8..8c46c987b974 100644
@@ -45,7 +45,7 @@ import selinux
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/usersPage.py +1 -1
index 26794ed5c3f3..d15d4c5a71dd 100644
@@ -29,7 +29,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
policycoreutils/po/Makefile +5 -67

97 lines not on this page · raw message

policycoreutils/po/POTFILES new file +9 -0
new file mode 100644
index 000000000000..12237dc61ee4
@@ -0,0 +1,9 @@
+../run_init/open_init_pty.c
+../run_init/run_init.c
+../setsebool/setsebool.c
+../newrole/newrole.c
+../load_policy/load_policy.c
+../sestatus/sestatus.c
+../semodule/semodule.c
+../setfiles/setfiles.c
+../secon/secon.c
python/Makefile +1 -1
index 9b66d52fbd4d..00312dbdb5c6 100644
@@ -1,4 +1,4 @@
-SUBDIRS = sepolicy audit2allow semanage sepolgen chcat
+SUBDIRS = sepolicy audit2allow semanage sepolgen chcat po
 
 all install relabel clean indent test:
 	@for subdir in $(SUBDIRS); do \
python/chcat/chcat +1 -1
index fdd2e46ee3f9..839ddd3b54b6 100755
@@ -30,7 +30,7 @@ import getopt
 import selinux
 import seobject
 
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/po/Makefile new file +85 -0

85 lines not on this page · raw message

python/po/POTFILES new file +10 -0
new file mode 100644
index 000000000000..128eb870a69e
@@ -0,0 +1,10 @@
+../audit2allow/audit2allow
+../chcat/chcat
+../semanage/semanage
+../semanage/seobject.py
+../sepolgen/src/sepolgen/interfaces.py
+../sepolicy/sepolicy/generate.py
+../sepolicy/sepolicy/gui.py
+../sepolicy/sepolicy/__init__.py
+../sepolicy/sepolicy/interface.py
+../sepolicy/sepolicy.py
python/semanage/semanage +1 -1
index ff9fb66b1411..12bb159ef649 100644
@@ -30,7 +30,7 @@ import seobject
 import sys
 import traceback
 
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/semanage/seobject.py +1 -1
index 21adbf6eb74f..69e60db80060 100644
@@ -29,7 +29,7 @@ import sys
 import stat
 import socket
 from semanage import *
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 import sepolicy
 from setools.policyrep import SELinuxPolicy
 from setools.typequery import TypeQuery
python/sepolgen/src/sepolgen/sepolgeni18n.py +1 -1
index 998c4356415c..56ebd807c69c 100644
@@ -19,7 +19,7 @@
 
 try: 
     import gettext
-    t = gettext.translation( 'yumex' )
+    t = gettext.translation( 'selinux-python' )
     _ = t.gettext
 except:
     def _(str):
python/sepolicy/sepolicy.py +1 -1
index 7b2230651099..32956e58f52e 100755
@@ -28,7 +28,7 @@ import sepolicy
 from multiprocessing import Pool
 from sepolicy import get_os_version, get_conditionals, get_conditionals_format_text
 import argparse
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/sepolicy/sepolicy/__init__.py +1 -1
index e8654abbceb3..203ca25f4210 100644
@@ -23,7 +23,7 @@ from setools.typeattrquery import TypeAttributeQuery
 from setools.typequery import TypeQuery
 from setools.userquery import UserQuery
 
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/sepolicy/sepolicy/generate.py +1 -1
index 4e1ed4e9dc31..43180ca6fda4 100644
@@ -48,7 +48,7 @@ import sepolgen.defaults as defaults
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/sepolicy/sepolicy/gui.py +1 -1
index 1e86422b864a..c9ca158ddd09 100644
@@ -41,7 +41,7 @@ import os
 import re
 import unicodedata
 
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/sepolicy/sepolicy/interface.py +1 -1
index bdffb770f364..9d40aea1498d 100644
@@ -30,7 +30,7 @@ __all__ = ['get_all_interfaces', 'get_interfaces_from_xml', 'get_admin', 'get_us
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
sandbox/Makefile +3 -0
index 9da5e58db9e6..84cb5a39bf7e 100644
@@ -13,6 +13,7 @@ override LDLIBS += -lselinux -lcap-ng
 SEUNSHARE_OBJS = seunshare.o
 
 all: sandbox seunshare sandboxX.sh start
+	(cd po && $(MAKE) $@)
 
 seunshare: $(SEUNSHARE_OBJS)
 
@@ -39,12 +40,14 @@ install: all
 	install -m 755 start $(DESTDIR)$(SHAREDIR)
 	-mkdir -p $(DESTDIR)$(SYSCONFDIR)
 	install -m 644 sandbox.conf $(DESTDIR)$(SYSCONFDIR)/sandbox
+	(cd po && $(MAKE) $@)
 
 test:
 	@$(PYTHON) test_sandbox.py -v
 
 clean:
 	-rm -f seunshare *.o *~
+	(cd po && $(MAKE) $@)
 
 indent:
 	../../scripts/Lindent $(wildcard *.[ch])
sandbox/po/Makefile new file +84 -0

84 lines not on this page · raw message

sandbox/po/POTFILES new file +1 -0
new file mode 100644
index 000000000000..deff3f2f4656
@@ -0,0 +1 @@
+../sandbox
sandbox/sandbox +1 -1
index ca5f1e030a51..16c43b51eaaa 100644
@@ -37,7 +37,7 @@ import sepolicy
 
 SEUNSHARE = "/usr/sbin/seunshare"
 SANDBOXSH = "/usr/share/sandbox/sandboxX.sh"
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-sandbox"
 try:
     import gettext
     kwargs = {}
Signature · 1 line
2.35.1
Acked-by on v1 1/1
#2 lore raw

Re: [PATCH] Split po/ translation files into the relevant sub-directories

Quoted 10 lines · Petr Lautrbach

When policycoreutils was split into policycoreutils/ python/ gui/ and sandbox/ sub-directories, po/ translation files stayed in policycoreutils/.

This commit splits original policycoreutils translations to policycoreutils, selinux-python, selinux-gui, and selinux-sandbox.

See original Fedora issue https://github.com/fedora-selinux/selinux/issues/43

There is an extra space at the end of one of the lines as indicated below, but that can be fixed when merged.

Quoted 500 lines
---
 gui/Makefile                                 |  4 +
 gui/booleansPage.py                          |  2 +-
 gui/domainsPage.py                           |  2 +-
 gui/fcontextPage.py                          |  2 +-
 gui/loginsPage.py                            |  2 +-
 gui/modulesPage.py                           |  2 +-
 gui/po/Makefile                              | 84 +++++++++++++++++++
 gui/po/POTFILES                              | 17 ++++
 gui/polgengui.py                             |  2 +-
 gui/portsPage.py                             |  2 +-
 gui/semanagePage.py                          |  2 +-
 gui/statusPage.py                            |  2 +-
 gui/system-config-selinux.py                 |  2 +-
 gui/usersPage.py                             |  2 +-
 policycoreutils/po/Makefile                  | 72 ++---------------
 policycoreutils/po/POTFILES                  |  9 +++
 python/Makefile                              |  2 +-
 python/chcat/chcat                           |  2 +-
 python/po/Makefile                           | 85 ++++++++++++++++++++
 python/po/POTFILES                           | 10 +++
 python/semanage/semanage                     |  2 +-
 python/semanage/seobject.py                  |  2 +-
 python/sepolgen/src/sepolgen/sepolgeni18n.py |  2 +-
 python/sepolicy/sepolicy.py                  |  2 +-
 python/sepolicy/sepolicy/__init__.py         |  2 +-
 python/sepolicy/sepolicy/generate.py         |  2 +-
 python/sepolicy/sepolicy/gui.py              |  2 +-
 python/sepolicy/sepolicy/interface.py        |  2 +-
 sandbox/Makefile                             |  3 +
 sandbox/po/Makefile                          | 84 +++++++++++++++++++
 sandbox/po/POTFILES                          |  1 +
 sandbox/sandbox                              |  2 +-
 32 files changed, 324 insertions(+), 89 deletions(-)
 create mode 100644 gui/po/Makefile
 create mode 100644 gui/po/POTFILES
 create mode 100644 policycoreutils/po/POTFILES
 create mode 100644 python/po/Makefile
 create mode 100644 python/po/POTFILES
 create mode 100644 sandbox/po/Makefile
 create mode 100644 sandbox/po/POTFILES
gui/Makefile +4 -0
index ca965c942912..4035fb21b8c9 100644
@@ -22,6 +22,7 @@ system-config-selinux.ui \
 usersPage.py
 
 all: $(TARGETS) system-config-selinux.py polgengui.py
+       (cd po && $(MAKE) $@)
 
 install: all
        -mkdir -p $(DESTDIR)$(MANDIR)/man8
@@ -54,7 +55,10 @@ install: all
                install -m 644 sepolicy_$${i}.png $(DESTDIR)$(DATADIR)/icons/hicolor/$${i}x$${i}/apps/sepolicy.png; \
        done
        install -m 644 org.selinux.config.policy $(DESTDIR)$(DATADIR)/polkit-1/actions/
+       (cd po && $(MAKE) $@)
+
 clean:
+       (cd po && $(MAKE) $@)
 
 indent:
 
gui/booleansPage.py +1 -1
index 7849bea26a06..dd12b6d6ab86 100644
@@ -38,7 +38,7 @@ DISABLED = 2
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/domainsPage.py +1 -1
index bad5140d8c59..6bbe4de5884f 100644
@@ -30,7 +30,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/fcontextPage.py +1 -1
index d26aa1b405a9..52292cae01d2 100644
@@ -47,7 +47,7 @@ class context:
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/loginsPage.py +1 -1
index b67eb8bc42af..cbfb0cc23f65 100644
@@ -29,7 +29,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/modulesPage.py +1 -1
index 0584acf9b3a4..35a0129bab9c 100644
@@ -30,7 +30,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/po/Makefile new file +84 -0
new file mode 100644
index 000000000000..7ccd48eb2422
@@ -0,0 +1,84 @@
+#
+# Makefile for the PO files (translation) catalog
+#
+
+PREFIX ?= /usr
+
+# What is this package?
+NLSPACKAGE     = gui
+POTFILE                = $(NLSPACKAGE).pot
+INSTALL                = /usr/bin/install -c -p
+INSTALL_DATA   = $(INSTALL) -m 644
+INSTALL_DIR    = /usr/bin/install -d
+
+# destination directory
+INSTALL_NLS_DIR = $(PREFIX)/share/locale
+
+# PO catalog handling
+MSGMERGE       = msgmerge
+MSGMERGE_FLAGS = -q
+XGETTEXT       = xgettext --default-domain=$(NLSPACKAGE)
+MSGFMT         = msgfmt
+
+# All possible linguas
+PO_LINGUAS := $(sort $(patsubst %.po,%,$(wildcard *.po)))
+
+# Only the files matching what the user has set in LINGUAS
+USER_LINGUAS := $(filter $(patsubst %,%%,$(LINGUAS)),$(PO_LINGUAS))
+
+# if no valid LINGUAS, build all languages
+USE_LINGUAS := $(if $(USER_LINGUAS),$(USER_LINGUAS),$(PO_LINGUAS))
+
+POFILES                = $(patsubst %,%.po,$(USE_LINGUAS))
+MOFILES                = $(patsubst %.po,%.mo,$(POFILES))
+POTFILES  = $(shell cat POTFILES)
+
+#default:: clean
+
+all::  $(MOFILES)
+
+$(POTFILE): $(POTFILES)
+       $(XGETTEXT) --keyword=_ --keyword=N_ $(POTFILES)
+       @if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
+           rm -f $(NLSPACKAGE).po; \
+       else \
+           mv -f $(NLSPACKAGE).po $(POTFILE); \
+       fi; \
+
+
+refresh-po: Makefile
+       for cat in $(POFILES); do \
+               lang=`basename $$cat .po`; \
+               if $(MSGMERGE) $(MSGMERGE_FLAGS) $$lang.po $(POTFILE) > $$lang.pot ; then \
+                       mv -f $$lang.pot $$lang.po ; \
+                       echo "$(MSGMERGE) of $$lang succeeded" ; \
+               else \
+                       echo "$(MSGMERGE) of $$lang failed" ; \
+                       rm -f $$lang.pot ; \
+               fi \
+       done
+
+clean:
+       @rm -fv *mo *~ .depend
+       @rm -rf tmp
+
+install: $(MOFILES)
+       @for n in $(MOFILES); do \
+           l=`basename $$n .mo`; \
+           $(INSTALL_DIR) $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \
+           $(INSTALL_DATA) --verbose $$n $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/selinux-$(NLSPACKAGE).mo; \
+       done
+
+%.mo: %.po
+       $(MSGFMT) -o $@ $<
+report:
+       @for cat in $(wildcard *.po); do \
+                echo -n "$$cat: "; \
+                msgfmt -v --statistics -o /dev/null $$cat; \
+        done
+
+.PHONY: missing depend
+
+relabel:
+
+test:
gui/po/POTFILES new file +17 -0
new file mode 100644
index 000000000000..1795c5c1951b
@@ -0,0 +1,17 @@
+../booleansPage.py
+../domainsPage.py
+../fcontextPage.py
+../loginsPage.py
+../modulesPage.py
+../org.selinux.config.policy
+../polgengui.py
+../polgen.ui
+../portsPage.py
+../selinux-polgengui.desktop
+../semanagePage.py
+../sepolicy.desktop
+../statusPage.py
+../system-config-selinux.desktop
+../system-config-selinux.py
+../system-config-selinux.ui
+../usersPage.py
gui/polgengui.py +1 -1
index d284ded65279..01f541bafae8 100644
@@ -63,7 +63,7 @@ def get_all_modules():
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/portsPage.py +1 -1
index 30f58383bc1d..a537ecc8c0a1 100644
@@ -35,7 +35,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/semanagePage.py +1 -1
index 4127804fbbee..5361d69c1313 100644
@@ -22,7 +22,7 @@ from gi.repository import Gdk, Gtk
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/statusPage.py +1 -1
index 766854b19cba..a8f079b9b163 100644
@@ -35,7 +35,7 @@ RELABELFILE = "/.autorelabel"
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/system-config-selinux.py +1 -1
index 3f70122b87e8..8c46c987b974 100644
@@ -45,7 +45,7 @@ import selinux
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/usersPage.py +1 -1
index 26794ed5c3f3..d15d4c5a71dd 100644
@@ -29,7 +29,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
policycoreutils/po/Makefile +5 -67
index 575e143122e6..5ff92bff6fdc 100644
@@ -3,7 +3,6 @@
 #
 
 PREFIX ?= /usr
-TOP     = ../..
 
 # What is this package?
 NLSPACKAGE     = policycoreutils
@@ -32,74 +31,13 @@ USE_LINGUAS := $(if $(USER_LINGUAS),$(USER_LINGUAS),$(PO_LINGUAS))
 
 POFILES                = $(patsubst %,%.po,$(USE_LINGUAS))
 MOFILES                = $(patsubst %.po,%.mo,$(POFILES))
-POTFILES = \
-       ../run_init/open_init_pty.c \
-       ../run_init/run_init.c \
-       ../semodule_link/semodule_link.c \
-       ../audit2allow/audit2allow \
-       ../semanage/seobject.py \
-       ../setsebool/setsebool.c \
-       ../newrole/newrole.c \
-       ../load_policy/load_policy.c \
-       ../sestatus/sestatus.c \
-       ../semodule/semodule.c \
-       ../setfiles/setfiles.c \
-       ../semodule_package/semodule_package.c \
-       ../semodule_deps/semodule_deps.c \
-       ../semodule_expand/semodule_expand.c \
-       ../scripts/chcat \
-       ../scripts/fixfiles \
-       ../restorecond/stringslist.c \
-       ../restorecond/restorecond.h \
-       ../restorecond/utmpwatcher.h \
-       ../restorecond/stringslist.h \
-       ../restorecond/restorecond.c \
-       ../restorecond/utmpwatcher.c \
-       ../gui/booleansPage.py \
-       ../gui/fcontextPage.py \
-       ../gui/loginsPage.py \
-       ../gui/mappingsPage.py \
-       ../gui/modulesPage.py \
-       ../gui/polgen.glade \
-       ../gui/polgengui.py \
-       ../gui/portsPage.py \
-       ../gui/semanagePage.py \
-       ../gui/statusPage.py \
-       ../gui/system-config-selinux.glade \
-       ../gui/system-config-selinux.py \
-       ../gui/usersPage.py \
-       ../secon/secon.c \
-       booleans.py \
-       ../sepolicy/sepolicy.py \
-       ../sepolicy/sepolicy/communicate.py \
-       ../sepolicy/sepolicy/__init__.py \
-       ../sepolicy/sepolicy/network.py \
-       ../sepolicy/sepolicy/generate.py \
-       ../sepolicy/sepolicy/sepolicy.glade \
-       ../sepolicy/sepolicy/gui.py \
-       ../sepolicy/sepolicy/manpage.py \
-       ../sepolicy/sepolicy/transition.py \
-       ../sepolicy/sepolicy/templates/executable.py \
-       ../sepolicy/sepolicy/templates/__init__.py \
-       ../sepolicy/sepolicy/templates/network.py \
-       ../sepolicy/sepolicy/templates/rw.py \
-       ../sepolicy/sepolicy/templates/script.py \
-       ../sepolicy/sepolicy/templates/semodule.py \
-       ../sepolicy/sepolicy/templates/tmp.py \
-       ../sepolicy/sepolicy/templates/user.py \
-       ../sepolicy/sepolicy/templates/var_lib.py \
-       ../sepolicy/sepolicy/templates/var_log.py \
-       ../sepolicy/sepolicy/templates/var_run.py \
-       ../sepolicy/sepolicy/templates/var_spool.py
+POTFILES  = $(shell cat POTFILES)
 
 #default:: clean
 
-all::  $(MOFILES)
+all:: $(POTFILE) $(MOFILES)
 
-booleans.py:
-       sepolicy booleans -a > booleans.py
-
-$(POTFILE): $(POTFILES) booleans.py
+$(POTFILE): $(POTFILES)
        $(XGETTEXT) --keyword=_ --keyword=N_ $(POTFILES)
        @if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
            rm -f $(NLSPACKAGE).po; \
@@ -107,8 +45,6 @@ $(POTFILE): $(POTFILES) booleans.py
            mv -f $(NLSPACKAGE).po $(POTFILE); \
        fi; \
 
-update-po: Makefile $(POTFILE) refresh-po
-       @rm -f booleans.py
 
 refresh-po: Makefile
        for cat in $(POFILES); do \
@@ -144,3 +80,5 @@ report:
 .PHONY: missing depend
 
 relabel:
+
+test:
policycoreutils/po/POTFILES new file +9 -0
new file mode 100644
index 000000000000..12237dc61ee4
@@ -0,0 +1,9 @@
+../run_init/open_init_pty.c
+../run_init/run_init.c
+../setsebool/setsebool.c
+../newrole/newrole.c
+../load_policy/load_policy.c
+../sestatus/sestatus.c
+../semodule/semodule.c
+../setfiles/setfiles.c
+../secon/secon.c
python/Makefile +1 -1
index 9b66d52fbd4d..00312dbdb5c6 100644
@@ -1,4 +1,4 @@
-SUBDIRS = sepolicy audit2allow semanage sepolgen chcat
+SUBDIRS = sepolicy audit2allow semanage sepolgen chcat po
 
 all install relabel clean indent test:
        @for subdir in $(SUBDIRS); do \
python/chcat/chcat +1 -1
index fdd2e46ee3f9..839ddd3b54b6 100755
@@ -30,7 +30,7 @@ import getopt
 import selinux
 import seobject
 
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/po/Makefile new file +30 -0
new file mode 100644
index 000000000000..05e49f0cc274
@@ -0,0 +1,85 @@
+#
+# Makefile for the PO files (translation) catalog
+#
+
+PREFIX ?= /usr
+
+# What is this package?
+NLSPACKAGE     = python
+POTFILE                = $(NLSPACKAGE).pot
+INSTALL                = /usr/bin/install -c -p
+INSTALL_DATA   = $(INSTALL) -m 644
+INSTALL_DIR    = /usr/bin/install -d
+
+# destination directory
+INSTALL_NLS_DIR = $(PREFIX)/share/locale
+
+# PO catalog handling
+MSGMERGE       = msgmerge
+MSGMERGE_FLAGS = -q
+XGETTEXT       = xgettext --default-domain=$(NLSPACKAGE)
+MSGFMT         = msgfmt
+
+# All possible linguas
+PO_LINGUAS := $(sort $(patsubst %.po,%,$(wildcard *.po)))
+
+# Only the files matching what the user has set in LINGUAS
+USER_LINGUAS := $(filter $(patsubst %,%%,$(LINGUAS)),$(PO_LINGUAS))
+
+# if no valid LINGUAS, build all languages
+USE_LINGUAS := $(if $(USER_LINGUAS),$(USER_LINGUAS),$(PO_LINGUAS))

python/po/Makefile line 40

Quoted 10 lines
python/po/Makefile new file +10 -0
+
+POFILES                = $(patsubst %,%.po,$(USE_LINGUAS))
+MOFILES                = $(patsubst %.po,%.mo,$(POFILES))
+POTFILES  = $(shell cat POTFILES)
+
+#default:: clean
+
+all::  $(MOFILES)
+
+$(POTFILE): $(POTFILES)

Extra space at the end of the line above.

Quoted 305 lines
python/po/Makefile new file +45 -0
+       $(XGETTEXT) -L Python --keyword=_ --keyword=N_ $(POTFILES)
+       $(XGETTEXT) -j --keyword=_ --keyword=N_ ../sepolicy/sepolicy/sepolicy.glade
+       @if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
+           rm -f $(NLSPACKAGE).po; \
+       else \
+           mv -f $(NLSPACKAGE).po $(POTFILE); \
+       fi; \
+
+
+refresh-po: Makefile
+       for cat in $(POFILES); do \
+               lang=`basename $$cat .po`; \
+               if $(MSGMERGE) $(MSGMERGE_FLAGS) $$lang.po $(POTFILE) > $$lang.pot ; then \
+                       mv -f $$lang.pot $$lang.po ; \
+                       echo "$(MSGMERGE) of $$lang succeeded" ; \
+               else \
+                       echo "$(MSGMERGE) of $$lang failed" ; \
+                       rm -f $$lang.pot ; \
+               fi \
+       done
+
+clean:
+       @rm -fv *mo *~ .depend
+       @rm -rf tmp
+
+install: $(MOFILES)
+       @for n in $(MOFILES); do \
+           l=`basename $$n .mo`; \
+           $(INSTALL_DIR) $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \
+           $(INSTALL_DATA) --verbose $$n $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/selinux-$(NLSPACKAGE).mo; \
+       done
+
+%.mo: %.po
+       $(MSGFMT) -o $@ $<
+report:
+       @for cat in $(wildcard *.po); do \
+                echo -n "$$cat: "; \
+                msgfmt -v --statistics -o /dev/null $$cat; \
+        done
+
+.PHONY: missing depend
+
+relabel:
+
+test:
python/po/POTFILES new file +10 -0
new file mode 100644
index 000000000000..128eb870a69e
@@ -0,0 +1,10 @@
+../audit2allow/audit2allow
+../chcat/chcat
+../semanage/semanage
+../semanage/seobject.py
+../sepolgen/src/sepolgen/interfaces.py
+../sepolicy/sepolicy/generate.py
+../sepolicy/sepolicy/gui.py
+../sepolicy/sepolicy/__init__.py
+../sepolicy/sepolicy/interface.py
+../sepolicy/sepolicy.py
python/semanage/semanage +1 -1
index ff9fb66b1411..12bb159ef649 100644
@@ -30,7 +30,7 @@ import seobject
 import sys
 import traceback
 
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/semanage/seobject.py +1 -1
index 21adbf6eb74f..69e60db80060 100644
@@ -29,7 +29,7 @@ import sys
 import stat
 import socket
 from semanage import *
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 import sepolicy
 from setools.policyrep import SELinuxPolicy
 from setools.typequery import TypeQuery
python/sepolgen/src/sepolgen/sepolgeni18n.py +1 -1
index 998c4356415c..56ebd807c69c 100644
@@ -19,7 +19,7 @@
 
 try:
     import gettext
-    t = gettext.translation( 'yumex' )
+    t = gettext.translation( 'selinux-python' )
     _ = t.gettext
 except:
     def _(str):
python/sepolicy/sepolicy.py +1 -1
index 7b2230651099..32956e58f52e 100755
@@ -28,7 +28,7 @@ import sepolicy
 from multiprocessing import Pool
 from sepolicy import get_os_version, get_conditionals, get_conditionals_format_text
 import argparse
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/sepolicy/sepolicy/__init__.py +1 -1
index e8654abbceb3..203ca25f4210 100644
@@ -23,7 +23,7 @@ from setools.typeattrquery import TypeAttributeQuery
 from setools.typequery import TypeQuery
 from setools.userquery import UserQuery
 
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/sepolicy/sepolicy/generate.py +1 -1
index 4e1ed4e9dc31..43180ca6fda4 100644
@@ -48,7 +48,7 @@ import sepolgen.defaults as defaults
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/sepolicy/sepolicy/gui.py +1 -1
index 1e86422b864a..c9ca158ddd09 100644
@@ -41,7 +41,7 @@ import os
 import re
 import unicodedata
 
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/sepolicy/sepolicy/interface.py +1 -1
index bdffb770f364..9d40aea1498d 100644
@@ -30,7 +30,7 @@ __all__ = ['get_all_interfaces', 'get_interfaces_from_xml', 'get_admin', 'get_us
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
sandbox/Makefile +3 -0
index 9da5e58db9e6..84cb5a39bf7e 100644
@@ -13,6 +13,7 @@ override LDLIBS += -lselinux -lcap-ng
 SEUNSHARE_OBJS = seunshare.o
 
 all: sandbox seunshare sandboxX.sh start
+       (cd po && $(MAKE) $@)
 
 seunshare: $(SEUNSHARE_OBJS)
 
@@ -39,12 +40,14 @@ install: all
        install -m 755 start $(DESTDIR)$(SHAREDIR)
        -mkdir -p $(DESTDIR)$(SYSCONFDIR)
        install -m 644 sandbox.conf $(DESTDIR)$(SYSCONFDIR)/sandbox
+       (cd po && $(MAKE) $@)
 
 test:
        @$(PYTHON) test_sandbox.py -v
 
 clean:
        -rm -f seunshare *.o *~
+       (cd po && $(MAKE) $@)
 
 indent:
        ../../scripts/Lindent $(wildcard *.[ch])
sandbox/po/Makefile new file +84 -0
new file mode 100644
index 000000000000..e75343649b67
@@ -0,0 +1,84 @@
+#
+# Makefile for the PO files (translation) catalog
+#
+
+PREFIX ?= /usr
+
+# What is this package?
+NLSPACKAGE     = sandbox
+POTFILE                = $(NLSPACKAGE).pot
+INSTALL                = /usr/bin/install -c -p
+INSTALL_DATA   = $(INSTALL) -m 644
+INSTALL_DIR    = /usr/bin/install -d
+
+# destination directory
+INSTALL_NLS_DIR = $(PREFIX)/share/locale
+
+# PO catalog handling
+MSGMERGE       = msgmerge
+MSGMERGE_FLAGS = -q
+XGETTEXT       = xgettext -L Python --default-domain=$(NLSPACKAGE)
+MSGFMT         = msgfmt
+
+# All possible linguas
+PO_LINGUAS := $(sort $(patsubst %.po,%,$(wildcard *.po)))
+
+# Only the files matching what the user has set in LINGUAS
+USER_LINGUAS := $(filter $(patsubst %,%%,$(LINGUAS)),$(PO_LINGUAS))
+
+# if no valid LINGUAS, build all languages
+USE_LINGUAS := $(if $(USER_LINGUAS),$(USER_LINGUAS),$(PO_LINGUAS))
+
+POFILES                = $(patsubst %,%.po,$(USE_LINGUAS))
+MOFILES                = $(patsubst %.po,%.mo,$(POFILES))
+POTFILES  = $(shell cat POTFILES)
+
+#default:: clean
+
+all:: $(POTFILE) $(MOFILES)
+
+$(POTFILE): $(POTFILES)
+       $(XGETTEXT) --keyword=_ --keyword=N_ $(POTFILES)
+       @if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
+           rm -f $(NLSPACKAGE).po; \
+       else \
+           mv -f $(NLSPACKAGE).po $(POTFILE); \
+       fi; \
+
+
+refresh-po: Makefile
+       for cat in $(POFILES); do \
+               lang=`basename $$cat .po`; \
+               if $(MSGMERGE) $(MSGMERGE_FLAGS) $$lang.po $(POTFILE) > $$lang.pot ; then \
+                       mv -f $$lang.pot $$lang.po ; \
+                       echo "$(MSGMERGE) of $$lang succeeded" ; \
+               else \
+                       echo "$(MSGMERGE) of $$lang failed" ; \
+                       rm -f $$lang.pot ; \
+               fi \
+       done
+
+clean:
+       @rm -fv *mo *~ .depend
+       @rm -rf tmp
+
+install: $(MOFILES)
+       @for n in $(MOFILES); do \
+           l=`basename $$n .mo`; \
+           $(INSTALL_DIR) $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \
+           $(INSTALL_DATA) --verbose $$n $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/selinux-$(NLSPACKAGE).mo; \
+       done
+
+%.mo: %.po
+       $(MSGFMT) -o $@ $<
+report:
+       @for cat in $(wildcard *.po); do \
+                echo -n "$$cat: "; \
+                msgfmt -v --statistics -o /dev/null $$cat; \
+        done
+
+.PHONY: missing depend
+
+relabel:
+
+test:
sandbox/po/POTFILES new file +1 -0
new file mode 100644
index 000000000000..deff3f2f4656
@@ -0,0 +1 @@
+../sandbox
sandbox/sandbox +1 -2
index ca5f1e030a51..16c43b51eaaa 100644
@@ -37,7 +37,7 @@ import sepolicy
 
 SEUNSHARE = "/usr/sbin/seunshare"
 SANDBOXSH = "/usr/share/sandbox/sandboxX.sh"
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-sandbox"
 try:
     import gettext
     kwargs = {}
--

2.35.1

#3 lore raw

Re: [PATCH] Split po/ translation files into the relevant sub-directories

Quoted 8 lines · James Carter
Quoted 7 lines · Petr Lautrbach

When policycoreutils was split into policycoreutils/ python/ gui/ and sandbox/ sub-directories, po/ translation files stayed in policycoreutils/.

This commit splits original policycoreutils translations to policycoreutils, selinux-python, selinux-gui, and selinux-sandbox.

Quoted 9 lines
Quoted 3 lines

See original Fedora issue https://github.com/fedora-selinux/selinux/issues/43

There is an extra space at the end of one of the lines as indicated below, but that can be fixed when merged.

Merged with fixed extra space, thanks!

Quoted 818 lines
Quoted 500 lines
---
 gui/Makefile                                 |  4 +
 gui/booleansPage.py                          |  2 +-
 gui/domainsPage.py                           |  2 +-
 gui/fcontextPage.py                          |  2 +-
 gui/loginsPage.py                            |  2 +-
 gui/modulesPage.py                           |  2 +-
 gui/po/Makefile                              | 84 +++++++++++++++++++
 gui/po/POTFILES                              | 17 ++++
 gui/polgengui.py                             |  2 +-
 gui/portsPage.py                             |  2 +-
 gui/semanagePage.py                          |  2 +-
 gui/statusPage.py                            |  2 +-
 gui/system-config-selinux.py                 |  2 +-
 gui/usersPage.py                             |  2 +-
 policycoreutils/po/Makefile                  | 72 ++---------------
 policycoreutils/po/POTFILES                  |  9 +++
 python/Makefile                              |  2 +-
 python/chcat/chcat                           |  2 +-
 python/po/Makefile                           | 85 ++++++++++++++++++++
 python/po/POTFILES                           | 10 +++
 python/semanage/semanage                     |  2 +-
 python/semanage/seobject.py                  |  2 +-
 python/sepolgen/src/sepolgen/sepolgeni18n.py |  2 +-
 python/sepolicy/sepolicy.py                  |  2 +-
 python/sepolicy/sepolicy/__init__.py         |  2 +-
 python/sepolicy/sepolicy/generate.py         |  2 +-
 python/sepolicy/sepolicy/gui.py              |  2 +-
 python/sepolicy/sepolicy/interface.py        |  2 +-
 sandbox/Makefile                             |  3 +
 sandbox/po/Makefile                          | 84 +++++++++++++++++++
 sandbox/po/POTFILES                          |  1 +
 sandbox/sandbox                              |  2 +-
 32 files changed, 324 insertions(+), 89 deletions(-)
 create mode 100644 gui/po/Makefile
 create mode 100644 gui/po/POTFILES
 create mode 100644 policycoreutils/po/POTFILES
 create mode 100644 python/po/Makefile
 create mode 100644 python/po/POTFILES
 create mode 100644 sandbox/po/Makefile
 create mode 100644 sandbox/po/POTFILES
gui/Makefile +4 -0
index ca965c942912..4035fb21b8c9 100644
@@ -22,6 +22,7 @@ system-config-selinux.ui \
 usersPage.py
 
 all: $(TARGETS) system-config-selinux.py polgengui.py
+       (cd po && $(MAKE) $@)
 
 install: all
        -mkdir -p $(DESTDIR)$(MANDIR)/man8
@@ -54,7 +55,10 @@ install: all
                install -m 644 sepolicy_$${i}.png $(DESTDIR)$(DATADIR)/icons/hicolor/$${i}x$${i}/apps/sepolicy.png; \
        done
        install -m 644 org.selinux.config.policy $(DESTDIR)$(DATADIR)/polkit-1/actions/
+       (cd po && $(MAKE) $@)
+
 clean:
+       (cd po && $(MAKE) $@)
 
 indent:
 
gui/booleansPage.py +1 -1
index 7849bea26a06..dd12b6d6ab86 100644
@@ -38,7 +38,7 @@ DISABLED = 2
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/domainsPage.py +1 -1
index bad5140d8c59..6bbe4de5884f 100644
@@ -30,7 +30,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/fcontextPage.py +1 -1
index d26aa1b405a9..52292cae01d2 100644
@@ -47,7 +47,7 @@ class context:
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/loginsPage.py +1 -1
index b67eb8bc42af..cbfb0cc23f65 100644
@@ -29,7 +29,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/modulesPage.py +1 -1
index 0584acf9b3a4..35a0129bab9c 100644
@@ -30,7 +30,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/po/Makefile new file +84 -0
new file mode 100644
index 000000000000..7ccd48eb2422
@@ -0,0 +1,84 @@
+#
+# Makefile for the PO files (translation) catalog
+#
+
+PREFIX ?= /usr
+
+# What is this package?
+NLSPACKAGE     = gui
+POTFILE                = $(NLSPACKAGE).pot
+INSTALL                = /usr/bin/install -c -p
+INSTALL_DATA   = $(INSTALL) -m 644
+INSTALL_DIR    = /usr/bin/install -d
+
+# destination directory
+INSTALL_NLS_DIR = $(PREFIX)/share/locale
+
+# PO catalog handling
+MSGMERGE       = msgmerge
+MSGMERGE_FLAGS = -q
+XGETTEXT       = xgettext --default-domain=$(NLSPACKAGE)
+MSGFMT         = msgfmt
+
+# All possible linguas
+PO_LINGUAS := $(sort $(patsubst %.po,%,$(wildcard *.po)))
+
+# Only the files matching what the user has set in LINGUAS
+USER_LINGUAS := $(filter $(patsubst %,%%,$(LINGUAS)),$(PO_LINGUAS))
+
+# if no valid LINGUAS, build all languages
+USE_LINGUAS := $(if $(USER_LINGUAS),$(USER_LINGUAS),$(PO_LINGUAS))
+
+POFILES                = $(patsubst %,%.po,$(USE_LINGUAS))
+MOFILES                = $(patsubst %.po,%.mo,$(POFILES))
+POTFILES  = $(shell cat POTFILES)
+
+#default:: clean
+
+all::  $(MOFILES)
+
+$(POTFILE): $(POTFILES)
+       $(XGETTEXT) --keyword=_ --keyword=N_ $(POTFILES)
+       @if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
+           rm -f $(NLSPACKAGE).po; \
+       else \
+           mv -f $(NLSPACKAGE).po $(POTFILE); \
+       fi; \
+
+
+refresh-po: Makefile
+       for cat in $(POFILES); do \
+               lang=`basename $$cat .po`; \
+               if $(MSGMERGE) $(MSGMERGE_FLAGS) $$lang.po $(POTFILE) > $$lang.pot ; then \
+                       mv -f $$lang.pot $$lang.po ; \
+                       echo "$(MSGMERGE) of $$lang succeeded" ; \
+               else \
+                       echo "$(MSGMERGE) of $$lang failed" ; \
+                       rm -f $$lang.pot ; \
+               fi \
+       done
+
+clean:
+       @rm -fv *mo *~ .depend
+       @rm -rf tmp
+
+install: $(MOFILES)
+       @for n in $(MOFILES); do \
+           l=`basename $$n .mo`; \
+           $(INSTALL_DIR) $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \
+           $(INSTALL_DATA) --verbose $$n $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/selinux-$(NLSPACKAGE).mo; \
+       done
+
+%.mo: %.po
+       $(MSGFMT) -o $@ $<
+report:
+       @for cat in $(wildcard *.po); do \
+                echo -n "$$cat: "; \
+                msgfmt -v --statistics -o /dev/null $$cat; \
+        done
+
+.PHONY: missing depend
+
+relabel:
+
+test:
gui/po/POTFILES new file +17 -0
new file mode 100644
index 000000000000..1795c5c1951b
@@ -0,0 +1,17 @@
+../booleansPage.py
+../domainsPage.py
+../fcontextPage.py
+../loginsPage.py
+../modulesPage.py
+../org.selinux.config.policy
+../polgengui.py
+../polgen.ui
+../portsPage.py
+../selinux-polgengui.desktop
+../semanagePage.py
+../sepolicy.desktop
+../statusPage.py
+../system-config-selinux.desktop
+../system-config-selinux.py
+../system-config-selinux.ui
+../usersPage.py
gui/polgengui.py +1 -1
index d284ded65279..01f541bafae8 100644
@@ -63,7 +63,7 @@ def get_all_modules():
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/portsPage.py +1 -1
index 30f58383bc1d..a537ecc8c0a1 100644
@@ -35,7 +35,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/semanagePage.py +1 -1
index 4127804fbbee..5361d69c1313 100644
@@ -22,7 +22,7 @@ from gi.repository import Gdk, Gtk
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/statusPage.py +1 -1
index 766854b19cba..a8f079b9b163 100644
@@ -35,7 +35,7 @@ RELABELFILE = "/.autorelabel"
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/system-config-selinux.py +1 -1
index 3f70122b87e8..8c46c987b974 100644
@@ -45,7 +45,7 @@ import selinux
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
gui/usersPage.py +1 -1
index 26794ed5c3f3..d15d4c5a71dd 100644
@@ -29,7 +29,7 @@ from semanagePage import *
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-gui"
 try:
     import gettext
     kwargs = {}
policycoreutils/po/Makefile +5 -67
index 575e143122e6..5ff92bff6fdc 100644
@@ -3,7 +3,6 @@
 #
 
 PREFIX ?= /usr
-TOP     = ../..
 
 # What is this package?
 NLSPACKAGE     = policycoreutils
@@ -32,74 +31,13 @@ USE_LINGUAS := $(if $(USER_LINGUAS),$(USER_LINGUAS),$(PO_LINGUAS))
 
 POFILES                = $(patsubst %,%.po,$(USE_LINGUAS))
 MOFILES                = $(patsubst %.po,%.mo,$(POFILES))
-POTFILES = \
-       ../run_init/open_init_pty.c \
-       ../run_init/run_init.c \
-       ../semodule_link/semodule_link.c \
-       ../audit2allow/audit2allow \
-       ../semanage/seobject.py \
-       ../setsebool/setsebool.c \
-       ../newrole/newrole.c \
-       ../load_policy/load_policy.c \
-       ../sestatus/sestatus.c \
-       ../semodule/semodule.c \
-       ../setfiles/setfiles.c \
-       ../semodule_package/semodule_package.c \
-       ../semodule_deps/semodule_deps.c \
-       ../semodule_expand/semodule_expand.c \
-       ../scripts/chcat \
-       ../scripts/fixfiles \
-       ../restorecond/stringslist.c \
-       ../restorecond/restorecond.h \
-       ../restorecond/utmpwatcher.h \
-       ../restorecond/stringslist.h \
-       ../restorecond/restorecond.c \
-       ../restorecond/utmpwatcher.c \
-       ../gui/booleansPage.py \
-       ../gui/fcontextPage.py \
-       ../gui/loginsPage.py \
-       ../gui/mappingsPage.py \
-       ../gui/modulesPage.py \
-       ../gui/polgen.glade \
-       ../gui/polgengui.py \
-       ../gui/portsPage.py \
-       ../gui/semanagePage.py \
-       ../gui/statusPage.py \
-       ../gui/system-config-selinux.glade \
-       ../gui/system-config-selinux.py \
-       ../gui/usersPage.py \
-       ../secon/secon.c \
-       booleans.py \
-       ../sepolicy/sepolicy.py \
-       ../sepolicy/sepolicy/communicate.py \
-       ../sepolicy/sepolicy/__init__.py \
-       ../sepolicy/sepolicy/network.py \
-       ../sepolicy/sepolicy/generate.py \
-       ../sepolicy/sepolicy/sepolicy.glade \
-       ../sepolicy/sepolicy/gui.py \
-       ../sepolicy/sepolicy/manpage.py \
-       ../sepolicy/sepolicy/transition.py \
-       ../sepolicy/sepolicy/templates/executable.py \
-       ../sepolicy/sepolicy/templates/__init__.py \
-       ../sepolicy/sepolicy/templates/network.py \
-       ../sepolicy/sepolicy/templates/rw.py \
-       ../sepolicy/sepolicy/templates/script.py \
-       ../sepolicy/sepolicy/templates/semodule.py \
-       ../sepolicy/sepolicy/templates/tmp.py \
-       ../sepolicy/sepolicy/templates/user.py \
-       ../sepolicy/sepolicy/templates/var_lib.py \
-       ../sepolicy/sepolicy/templates/var_log.py \
-       ../sepolicy/sepolicy/templates/var_run.py \
-       ../sepolicy/sepolicy/templates/var_spool.py
+POTFILES  = $(shell cat POTFILES)
 
 #default:: clean
 
-all::  $(MOFILES)
+all:: $(POTFILE) $(MOFILES)
 
-booleans.py:
-       sepolicy booleans -a > booleans.py
-
-$(POTFILE): $(POTFILES) booleans.py
+$(POTFILE): $(POTFILES)
        $(XGETTEXT) --keyword=_ --keyword=N_ $(POTFILES)
        @if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
            rm -f $(NLSPACKAGE).po; \
@@ -107,8 +45,6 @@ $(POTFILE): $(POTFILES) booleans.py
            mv -f $(NLSPACKAGE).po $(POTFILE); \
        fi; \
 
-update-po: Makefile $(POTFILE) refresh-po
-       @rm -f booleans.py
 
 refresh-po: Makefile
        for cat in $(POFILES); do \
@@ -144,3 +80,5 @@ report:
 .PHONY: missing depend
 
 relabel:
+
+test:
policycoreutils/po/POTFILES new file +9 -0
new file mode 100644
index 000000000000..12237dc61ee4
@@ -0,0 +1,9 @@
+../run_init/open_init_pty.c
+../run_init/run_init.c
+../setsebool/setsebool.c
+../newrole/newrole.c
+../load_policy/load_policy.c
+../sestatus/sestatus.c
+../semodule/semodule.c
+../setfiles/setfiles.c
+../secon/secon.c
python/Makefile +1 -1
index 9b66d52fbd4d..00312dbdb5c6 100644
@@ -1,4 +1,4 @@
-SUBDIRS = sepolicy audit2allow semanage sepolgen chcat
+SUBDIRS = sepolicy audit2allow semanage sepolgen chcat po
 
 all install relabel clean indent test:
        @for subdir in $(SUBDIRS); do \
python/chcat/chcat +1 -1
index fdd2e46ee3f9..839ddd3b54b6 100755
@@ -30,7 +30,7 @@ import getopt
 import selinux
 import seobject
 
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/po/Makefile new file +30 -0
new file mode 100644
index 000000000000..05e49f0cc274
@@ -0,0 +1,85 @@
+#
+# Makefile for the PO files (translation) catalog
+#
+
+PREFIX ?= /usr
+
+# What is this package?
+NLSPACKAGE     = python
+POTFILE                = $(NLSPACKAGE).pot
+INSTALL                = /usr/bin/install -c -p
+INSTALL_DATA   = $(INSTALL) -m 644
+INSTALL_DIR    = /usr/bin/install -d
+
+# destination directory
+INSTALL_NLS_DIR = $(PREFIX)/share/locale
+
+# PO catalog handling
+MSGMERGE       = msgmerge
+MSGMERGE_FLAGS = -q
+XGETTEXT       = xgettext --default-domain=$(NLSPACKAGE)
+MSGFMT         = msgfmt
+
+# All possible linguas
+PO_LINGUAS := $(sort $(patsubst %.po,%,$(wildcard *.po)))
+
+# Only the files matching what the user has set in LINGUAS
+USER_LINGUAS := $(filter $(patsubst %,%%,$(LINGUAS)),$(PO_LINGUAS))
+
+# if no valid LINGUAS, build all languages
+USE_LINGUAS := $(if $(USER_LINGUAS),$(USER_LINGUAS),$(PO_LINGUAS))

python/po/Makefile line 40

Quoted 10 lines
python/po/Makefile new file +10 -0
+
+POFILES                = $(patsubst %,%.po,$(USE_LINGUAS))
+MOFILES                = $(patsubst %.po,%.mo,$(POFILES))
+POTFILES  = $(shell cat POTFILES)
+
+#default:: clean
+
+all::  $(MOFILES)
+
+$(POTFILE): $(POTFILES)

Extra space at the end of the line above.

Quoted 305 lines
python/po/Makefile new file +45 -0
+       $(XGETTEXT) -L Python --keyword=_ --keyword=N_ $(POTFILES)
+       $(XGETTEXT) -j --keyword=_ --keyword=N_ ../sepolicy/sepolicy/sepolicy.glade
+       @if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
+           rm -f $(NLSPACKAGE).po; \
+       else \
+           mv -f $(NLSPACKAGE).po $(POTFILE); \
+       fi; \
+
+
+refresh-po: Makefile
+       for cat in $(POFILES); do \
+               lang=`basename $$cat .po`; \
+               if $(MSGMERGE) $(MSGMERGE_FLAGS) $$lang.po $(POTFILE) > $$lang.pot ; then \
+                       mv -f $$lang.pot $$lang.po ; \
+                       echo "$(MSGMERGE) of $$lang succeeded" ; \
+               else \
+                       echo "$(MSGMERGE) of $$lang failed" ; \
+                       rm -f $$lang.pot ; \
+               fi \
+       done
+
+clean:
+       @rm -fv *mo *~ .depend
+       @rm -rf tmp
+
+install: $(MOFILES)
+       @for n in $(MOFILES); do \
+           l=`basename $$n .mo`; \
+           $(INSTALL_DIR) $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \
+           $(INSTALL_DATA) --verbose $$n $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/selinux-$(NLSPACKAGE).mo; \
+       done
+
+%.mo: %.po
+       $(MSGFMT) -o $@ $<
+report:
+       @for cat in $(wildcard *.po); do \
+                echo -n "$$cat: "; \
+                msgfmt -v --statistics -o /dev/null $$cat; \
+        done
+
+.PHONY: missing depend
+
+relabel:
+
+test:
python/po/POTFILES new file +10 -0
new file mode 100644
index 000000000000..128eb870a69e
@@ -0,0 +1,10 @@
+../audit2allow/audit2allow
+../chcat/chcat
+../semanage/semanage
+../semanage/seobject.py
+../sepolgen/src/sepolgen/interfaces.py
+../sepolicy/sepolicy/generate.py
+../sepolicy/sepolicy/gui.py
+../sepolicy/sepolicy/__init__.py
+../sepolicy/sepolicy/interface.py
+../sepolicy/sepolicy.py
python/semanage/semanage +1 -1
index ff9fb66b1411..12bb159ef649 100644
@@ -30,7 +30,7 @@ import seobject
 import sys
 import traceback
 
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/semanage/seobject.py +1 -1
index 21adbf6eb74f..69e60db80060 100644
@@ -29,7 +29,7 @@ import sys
 import stat
 import socket
 from semanage import *
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 import sepolicy
 from setools.policyrep import SELinuxPolicy
 from setools.typequery import TypeQuery
python/sepolgen/src/sepolgen/sepolgeni18n.py +1 -1
index 998c4356415c..56ebd807c69c 100644
@@ -19,7 +19,7 @@
 
 try:
     import gettext
-    t = gettext.translation( 'yumex' )
+    t = gettext.translation( 'selinux-python' )
     _ = t.gettext
 except:
     def _(str):
python/sepolicy/sepolicy.py +1 -1
index 7b2230651099..32956e58f52e 100755
@@ -28,7 +28,7 @@ import sepolicy
 from multiprocessing import Pool
 from sepolicy import get_os_version, get_conditionals, get_conditionals_format_text
 import argparse
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/sepolicy/sepolicy/__init__.py +1 -1
index e8654abbceb3..203ca25f4210 100644
@@ -23,7 +23,7 @@ from setools.typeattrquery import TypeAttributeQuery
 from setools.typequery import TypeQuery
 from setools.userquery import UserQuery
 
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/sepolicy/sepolicy/generate.py +1 -1
index 4e1ed4e9dc31..43180ca6fda4 100644
@@ -48,7 +48,7 @@ import sepolgen.defaults as defaults
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/sepolicy/sepolicy/gui.py +1 -1
index 1e86422b864a..c9ca158ddd09 100644
@@ -41,7 +41,7 @@ import os
 import re
 import unicodedata
 
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
python/sepolicy/sepolicy/interface.py +1 -1
index bdffb770f364..9d40aea1498d 100644
@@ -30,7 +30,7 @@ __all__ = ['get_all_interfaces', 'get_interfaces_from_xml', 'get_admin', 'get_us
 ##
 ## I18N
 ##
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-python"
 try:
     import gettext
     kwargs = {}
sandbox/Makefile +3 -0
index 9da5e58db9e6..84cb5a39bf7e 100644
@@ -13,6 +13,7 @@ override LDLIBS += -lselinux -lcap-ng
 SEUNSHARE_OBJS = seunshare.o
 
 all: sandbox seunshare sandboxX.sh start
+       (cd po && $(MAKE) $@)
 
 seunshare: $(SEUNSHARE_OBJS)
 
@@ -39,12 +40,14 @@ install: all
        install -m 755 start $(DESTDIR)$(SHAREDIR)
        -mkdir -p $(DESTDIR)$(SYSCONFDIR)
        install -m 644 sandbox.conf $(DESTDIR)$(SYSCONFDIR)/sandbox
+       (cd po && $(MAKE) $@)
 
 test:
        @$(PYTHON) test_sandbox.py -v
 
 clean:
        -rm -f seunshare *.o *~
+       (cd po && $(MAKE) $@)
 
 indent:
        ../../scripts/Lindent $(wildcard *.[ch])
sandbox/po/Makefile new file +84 -0
new file mode 100644
index 000000000000..e75343649b67
@@ -0,0 +1,84 @@
+#
+# Makefile for the PO files (translation) catalog
+#
+
+PREFIX ?= /usr
+
+# What is this package?
+NLSPACKAGE     = sandbox
+POTFILE                = $(NLSPACKAGE).pot
+INSTALL                = /usr/bin/install -c -p
+INSTALL_DATA   = $(INSTALL) -m 644
+INSTALL_DIR    = /usr/bin/install -d
+
+# destination directory
+INSTALL_NLS_DIR = $(PREFIX)/share/locale
+
+# PO catalog handling
+MSGMERGE       = msgmerge
+MSGMERGE_FLAGS = -q
+XGETTEXT       = xgettext -L Python --default-domain=$(NLSPACKAGE)
+MSGFMT         = msgfmt
+
+# All possible linguas
+PO_LINGUAS := $(sort $(patsubst %.po,%,$(wildcard *.po)))
+
+# Only the files matching what the user has set in LINGUAS
+USER_LINGUAS := $(filter $(patsubst %,%%,$(LINGUAS)),$(PO_LINGUAS))
+
+# if no valid LINGUAS, build all languages
+USE_LINGUAS := $(if $(USER_LINGUAS),$(USER_LINGUAS),$(PO_LINGUAS))
+
+POFILES                = $(patsubst %,%.po,$(USE_LINGUAS))
+MOFILES                = $(patsubst %.po,%.mo,$(POFILES))
+POTFILES  = $(shell cat POTFILES)
+
+#default:: clean
+
+all:: $(POTFILE) $(MOFILES)
+
+$(POTFILE): $(POTFILES)
+       $(XGETTEXT) --keyword=_ --keyword=N_ $(POTFILES)
+       @if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
+           rm -f $(NLSPACKAGE).po; \
+       else \
+           mv -f $(NLSPACKAGE).po $(POTFILE); \
+       fi; \
+
+
+refresh-po: Makefile
+       for cat in $(POFILES); do \
+               lang=`basename $$cat .po`; \
+               if $(MSGMERGE) $(MSGMERGE_FLAGS) $$lang.po $(POTFILE) > $$lang.pot ; then \
+                       mv -f $$lang.pot $$lang.po ; \
+                       echo "$(MSGMERGE) of $$lang succeeded" ; \
+               else \
+                       echo "$(MSGMERGE) of $$lang failed" ; \
+                       rm -f $$lang.pot ; \
+               fi \
+       done
+
+clean:
+       @rm -fv *mo *~ .depend
+       @rm -rf tmp
+
+install: $(MOFILES)
+       @for n in $(MOFILES); do \
+           l=`basename $$n .mo`; \
+           $(INSTALL_DIR) $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \
+           $(INSTALL_DATA) --verbose $$n $(DESTDIR)$(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/selinux-$(NLSPACKAGE).mo; \
+       done
+
+%.mo: %.po
+       $(MSGFMT) -o $@ $<
+report:
+       @for cat in $(wildcard *.po); do \
+                echo -n "$$cat: "; \
+                msgfmt -v --statistics -o /dev/null $$cat; \
+        done
+
+.PHONY: missing depend
+
+relabel:
+
+test:
sandbox/po/POTFILES new file +1 -0
new file mode 100644
index 000000000000..deff3f2f4656
@@ -0,0 +1 @@
+../sandbox
sandbox/sandbox +1 -2
index ca5f1e030a51..16c43b51eaaa 100644
@@ -37,7 +37,7 @@ import sepolicy
 
 SEUNSHARE = "/usr/sbin/seunshare"
 SANDBOXSH = "/usr/share/sandbox/sandboxX.sh"
-PROGNAME = "policycoreutils"
+PROGNAME = "selinux-sandbox"
 try:
     import gettext
     kwargs = {}
--

2.35.1