[libvirt PATCH 00/51] Use permutable format strings in translations

Jiri Denemark posted 51 patches 1 week, 5 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1678463799.git.jdenemar@redhat.com
.gitlab-ci.yml                                |   1 +
build-aux/syntax-check.mk                     |   5 +
docs/coding-style.rst                         |  20 +-
po/meson.build                                |   8 +
scripts/check-pot.py                          |  54 ++
src/access/viraccessdriverpolkit.c            |   2 +-
src/access/viraccessmanager.c                 |   4 +-
src/admin/admin_server_dispatch.c             |  10 +-
src/admin/libvirt-admin.c                     |   6 +-
src/bhyve/bhyve_command.c                     |  18 +-
src/bhyve/bhyve_domain.c                      |   2 +-
src/bhyve/bhyve_driver.c                      |  38 +-
src/bhyve/bhyve_firmware.c                    |   4 +-
src/bhyve/bhyve_monitor.c                     |   6 +-
src/bhyve/bhyve_parse_command.c               |  17 +-
src/bhyve/bhyve_process.c                     |  20 +-
src/ch/ch_conf.c                              |   2 +-
src/ch/ch_domain.c                            |   4 +-
src/ch/ch_driver.c                            |  20 +-
src/ch/ch_monitor.c                           |  27 +-
src/ch/ch_process.c                           |   6 +-
src/conf/backup_conf.c                        |  16 +-
src/conf/capabilities.c                       |  21 +-
src/conf/checkpoint_conf.c                    |   8 +-
src/conf/cpu_conf.c                           |  46 +-
src/conf/device_conf.c                        |   2 +-
src/conf/domain_addr.c                        |  79 +-
src/conf/domain_capabilities.c                |   3 +-
src/conf/domain_conf.c                        | 874 ++++++++----------
src/conf/domain_event.c                       |   4 +-
src/conf/domain_postparse.c                   |  30 +-
src/conf/domain_validate.c                    | 138 ++-
src/conf/interface_conf.c                     |  17 +-
src/conf/netdev_bandwidth_conf.c              |  10 +-
src/conf/netdev_vlan_conf.c                   |  10 +-
src/conf/netdev_vport_profile_conf.c          |   2 +-
src/conf/network_conf.c                       | 367 +++-----
src/conf/networkcommon_conf.c                 |  64 +-
src/conf/node_device_conf.c                   | 178 ++--
src/conf/node_device_util.c                   |   6 +-
src/conf/numa_conf.c                          |  67 +-
src/conf/nwfilter_conf.c                      |  23 +-
src/conf/nwfilter_params.c                    |  25 +-
src/conf/object_event.c                       |  10 +-
src/conf/secret_conf.c                        |   8 +-
src/conf/snapshot_conf.c                      |  45 +-
src/conf/storage_adapter_conf.c               |   6 +-
src/conf/storage_conf.c                       |  26 +-
src/conf/storage_encryption_conf.c            |   4 +-
src/conf/storage_source_conf.c                |  15 +-
src/conf/virchrdev.c                          |  13 +-
src/conf/virdomainjob.c                       |  25 +-
src/conf/virdomainmomentobjlist.c             |   8 +-
src/conf/virdomainobjlist.c                   |  18 +-
src/conf/virnetworkobj.c                      |  24 +-
src/conf/virnetworkportdef.c                  |  14 +-
src/conf/virnodedeviceobj.c                   |   9 +-
src/conf/virnwfilterbindingdef.c              |   4 +-
src/conf/virnwfilterbindingobj.c              |   4 +-
src/conf/virnwfilterbindingobjlist.c          |   8 +-
src/conf/virnwfilterobj.c                     |  12 +-
src/conf/virsecretobj.c                       |  22 +-
src/conf/virstorageobj.c                      |  22 +-
src/cpu/cpu.c                                 |  40 +-
src/cpu/cpu_arm.c                             |  23 +-
src/cpu/cpu_map.c                             |   6 +-
src/cpu/cpu_ppc64.c                           |  33 +-
src/cpu/cpu_s390.c                            |   5 +-
src/cpu/cpu_x86.c                             |  68 +-
src/driver.c                                  |   6 +-
src/esx/esx_driver.c                          | 106 +--
src/esx/esx_network_driver.c                  |  21 +-
src/esx/esx_storage_backend_iscsi.c           |   6 +-
src/esx/esx_storage_backend_vmfs.c            |  32 +-
src/esx/esx_storage_driver.c                  |   8 +-
src/esx/esx_stream.c                          |   4 +-
src/esx/esx_util.c                            |  29 +-
src/esx/esx_vi.c                              | 189 ++--
src/esx/esx_vi_types.c                        |  48 +-
src/hyperv/hyperv_driver.c                    |  46 +-
src/hyperv/hyperv_network_driver.c            |   4 +-
src/hyperv/hyperv_util.c                      |   3 +-
src/hyperv/hyperv_wmi.c                       |  43 +-
src/hypervisor/domain_cgroup.c                |   4 +-
src/hypervisor/domain_driver.c                |  20 +-
src/hypervisor/virhostdev.c                   |  53 +-
src/interface/interface_backend_netcf.c       |  50 +-
src/interface/interface_backend_udev.c        | 100 +-
src/internal.h                                |  20 +-
src/libvirt-domain.c                          |  44 +-
src/libvirt-host.c                            |   6 +-
src/libvirt-lxc.c                             |  11 +-
src/libvirt-network.c                         |   8 +-
src/libvirt-nodedev.c                         |   4 +-
src/libvirt-nwfilter.c                        |   2 +-
src/libvirt-qemu.c                            |   4 +-
src/libvirt-secret.c                          |   6 +-
src/libvirt-storage.c                         |  13 +-
src/libvirt.c                                 |  24 +-
src/libxl/libxl_capabilities.c                |   2 +-
src/libxl/libxl_conf.c                        |  61 +-
src/libxl/libxl_domain.c                      |  24 +-
src/libxl/libxl_driver.c                      | 215 +++--
src/libxl/libxl_migration.c                   |   6 +-
src/libxl/xen_common.c                        |  72 +-
src/libxl/xen_xl.c                            |  28 +-
src/libxl/xen_xm.c                            |   4 +-
src/locking/lock_daemon.c                     |  26 +-
src/locking/lock_daemon_dispatch.c            |  10 +-
src/locking/lock_driver_lockd.c               |  12 +-
src/locking/lock_driver_sanlock.c             |  94 +-
src/locking/lock_manager.c                    |   8 +-
src/locking/sanlock_helper.c                  |   6 +-
src/logging/log_cleaner.c                     |   2 +-
src/logging/log_daemon.c                      |  26 +-
src/logging/log_daemon_dispatch.c             |   2 +-
src/logging/log_handler.c                     |   4 +-
src/lxc/lxc_cgroup.c                          |   2 +-
src/lxc/lxc_container.c                       | 114 +--
src/lxc/lxc_controller.c                      |  78 +-
src/lxc/lxc_domain.c                          |   8 +-
src/lxc/lxc_driver.c                          | 104 +--
src/lxc/lxc_fuse.c                            |   4 +-
src/lxc/lxc_hostdev.c                         |   6 +-
src/lxc/lxc_native.c                          |  26 +-
src/lxc/lxc_process.c                         |  38 +-
src/network/bridge_driver.c                   | 188 ++--
src/network/bridge_driver_conf.c              |   2 +-
src/network/bridge_driver_linux.c             |  12 +-
src/network/leaseshelper.c                    |  12 +-
src/node_device/node_device_driver.c          |  37 +-
src/node_device/node_device_udev.c            |  49 +-
src/nwfilter/nwfilter_dhcpsnoop.c             |  67 +-
src/nwfilter/nwfilter_driver.c                |  18 +-
src/nwfilter/nwfilter_ebiptables_driver.c     |  16 +-
src/nwfilter/nwfilter_gentech_driver.c        |  19 +-
src/nwfilter/nwfilter_learnipaddr.c           |   9 +-
src/openvz/openvz_conf.c                      |  29 +-
src/openvz/openvz_driver.c                    |  43 +-
src/qemu/qemu_agent.c                         |  41 +-
src/qemu/qemu_backup.c                        |  12 +-
src/qemu/qemu_block.c                         |  39 +-
src/qemu/qemu_blockjob.c                      |   2 +-
src/qemu/qemu_capabilities.c                  |  50 +-
src/qemu/qemu_cgroup.c                        |   4 +-
src/qemu/qemu_checkpoint.c                    |  19 +-
src/qemu/qemu_command.c                       |  82 +-
src/qemu/qemu_conf.c                          |  75 +-
src/qemu/qemu_dbus.c                          |  12 +-
src/qemu/qemu_domain.c                        | 188 ++--
src/qemu/qemu_domain_address.c                |  26 +-
src/qemu/qemu_domainjob.c                     |   6 +-
src/qemu/qemu_driver.c                        | 428 ++++-----
src/qemu/qemu_extdevice.c                     |   2 +-
src/qemu/qemu_fd.c                            |   2 +-
src/qemu/qemu_firmware.c                      |  42 +-
src/qemu/qemu_hotplug.c                       | 160 ++--
src/qemu/qemu_interface.c                     |   6 +-
src/qemu/qemu_interop_config.c                |   4 +-
src/qemu/qemu_migration.c                     | 105 ++-
src/qemu/qemu_migration_cookie.c              |  34 +-
src/qemu/qemu_migration_params.c              |  18 +-
src/qemu/qemu_monitor.c                       |  30 +-
src/qemu/qemu_monitor_json.c                  |  91 +-
src/qemu/qemu_monitor_text.c                  |   4 +-
src/qemu/qemu_namespace.c                     |  46 +-
src/qemu/qemu_passt.c                         |   2 +-
src/qemu/qemu_process.c                       | 116 ++-
src/qemu/qemu_qapi.c                          |   4 +-
src/qemu/qemu_saveimage.c                     |  30 +-
src/qemu/qemu_slirp.c                         |   6 +-
src/qemu/qemu_snapshot.c                      |  78 +-
src/qemu/qemu_tpm.c                           |  29 +-
src/qemu/qemu_validate.c                      | 317 +++----
src/qemu/qemu_vhost_user.c                    |   8 +-
src/qemu/qemu_vhost_user_gpu.c                |   2 +-
src/qemu/qemu_virtiofs.c                      |  10 +-
src/remote/remote_daemon.c                    |  20 +-
src/remote/remote_daemon_config.c             |   4 +-
src/remote/remote_daemon_dispatch.c           |  75 +-
src/remote/remote_daemon_stream.c             |   4 +-
src/remote/remote_driver.c                    |  88 +-
src/remote/remote_sockets.c                   |   5 +-
src/remote/remote_ssh_helper.c                |  16 +-
src/rpc/gendispatch.pl                        |  10 +-
src/rpc/virkeepalive.c                        |   2 +-
src/rpc/virnetclient.c                        |   4 +-
src/rpc/virnetclientprogram.c                 |  26 +-
src/rpc/virnetclientstream.c                  |   6 +-
src/rpc/virnetdaemon.c                        |   6 +-
src/rpc/virnetlibsshsession.c                 |  57 +-
src/rpc/virnetmessage.c                       |  21 +-
src/rpc/virnetsaslcontext.c                   |  38 +-
src/rpc/virnetserver.c                        |   2 +-
src/rpc/virnetserverclient.c                  |   4 +-
src/rpc/virnetserverprogram.c                 |  12 +-
src/rpc/virnetsocket.c                        |  42 +-
src/rpc/virnetsshsession.c                    |  59 +-
src/rpc/virnettlscontext.c                    |  78 +-
src/secret/secret_driver.c                    |  13 +-
src/security/security_apparmor.c              |  37 +-
src/security/security_dac.c                   |  28 +-
src/security/security_driver.c                |   4 +-
src/security/security_manager.c               |   6 +-
src/security/security_selinux.c               | 114 +--
src/security/security_util.c                  |  16 +-
src/security/virt-aa-helper.c                 |  10 +-
src/storage/parthelper.c                      |   6 +-
src/storage/storage_backend.c                 |   4 +-
src/storage/storage_backend_disk.c            |  20 +-
src/storage/storage_backend_fs.c              |  15 +-
src/storage/storage_backend_gluster.c         |  31 +-
src/storage/storage_backend_iscsi.c           |   6 +-
src/storage/storage_backend_iscsi_direct.c    |  44 +-
src/storage/storage_backend_logical.c         |  19 +-
src/storage/storage_backend_mpath.c           |   2 +-
src/storage/storage_backend_rbd.c             |  87 +-
src/storage/storage_backend_scsi.c            |  17 +-
src/storage/storage_backend_vstorage.c        |   2 +-
src/storage/storage_driver.c                  | 126 +--
src/storage/storage_util.c                    | 176 ++--
src/storage_file/storage_file_backend.c       |   8 +-
src/storage_file/storage_file_backend_fs.c    |   6 +-
.../storage_file_backend_gluster.c            |  16 +-
src/storage_file/storage_file_probe.c         |  13 +-
src/storage_file/storage_source.c             |  36 +-
.../storage_source_backingstore.c             |  47 +-
src/test/test_driver.c                        | 161 ++--
src/util/iohelper.c                           |  10 +-
src/util/viralloc.c                           |   2 +-
src/util/virauth.c                            |   6 +-
src/util/virauthconfig.c                      |   4 +-
src/util/virbitmap.c                          |   4 +-
src/util/virccw.c                             |   2 +-
src/util/vircgroup.c                          |  42 +-
src/util/vircgroupbackend.c                   |   2 +-
src/util/vircgroupbackend.h                   |   4 +-
src/util/vircgroupv1.c                        |  78 +-
src/util/vircgroupv2.c                        |  80 +-
src/util/vircgroupv2devices.c                 |   4 +-
src/util/vircommand.c                         |  38 +-
src/util/virconf.c                            |  40 +-
src/util/vircrypto.c                          |  14 +-
src/util/virdaemon.c                          |   8 +-
src/util/virdevmapper.c                       |   8 +-
src/util/virdnsmasq.c                         |  15 +-
src/util/virerror.c                           | 212 ++---
src/util/virerror.h                           |  14 +-
src/util/vireventthread.c                     |   2 +-
src/util/virfdstream.c                        |  30 +-
src/util/virfile.c                            | 184 ++--
src/util/virfilecache.c                       |   4 +-
src/util/virfirewall.c                        |   4 +-
src/util/virfirewalld.c                       |   6 +-
src/util/virfirmware.c                        |   4 +-
src/util/virgdbus.c                           |   4 +-
src/util/virhash.c                            |   2 +-
src/util/virhook.c                            |   4 +-
src/util/virhostcpu.c                         |  36 +-
src/util/virhostmem.c                         |  32 +-
src/util/virhostuptime.c                      |   4 +-
src/util/viridentity.c                        |  16 +-
src/util/virinitctl.c                         |   6 +-
src/util/viriptables.c                        |   2 +-
src/util/viriscsi.c                           |  16 +-
src/util/virjson.c                            |  24 +-
src/util/virlease.c                           |   4 +-
src/util/virlockspace.c                       |  34 +-
src/util/virlog.c                             |  28 +-
src/util/virmacmap.c                          |   6 +-
src/util/virmdev.c                            |  18 +-
src/util/virmodule.c                          |  10 +-
src/util/virnetdev.c                          | 145 ++-
src/util/virnetdevbandwidth.c                 |   7 +-
src/util/virnetdevbridge.c                    |  64 +-
src/util/virnetdevip.c                        |  28 +-
src/util/virnetdevmacvlan.c                   |   4 +-
src/util/virnetdevmidonet.c                   |   4 +-
src/util/virnetdevopenvswitch.c               |  28 +-
src/util/virnetdevtap.c                       |  24 +-
src/util/virnetdevveth.c                      |   4 +-
src/util/virnetdevvportprofile.c              |  39 +-
src/util/virnetlink.c                         |  14 +-
src/util/virnodesuspend.c                     |   2 +-
src/util/virnuma.c                            |  26 +-
src/util/virnvme.c                            |   6 +-
src/util/virobject.c                          |   6 +-
src/util/virpci.c                             | 108 +--
src/util/virperf.c                            |   8 +-
src/util/virpidfile.c                         |  14 +-
src/util/virpolkit.c                          |   2 +-
src/util/virportallocator.c                   |  10 +-
src/util/virprocess.c                         |  61 +-
src/util/virrandom.c                          |   2 +-
src/util/virresctrl.c                         |  86 +-
src/util/virrotatingfile.c                    |  30 +-
src/util/virscsi.c                            |   6 +-
src/util/virscsihost.c                        |   7 +-
src/util/virscsivhost.c                       |   6 +-
src/util/virsecret.c                          |   5 +-
src/util/virsocketaddr.c                      |  51 +-
src/util/virstoragefile.c                     |   2 +-
src/util/virstring.c                          |   8 +-
src/util/virsysinfo.c                         |  16 +-
src/util/virsystemd.c                         |   2 +-
src/util/virthreadjob.c                       |   4 +-
src/util/virtpm.c                             |  10 +-
src/util/virtypedparam-public.c               |  25 +-
src/util/virtypedparam.c                      |  29 +-
src/util/viruri.c                             |  11 +-
src/util/virusb.c                             |  16 +-
src/util/virutil.c                            |  35 +-
src/util/virvhba.c                            |   7 +-
src/util/virxml.c                             |  72 +-
src/vbox/vbox_XPCOMCGlue.c                    |   6 +-
src/vbox/vbox_common.c                        | 157 ++--
src/vbox/vbox_network.c                       |   2 +-
src/vbox/vbox_snapshot_conf.c                 |  12 +-
src/vbox/vbox_storage.c                       |  20 +-
src/vbox/vbox_tmpl.c                          |  16 +-
src/vmware/vmware_conf.c                      |  16 +-
src/vmware/vmware_driver.c                    |  26 +-
src/vmx/vmx.c                                 | 264 +++---
src/vz/vz_driver.c                            |  32 +-
src/vz/vz_sdk.c                               |  74 +-
src/vz/vz_utils.c                             |  31 +-
src/vz/vz_utils.h                             |   2 +-
tests/virerrortest.c                          |   7 +-
tools/virsh-checkpoint.c                      |  28 +-
tools/virsh-domain-event.c                    |  65 +-
tools/virsh-domain-monitor.c                  |  24 +-
tools/virsh-domain.c                          | 312 +++----
tools/virsh-edit.c                            |   2 +-
tools/virsh-host.c                            |  46 +-
tools/virsh-interface.c                       |  84 +-
tools/virsh-network.c                         |  71 +-
tools/virsh-nodedev.c                         |  62 +-
tools/virsh-nwfilter.c                        |  27 +-
tools/virsh-pool.c                            |  72 +-
tools/virsh-secret.c                          |  22 +-
tools/virsh-snapshot.c                        |  46 +-
tools/virsh-util.c                            |   2 +-
tools/virsh-volume.c                          |  78 +-
tools/virsh.c                                 |  40 +-
tools/virt-admin.c                            |  54 +-
tools/virt-host-validate-bhyve.c              |   4 +-
tools/virt-host-validate-common.c             |   4 +-
tools/virt-host-validate.c                    |   8 +-
tools/virt-login-shell-helper.c               |  22 +-
tools/virt-pki-query-dn.c                     |  12 +-
tools/vsh.c                                   | 138 ++-
tools/vsh.h                                   |   6 +-
352 files changed, 6145 insertions(+), 6762 deletions(-)
create mode 100755 scripts/check-pot.py
[libvirt PATCH 00/51] Use permutable format strings in translations
Posted by Jiri Denemark 1 week, 5 days ago
See 01/51 for rationale. Enforced by the last two patches of this
series. The rest is quite boring mechanical update, partially done using
a perl oneliner

    perl -pe 'for (my $i=1; $i<=12; $i++) { s/(N?_\("[^"]*?%)([^%$ ]*[a-zA-Z][^"]*")/\1$i\$\2/; }'

