From 4e9c18a565629ad62225715177ec3d2177f097fc Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 9 Nov 2020 15:14:41 +0100 Subject: [PATCH 1/5] [users] Translate PWQuality error messages with numbers --- src/modules/users/CheckPWQuality.cpp | 44 ++++++++++++++++------------ 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/modules/users/CheckPWQuality.cpp b/src/modules/users/CheckPWQuality.cpp index 9332c6080..44e35b1f5 100644 --- a/src/modules/users/CheckPWQuality.cpp +++ b/src/modules/users/CheckPWQuality.cpp @@ -172,62 +172,66 @@ public: case PWQ_ERROR_MIN_DIGITS: if ( auxerror ) { - return QCoreApplication::translate( "PWQ", "The password contains less than %1 digits" ) - .arg( mungeLong( auxerror ) ); + return QCoreApplication::translate( + "PWQ", "The password contains fewer than %n digits", nullptr, mungeLong( auxerror ) ); } return QCoreApplication::translate( "PWQ", "The password contains too few digits" ); case PWQ_ERROR_MIN_UPPERS: if ( auxerror ) { - return QCoreApplication::translate( "PWQ", "The password contains less than %1 uppercase letters" ) - .arg( mungeLong( auxerror ) ); + return QCoreApplication::translate( + "PWQ", "The password contains fewer than %n uppercase letters", nullptr, mungeLong( auxerror ) ); } return QCoreApplication::translate( "PWQ", "The password contains too few uppercase letters" ); case PWQ_ERROR_MIN_LOWERS: if ( auxerror ) { - return QCoreApplication::translate( "PWQ", "The password contains less than %1 lowercase letters" ) - .arg( mungeLong( auxerror ) ); + return QCoreApplication::translate( + "PWQ", "The password contains fewer than %n lowercase letters", nullptr, mungeLong( auxerror ) ); } return QCoreApplication::translate( "PWQ", "The password contains too few lowercase letters" ); case PWQ_ERROR_MIN_OTHERS: if ( auxerror ) { return QCoreApplication::translate( "PWQ", - "The password contains less than %1 non-alphanumeric characters" ) - .arg( mungeLong( auxerror ) ); + "The password contains fewer than %n non-alphanumeric characters", + nullptr, + mungeLong( auxerror ) ); } return QCoreApplication::translate( "PWQ", "The password contains too few non-alphanumeric characters" ); case PWQ_ERROR_MIN_LENGTH: if ( auxerror ) { - return QCoreApplication::translate( "PWQ", "The password is shorter than %1 characters" ) - .arg( mungeLong( auxerror ) ); + return QCoreApplication::translate( + "PWQ", "The password is shorter than %n characters", nullptr, mungeLong( auxerror ) ); } return QCoreApplication::translate( "PWQ", "The password is too short" ); case PWQ_ERROR_ROTATED: - return QCoreApplication::translate( "PWQ", "The password is just rotated old one" ); + return QCoreApplication::translate( "PWQ", "The password is a rotated version of the previous one" ); case PWQ_ERROR_MIN_CLASSES: if ( auxerror ) { - return QCoreApplication::translate( "PWQ", "The password contains less than %1 character classes" ) - .arg( mungeLong( auxerror ) ); + return QCoreApplication::translate( + "PWQ", "The password contains fewer than %n character classes", nullptr, mungeLong( auxerror ) ); } return QCoreApplication::translate( "PWQ", "The password does not contain enough character classes" ); case PWQ_ERROR_MAX_CONSECUTIVE: if ( auxerror ) { return QCoreApplication::translate( "PWQ", - "The password contains more than %1 same characters consecutively" ) - .arg( mungeLong( auxerror ) ); + "The password contains more than %n same characters consecutively", + nullptr, + mungeLong( auxerror ) ); } return QCoreApplication::translate( "PWQ", "The password contains too many same characters consecutively" ); case PWQ_ERROR_MAX_CLASS_REPEAT: if ( auxerror ) { return QCoreApplication::translate( - "PWQ", "The password contains more than %1 characters of the same class consecutively" ) - .arg( mungeLong( auxerror ) ); + "PWQ", + "The password contains more than %n characters of the same class consecutively", + nullptr, + mungeLong( auxerror ) ); } return QCoreApplication::translate( "PWQ", "The password contains too many characters of the same class consecutively" ); @@ -235,8 +239,10 @@ public: if ( auxerror ) { return QCoreApplication::translate( - "PWQ", "The password contains monotonic sequence longer than %1 characters" ) - .arg( mungeLong( auxerror ) ); + "PWQ", + "The password contains monotonic sequence longer than %n characters", + nullptr, + mungeLong( auxerror ) ); } return QCoreApplication::translate( "PWQ", "The password contains too long of a monotonic character sequence" ); From a5dfe7cd68870fc577a80f02054072b43281f2ca Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 9 Nov 2020 15:14:54 +0100 Subject: [PATCH 2/5] i18n: update english translations --- lang/calamares_en.ts | 442 ++++++++++-------- lang/python.pot | 169 +++---- .../dummypythonqt/lang/dummypythonqt.pot | 18 +- 3 files changed, 335 insertions(+), 294 deletions(-) diff --git a/lang/calamares_en.ts b/lang/calamares_en.ts index 88c923a96..0ef707a3d 100644 --- a/lang/calamares_en.ts +++ b/lang/calamares_en.ts @@ -4,17 +4,17 @@ BootInfoWidget - + The <strong>boot environment</strong> of this system.<br><br>Older x86 systems only support <strong>BIOS</strong>.<br>Modern systems usually use <strong>EFI</strong>, but may also show up as BIOS if started in compatibility mode. The <strong>boot environment</strong> of this system.<br><br>Older x86 systems only support <strong>BIOS</strong>.<br>Modern systems usually use <strong>EFI</strong>, but may also show up as BIOS if started in compatibility mode. - + This system was started with an <strong>EFI</strong> boot environment.<br><br>To configure startup from an EFI environment, this installer must deploy a boot loader application, like <strong>GRUB</strong> or <strong>systemd-boot</strong> on an <strong>EFI System Partition</strong>. This is automatic, unless you choose manual partitioning, in which case you must choose it or create it on your own. This system was started with an <strong>EFI</strong> boot environment.<br><br>To configure startup from an EFI environment, this installer must deploy a boot loader application, like <strong>GRUB</strong> or <strong>systemd-boot</strong> on an <strong>EFI System Partition</strong>. This is automatic, unless you choose manual partitioning, in which case you must choose it or create it on your own. - + This system was started with a <strong>BIOS</strong> boot environment.<br><br>To configure startup from a BIOS environment, this installer must install a boot loader, like <strong>GRUB</strong>, either at the beginning of a partition or on the <strong>Master Boot Record</strong> near the beginning of the partition table (preferred). This is automatic, unless you choose manual partitioning, in which case you must set it up on your own. This system was started with a <strong>BIOS</strong> boot environment.<br><br>To configure startup from a BIOS environment, this installer must install a boot loader, like <strong>GRUB</strong>, either at the beginning of a partition or on the <strong>Master Boot Record</strong> near the beginning of the partition table (preferred). This is automatic, unless you choose manual partitioning, in which case you must set it up on your own. @@ -533,7 +533,7 @@ The installer will quit and all changes will be lost. <strong>Manual partitioning</strong><br/>You can create or resize partitions yourself. - + Reuse %1 as home partition for %2. Reuse %1 as home partition for %2. @@ -558,101 +558,101 @@ The installer will quit and all changes will be lost. <strong>Select a partition to install on</strong> - + An EFI system partition cannot be found anywhere on this system. Please go back and use manual partitioning to set up %1. An EFI system partition cannot be found anywhere on this system. Please go back and use manual partitioning to set up %1. - + The EFI system partition at %1 will be used for starting %2. The EFI system partition at %1 will be used for starting %2. - + EFI system partition: EFI system partition: - + This storage device does not seem to have an operating system on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. This storage device does not seem to have an operating system on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - - - - + + + + <strong>Erase disk</strong><br/>This will <font color="red">delete</font> all data currently present on the selected storage device. <strong>Erase disk</strong><br/>This will <font color="red">delete</font> all data currently present on the selected storage device. - - - - + + + + <strong>Install alongside</strong><br/>The installer will shrink a partition to make room for %1. <strong>Install alongside</strong><br/>The installer will shrink a partition to make room for %1. - - - - + + + + <strong>Replace a partition</strong><br/>Replaces a partition with %1. <strong>Replace a partition</strong><br/>Replaces a partition with %1. - + This storage device has %1 on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. This storage device has %1 on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - + This storage device already has an operating system on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. This storage device already has an operating system on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - + This storage device has multiple operating systems on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. This storage device has multiple operating systems on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. - + This storage device already has an operating system on it, but the partition table <strong>%1</strong> is different from the needed <strong>%2</strong>.<br/> This storage device already has an operating system on it, but the partition table <strong>%1</strong> is different from the needed <strong>%2</strong>.<br/> - + This storage device has one of its partitions <strong>mounted</strong>. This storage device has one of its partitions <strong>mounted</strong>. - + This storage device is a part of an <strong>inactive RAID</strong> device. This storage device is a part of an <strong>inactive RAID</strong> device. - + No Swap No Swap - + Reuse Swap Reuse Swap - + Swap (no Hibernate) Swap (no Hibernate) - + Swap (with Hibernate) Swap (with Hibernate) - + Swap to file Swap to file @@ -720,12 +720,12 @@ The installer will quit and all changes will be lost. Config - + Set keyboard model to %1.<br/> Set keyboard model to %1.<br/> - + Set keyboard layout to %1/%2. Set keyboard layout to %1/%2. @@ -810,47 +810,47 @@ The installer will quit and all changes will be lost. <h1>Welcome to the %1 installer</h1> - + Your username is too long. Your username is too long. - + '%1' is not allowed as username. '%1' is not allowed as username. - + Your username must start with a lowercase letter or underscore. Your username must start with a lowercase letter or underscore. - + Only lowercase letters, numbers, underscore and hyphen are allowed. Only lowercase letters, numbers, underscore and hyphen are allowed. - + Your hostname is too short. Your hostname is too short. - + Your hostname is too long. Your hostname is too long. - + '%1' is not allowed as hostname. '%1' is not allowed as hostname. - + Only letters, numbers, underscore and hyphen are allowed. Only letters, numbers, underscore and hyphen are allowed. - + Your passwords do not match! Your passwords do not match! @@ -1018,29 +1018,39 @@ The installer will quit and all changes will be lost. CreateUserJob - + Create user %1 Create user %1 - + Create user <strong>%1</strong>. Create user <strong>%1</strong>. - + Creating user %1. Creating user %1. - - Cannot create sudoers file for writing. - Cannot create sudoers file for writing. + + Preserving home directory + - - Cannot chmod sudoers file. - Cannot chmod sudoers file. + + Creating user %1 + Creating user %1. {1?} + + + + Configuring user %1 + + + + + Setting file permissions + @@ -1243,7 +1253,7 @@ The installer will quit and all changes will be lost. Flags: - + Mountpoint already in use. Please select another one. Mountpoint already in use. Please select another one. @@ -1558,23 +1568,10 @@ The installer will quit and all changes will be lost. Script - - KeyboardPage - - - Set keyboard model to %1.<br/> - Set keyboard model to %1.<br/> - - - - Set keyboard layout to %1/%2. - Set keyboard layout to %1/%2. - - KeyboardQmlViewStep - + Keyboard Keyboard @@ -1582,7 +1579,7 @@ The installer will quit and all changes will be lost. KeyboardViewStep - + Keyboard Keyboard @@ -1664,59 +1661,59 @@ The installer will quit and all changes will be lost. LicenseWidget - + URL: %1 URL: %1 - + <strong>%1 driver</strong><br/>by %2 %1 is an untranslatable product name, example: Creative Audigy driver <strong>%1 driver</strong><br/>by %2 - + <strong>%1 graphics driver</strong><br/><font color="Grey">by %2</font> %1 is usually a vendor name, example: Nvidia graphics driver <strong>%1 graphics driver</strong><br/><font color="Grey">by %2</font> - + <strong>%1 browser plugin</strong><br/><font color="Grey">by %2</font> <strong>%1 browser plugin</strong><br/><font color="Grey">by %2</font> - + <strong>%1 codec</strong><br/><font color="Grey">by %2</font> <strong>%1 codec</strong><br/><font color="Grey">by %2</font> - + <strong>%1 package</strong><br/><font color="Grey">by %2</font> <strong>%1 package</strong><br/><font color="Grey">by %2</font> - + <strong>%1</strong><br/><font color="Grey">by %2</font> <strong>%1</strong><br/><font color="Grey">by %2</font> - + File: %1 File: %1 - + Hide license text Hide license text - + Show the license text Show the license text - + Open license agreement in browser. Open license agreement in browser. @@ -1724,18 +1721,18 @@ The installer will quit and all changes will be lost. LocalePage - + Region: Region: - + Zone: Zone: - - + + &Change... &Change... @@ -2057,188 +2054,215 @@ The installer will quit and all changes will be lost. The password contains forbidden words in some form The password contains forbidden words in some form - - - The password contains less than %1 digits - The password contains less than %1 digits - The password contains too few digits The password contains too few digits - - - The password contains less than %1 uppercase letters - The password contains less than %1 uppercase letters - The password contains too few uppercase letters The password contains too few uppercase letters - - - The password contains less than %1 lowercase letters - The password contains less than %1 lowercase letters - The password contains too few lowercase letters The password contains too few lowercase letters - - The password contains less than %1 non-alphanumeric characters - The password contains less than %1 non-alphanumeric characters - - - + The password contains too few non-alphanumeric characters The password contains too few non-alphanumeric characters - - The password is shorter than %1 characters - The password is shorter than %1 characters - - - + The password is too short The password is too short - - The password is just rotated old one - The password is just rotated old one - - - - The password contains less than %1 character classes - The password contains less than %1 character classes - - - + The password does not contain enough character classes The password does not contain enough character classes - - The password contains more than %1 same characters consecutively - The password contains more than %1 same characters consecutively - - - + The password contains too many same characters consecutively The password contains too many same characters consecutively - - The password contains more than %1 characters of the same class consecutively - The password contains more than %1 characters of the same class consecutively - - - + The password contains too many characters of the same class consecutively The password contains too many characters of the same class consecutively - - - The password contains monotonic sequence longer than %1 characters - The password contains monotonic sequence longer than %1 characters + + + The password contains fewer than %n digits + + + + + + + + The password contains fewer than %n uppercase letters + + + + + + + + The password contains fewer than %n lowercase letters + + + + + + + + The password contains fewer than %n non-alphanumeric characters + + + + + + + + The password is shorter than %n characters + + + + + + The password is a rotated version of the previous one + + + + + The password contains fewer than %n character classes + + + + + + + + The password contains more than %n same characters consecutively + + + + + + + + The password contains more than %n characters of the same class consecutively + + + + + + + The password contains monotonic sequence longer than %n characters + + + + + + + The password contains too long of a monotonic character sequence The password contains too long of a monotonic character sequence - + No password supplied No password supplied - + Cannot obtain random numbers from the RNG device Cannot obtain random numbers from the RNG device - + Password generation failed - required entropy too low for settings Password generation failed - required entropy too low for settings - + The password fails the dictionary check - %1 The password fails the dictionary check - %1 - + The password fails the dictionary check The password fails the dictionary check - + Unknown setting - %1 Unknown setting - %1 - + Unknown setting Unknown setting - + Bad integer value of setting - %1 Bad integer value of setting - %1 - + Bad integer value Bad integer value - + Setting %1 is not of integer type Setting %1 is not of integer type - + Setting is not of integer type Setting is not of integer type - + Setting %1 is not of string type Setting %1 is not of string type - + Setting is not of string type Setting is not of string type - + Opening the configuration file failed Opening the configuration file failed - + The configuration file is malformed The configuration file is malformed - + Fatal failure Fatal failure - + Unknown error Unknown error - + Password is empty Password is empty @@ -2572,117 +2596,117 @@ The installer will quit and all changes will be lost. PartitionViewStep - + Gathering system information... Gathering system information... - + Partitions Partitions - + Install %1 <strong>alongside</strong> another operating system. Install %1 <strong>alongside</strong> another operating system. - + <strong>Erase</strong> disk and install %1. <strong>Erase</strong> disk and install %1. - + <strong>Replace</strong> a partition with %1. <strong>Replace</strong> a partition with %1. - + <strong>Manual</strong> partitioning. <strong>Manual</strong> partitioning. - + Install %1 <strong>alongside</strong> another operating system on disk <strong>%2</strong> (%3). Install %1 <strong>alongside</strong> another operating system on disk <strong>%2</strong> (%3). - + <strong>Erase</strong> disk <strong>%2</strong> (%3) and install %1. <strong>Erase</strong> disk <strong>%2</strong> (%3) and install %1. - + <strong>Replace</strong> a partition on disk <strong>%2</strong> (%3) with %1. <strong>Replace</strong> a partition on disk <strong>%2</strong> (%3) with %1. - + <strong>Manual</strong> partitioning on disk <strong>%1</strong> (%2). <strong>Manual</strong> partitioning on disk <strong>%1</strong> (%2). - + Disk <strong>%1</strong> (%2) Disk <strong>%1</strong> (%2) - + Current: Current: - + After: After: - + No EFI system partition configured No EFI system partition configured - + An EFI system partition is necessary to start %1.<br/><br/>To configure an EFI system partition, go back and select or create a FAT32 filesystem with the <strong>%3</strong> flag enabled and mount point <strong>%2</strong>.<br/><br/>You can continue without setting up an EFI system partition but your system may fail to start. An EFI system partition is necessary to start %1.<br/><br/>To configure an EFI system partition, go back and select or create a FAT32 filesystem with the <strong>%3</strong> flag enabled and mount point <strong>%2</strong>.<br/><br/>You can continue without setting up an EFI system partition but your system may fail to start. - + An EFI system partition is necessary to start %1.<br/><br/>A partition was configured with mount point <strong>%2</strong> but its <strong>%3</strong> flag is not set.<br/>To set the flag, go back and edit the partition.<br/><br/>You can continue without setting the flag but your system may fail to start. An EFI system partition is necessary to start %1.<br/><br/>A partition was configured with mount point <strong>%2</strong> but its <strong>%3</strong> flag is not set.<br/>To set the flag, go back and edit the partition.<br/><br/>You can continue without setting the flag but your system may fail to start. - + EFI system partition flag not set EFI system partition flag not set - + Option to use GPT on BIOS Option to use GPT on BIOS - + A GPT partition table is the best option for all systems. This installer supports such a setup for BIOS systems too.<br/><br/>To configure a GPT partition table on BIOS, (if not done so already) go back and set the partition table to GPT, next create a 8 MB unformatted partition with the <strong>bios_grub</strong> flag enabled.<br/><br/>An unformatted 8 MB partition is necessary to start %1 on a BIOS system with GPT. A GPT partition table is the best option for all systems. This installer supports such a setup for BIOS systems too.<br/><br/>To configure a GPT partition table on BIOS, (if not done so already) go back and set the partition table to GPT, next create a 8 MB unformatted partition with the <strong>bios_grub</strong> flag enabled.<br/><br/>An unformatted 8 MB partition is necessary to start %1 on a BIOS system with GPT. - + Boot partition not encrypted Boot partition not encrypted - + A separate boot partition was set up together with an encrypted root partition, but the boot partition is not encrypted.<br/><br/>There are security concerns with this kind of setup, because important system files are kept on an unencrypted partition.<br/>You may continue if you wish, but filesystem unlocking will happen later during system startup.<br/>To encrypt the boot partition, go back and recreate it, selecting <strong>Encrypt</strong> in the partition creation window. A separate boot partition was set up together with an encrypted root partition, but the boot partition is not encrypted.<br/><br/>There are security concerns with this kind of setup, because important system files are kept on an unencrypted partition.<br/>You may continue if you wish, but filesystem unlocking will happen later during system startup.<br/>To encrypt the boot partition, go back and recreate it, selecting <strong>Encrypt</strong> in the partition creation window. - + has at least one disk device available. has at least one disk device available. - + There are no partitions to install on. There are no partitions to install on. @@ -2842,13 +2866,8 @@ Output: swap - - Default Keyboard Model - Default Keyboard Model - - - - + + Default Default @@ -3232,29 +3251,29 @@ Output: SetKeyboardLayoutJob - + Set keyboard model to %1, layout to %2-%3 Set keyboard model to %1, layout to %2-%3 - + Failed to write keyboard configuration for the virtual console. Failed to write keyboard configuration for the virtual console. - - - + + + Failed to write to %1 Failed to write to %1 - + Failed to write keyboard configuration for X11. Failed to write keyboard configuration for X11. - + Failed to write keyboard configuration to existing /etc/default directory. Failed to write keyboard configuration to existing /etc/default directory. @@ -3423,6 +3442,43 @@ Output: Cannot open /etc/timezone for writing + + SetupGroupsJob + + + Preparing groups. + + + + + + Could not create groups in target system + + + + + These groups are missing in the target system: %1 + + + + + SetupSudoJob + + + Configure <pre>sudo</pre> users. + + + + + Cannot chmod sudoers file. + Cannot chmod sudoers file. + + + + Cannot create sudoers file for writing. + Cannot create sudoers file for writing. + + ShellProcessJob @@ -3443,12 +3499,12 @@ Output: SummaryPage - + This is an overview of what will happen once you start the setup procedure. This is an overview of what will happen once you start the setup procedure. - + This is an overview of what will happen once you start the install procedure. This is an overview of what will happen once you start the install procedure. diff --git a/lang/python.pot b/lang/python.pot index 5dc844031..1de1081b7 100644 --- a/lang/python.pot +++ b/lang/python.pot @@ -2,32 +2,32 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-16 22:35+0200\n" +"POT-Creation-Date: 2020-11-09 15:12+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: \n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" #: src/modules/grubcfg/main.py:28 msgid "Configure GRUB." -msgstr "Configure GRUB." +msgstr "" -#: src/modules/mount/main.py:29 +#: src/modules/mount/main.py:30 msgid "Mounting partitions." -msgstr "Mounting partitions." +msgstr "" -#: src/modules/mount/main.py:141 src/modules/initcpiocfg/main.py:196 -#: src/modules/initcpiocfg/main.py:200 +#: src/modules/mount/main.py:127 src/modules/initcpiocfg/main.py:199 +#: src/modules/initcpiocfg/main.py:203 #: src/modules/luksopenswaphookcfg/main.py:86 #: src/modules/luksopenswaphookcfg/main.py:90 src/modules/rawfs/main.py:164 #: src/modules/initramfscfg/main.py:85 src/modules/initramfscfg/main.py:89 @@ -36,327 +36,312 @@ msgstr "Mounting partitions." #: src/modules/fstab/main.py:367 src/modules/localecfg/main.py:135 #: src/modules/networkcfg/main.py:39 msgid "Configuration Error" -msgstr "Configuration Error" +msgstr "" -#: src/modules/mount/main.py:142 src/modules/initcpiocfg/main.py:197 +#: src/modules/mount/main.py:128 src/modules/initcpiocfg/main.py:200 #: src/modules/luksopenswaphookcfg/main.py:87 src/modules/rawfs/main.py:165 #: src/modules/initramfscfg/main.py:86 src/modules/openrcdmcryptcfg/main.py:70 #: src/modules/fstab/main.py:362 msgid "No partitions are defined for
{!s}
to use." -msgstr "No partitions are defined for
{!s}
to use." +msgstr "" #: src/modules/services-systemd/main.py:26 msgid "Configure systemd services" -msgstr "Configure systemd services" +msgstr "" #: src/modules/services-systemd/main.py:59 #: src/modules/services-openrc/main.py:93 msgid "Cannot modify service" -msgstr "Cannot modify service" +msgstr "" #: src/modules/services-systemd/main.py:60 msgid "" "systemctl {arg!s} call in chroot returned error code {num!s}." msgstr "" -"systemctl {arg!s} call in chroot returned error code {num!s}." #: src/modules/services-systemd/main.py:63 #: src/modules/services-systemd/main.py:67 msgid "Cannot enable systemd service {name!s}." -msgstr "Cannot enable systemd service {name!s}." +msgstr "" #: src/modules/services-systemd/main.py:65 msgid "Cannot enable systemd target {name!s}." -msgstr "Cannot enable systemd target {name!s}." +msgstr "" #: src/modules/services-systemd/main.py:69 msgid "Cannot disable systemd target {name!s}." -msgstr "Cannot disable systemd target {name!s}." +msgstr "" #: src/modules/services-systemd/main.py:71 msgid "Cannot mask systemd unit {name!s}." -msgstr "Cannot mask systemd unit {name!s}." +msgstr "" #: src/modules/services-systemd/main.py:73 msgid "" -"Unknown systemd commands {command!s} and " -"{suffix!s} for unit {name!s}." +"Unknown systemd commands {command!s} and {suffix!s} for unit {name!s}." msgstr "" -"Unknown systemd commands {command!s} and " -"{suffix!s} for unit {name!s}." #: src/modules/umount/main.py:31 msgid "Unmount file systems." -msgstr "Unmount file systems." +msgstr "" #: src/modules/unpackfs/main.py:35 msgid "Filling up filesystems." -msgstr "Filling up filesystems." +msgstr "" #: src/modules/unpackfs/main.py:254 msgid "rsync failed with error code {}." -msgstr "rsync failed with error code {}." +msgstr "" #: src/modules/unpackfs/main.py:299 msgid "Unpacking image {}/{}, file {}/{}" -msgstr "Unpacking image {}/{}, file {}/{}" +msgstr "" #: src/modules/unpackfs/main.py:314 msgid "Starting to unpack {}" -msgstr "Starting to unpack {}" +msgstr "" #: src/modules/unpackfs/main.py:323 src/modules/unpackfs/main.py:463 msgid "Failed to unpack image \"{}\"" -msgstr "Failed to unpack image \"{}\"" +msgstr "" #: src/modules/unpackfs/main.py:430 msgid "No mount point for root partition" -msgstr "No mount point for root partition" +msgstr "" #: src/modules/unpackfs/main.py:431 msgid "globalstorage does not contain a \"rootMountPoint\" key, doing nothing" -msgstr "globalstorage does not contain a \"rootMountPoint\" key, doing nothing" +msgstr "" #: src/modules/unpackfs/main.py:436 msgid "Bad mount point for root partition" -msgstr "Bad mount point for root partition" +msgstr "" #: src/modules/unpackfs/main.py:437 msgid "rootMountPoint is \"{}\", which does not exist, doing nothing" -msgstr "rootMountPoint is \"{}\", which does not exist, doing nothing" +msgstr "" #: src/modules/unpackfs/main.py:453 src/modules/unpackfs/main.py:457 #: src/modules/unpackfs/main.py:477 msgid "Bad unsquash configuration" -msgstr "Bad unsquash configuration" +msgstr "" #: src/modules/unpackfs/main.py:454 msgid "The filesystem for \"{}\" ({}) is not supported by your current kernel" -msgstr "The filesystem for \"{}\" ({}) is not supported by your current kernel" +msgstr "" #: src/modules/unpackfs/main.py:458 msgid "The source filesystem \"{}\" does not exist" -msgstr "The source filesystem \"{}\" does not exist" +msgstr "" #: src/modules/unpackfs/main.py:464 msgid "" "Failed to find unsquashfs, make sure you have the squashfs-tools package " "installed" msgstr "" -"Failed to find unsquashfs, make sure you have the squashfs-tools package " -"installed" #: src/modules/unpackfs/main.py:478 msgid "The destination \"{}\" in the target system is not a directory" -msgstr "The destination \"{}\" in the target system is not a directory" +msgstr "" #: src/modules/displaymanager/main.py:514 msgid "Cannot write KDM configuration file" -msgstr "Cannot write KDM configuration file" +msgstr "" #: src/modules/displaymanager/main.py:515 msgid "KDM config file {!s} does not exist" -msgstr "KDM config file {!s} does not exist" +msgstr "" #: src/modules/displaymanager/main.py:576 msgid "Cannot write LXDM configuration file" -msgstr "Cannot write LXDM configuration file" +msgstr "" #: src/modules/displaymanager/main.py:577 msgid "LXDM config file {!s} does not exist" -msgstr "LXDM config file {!s} does not exist" +msgstr "" #: src/modules/displaymanager/main.py:660 msgid "Cannot write LightDM configuration file" -msgstr "Cannot write LightDM configuration file" +msgstr "" #: src/modules/displaymanager/main.py:661 msgid "LightDM config file {!s} does not exist" -msgstr "LightDM config file {!s} does not exist" +msgstr "" #: src/modules/displaymanager/main.py:735 msgid "Cannot configure LightDM" -msgstr "Cannot configure LightDM" +msgstr "" #: src/modules/displaymanager/main.py:736 msgid "No LightDM greeter installed." -msgstr "No LightDM greeter installed." +msgstr "" #: src/modules/displaymanager/main.py:767 msgid "Cannot write SLIM configuration file" -msgstr "Cannot write SLIM configuration file" +msgstr "" #: src/modules/displaymanager/main.py:768 msgid "SLIM config file {!s} does not exist" -msgstr "SLIM config file {!s} does not exist" +msgstr "" #: src/modules/displaymanager/main.py:894 msgid "No display managers selected for the displaymanager module." -msgstr "No display managers selected for the displaymanager module." +msgstr "" #: src/modules/displaymanager/main.py:895 msgid "" "The displaymanagers list is empty or undefined in both globalstorage and " "displaymanager.conf." msgstr "" -"The displaymanagers list is empty or undefined in both globalstorage and " -"displaymanager.conf." #: src/modules/displaymanager/main.py:977 msgid "Display manager configuration was incomplete" -msgstr "Display manager configuration was incomplete" +msgstr "" #: src/modules/initcpiocfg/main.py:28 msgid "Configuring mkinitcpio." -msgstr "Configuring mkinitcpio." +msgstr "" -#: src/modules/initcpiocfg/main.py:201 +#: src/modules/initcpiocfg/main.py:204 #: src/modules/luksopenswaphookcfg/main.py:91 #: src/modules/initramfscfg/main.py:90 src/modules/openrcdmcryptcfg/main.py:74 #: src/modules/fstab/main.py:368 src/modules/localecfg/main.py:136 #: src/modules/networkcfg/main.py:40 msgid "No root mount point is given for
{!s}
to use." -msgstr "No root mount point is given for
{!s}
to use." +msgstr "" #: src/modules/luksopenswaphookcfg/main.py:26 msgid "Configuring encrypted swap." -msgstr "Configuring encrypted swap." +msgstr "" #: src/modules/rawfs/main.py:26 msgid "Installing data." -msgstr "Installing data." +msgstr "" #: src/modules/services-openrc/main.py:29 msgid "Configure OpenRC services" -msgstr "Configure OpenRC services" +msgstr "" #: src/modules/services-openrc/main.py:57 msgid "Cannot add service {name!s} to run-level {level!s}." -msgstr "Cannot add service {name!s} to run-level {level!s}." +msgstr "" #: src/modules/services-openrc/main.py:59 msgid "Cannot remove service {name!s} from run-level {level!s}." -msgstr "Cannot remove service {name!s} from run-level {level!s}." +msgstr "" #: src/modules/services-openrc/main.py:61 msgid "" "Unknown service-action {arg!s} for service {name!s} in run-" "level {level!s}." msgstr "" -"Unknown service-action {arg!s} for service {name!s} in run-" -"level {level!s}." #: src/modules/services-openrc/main.py:94 msgid "" "rc-update {arg!s} call in chroot returned error code {num!s}." msgstr "" -"rc-update {arg!s} call in chroot returned error code {num!s}." #: src/modules/services-openrc/main.py:101 msgid "Target runlevel does not exist" -msgstr "Target runlevel does not exist" +msgstr "" #: src/modules/services-openrc/main.py:102 msgid "" "The path for runlevel {level!s} is {path!s}, which does not " "exist." msgstr "" -"The path for runlevel {level!s} is {path!s}, which does not " -"exist." #: src/modules/services-openrc/main.py:110 msgid "Target service does not exist" -msgstr "Target service does not exist" +msgstr "" #: src/modules/services-openrc/main.py:111 msgid "" -"The path for service {name!s} is {path!s}, which does not " -"exist." +"The path for service {name!s} is {path!s}, which does not exist." msgstr "" -"The path for service {name!s} is {path!s}, which does not " -"exist." #: src/modules/plymouthcfg/main.py:27 msgid "Configure Plymouth theme" -msgstr "Configure Plymouth theme" +msgstr "" #: src/modules/packages/main.py:50 src/modules/packages/main.py:59 #: src/modules/packages/main.py:69 msgid "Install packages." -msgstr "Install packages." +msgstr "" #: src/modules/packages/main.py:57 #, python-format msgid "Processing packages (%(count)d / %(total)d)" -msgstr "Processing packages (%(count)d / %(total)d)" +msgstr "" #: src/modules/packages/main.py:62 #, python-format msgid "Installing one package." msgid_plural "Installing %(num)d packages." -msgstr[0] "Installing one package." -msgstr[1] "Installing %(num)d packages." +msgstr[0] "" +msgstr[1] "" #: src/modules/packages/main.py:65 #, python-format msgid "Removing one package." msgid_plural "Removing %(num)d packages." -msgstr[0] "Removing one package." -msgstr[1] "Removing %(num)d packages." +msgstr[0] "" +msgstr[1] "" #: src/modules/bootloader/main.py:42 msgid "Install bootloader." -msgstr "Install bootloader." +msgstr "" #: src/modules/hwclock/main.py:26 msgid "Setting hardware clock." -msgstr "Setting hardware clock." +msgstr "" #: src/modules/mkinitfs/main.py:27 msgid "Creating initramfs with mkinitfs." -msgstr "Creating initramfs with mkinitfs." +msgstr "" #: src/modules/mkinitfs/main.py:49 msgid "Failed to run mkinitfs on the target" -msgstr "Failed to run mkinitfs on the target" +msgstr "" #: src/modules/mkinitfs/main.py:50 src/modules/dracut/main.py:50 msgid "The exit code was {}" -msgstr "The exit code was {}" +msgstr "" #: src/modules/dracut/main.py:27 msgid "Creating initramfs with dracut." -msgstr "Creating initramfs with dracut." +msgstr "" #: src/modules/dracut/main.py:49 msgid "Failed to run dracut on the target" -msgstr "Failed to run dracut on the target" +msgstr "" #: src/modules/initramfscfg/main.py:32 msgid "Configuring initramfs." -msgstr "Configuring initramfs." +msgstr "" #: src/modules/openrcdmcryptcfg/main.py:25 msgid "Configuring OpenRC dmcrypt service." -msgstr "Configuring OpenRC dmcrypt service." +msgstr "" #: src/modules/fstab/main.py:29 msgid "Writing fstab." -msgstr "Writing fstab." +msgstr "" #: src/modules/dummypython/main.py:35 msgid "Dummy python job." -msgstr "Dummy python job." +msgstr "" #: src/modules/dummypython/main.py:37 src/modules/dummypython/main.py:93 #: src/modules/dummypython/main.py:94 msgid "Dummy python step {}" -msgstr "Dummy python step {}" +msgstr "" #: src/modules/localecfg/main.py:30 msgid "Configuring locales." -msgstr "Configuring locales." +msgstr "" #: src/modules/networkcfg/main.py:28 msgid "Saving network configuration." -msgstr "Saving network configuration." +msgstr "" diff --git a/src/modules/dummypythonqt/lang/dummypythonqt.pot b/src/modules/dummypythonqt/lang/dummypythonqt.pot index b1665e503..e3a5ff33d 100644 --- a/src/modules/dummypythonqt/lang/dummypythonqt.pot +++ b/src/modules/dummypythonqt/lang/dummypythonqt.pot @@ -2,41 +2,41 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-10-15 12:53+0200\n" +"POT-Creation-Date: 2020-11-09 15:12+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: \n" #: src/modules/dummypythonqt/main.py:75 msgid "Click me!" -msgstr "Click me!" +msgstr "" #: src/modules/dummypythonqt/main.py:85 msgid "A new QLabel." -msgstr "A new QLabel." +msgstr "" #: src/modules/dummypythonqt/main.py:88 msgid "Dummy PythonQt ViewStep" -msgstr "Dummy PythonQt ViewStep" +msgstr "" #: src/modules/dummypythonqt/main.py:174 msgid "The Dummy PythonQt Job" -msgstr "The Dummy PythonQt Job" +msgstr "" #: src/modules/dummypythonqt/main.py:177 msgid "This is the Dummy PythonQt Job. The dummy job says: {}" -msgstr "This is the Dummy PythonQt Job. The dummy job says: {}" +msgstr "" #: src/modules/dummypythonqt/main.py:181 msgid "A status message for Dummy PythonQt Job." -msgstr "A status message for Dummy PythonQt Job." +msgstr "" From f3e37f3ceef19b3eccdf74b73f47f4834763512d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 9 Nov 2020 15:40:23 +0100 Subject: [PATCH 3/5] [users] Remove unused PWQuality method --- src/modules/users/CheckPWQuality.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/users/CheckPWQuality.cpp b/src/modules/users/CheckPWQuality.cpp index 44e35b1f5..3800c00e8 100644 --- a/src/modules/users/CheckPWQuality.cpp +++ b/src/modules/users/CheckPWQuality.cpp @@ -122,8 +122,6 @@ public: return r; } - bool hasExplanation() const { return m_rv < 0; } - /* This is roughly the same as the function pwquality_strerror, * only with QStrings instead, and using the Qt translation scheme. * It is used under the terms of the GNU GPL v3 or later, as From 43565027f587c777ab60a6f50c090283c557b252 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 9 Nov 2020 15:42:22 +0100 Subject: [PATCH 4/5] [users] m_auxerror never set, always nullptr --- src/modules/users/CheckPWQuality.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/modules/users/CheckPWQuality.cpp b/src/modules/users/CheckPWQuality.cpp index 3800c00e8..fe6a49b2f 100644 --- a/src/modules/users/CheckPWQuality.cpp +++ b/src/modules/users/CheckPWQuality.cpp @@ -104,7 +104,6 @@ public: PWSettingsHolder() : m_settings( pwquality_default_settings() ) - , m_auxerror( nullptr ) { } @@ -129,8 +128,7 @@ public: */ QString explanation() { - void* auxerror = m_auxerror; - m_auxerror = nullptr; + void* auxerror = nullptr; if ( m_rv >= arbitrary_minimum_strength ) { @@ -308,7 +306,6 @@ public: private: pwquality_settings_t* m_settings; int m_rv; - void* m_auxerror; }; DEFINE_CHECK_FUNC( libpwquality ) From b4c3236e4ad71a2dfc034f2dc19b051a56ffc26c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 9 Nov 2020 16:08:19 +0100 Subject: [PATCH 5/5] [users] Consume error information from libpwquality Previously, the auxerror information was never stored, and the messages were all un-numbered or un-explained. Now, consume that information and store it when check() is called, ready to be used when (possibly much later, or after a translation change) explanation() is called. --- src/modules/users/CheckPWQuality.cpp | 154 ++++++++++++++++----------- 1 file changed, 94 insertions(+), 60 deletions(-) diff --git a/src/modules/users/CheckPWQuality.cpp b/src/modules/users/CheckPWQuality.cpp index fe6a49b2f..8dfea1f79 100644 --- a/src/modules/users/CheckPWQuality.cpp +++ b/src/modules/users/CheckPWQuality.cpp @@ -112,24 +112,73 @@ public: /// Sets an option via the configuration string @p v, = style. int set( const QString& v ) { return pwquality_set_option( m_settings, v.toUtf8().constData() ); } - /// Checks the given password @p pwd against the current configuration + /** @brief Checks the given password @p pwd against the current configuration + * + * Resets m_errorString and m_errorCount and then sets them appropriately + * so that explanation() can be called afterwards. Sets m_rv as well. + */ + int check( const QString& pwd ) { void* auxerror = nullptr; - int r = pwquality_check( m_settings, pwd.toUtf8().constData(), nullptr, nullptr, &auxerror ); - m_rv = r; - return r; + m_rv = pwquality_check( m_settings, pwd.toUtf8().constData(), nullptr, nullptr, &auxerror ); + + // Positive return values could be ignored; some negative ones + // place extra information in auxerror, which is a void* and + // which needs interpretation to long- or string-values. + m_errorCount = 0; + m_errorString = QString(); + + switch ( m_rv ) + { + case PWQ_ERROR_CRACKLIB_CHECK: + if ( auxerror ) + { + /* Here the string comes from cracklib, don't free? */ + m_errorString = mungeString( auxerror ); + } + break; + case PWQ_ERROR_MEM_ALLOC: + case PWQ_ERROR_UNKNOWN_SETTING: + case PWQ_ERROR_INTEGER: + case PWQ_ERROR_NON_INT_SETTING: + case PWQ_ERROR_NON_STR_SETTING: + if ( auxerror ) + { + m_errorString = mungeString( auxerror ); + free( auxerror ); + } + break; + case PWQ_ERROR_MIN_DIGITS: + case PWQ_ERROR_MIN_UPPERS: + case PWQ_ERROR_MIN_LOWERS: + case PWQ_ERROR_MIN_OTHERS: + case PWQ_ERROR_MIN_LENGTH: + case PWQ_ERROR_MIN_CLASSES: + case PWQ_ERROR_MAX_CONSECUTIVE: + case PWQ_ERROR_MAX_CLASS_REPEAT: + case PWQ_ERROR_MAX_SEQUENCE: + if ( auxerror ) + { + m_errorCount = mungeLong( auxerror ); + } + break; + default: + break; + } + + return m_rv; } - /* This is roughly the same as the function pwquality_strerror, + /** @brief Explain the results of the last call to check() + * + * This is roughly the same as the function pwquality_strerror, * only with QStrings instead, and using the Qt translation scheme. * It is used under the terms of the GNU GPL v3 or later, as * allowed by the libpwquality license (LICENSES/GPLv2+-libpwquality) */ QString explanation() { - void* auxerror = nullptr; - if ( m_rv >= arbitrary_minimum_strength ) { return QString(); @@ -142,12 +191,10 @@ public: switch ( m_rv ) { case PWQ_ERROR_MEM_ALLOC: - if ( auxerror ) + if ( !m_errorString.isEmpty() ) { - QString s = QCoreApplication::translate( "PWQ", "Memory allocation error when setting '%1'" ) - .arg( mungeString( auxerror ) ); - free( auxerror ); - return s; + return QCoreApplication::translate( "PWQ", "Memory allocation error when setting '%1'" ) + .arg( m_errorString ); } return QCoreApplication::translate( "PWQ", "Memory allocation error" ); case PWQ_ERROR_SAME_PASSWORD: @@ -166,79 +213,75 @@ public: case PWQ_ERROR_BAD_WORDS: return QCoreApplication::translate( "PWQ", "The password contains forbidden words in some form" ); case PWQ_ERROR_MIN_DIGITS: - if ( auxerror ) + if ( m_errorCount ) { return QCoreApplication::translate( - "PWQ", "The password contains fewer than %n digits", nullptr, mungeLong( auxerror ) ); + "PWQ", "The password contains fewer than %n digits", nullptr, m_errorCount ); } return QCoreApplication::translate( "PWQ", "The password contains too few digits" ); case PWQ_ERROR_MIN_UPPERS: - if ( auxerror ) + if ( m_errorCount ) { return QCoreApplication::translate( - "PWQ", "The password contains fewer than %n uppercase letters", nullptr, mungeLong( auxerror ) ); + "PWQ", "The password contains fewer than %n uppercase letters", nullptr, m_errorCount ); } return QCoreApplication::translate( "PWQ", "The password contains too few uppercase letters" ); case PWQ_ERROR_MIN_LOWERS: - if ( auxerror ) + if ( m_errorCount ) { return QCoreApplication::translate( - "PWQ", "The password contains fewer than %n lowercase letters", nullptr, mungeLong( auxerror ) ); + "PWQ", "The password contains fewer than %n lowercase letters", nullptr, m_errorCount ); } return QCoreApplication::translate( "PWQ", "The password contains too few lowercase letters" ); case PWQ_ERROR_MIN_OTHERS: - if ( auxerror ) + if ( m_errorCount ) { - return QCoreApplication::translate( "PWQ", - "The password contains fewer than %n non-alphanumeric characters", - nullptr, - mungeLong( auxerror ) ); + return QCoreApplication::translate( + "PWQ", "The password contains fewer than %n non-alphanumeric characters", nullptr, m_errorCount ); } return QCoreApplication::translate( "PWQ", "The password contains too few non-alphanumeric characters" ); case PWQ_ERROR_MIN_LENGTH: - if ( auxerror ) + if ( m_errorCount ) { return QCoreApplication::translate( - "PWQ", "The password is shorter than %n characters", nullptr, mungeLong( auxerror ) ); + "PWQ", "The password is shorter than %n characters", nullptr, m_errorCount ); } return QCoreApplication::translate( "PWQ", "The password is too short" ); case PWQ_ERROR_ROTATED: return QCoreApplication::translate( "PWQ", "The password is a rotated version of the previous one" ); case PWQ_ERROR_MIN_CLASSES: - if ( auxerror ) + if ( m_errorCount ) { return QCoreApplication::translate( - "PWQ", "The password contains fewer than %n character classes", nullptr, mungeLong( auxerror ) ); + "PWQ", "The password contains fewer than %n character classes", nullptr, m_errorCount ); } return QCoreApplication::translate( "PWQ", "The password does not contain enough character classes" ); case PWQ_ERROR_MAX_CONSECUTIVE: - if ( auxerror ) + if ( m_errorCount ) { - return QCoreApplication::translate( "PWQ", - "The password contains more than %n same characters consecutively", - nullptr, - mungeLong( auxerror ) ); + return QCoreApplication::translate( + "PWQ", "The password contains more than %n same characters consecutively", nullptr, m_errorCount ); } return QCoreApplication::translate( "PWQ", "The password contains too many same characters consecutively" ); case PWQ_ERROR_MAX_CLASS_REPEAT: - if ( auxerror ) + if ( m_errorCount ) { return QCoreApplication::translate( "PWQ", "The password contains more than %n characters of the same class consecutively", nullptr, - mungeLong( auxerror ) ); + m_errorCount ); } return QCoreApplication::translate( "PWQ", "The password contains too many characters of the same class consecutively" ); case PWQ_ERROR_MAX_SEQUENCE: - if ( auxerror ) + if ( m_errorCount ) { return QCoreApplication::translate( "PWQ", "The password contains monotonic sequence longer than %n characters", nullptr, - mungeLong( auxerror ) ); + m_errorCount ); } return QCoreApplication::translate( "PWQ", "The password contains too long of a monotonic character sequence" ); @@ -250,46 +293,34 @@ public: return QCoreApplication::translate( "PWQ", "Password generation failed - required entropy too low for settings" ); case PWQ_ERROR_CRACKLIB_CHECK: - if ( auxerror ) + if ( !m_errorString.isEmpty() ) { - /* Here the string comes from cracklib, don't free? */ return QCoreApplication::translate( "PWQ", "The password fails the dictionary check - %1" ) - .arg( mungeString( auxerror ) ); + .arg( m_errorString ); } return QCoreApplication::translate( "PWQ", "The password fails the dictionary check" ); case PWQ_ERROR_UNKNOWN_SETTING: - if ( auxerror ) + if ( !m_errorString.isEmpty() ) { - QString s = QCoreApplication::translate( "PWQ", "Unknown setting - %1" ).arg( mungeString( auxerror ) ); - free( auxerror ); - return s; + return QCoreApplication::translate( "PWQ", "Unknown setting - %1" ).arg( m_errorString ); } return QCoreApplication::translate( "PWQ", "Unknown setting" ); case PWQ_ERROR_INTEGER: - if ( auxerror ) + if ( !m_errorString.isEmpty() ) { - QString s = QCoreApplication::translate( "PWQ", "Bad integer value of setting - %1" ) - .arg( mungeString( auxerror ) ); - free( auxerror ); - return s; + return QCoreApplication::translate( "PWQ", "Bad integer value of setting - %1" ).arg( m_errorString ); } return QCoreApplication::translate( "PWQ", "Bad integer value" ); case PWQ_ERROR_NON_INT_SETTING: - if ( auxerror ) + if ( !m_errorString.isEmpty() ) { - QString s = QCoreApplication::translate( "PWQ", "Setting %1 is not of integer type" ) - .arg( mungeString( auxerror ) ); - free( auxerror ); - return s; + return QCoreApplication::translate( "PWQ", "Setting %1 is not of integer type" ).arg( m_errorString ); } return QCoreApplication::translate( "PWQ", "Setting is not of integer type" ); case PWQ_ERROR_NON_STR_SETTING: - if ( auxerror ) + if ( !m_errorString.isEmpty() ) { - QString s = QCoreApplication::translate( "PWQ", "Setting %1 is not of string type" ) - .arg( mungeString( auxerror ) ); - free( auxerror ); - return s; + return QCoreApplication::translate( "PWQ", "Setting %1 is not of string type" ).arg( m_errorString ); } return QCoreApplication::translate( "PWQ", "Setting is not of string type" ); case PWQ_ERROR_CFGFILE_OPEN: @@ -304,8 +335,11 @@ public: } private: - pwquality_settings_t* m_settings; - int m_rv; + QString m_errorString; ///< Textual error from last call to check() + int m_errorCount = 0; ///< Count (used in %n) error from last call to check() + int m_rv = 0; ///< Return value from libpwquality + + pwquality_settings_t* m_settings = nullptr; }; DEFINE_CHECK_FUNC( libpwquality )