From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pve-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 595161FF15E for <inbox@lore.proxmox.com>; Tue, 25 Feb 2025 16:34:15 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B5A47288E6; Tue, 25 Feb 2025 16:34:12 +0100 (CET) Mime-Version: 1.0 Date: Tue, 25 Feb 2025 16:33:37 +0100 Message-Id: <D81MWVAEMDJD.38NZJHZPRPIC3@proxmox.com> Cc: "pve-devel" <pve-devel-bounces@lists.proxmox.com> From: "Shannon Sterz" <s.sterz@proxmox.com> To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com> X-Mailer: aerc 0.20.1-0-g2ecb8770224a-dirty References: <20250124143709.374750-1-m.sandoval@proxmox.com> <20250124143709.374750-2-m.sandoval@proxmox.com> In-Reply-To: <20250124143709.374750-2-m.sandoval@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.032 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [jsgettext.pl, po2js.pl, proxmox.com] Subject: Re: [pve-devel] [PATCH proxmox-i18n v2 2/2] make: add proxmox-datacenter-manager translations X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/> List-Post: <mailto:pve-devel@lists.proxmox.com> List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com> On Fri Jan 24, 2025 at 3:37 PM CET, Maximiliano Sandoval wrote: > The catalog-{lang}.mo files are generated only with strings that are > relevant to the proxmox-datacenter-manager instead of the whole > {lang}.po file. The msgmerge command will produce all strings containing > in the {lang}.po file but the ones that do not concern > proxmox-datacenter-manager.pot will be written without a source file, > then msgattrib will discard all those strings with --no-obsolete. We > throw a --no-fuzzy to further decrease the resulting catalog-{lang}.mo's > file size. > > One thing to note is that xtr, unlike our script to extract translations > will add comments, context, and plural forms. > > Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com> > --- > .gitmodules | 9 +++++++++ > Makefile | 33 ++++++++++++++++++++++++++++++--- > debian/control | 8 +++++++- > debian/pdm-i18n.install | 1 + > proxmox-datacenter-manager | 1 + > proxmox-yew-comp | 1 + > proxmox-yew-widget-toolkit | 1 + > 7 files changed, 50 insertions(+), 4 deletions(-) > create mode 100644 debian/pdm-i18n.install > create mode 160000 proxmox-datacenter-manager > create mode 160000 proxmox-yew-comp > create mode 160000 proxmox-yew-widget-toolkit > > diff --git a/.gitmodules b/.gitmodules > index a81a7e3..885b6e1 100644 > --- a/.gitmodules > +++ b/.gitmodules > @@ -12,3 +12,12 @@ > [submodule "proxmox-backup"] > path = proxmox-backup > url = ../proxmox-backup > +[submodule "proxmox-datacenter-manager"] > + path = proxmox-datacenter-manager > + url = ../proxmox-datacenter-manager > +[submodule "proxmox-yew-widget-toolkit"] > + path = proxmox-yew-widget-toolkit > + url = ../proxmox-yew-widget-toolkit > +[submodule "proxmox-yew-comp"] > + path = proxmox-yew-comp > + url = ../proxmox-yew-comp > diff --git a/Makefile b/Makefile > index 90a7453..ca98ef9 100644 > --- a/Makefile > +++ b/Makefile > @@ -37,16 +37,19 @@ DSC=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc > PVE_I18N_DEB=pve-i18n_$(DEB_VERSION)_all.deb > PMG_I18N_DEB=pmg-i18n_$(DEB_VERSION)_all.deb > PBS_I18N_DEB=pbs-i18n_$(DEB_VERSION)_all.deb > +PDM_I18N_DEB=pdm-i18n_$(DEB_VERSION)_all.deb > > -DEBS=$(PMG_I18N_DEB) $(PVE_I18N_DEB) $(PBS_I18N_DEB) > +DEBS=$(PMG_I18N_DEB) $(PVE_I18N_DEB) $(PBS_I18N_DEB) $(PDM_I18N_DEB) > > PMGLOCALEDIR=$(DESTDIR)/usr/share/pmg-i18n > PVELOCALEDIR=$(DESTDIR)/usr/share/pve-i18n > PBSLOCALEDIR=$(DESTDIR)/usr/share/pbs-i18n > +PDMLOCALEDIR=$(DESTDIR)/usr/share/pdm-i18n > > PMG_LANG_FILES=$(patsubst %, pmg-lang-%.js, $(LINGUAS)) > PVE_LANG_FILES=$(patsubst %, pve-lang-%.js, $(LINGUAS)) > PBS_LANG_FILES=$(patsubst %, pbs-lang-%.js, $(LINGUAS)) > +PDM_LANG_FILES=$(patsubst %, catalog-%.mo, $(LINGUAS)) > > all: > > @@ -78,13 +81,16 @@ submodule: > || git submodule update --init > > .PHONY: install > -install: $(PMG_LANG_FILES) $(PVE_LANG_FILES) $(PBS_LANG_FILES) > +install: $(PMG_LANG_FILES) $(PVE_LANG_FILES) $(PBS_LANG_FILES) $(PDM_LANG_FILES) > install -d $(PMGLOCALEDIR) > install -m 0644 $(PMG_LANG_FILES) $(PMGLOCALEDIR) > install -d $(PVELOCALEDIR) > install -m 0644 $(PVE_LANG_FILES) $(PVELOCALEDIR) > install -d $(PBSLOCALEDIR) > install -m 0644 $(PBS_LANG_FILES) $(PBSLOCALEDIR) > + install -d $(PDMLOCALEDIR) > + install -m 0644 $(PDM_LANG_FILES) $(PDMLOCALEDIR) > + > # compat symlinks for kr -> ko correction. > ln -s pmg-lang-ko.js $(PMGLOCALEDIR)/pmg-lang-kr.js > ln -s pve-lang-ko.js $(PVELOCALEDIR)/pve-lang-kr.js > @@ -99,18 +105,35 @@ pve-lang-%.js: %.po > pbs-lang-%.js: %.po > ./po2js.pl -t pbs -v "$(DEB_VERSION)" -o pbs-lang-$*.js $? > > +catalog-%.mo: %.po proxmox-datacenter-manager.pot > + msgmerge $< proxmox-datacenter-manager.pot | msgattrib --no-fuzzy --no-obsolete | msgfmt --verbose --output-file $@ $<; this could be `msmerge $^ | msgattrib ..` since you basically want to pass all prerequisits to `msmerge`, no? > + > # parameter 1 is the name > # parameter 2 is the directory > define potupdate > ./jsgettext.pl -p "$(1) $(shell cd $(2);git rev-parse HEAD)" -o $(1).pot $(2) > endef > > +# parameter 1 is the name > +# parameter 2 is the directory > +define xtrpotupdate > + xtr --package-name "$(1)" \ > + --package-version="$(shell cd $(2);git rev-parse HEAD)" \ > + --msgid-bugs-address="<support@proxmox.com>" \ > + --copyright-holder="Copyright (C) Proxmox Server Solutions GmbH <support@proxmox.com> & the translation contributors." \ > + --output $(1).pot \ > + $(2)*.rs > +endef > + > .PHONY: update update_pot do_update > update_pot: submodule > $(call potupdate,proxmox-widget-toolkit,proxmox-widget-toolkit/) > $(call potupdate,pve-manager,pve-manager/www/manager6/) > $(call potupdate,proxmox-mailgateway,pmg-gui/js/) > $(call potupdate,proxmox-backup,proxmox-backup/www/) > + $(call xtrpotupdate,proxmox-datacenter-manager-ui,proxmox-datacenter-manager/ui/src/) > + $(call xtrpotupdate,proxmox-yew-comp,proxmox-yew-comp/src/) > + $(call xtrpotupdate,proxmox-yew-widget-toolkit,proxmox-yew-widget-toolkit/src/) > > do_update: > $(MAKE) update_pot > @@ -128,7 +151,11 @@ init-%.po: messages.pot > msginit -i $^ -l $^ -o $*.po --no-translator > > .INTERMEDIATE: messages.pot > -messages.pot: proxmox-widget-toolkit.pot proxmox-mailgateway.pot pve-manager.pot proxmox-backup.pot > +messages.pot: proxmox-widget-toolkit.pot proxmox-mailgateway.pot pve-manager.pot proxmox-backup.pot proxmox-datacenter-manager-ui.pot proxmox-yew-comp.pot proxmox-yew-widget-toolkit.pot > + xgettext $^ --msgid-bugs-address="<support@proxmox.com>" --output $@ > + > +.INTERMEDIATE: proxmox-datacenter-manager.pot > +proxmox-datacenter-manager.pot: proxmox-datacenter-manager-ui.pot proxmox-yew-comp.pot proxmox-yew-widget-toolkit.pot > xgettext $^ --msgid-bugs-address="<support@proxmox.com>" --output $@ > > .PHONY: distclean > diff --git a/debian/control b/debian/control > index cdd04a8..346c34c 100644 > --- a/debian/control > +++ b/debian/control > @@ -2,7 +2,7 @@ Source: proxmox-i18n > Section: perl > Priority: optional > Maintainer: Proxmox Support Team <support@proxmox.com> > -Build-Depends: debhelper-compat (= 13), libjson-perl, liblocale-po-perl, gettext, > +Build-Depends: debhelper-compat (= 13), libjson-perl, liblocale-po-perl, gettext, xtr, > Standards-Version: 4.6.2 > Homepage: https://www.proxmox.com > > @@ -23,3 +23,9 @@ Architecture: all > Depends: ${misc:Depends}, > Description: Internationalization support for Proxmox VE > This package provides the translations into all available languages. > + > +Package: pdm-i18n > +Architecture: all > +Depends: ${misc:Depends}, > +Description: Internationalization support for Proxmox Datacenter Manager > + This package provides the translations into all available languages. > diff --git a/debian/pdm-i18n.install b/debian/pdm-i18n.install > new file mode 100644 > index 0000000..628332b > --- /dev/null > +++ b/debian/pdm-i18n.install > @@ -0,0 +1,1 @@ > +/usr/share/pdm-i18n/ _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel