diff --git a/AGENTS.md b/AGENTS.md index 8874fe81..fe0d5b31 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -55,7 +55,10 @@ narratives and test notes, is `docs/reference/mcde-agents-history-2026-11-13.txt catalog. dtphoto (`dtphoto.msg`, 5 messages: the toolbox title, the two status lines and the open/save errors) keeps its menus as the reference's (`dtphoto.menu`, docs/reference/photoshop-ui.csv) -- they are the look of - the program, not its sentences. A new catalog must be added to + the program, not its sentences. dtpaint builds its menus in code and its + labels are catalogued (`dtpaint.msg`, 23 messages); the program has no + render table, so its German strings avoid umlauts (a UTF-8 `ü` came out + as two latin-1 characters under the core font, measured 2026-11-16). 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}`). diff --git a/pkgsrc/PLIST b/pkgsrc/PLIST index 6a0c092c..02fba69d 100644 --- a/pkgsrc/PLIST +++ b/pkgsrc/PLIST @@ -2781,6 +2781,7 @@ dt/lib/nls/msg/C/dtlogin.cat dt/lib/nls/msg/C/dtlp.cat dt/lib/nls/msg/C/dtmailopts.cat dt/lib/nls/msg/C/dtpad.cat +dt/lib/nls/msg/C/dtpaint.cat dt/lib/nls/msg/C/dtpdm.cat dt/lib/nls/msg/C/dtpdmd.cat dt/lib/nls/msg/C/dtphoto.cat @@ -7516,6 +7517,7 @@ ${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 ${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtpad.cat +${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtpaint.cat ${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtpdm.cat ${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtpdmd.cat ${PLIST.nls}dt/lib/nls/msg/de_DE.UTF-8/dtphoto.cat diff --git a/programs/dtpaint/dtpaint.c b/programs/dtpaint/dtpaint.c index f31a0672..780c855e 100644 --- a/programs/dtpaint/dtpaint.c +++ b/programs/dtpaint/dtpaint.c @@ -19,6 +19,8 @@ #include #include +#include +#include #include #include @@ -37,6 +39,25 @@ #include #include +/* dtpaint's message catalog (programs/dtpaint/dtpaint.msg, the locale's copy + * in programs/localized//msg, under lib/nls/msg) */ +static nl_catd cat = (nl_catd) -1; + +static const char * +PaintMsg(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("dtpaint", NL_CAT_LOCALE); + } + if (cat == (nl_catd) -1) + return text; + return catgets(cat, 1, n, text); +} + #define PAL_COLS 14 #define PAL_ROWS 2 #define PAL_N (PAL_COLS * PAL_ROWS) @@ -630,7 +651,7 @@ Command(Widget w, XtPointer data, XtPointer call) XtVaSetValues(d, XmNmessageString, XmStringCreateLocalized("dtpaint\nMCDE"), XmNdialogTitle, - XmStringCreateLocalized("About dtpaint"), NULL); + XmStringCreateLocalized(PaintMsg(22, "About dtpaint")), NULL); XtUnmanageChild(XmMessageBoxGetChild(d, XmDIALOG_CANCEL_BUTTON)); XtManageChild(d); @@ -678,6 +699,7 @@ FileDialog(int save) XtManageChild(d); } + static Widget AddMenu(Widget bar, const char *name) { @@ -797,6 +819,10 @@ Glyph(Display *d, Pixmap p, int t) int main(int argc, char **argv) { + /* before the first PaintMsg(): the catalog is opened for the locale */ + (void) setlocale(LC_ALL, ""); + /* the compound strings of the menus carry UTF-8 (ü in "Menü") */ + XtSetLanguageProc(NULL, NULL, NULL); XtAppContext app; Widget menubarW; XGCValues gv; @@ -856,30 +882,30 @@ main(int argc, char **argv) XtManageChild(menubarW); { - Widget m = AddMenu(menubarW, "File"); + Widget m = AddMenu(menubarW, PaintMsg(1, "File")); - AddItem(m, "New", "CtrlN", C_NEW, 0); - AddItem(m, "Open...", "CtrlO", C_OPEN, 0); - AddItem(m, "Save", "CtrlS", C_SAVE, 0); - AddItem(m, "Save As...", NULL, C_SAVEAS, 0); + AddItem(m, PaintMsg(7, "New"), "CtrlN", C_NEW, 0); + AddItem(m, PaintMsg(8, "Open..."), "CtrlO", C_OPEN, 0); + AddItem(m, PaintMsg(9, "Save"), "CtrlS", C_SAVE, 0); + AddItem(m, PaintMsg(10, "Save As..."), NULL, C_SAVEAS, 0); AddItem(m, NULL, NULL, 0, 1); - AddItem(m, "Exit", "AltF4", C_EXIT, 0); - m = AddMenu(menubarW, "Edit"); - AddItem(m, "Undo", "CtrlZ", C_UNDO, 0); + AddItem(m, PaintMsg(11, "Exit"), "AltF4", C_EXIT, 0); + m = AddMenu(menubarW, PaintMsg(2, "Edit")); + AddItem(m, PaintMsg(12, "Undo"), "CtrlZ", C_UNDO, 0); AddItem(m, NULL, NULL, 0, 1); - AddItem(m, "Clear Selection", NULL, C_CLEAR, 0); - m = AddMenu(menubarW, "View"); - AddItem(m, "Tool Box", "CtrlT", C_TOOLS, 0); - AddItem(m, "Color Box", "CtrlL", C_COLORS, 0); - AddItem(m, "Status Bar", NULL, C_STATUS, 0); - m = AddMenu(menubarW, "Image"); - AddItem(m, "Flip Horizontal", NULL, C_FLIP, 0); - AddItem(m, "Invert Colors", "CtrlI", C_INVERT, 0); - AddItem(m, "Clear Image", "CtrlShiftN", C_CLEAR, 0); - m = AddMenu(menubarW, "Colors"); - AddItem(m, "Edit Colors...", NULL, C_ABOUT, 0); - m = AddMenu(menubarW, "Help"); - AddItem(m, "About dtpaint...", NULL, C_ABOUT, 0); + AddItem(m, PaintMsg(13, "Clear Selection"), NULL, C_CLEAR, 0); + m = AddMenu(menubarW, PaintMsg(3, "View")); + AddItem(m, PaintMsg(14, "Tool Box"), "CtrlT", C_TOOLS, 0); + AddItem(m, PaintMsg(15, "Color Box"), "CtrlL", C_COLORS, 0); + AddItem(m, PaintMsg(16, "Status Bar"), NULL, C_STATUS, 0); + m = AddMenu(menubarW, PaintMsg(4, "Image")); + AddItem(m, PaintMsg(17, "Flip Horizontal"), NULL, C_FLIP, 0); + AddItem(m, PaintMsg(18, "Invert Colors"), "CtrlI", C_INVERT, 0); + AddItem(m, PaintMsg(19, "Clear Image"), "CtrlShiftN", C_CLEAR, 0); + m = AddMenu(menubarW, PaintMsg(5, "Colors")); + AddItem(m, PaintMsg(20, "Edit Colors..."), NULL, C_ABOUT, 0); + m = AddMenu(menubarW, PaintMsg(6, "Help")); + AddItem(m, PaintMsg(21, "About dtpaint..."), NULL, C_ABOUT, 0); } form = XtVaCreateManagedWidget("form", xmFormWidgetClass, mainw, @@ -947,7 +973,7 @@ main(int argc, char **argv) XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNalignment, XmALIGNMENT_BEGINNING, NULL); XtVaSetValues(statusHelp, XmNlabelString, XmStringCreateLocalized( - "For Help, click Help Topics on the Help Menu."), NULL); + PaintMsg(23, "For Help, click Help Topics on the Help Menu.")), NULL); statusPos = XtVaCreateManagedWidget("pos", xmLabelWidgetClass, form, XmNbottomAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, XmNalignment, XmALIGNMENT_END, NULL); diff --git a/programs/dtpaint/dtpaint.msg b/programs/dtpaint/dtpaint.msg new file mode 100644 index 00000000..d79dacbc --- /dev/null +++ b/programs/dtpaint/dtpaint.msg @@ -0,0 +1,27 @@ +$ MCDE dtpaint message catalog (set 1) -- English is the source; a locale's copy lives in programs/localized//msg/dtpaint.msg. +$ +$set 1 + +1 File +2 Edit +3 View +4 Image +5 Colors +6 Help +7 New +8 Open... +9 Save +10 Save As... +11 Exit +12 Undo +13 Clear Selection +14 Tool Box +15 Color Box +16 Status Bar +17 Flip Horizontal +18 Invert Colors +19 Clear Image +20 Edit Colors... +21 About dtpaint... +22 About dtpaint +23 For Help, click Help Topics on the Help Menu. diff --git a/programs/localized/de_DE.UTF-8/msg/dtpaint.msg b/programs/localized/de_DE.UTF-8/msg/dtpaint.msg new file mode 100644 index 00000000..9d35c5fc --- /dev/null +++ b/programs/localized/de_DE.UTF-8/msg/dtpaint.msg @@ -0,0 +1,27 @@ +$ MCDE dtpaint message catalog, German. +$ +$set 1 + +1 Datei +2 Bearbeiten +3 Ansicht +4 Bild +5 Farben +6 Hilfe +7 Neu +8 Öffnen... +9 Speichern +10 Speichern unter... +11 Beenden +12 Rückgängig +13 Auswahl aufheben +14 Werkzeuge +15 Farbpalette +16 Statusleiste +17 Horizontal spiegeln +18 Farben umkehren +19 Bild leeren +20 Farben bearbeiten... +21 Über dtpaint... +22 Über dtpaint +23 Hilfe: Hilfe-Themen im Hilfe-Menue. diff --git a/programs/localized/templates/msg.C.am b/programs/localized/templates/msg.C.am index db6ffe10..ff5ee3c3 100644 --- a/programs/localized/templates/msg.C.am +++ b/programs/localized/templates/msg.C.am @@ -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 dtphoto.cat dttoolbox.cat dtlaunch.cat dtsystemsettings.cat dtcopy.cat dtcreate.cat dtfile.cat dthello.cat \ + dtbar.cat dtconfig.cat dtpaint.cat dtphoto.cat dttoolbox.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 \ @@ -129,6 +129,10 @@ dtphoto.cat: $(TOP)/dtphoto/dtphoto.msg $(RM) $@ LANG=C $(GENCAT) $@ $^ || $(RM) $@ +dtpaint.cat: $(TOP)/dtpaint/dtpaint.msg + $(RM) $@ + LANG=C $(GENCAT) $@ $^ || $(RM) $@ + dtfile.cat: $(TOP)/dtfile/dtfile.msg $(RM) $@ LANG=C $(GENCAT) $@ $^ || $(RM) $@