and tuned manually to fix cases not covered by the regexp above and to
merge multiline messages into a single line. I merged only those that
were touched anyway. Some very long messages consisting of several
sentences were merged only partially and split on sentence boundary.

I will also update libvirt.pot once this is pushed.

Also available via

    git fetch git@gitlab.com:jirkade/libvirt.git format-strings

Jiri Denemark (51):
  docs: Document requirements on format strings in translated messages
  access: Update format strings in translated messages
  admin: Update format strings in translated messages
  bhyve: Update format strings in translated messages
  ch: Update format strings in translated messages
  conf/domain_conf: Update format strings in translated messages
  conf/domain_validate: Update format strings in translated messages
  conf/network_conf: Update format strings in translated messages
  conf/node_device_conf: Update format strings in translated messages
  conf: Update format strings in translated messages
  cpu: Update format strings in translated messages
  esx: Update format strings in translated messages
  hyperv: Update format strings in translated messages
  hypervisor: Update format strings in translated messages
  interface: Update format strings in translated messages
  libxl: Update format strings in translated messages
  locking: Update format strings in translated messages
  logging: Update format strings in translated messages
  lxc: Update format strings in translated messages
  network: Update format strings in translated messages
  node_device: Update format strings in translated messages
  nwfilter: Update format strings in translated messages
  openvz: Update format strings in translated messages
  qemu/qemu_command: Update format strings in translated messages
  qemu/qemu_domain: Update format strings in translated messages
  qemu/qemu_driver: Update format strings in translated messages
  qemu/qemu_hotplug: Update format strings in translated messages
  qemu/qemu_migration: Update format strings in translated messages
  qemu/qemu_monitor_json: Update format strings in translated messages
  qemu/qemu_process: Update format strings in translated messages
  qemu/qemu_validate: Update format strings in translated messages
  qemu: Update format strings in translated messages
  remote: Update format strings in translated messages
  rpc: Update format strings in translated messages
  security: Update format strings in translated messages
  secret: Update format strings in translated messages
  storage: Update format strings in translated messages
  storage_file: Update format strings in translated messages
  test: Update format strings in translated messages
  util: Update format strings in translated messages (part 1)
  util: Update format strings in translated messages (part 2)
  util: Update format strings in translated messages (part 3)
  vbox: Update format strings in translated messages
  vmware: Update format strings in translated messages
  vmx: Update format strings in translated messages
  vz: Update format strings in translated messages
  src: Update format strings in translated messages
  tools: Update format strings in translated messages (part 1)
  tools: Update format strings in translated messages (part 2)
  build: Add checks for permutable format strings
  ci: Run libvirt-pot-check in potfile job

 .gitlab-ci.yml                                |   1 +
 build-aux/syntax-check.mk                     |   5 +
 docs/coding-style.rst                         |  20 +-
 po/meson.build                                |   8 +
 scripts/check-pot.py                          |  54 ++
 src/access/viraccessdriverpolkit.c            |   2 +-
 src/access/viraccessmanager.c                 |   4 +-
 src/admin/admin_server_dispatch.c             |  10 +-
 src/admin/libvirt-admin.c                     |   6 +-
 src/bhyve/bhyve_command.c                     |  18 +-
 src/bhyve/bhyve_domain.c                      |   2 +-
 src/bhyve/bhyve_driver.c                      |  38 +-
 src/bhyve/bhyve_firmware.c                    |   4 +-
 src/bhyve/bhyve_monitor.c                     |   6 +-
 src/bhyve/bhyve_parse_command.c               |  17 +-
 src/bhyve/bhyve_process.c                     |  20 +-
 src/ch/ch_conf.c                              |   2 +-
 src/ch/ch_domain.c                            |   4 +-
 src/ch/ch_driver.c                            |  20 +-
 src/ch/ch_monitor.c                           |  27 +-
 src/ch/ch_process.c                           |   6 +-
 src/conf/backup_conf.c                        |  16 +-
 src/conf/capabilities.c                       |  21 +-
 src/conf/checkpoint_conf.c                    |   8 +-
 src/conf/cpu_conf.c                           |  46 +-
 src/conf/device_conf.c                        |   2 +-
 src/conf/domain_addr.c                        |  79 +-
 src/conf/domain_capabilities.c                |   3 +-
 src/conf/domain_conf.c                        | 874 ++++++++----------
 src/conf/domain_event.c                       |   4 +-
 src/conf/domain_postparse.c                   |  30 +-
 src/conf/domain_validate.c                    | 138 ++-
 src/conf/interface_conf.c                     |  17 +-
 src/conf/netdev_bandwidth_conf.c              |  10 +-
 src/conf/netdev_vlan_conf.c                   |  10 +-
 src/conf/netdev_vport_profile_conf.c          |   2 +-
 src/conf/network_conf.c                       | 367 +++-----
 src/conf/networkcommon_conf.c                 |  64 +-
 src/conf/node_device_conf.c                   | 178 ++--
 src/conf/node_device_util.c                   |   6 +-
 src/conf/numa_conf.c                          |  67 +-
 src/conf/nwfilter_conf.c                      |  23 +-
 src/conf/nwfilter_params.c                    |  25 +-
 src/conf/object_event.c                       |  10 +-
 src/conf/secret_conf.c                        |   8 +-
 src/conf/snapshot_conf.c                      |  45 +-
 src/conf/storage_adapter_conf.c               |   6 +-
 src/conf/storage_conf.c                       |  26 +-
 src/conf/storage_encryption_conf.c            |   4 +-
 src/conf/storage_source_conf.c                |  15 +-
 src/conf/virchrdev.c                          |  13 +-
 src/conf/virdomainjob.c                       |  25 +-
 src/conf/virdomainmomentobjlist.c             |   8 +-
 src/conf/virdomainobjlist.c                   |  18 +-
 src/conf/virnetworkobj.c                      |  24 +-
 src/conf/virnetworkportdef.c                  |  14 +-
 src/conf/virnodedeviceobj.c                   |   9 +-
 src/conf/virnwfilterbindingdef.c              |   4 +-
 src/conf/virnwfilterbindingobj.c              |   4 +-
 src/conf/virnwfilterbindingobjlist.c          |   8 +-
 src/conf/virnwfilterobj.c                     |  12 +-
 src/conf/virsecretobj.c                       |  22 +-
 src/conf/virstorageobj.c                      |  22 +-
 src/cpu/cpu.c                                 |  40 +-
 src/cpu/cpu_arm.c                             |  23 +-
 src/cpu/cpu_map.c                             |   6 +-
 src/cpu/cpu_ppc64.c                           |  33 +-
 src/cpu/cpu_s390.c                            |   5 +-
 src/cpu/cpu_x86.c                             |  68 +-
 src/driver.c                                  |   6 +-
 src/esx/esx_driver.c                          | 106 +--
 src/esx/esx_network_driver.c                  |  21 +-
 src/esx/esx_storage_backend_iscsi.c           |   6 +-
 src/esx/esx_storage_backend_vmfs.c            |  32 +-
 src/esx/esx_storage_driver.c                  |   8 +-
 src/esx/esx_stream.c                          |   4 +-
 src/esx/esx_util.c                            |  29 +-
 src/esx/esx_vi.c                              | 189 ++--
 src/esx/esx_vi_types.c                        |  48 +-
 src/hyperv/hyperv_driver.c                    |  46 +-
 src/hyperv/hyperv_network_driver.c            |   4 +-
 src/hyperv/hyperv_util.c                      |   3 +-
 src/hyperv/hyperv_wmi.c                       |  43 +-
 src/hypervisor/domain_cgroup.c                |   4 +-
 src/hypervisor/domain_driver.c                |  20 +-
 src/hypervisor/virhostdev.c                   |  53 +-
 src/interface/interface_backend_netcf.c       |  50 +-
 src/interface/interface_backend_udev.c        | 100 +-
 src/internal.h                                |  20 +-
 src/libvirt-domain.c                          |  44 +-
 src/libvirt-host.c                            |   6 +-
 src/libvirt-lxc.c                             |  11 +-
 src/libvirt-network.c                         |   8 +-
 src/libvirt-nodedev.c                         |   4 +-
 src/libvirt-nwfilter.c                        |   2 +-
 src/libvirt-qemu.c                            |   4 +-
 src/libvirt-secret.c                          |   6 +-
 src/libvirt-storage.c                         |  13 +-
 src/libvirt.c                                 |  24 +-
 src/libxl/libxl_capabilities.c                |   2 +-
 src/libxl/libxl_conf.c                        |  61 +-
 src/libxl/libxl_domain.c                      |  24 +-
 src/libxl/libxl_driver.c                      | 215 +++--
 src/libxl/libxl_migration.c                   |   6 +-
 src/libxl/xen_common.c                        |  72 +-
 src/libxl/xen_xl.c                            |  28 +-
 src/libxl/xen_xm.c                            |   4 +-
 src/locking/lock_daemon.c                     |  26 +-
 src/locking/lock_daemon_dispatch.c            |  10 +-
 src/locking/lock_driver_lockd.c               |  12 +-
 src/locking/lock_driver_sanlock.c             |  94 +-
 src/locking/lock_manager.c                    |   8 +-
 src/locking/sanlock_helper.c                  |   6 +-
 src/logging/log_cleaner.c                     |   2 +-
 src/logging/log_daemon.c                      |  26 +-
 src/logging/log_daemon_dispatch.c             |   2 +-
 src/logging/log_handler.c                     |   4 +-
 src/lxc/lxc_cgroup.c                          |   2 +-
 src/lxc/lxc_container.c                       | 114 +--
 src/lxc/lxc_controller.c                      |  78 +-
 src/lxc/lxc_domain.c                          |   8 +-
 src/lxc/lxc_driver.c                          | 104 +--
 src/lxc/lxc_fuse.c                            |   4 +-
 src/lxc/lxc_hostdev.c                         |   6 +-
 src/lxc/lxc_native.c                          |  26 +-
 src/lxc/lxc_process.c                         |  38 +-
 src/network/bridge_driver.c                   | 188 ++--
 src/network/bridge_driver_conf.c              |   2 +-
 src/network/bridge_driver_linux.c             |  12 +-
 src/network/leaseshelper.c                    |  12 +-
 src/node_device/node_device_driver.c          |  37 +-
 src/node_device/node_device_udev.c            |  49 +-
 src/nwfilter/nwfilter_dhcpsnoop.c             |  67 +-
 src/nwfilter/nwfilter_driver.c                |  18 +-
 src/nwfilter/nwfilter_ebiptables_driver.c     |  16 +-
 src/nwfilter/nwfilter_gentech_driver.c        |  19 +-
 src/nwfilter/nwfilter_learnipaddr.c           |   9 +-
 src/openvz/openvz_conf.c                      |  29 +-
 src/openvz/openvz_driver.c                    |  43 +-
 src/qemu/qemu_agent.c                         |  41 +-
 src/qemu/qemu_backup.c                        |  12 +-
 src/qemu/qemu_block.c                         |  39 +-
 src/qemu/qemu_blockjob.c                      |   2 +-
 src/qemu/qemu_capabilities.c                  |  50 +-
 src/qemu/qemu_cgroup.c                        |   4 +-
 src/qemu/qemu_checkpoint.c                    |  19 +-
 src/qemu/qemu_command.c                       |  82 +-
 src/qemu/qemu_conf.c                          |  75 +-
 src/qemu/qemu_dbus.c                          |  12 +-
 src/qemu/qemu_domain.c                        | 188 ++--
 src/qemu/qemu_domain_address.c                |  26 +-
 src/qemu/qemu_domainjob.c                     |   6 +-
 src/qemu/qemu_driver.c                        | 428 ++++-----
 src/qemu/qemu_extdevice.c                     |   2 +-
 src/qemu/qemu_fd.c                            |   2 +-
 src/qemu/qemu_firmware.c                      |  42 +-
 src/qemu/qemu_hotplug.c                       | 160 ++--
 src/qemu/qemu_interface.c                     |   6 +-
 src/qemu/qemu_interop_config.c                |   4 +-
 src/qemu/qemu_migration.c                     | 105 ++-
 src/qemu/qemu_migration_cookie.c              |  34 +-
 src/qemu/qemu_migration_params.c              |  18 +-
 src/qemu/qemu_monitor.c                       |  30 +-
 src/qemu/qemu_monitor_json.c                  |  91 +-
 src/qemu/qemu_monitor_text.c                  |   4 +-
 src/qemu/qemu_namespace.c                     |  46 +-
 src/qemu/qemu_passt.c                         |   2 +-
 src/qemu/qemu_process.c                       | 116 ++-
 src/qemu/qemu_qapi.c                          |   4 +-
 src/qemu/qemu_saveimage.c                     |  30 +-
 src/qemu/qemu_slirp.c                         |   6 +-
 src/qemu/qemu_snapshot.c                      |  78 +-
 src/qemu/qemu_tpm.c                           |  29 +-
 src/qemu/qemu_validate.c                      | 317 +++----
 src/qemu/qemu_vhost_user.c                    |   8 +-
 src/qemu/qemu_vhost_user_gpu.c                |   2 +-
 src/qemu/qemu_virtiofs.c                      |  10 +-
 src/remote/remote_daemon.c                    |  20 +-
 src/remote/remote_daemon_config.c             |   4 +-
 src/remote/remote_daemon_dispatch.c           |  75 +-
 src/remote/remote_daemon_stream.c             |   4 +-
 src/remote/remote_driver.c                    |  88 +-
 src/remote/remote_sockets.c                   |   5 +-
 src/remote/remote_ssh_helper.c                |  16 +-
 src/rpc/gendispatch.pl                        |  10 +-
 src/rpc/virkeepalive.c                        |   2 +-
 src/rpc/virnetclient.c                        |   4 +-
 src/rpc/virnetclientprogram.c                 |  26 +-
 src/rpc/virnetclientstream.c                  |   6 +-
 src/rpc/virnetdaemon.c                        |   6 +-
 src/rpc/virnetlibsshsession.c                 |  57 +-
 src/rpc/virnetmessage.c                       |  21 +-
 src/rpc/virnetsaslcontext.c                   |  38 +-
 src/rpc/virnetserver.c                        |   2 +-
 src/rpc/virnetserverclient.c                  |   4 +-
 src/rpc/virnetserverprogram.c                 |  12 +-
 src/rpc/virnetsocket.c                        |  42 +-
 src/rpc/virnetsshsession.c                    |  59 +-
 src/rpc/virnettlscontext.c                    |  78 +-
 src/secret/secret_driver.c                    |  13 +-
 src/security/security_apparmor.c              |  37 +-
 src/security/security_dac.c                   |  28 +-
 src/security/security_driver.c                |   4 +-
 src/security/security_manager.c               |   6 +-
 src/security/security_selinux.c               | 114 +--
 src/security/security_util.c                  |  16 +-
 src/security/virt-aa-helper.c                 |  10 +-
 src/storage/parthelper.c                      |   6 +-
 src/storage/storage_backend.c                 |   4 +-
 src/storage/storage_backend_disk.c            |  20 +-
 src/storage/storage_backend_fs.c              |  15 +-
 src/storage/storage_backend_gluster.c         |  31 +-
 src/storage/storage_backend_iscsi.c           |   6 +-
 src/storage/storage_backend_iscsi_direct.c    |  44 +-
 src/storage/storage_backend_logical.c         |  19 +-
 src/storage/storage_backend_mpath.c           |   2 +-
 src/storage/storage_backend_rbd.c             |  87 +-
 src/storage/storage_backend_scsi.c            |  17 +-
 src/storage/storage_backend_vstorage.c        |   2 +-
 src/storage/storage_driver.c                  | 126 +--
 src/storage/storage_util.c                    | 176 ++--
 src/storage_file/storage_file_backend.c       |   8 +-
 src/storage_file/storage_file_backend_fs.c    |   6 +-
 .../storage_file_backend_gluster.c            |  16 +-
 src/storage_file/storage_file_probe.c         |  13 +-
 src/storage_file/storage_source.c             |  36 +-
 .../storage_source_backingstore.c             |  47 +-
 src/test/test_driver.c                        | 161 ++--
 src/util/iohelper.c                           |  10 +-
 src/util/viralloc.c                           |   2 +-
 src/util/virauth.c                            |   6 +-
 src/util/virauthconfig.c                      |   4 +-
 src/util/virbitmap.c                          |   4 +-
 src/util/virccw.c                             |   2 +-
 src/util/vircgroup.c                          |  42 +-
 src/util/vircgroupbackend.c                   |   2 +-
 src/util/vircgroupbackend.h                   |   4 +-
 src/util/vircgroupv1.c                        |  78 +-
 src/util/vircgroupv2.c                        |  80 +-
 src/util/vircgroupv2devices.c                 |   4 +-
 src/util/vircommand.c                         |  38 +-
 src/util/virconf.c                            |  40 +-
 src/util/vircrypto.c                          |  14 +-
 src/util/virdaemon.c                          |   8 +-
 src/util/virdevmapper.c                       |   8 +-
 src/util/virdnsmasq.c                         |  15 +-
 src/util/virerror.c                           | 212 ++---
 src/util/virerror.h                           |  14 +-
 src/util/vireventthread.c                     |   2 +-
 src/util/virfdstream.c                        |  30 +-
 src/util/virfile.c                            | 184 ++--
 src/util/virfilecache.c                       |   4 +-
 src/util/virfirewall.c                        |   4 +-
 src/util/virfirewalld.c                       |   6 +-
 src/util/virfirmware.c                        |   4 +-
 src/util/virgdbus.c                           |   4 +-
 src/util/virhash.c                            |   2 +-
 src/util/virhook.c                            |   4 +-
 src/util/virhostcpu.c                         |  36 +-
 src/util/virhostmem.c                         |  32 +-
 src/util/virhostuptime.c                      |   4 +-
 src/util/viridentity.c                        |  16 +-
 src/util/virinitctl.c                         |   6 +-
 src/util/viriptables.c                        |   2 +-
 src/util/viriscsi.c                           |  16 +-
 src/util/virjson.c                            |  24 +-
 src/util/virlease.c                           |   4 +-
 src/util/virlockspace.c                       |  34 +-
 src/util/virlog.c                             |  28 +-
 src/util/virmacmap.c                          |   6 +-
 src/util/virmdev.c                            |  18 +-
 src/util/virmodule.c                          |  10 +-
 src/util/virnetdev.c                          | 145 ++-
 src/util/virnetdevbandwidth.c                 |   7 +-
 src/util/virnetdevbridge.c                    |  64 +-
 src/util/virnetdevip.c                        |  28 +-
 src/util/virnetdevmacvlan.c                   |   4 +-
 src/util/virnetdevmidonet.c                   |   4 +-
 src/util/virnetdevopenvswitch.c               |  28 +-
 src/util/virnetdevtap.c                       |  24 +-
 src/util/virnetdevveth.c                      |   4 +-
 src/util/virnetdevvportprofile.c              |  39 +-
 src/util/virnetlink.c                         |  14 +-
 src/util/virnodesuspend.c                     |   2 +-
 src/util/virnuma.c                            |  26 +-
 src/util/virnvme.c                            |   6 +-
 src/util/virobject.c                          |   6 +-
 src/util/virpci.c                             | 108 +--
 src/util/virperf.c                            |   8 +-
 src/util/virpidfile.c                         |  14 +-
 src/util/virpolkit.c                          |   2 +-
 src/util/virportallocator.c                   |  10 +-
 src/util/virprocess.c                         |  61 +-
 src/util/virrandom.c                          |   2 +-
 src/util/virresctrl.c                         |  86 +-
 src/util/virrotatingfile.c                    |  30 +-
 src/util/virscsi.c                            |   6 +-
 src/util/virscsihost.c                        |   7 +-
 src/util/virscsivhost.c                       |   6 +-
 src/util/virsecret.c                          |   5 +-
 src/util/virsocketaddr.c                      |  51 +-
 src/util/virstoragefile.c                     |   2 +-
 src/util/virstring.c                          |   8 +-
 src/util/virsysinfo.c                         |  16 +-
 src/util/virsystemd.c                         |   2 +-
 src/util/virthreadjob.c                       |   4 +-
 src/util/virtpm.c                             |  10 +-
 src/util/virtypedparam-public.c               |  25 +-
 src/util/virtypedparam.c                      |  29 +-
 src/util/viruri.c                             |  11 +-
 src/util/virusb.c                             |  16 +-
 src/util/virutil.c                            |  35 +-
 src/util/virvhba.c                            |   7 +-
 src/util/virxml.c                             |  72 +-
 src/vbox/vbox_XPCOMCGlue.c                    |   6 +-
 src/vbox/vbox_common.c                        | 157 ++--
 src/vbox/vbox_network.c                       |   2 +-
 src/vbox/vbox_snapshot_conf.c                 |  12 +-
 src/vbox/vbox_storage.c                       |  20 +-
 src/vbox/vbox_tmpl.c                          |  16 +-
 src/vmware/vmware_conf.c                      |  16 +-
 src/vmware/vmware_driver.c                    |  26 +-
 src/vmx/vmx.c                                 | 264 +++---
 src/vz/vz_driver.c                            |  32 +-
 src/vz/vz_sdk.c                               |  74 +-
 src/vz/vz_utils.c                             |  31 +-
 src/vz/vz_utils.h                             |   2 +-
 tests/virerrortest.c                          |   7 +-
 tools/virsh-checkpoint.c                      |  28 +-
 tools/virsh-domain-event.c                    |  65 +-
 tools/virsh-domain-monitor.c                  |  24 +-
 tools/virsh-domain.c                          | 312 +++----
 tools/virsh-edit.c                            |   2 +-
 tools/virsh-host.c                            |  46 +-
 tools/virsh-interface.c                       |  84 +-
 tools/virsh-network.c                         |  71 +-
 tools/virsh-nodedev.c                         |  62 +-
 tools/virsh-nwfilter.c                        |  27 +-
 tools/virsh-pool.c                            |  72 +-
 tools/virsh-secret.c                          |  22 +-
 tools/virsh-snapshot.c                        |  46 +-
 tools/virsh-util.c                            |   2 +-
 tools/virsh-volume.c                          |  78 +-
 tools/virsh.c                                 |  40 +-
 tools/virt-admin.c                            |  54 +-
 tools/virt-host-validate-bhyve.c              |   4 +-
 tools/virt-host-validate-common.c             |   4 +-
 tools/virt-host-validate.c                    |   8 +-
 tools/virt-login-shell-helper.c               |  22 +-
 tools/virt-pki-query-dn.c                     |  12 +-
 tools/vsh.c                                   | 138 ++-
 tools/vsh.h                                   |   6 +-
 352 files changed, 6145 insertions(+), 6762 deletions(-)
 create mode 100755 scripts/check-pot.py

