MCDE dtlaunch: a message catalog, German measured (t0282)

dtlaunch's visible texts come from programs/dtlaunch/dtlaunch.msg (set 1, 3
messages: the hint line under the field, and the two Parental Controls
sentences), the German copy in programs/localized/de_DE.UTF-8/msg/
dtlaunch.msg, built by msg.C.am and listed in the PLIST (C plain,
${PLIST.nls} for German).  dtlaunch does not link libDtSvc, so it calls
catopen/catgets itself (Dt/MsgCatP.h's CATGETS needs _DtCatgets); its
Makefile now passes -DCDE_INSTALLATION_TOP for the NLSPATH fallback.

The list's pane entries are already translated: dtlaunch reads them from
`dtsystemsettings -list-panes`, which uses the catalog of 89e41554e6.

Measured on Xvfb (1280x800, fresh HOME, ttsession + dtwm, dtlaunch -show
-nograb), de_DE.UTF-8 via localedef/LOCPATH:
"Tippen: ein Programm, eine Einstellung, einen Schnipsel oder =1+2"; LANG=C:
"Type to find a program, a setting, a snippet, or =1+2" (screenshots
/tmp/opencode/dtl-de.png, /tmp/opencode/dtl-c.png).
make mcde-linux MCDE_DIRS="install programs/dtlaunch" and
"install programs/localized/C/msg" exit=0; MCDE_DIRS=plist: "3483 installed
names under dt/, 8674 in the PLISTs", ok.
This commit is contained in:
lotherk committed 2026-11-16 09:56:46 +00:00
1 parent 89e41554e6
commit 8482e357d0
7 files changed
+49 -7

No files matched your search

+3 -1
View File
@@ -46,7 +46,9 @@ narratives and test notes, is `docs/reference/mcde-agents-history-2026-11-13.txt
title (`dtsystemsettings.msg`, 32 messages); it calls `setlocale` before
its first message, because the window title is already an argument of
`XtVaAppInitialize` and a catalog opened then would stay the C one
(measured 2026-11-16). A new catalog must be added to
(measured 2026-11-16). dtlaunch (`dtlaunch.msg`, 3 messages) has no
libDtSvc to link, so it calls `catopen`/`catgets` itself and its
Makefile passes `CDE_INSTALLATION_TOP`. A new catalog must be added to
`programs/localized/templates/msg.C.am` for C and to the PLIST (C plain,
a locale with `${PLIST.nls}`).
+2
View File
@@ -2776,6 +2776,7 @@ dt/lib/nls/msg/C/dticon.cat
dt/lib/nls/msg/C/dtimsstart.cat
dt/lib/nls/msg/C/dtinfo.cat
dt/lib/nls/msg/C/dtinfo_start.cat
dt/lib/nls/msg/C/dtlaunch.cat
dt/lib/nls/msg/C/dtlogin.cat
dt/lib/nls/msg/C/dtlp.cat
dt/lib/nls/msg/C/dtmailopts.cat
@@ -7508,6 +7509,7 @@ ${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dticon.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtimsstart.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtinfo.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtinfo_start.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtlaunch.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtlogin.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtlp.cat
${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtmailopts.cat
+1 -1
View File
@@ -5,7 +5,7 @@ MAINTAINERCLEANFILES = Makefile.in
bin_PROGRAMS = dtlaunch
dtlaunch_SOURCES = dtlaunch.c model.c model.h
dtlaunch_CPPFLAGS = $(XFIXES_CPPFLAGS)
dtlaunch_CPPFLAGS = $(XFIXES_CPPFLAGS) -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\"
dtlaunch_LDADD = $(XFIXESLIB) $(XTOOLLIB) -lm
check_PROGRAMS = test_model
+24 -4
View File
@@ -46,6 +46,7 @@
#include <time.h>
#include <unistd.h>
#include <nl_types.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
@@ -688,6 +689,25 @@ parental_log(const char *program)
fclose(f);
}
/* dtlaunch's message catalog (programs/dtlaunch/dtlaunch.msg, the locale's
* copy in programs/localized/<locale>/msg, installed under lib/nls/msg) */
static nl_catd cat = (nl_catd) -1;
static const char *
Tr(int n, const char *text)
{
if (cat == (nl_catd) -1) {
if (getenv("NLSPATH") == NULL)
(void) setenv("NLSPATH", CDE_INSTALLATION_TOP
"/lib/nls/msg/%L/%N.cat:" CDE_INSTALLATION_TOP
"/lib/nls/msg/C/%N.cat", 0);
cat = catopen("dtlaunch", NL_CAT_LOCALE);
}
if (cat == (nl_catd) -1)
return text;
return catgets(cat, 1, n, text);
}
static void
hint_text(const char *text)
{
@@ -705,11 +725,11 @@ run_args(const char *program, char *const argv[])
pid_t pid;
if (!parental_in_hours()) {
hint_text("Outside the allowed hours (Parental Controls).");
hint_text(Tr(2, "Outside the allowed hours (Parental Controls)."));
return 0;
}
if (!ParentalAllowed(program)) {
hint_text("This program is not allowed (Parental Controls).");
hint_text(Tr(3, "This program is not allowed (Parental Controls)."));
return 0;
}
parental_log(program);
@@ -1010,8 +1030,8 @@ main(int argc, char **argv)
if (L.keep_history && !watch_clipboard())
(void)XtAppAddTimeOut(L.app, POLL_MS, poll_clipboard, NULL);
if (!L.keep_history) {
XmString none = XmStringCreateLocalized((char *)"Type to find a "
"program, a setting, a snippet, or =1+2");
XmString none = XmStringCreateLocalized((char *)Tr(1,
"Type to find a program, a setting, a snippet, or =1+2"));
XtVaSetValues(L.hint, XmNlabelString, none, NULL);
XmStringFree(none);
@@ -0,0 +1,7 @@
$ MCDE dtlaunch message catalog (set 1) -- English is the source; a locale's copy lives in programs/localized/<locale>/msg/dtlaunch.msg.
$
$set 1
1 Type to find a program, a setting, a snippet, or =1+2
2 Outside the allowed hours (Parental Controls).
3 This program is not allowed (Parental Controls).
@@ -0,0 +1,7 @@
$ MCDE dtlaunch message catalog, German.
$
$set 1
1 Tippen: ein Programm, eine Einstellung, einen Schnipsel oder =1+2
2 Außerhalb der erlaubten Zeiten (Kindersicherung).
3 Dieses Programm ist nicht erlaubt (Kindersicherung).
@@ -5,7 +5,7 @@
BUILT_SOURCES = Xm.cat Mrm.cat Uil.cat DtHelp.cat DtMail.cat \
DtPrint.cat DtWidget.cat MotifApp.cat SUNW_TOOLTALK.cat dt.cat \
dtact.cat dtbuilder.cat dtcalc.cat dtcm.cat dtcodegen.cat \
dtbar.cat dtconfig.cat dtsystemsettings.cat dtcopy.cat dtcreate.cat dtfile.cat dthello.cat \
dtbar.cat dtconfig.cat dtlaunch.cat dtsystemsettings.cat dtcopy.cat dtcreate.cat dtfile.cat dthello.cat \
dthelpgen.cat dthelpprint.cat dticon.cat dtimsstart.cat \
dtlogin.cat dtlp.cat dtmailopts.cat dtpad.cat \
dtpdm.cat dtpdmd.cat dtprintinfo.cat dtscreen.cat dtsearch.cat \
@@ -117,6 +117,10 @@ dtsystemsettings.cat: $(TOP)/dtsystemsettings/dtsystemsettings.msg
$(RM) $@
LANG=C $(GENCAT) $@ $^ || $(RM) $@
dtlaunch.cat: $(TOP)/dtlaunch/dtlaunch.msg
$(RM) $@
LANG=C $(GENCAT) $@ $^ || $(RM) $@
dtfile.cat: $(TOP)/dtfile/dtfile.msg
$(RM) $@
LANG=C $(GENCAT) $@ $^ || $(RM) $@