-- 
2.39.2
Re: [libvirt PATCH 00/51] Use permutable format strings in translations
Posted by Daniel P. Berrangé 1 week, 5 days ago
On Fri, Mar 10, 2023 at 05:09:16PM +0100, Jiri Denemark wrote:
> See 01/51 for rationale. Enforced by the last two patches of this
> series. The rest is quite boring mechanical update, partially done using
> a perl oneliner
> 
>     perl -pe 'for (my $i=1; $i<=12; $i++) { s/(N?_\("[^"]*?%)([^%$ ]*[a-zA-Z][^"]*")/\1$i\$\2/; }'
> 
> and tuned manually to fix cases not covered by the regexp above and to
> merge multiline messages into a single line. I merged only those that
> were touched anyway. Some very long messages consisting of several
> sentences were merged only partially and split on sentence boundary.
> 
> I will also update libvirt.pot once this is pushed.

Are we *100% sure* weblate is going to handle this intelligently.

This will change almost all of the msgid strings in libvirt.pot,
and translations are associatd with msgid strings.

IOW, this risks throwing all our translations away putting us back
to near zero translation coverage, unless weblate is intelligent
enough to map numbered format strings, to non-numbered format
strings, and I'm not convinced that it can do that.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Re: [libvirt PATCH 00/51] Use permutable format strings in translations
Posted by Jiri Denemark 1 week, 5 days ago
On Fri, Mar 10, 2023 at 16:14:00 +0000, Daniel P. Berrangé wrote:
> On Fri, Mar 10, 2023 at 05:09:16PM +0100, Jiri Denemark wrote:
> > See 01/51 for rationale. Enforced by the last two patches of this
> > series. The rest is quite boring mechanical update, partially done using
> > a perl oneliner
> > 
> >     perl -pe 'for (my $i=1; $i<=12; $i++) { s/(N?_\("[^"]*?%)([^%$ ]*[a-zA-Z][^"]*")/\1$i\$\2/; }'
> > 
> > and tuned manually to fix cases not covered by the regexp above and to
> > merge multiline messages into a single line. I merged only those that
> > were touched anyway. Some very long messages consisting of several
> > sentences were merged only partially and split on sentence boundary.
> > 
> > I will also update libvirt.pot once this is pushed.
> 
> Are we *100% sure* weblate is going to handle this intelligently.
> 
> This will change almost all of the msgid strings in libvirt.pot,
> and translations are associatd with msgid strings.
> 
> IOW, this risks throwing all our translations away putting us back
> to near zero translation coverage, unless weblate is intelligent
> enough to map numbered format strings, to non-numbered format
> strings, and I'm not convinced that it can do that.

I don't know is there a way to check this? Technically we should be able
to update the translations as well to make sure we don't lose any work
done by translators. But can that be pushed into weblate somehow (I
guess it must have some kind of import in case you do the translation in
a separate tool).

Jirka
Re: [libvirt PATCH 00/51] Use permutable format strings in translations
Posted by Ján Tomko 1 week, 5 days ago
On a Friday in 2023, Jiri Denemark wrote:
>On Fri, Mar 10, 2023 at 16:14:00 +0000, Daniel P. Berrangé wrote:
>> On Fri, Mar 10, 2023 at 05:09:16PM +0100, Jiri Denemark wrote:
>> > See 01/51 for rationale. Enforced by the last two patches of this
>> > series. The rest is quite boring mechanical update, partially done using
>> > a perl oneliner
>> >
>> >     perl -pe 'for (my $i=1; $i<=12; $i++) { s/(N?_\("[^"]*?%)([^%$ ]*[a-zA-Z][^"]*")/\1$i\$\2/; }'
>> >
>> > and tuned manually to fix cases not covered by the regexp above and to
>> > merge multiline messages into a single line. I merged only those that
>> > were touched anyway. Some very long messages consisting of several
>> > sentences were merged only partially and split on sentence boundary.
>> >
>> > I will also update libvirt.pot once this is pushed.
>>
>> Are we *100% sure* weblate is going to handle this intelligently.
>>
>> This will change almost all of the msgid strings in libvirt.pot,
>> and translations are associatd with msgid strings.
>>
>> IOW, this risks throwing all our translations away putting us back
>> to near zero translation coverage, unless weblate is intelligent
>> enough to map numbered format strings, to non-numbered format
>> strings, and I'm not convinced that it can do that.
>
>I don't know is there a way to check this?

We could change a small subset of the strings for a start. Preferably
those that are not likely to be exposed to users.

Jano

>Technically we should be able
>to update the translations as well to make sure we don't lose any work
>done by translators. But can that be pushed into weblate somehow (I
>guess it must have some kind of import in case you do the translation in
>a separate tool).
>
>Jirka
>
Re: [libvirt PATCH 00/51] Use permutable format strings in translations
Posted by Daniel P. Berrangé 1 week, 5 days ago
On Fri, Mar 10, 2023 at 05:17:21PM +0100, Jiri Denemark wrote:
> On Fri, Mar 10, 2023 at 16:14:00 +0000, Daniel P. Berrangé wrote:
> > On Fri, Mar 10, 2023 at 05:09:16PM +0100, Jiri Denemark wrote:
> > > See 01/51 for rationale. Enforced by the last two patches of this
> > > series. The rest is quite boring mechanical update, partially done using
> > > a perl oneliner
> > > 
> > >     perl -pe 'for (my $i=1; $i<=12; $i++) { s/(N?_\("[^"]*?%)([^%$ ]*[a-zA-Z][^"]*")/\1$i\$\2/; }'
> > > 
> > > and tuned manually to fix cases not covered by the regexp above and to
> > > merge multiline messages into a single line. I merged only those that
> > > were touched anyway. Some very long messages consisting of several
> > > sentences were merged only partially and split on sentence boundary.
> > > 
> > > I will also update libvirt.pot once this is pushed.
> > 
> > Are we *100% sure* weblate is going to handle this intelligently.
> > 
> > This will change almost all of the msgid strings in libvirt.pot,
> > and translations are associatd with msgid strings.
> > 
> > IOW, this risks throwing all our translations away putting us back
> > to near zero translation coverage, unless weblate is intelligent
> > enough to map numbered format strings, to non-numbered format
> > strings, and I'm not convinced that it can do that.
> 
> I don't know is there a way to check this? Technically we should be able
> to update the translations as well to make sure we don't lose any work
> done by translators. But can that be pushed into weblate somehow (I
> guess it must have some kind of import in case you do the translation in
> a separate tool).

Yes, there is a mechanism to import that I used when first setting
up weblate, but I can't remember exactly what it was now. I do
recall, however, that it was *immensely* slow and continually
pushed weblate into OOM death due to the large number of string
in libvirt.pot. Took me days to get everything imported :-(


Technically we should really not have to modify the .pot at all,
as it is valid to use numbered format strings in the translation
regardless of whether the .pot uses them.

The main downside is that weblates c-format check is broken so
will complain that the translation format is wrong, despite being
correct. 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

Re: [libvirt PATCH 00/51] Use permutable format strings in translations
Posted by Jiri Denemark 1 week, 5 days ago
On Fri, Mar 10, 2023 at 16:29:52 +0000, Daniel P. Berrangé wrote:
> On Fri, Mar 10, 2023 at 05:17:21PM +0100, Jiri Denemark wrote:
> > On Fri, Mar 10, 2023 at 16:14:00 +0000, Daniel P. Berrangé wrote:
> > > On Fri, Mar 10, 2023 at 05:09:16PM +0100, Jiri Denemark wrote:
> > > > See 01/51 for rationale. Enforced by the last two patches of this
> > > > series. The rest is quite boring mechanical update, partially done using
> > > > a perl oneliner
> > > > 
> > > >     perl -pe 'for (my $i=1; $i<=12; $i++) { s/(N?_\("[^"]*?%)([^%$ ]*[a-zA-Z][^"]*")/\1$i\$\2/; }'
> > > > 
> > > > and tuned manually to fix cases not covered by the regexp above and to
> > > > merge multiline messages into a single line. I merged only those that
> > > > were touched anyway. Some very long messages consisting of several
> > > > sentences were merged only partially and split on sentence boundary.
> > > > 
> > > > I will also update libvirt.pot once this is pushed.
> > > 
> > > Are we *100% sure* weblate is going to handle this intelligently.
> > > 
> > > This will change almost all of the msgid strings in libvirt.pot,
> > > and translations are associatd with msgid strings.
> > > 
> > > IOW, this risks throwing all our translations away putting us back
> > > to near zero translation coverage, unless weblate is intelligent
> > > enough to map numbered format strings, to non-numbered format
> > > strings, and I'm not convinced that it can do that.
> > 
> > I don't know is there a way to check this? Technically we should be able
> > to update the translations as well to make sure we don't lose any work
> > done by translators. But can that be pushed into weblate somehow (I
> > guess it must have some kind of import in case you do the translation in
> > a separate tool).
> 
> Yes, there is a mechanism to import that I used when first setting
> up weblate, but I can't remember exactly what it was now. I do
> recall, however, that it was *immensely* slow and continually
> pushed weblate into OOM death due to the large number of string
> in libvirt.pot. Took me days to get everything imported :-(
> 
> 
> Technically we should really not have to modify the .pot at all,
> as it is valid to use numbered format strings in the translation
> regardless of whether the .pot uses them.
> 
> The main downside is that weblates c-format check is broken so
> will complain that the translation format is wrong, despite being
> correct. 

Not sure whether the check is disabled by default, but it allows you to
use numbered format strings when msgid doesn't use it. The problem is
that translators cannot just copy&paste a format string to the right
place, they need to invent it. And sometimes they apparently use tools
that do not even allow using numbered format strings when they are not
present in msgid. Which then causes regressions as updates undoing the
correct formatting are pushed via weblate. Which is what happened just
now with https://gitlab.com/libvirt/libvirt/-/merge_requests/232

Jirka
Re: [libvirt PATCH 00/51] Use permutable format strings in translations
Posted by Daniel P. Berrangé 1 week, 5 days ago
On Fri, Mar 10, 2023 at 05:43:46PM +0100, Jiri Denemark wrote:
> On Fri, Mar 10, 2023 at 16:29:52 +0000, Daniel P. Berrangé wrote:
> > On Fri, Mar 10, 2023 at 05:17:21PM +0100, Jiri Denemark wrote:
> > > On Fri, Mar 10, 2023 at 16:14:00 +0000, Daniel P. Berrangé wrote:
> > > > On Fri, Mar 10, 2023 at 05:09:16PM +0100, Jiri Denemark wrote:
> > > > > See 01/51 for rationale. Enforced by the last two patches of this
> > > > > series. The rest is quite boring mechanical update, partially done using
> > > > > a perl oneliner
> > > > > 
> > > > >     perl -pe 'for (my $i=1; $i<=12; $i++) { s/(N?_\("[^"]*?%)([^%$ ]*[a-zA-Z][^"]*")/\1$i\$\2/; }'
> > > > > 
> > > > > and tuned manually to fix cases not covered by the regexp above and to
> > > > > merge multiline messages into a single line. I merged only those that
> > > > > were touched anyway. Some very long messages consisting of several
> > > > > sentences were merged only partially and split on sentence boundary.
> > > > > 
> > > > > I will also update libvirt.pot once this is pushed.
> > > > 
> > > > Are we *100% sure* weblate is going to handle this intelligently.
> > > > 
> > > > This will change almost all of the msgid strings in libvirt.pot,
> > > > and translations are associatd with msgid strings.
> > > > 
> > > > IOW, this risks throwing all our translations away putting us back
> > > > to near zero translation coverage, unless weblate is intelligent
> > > > enough to map numbered format strings, to non-numbered format
> > > > strings, and I'm not convinced that it can do that.
> > > 
> > > I don't know is there a way to check this? Technically we should be able
> > > to update the translations as well to make sure we don't lose any work
> > > done by translators. But can that be pushed into weblate somehow (I
> > > guess it must have some kind of import in case you do the translation in
> > > a separate tool).
> > 
> > Yes, there is a mechanism to import that I used when first setting
> > up weblate, but I can't remember exactly what it was now. I do
> > recall, however, that it was *immensely* slow and continually
> > pushed weblate into OOM death due to the large number of string
> > in libvirt.pot. Took me days to get everything imported :-(
> > 
> > 
> > Technically we should really not have to modify the .pot at all,
> > as it is valid to use numbered format strings in the translation
> > regardless of whether the .pot uses them.
> > 
> > The main downside is that weblates c-format check is broken so
> > will complain that the translation format is wrong, despite being
> > correct. 
> 
> Not sure whether the check is disabled by default, but it allows you to
> use numbered format strings when msgid doesn't use it. The problem is
> that translators cannot just copy&paste a format string to the right
> place, they need to invent it. And sometimes they apparently use tools
> that do not even allow using numbered format strings when they are not
> present in msgid. Which then causes regressions as updates undoing the
> correct formatting are pushed via weblate. Which is what happened just
> now with https://gitlab.com/libvirt/libvirt/-/merge_requests/232

The c-format check is currently marked enforcing, and that prevents
translators from confirming strings that have mis-matched formats.
When the string remains in the 'needs editting' state in weblate, it
gets marked as 'fuzzy' in the .po file, and msgfmt will then throw it
away when building the .mo file.

IOW, we should in fact be safe from any crash problems with mis-matched
format strings, despite them appearing in the .po file.

Looking at weblate we have about 100,000 strings in the 'needs editting'
state, which is almost 20% of our total translations in the .po files
not being used. Not all of this is due to c format ordering badness,
in some cases there are formats entirely missing !

We didn't actually have a regression in thue MR 232 because the old
translation with numbered formats was marked fuzzy too, so not being
used.

None the less we need to make this work. The c-format check is good
because it protects us from crashing. Ideally that would be fixed
to permit numbered formats in msgstrs, even when msgid does not use
them.

Even if fixed, it might be worth switching the .pot file anyway, but
this can't be done without us bulk updating the translations, and
bulk re-importing them, which will be challenging. We'll almost
certainly want to try this on a throw-away repo in weblate first,
not our main repo.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|