From 3f9aa7374aa2a9a4d3e07ebfb3bc9e987a939007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reu=CC=88el=20van=20der=20Steege?= Date: Wed, 4 Dec 2024 15:38:56 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Only=20mention=20=E2=80=9Cpublic=E2=80=9D?= =?UTF-8?q?=20in=20post=20status=20option=20if=20relevant.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/settings-field-post-types-support.php | 16 ++++-- languages/pronamic-post-expiration-nl_NL.mo | Bin 1730 -> 1716 bytes languages/pronamic-post-expiration-nl_NL.po | 54 +++++++++++--------- languages/pronamic-post-expiration.pot | 41 +++++++-------- 4 files changed, 60 insertions(+), 51 deletions(-) diff --git a/admin/settings-field-post-types-support.php b/admin/settings-field-post-types-support.php index 1cc7cb4..72f4807 100644 --- a/admin/settings-field-post-types-support.php +++ b/admin/settings-field-post-types-support.php @@ -99,12 +99,20 @@ function ( $post_status_object ) { foreach ( $post_status_objects as $key => $post_status_info ) { $options[ $key ] = \sprintf( - /* translators: 1: Post status label, 2: Post status name, 3: Public yes/no. */ - \__( '%1$s (%2$s) · Public: %3$s', 'pronamic-post-expiration' ), + /* translators: 1: Post status label, 2: Post status name */ + \__( '%1$s (`%2$s`)', 'pronamic-post-expiration' ), \esc_html( $post_status_info->label ), - \esc_html( $post_status_info->name ), - \esc_html( $post_status_info->public ? \__( 'Yes', 'pronamic-post-expiration' ) : \__( 'No', 'pronamic-post-expiration' ) ) + \esc_html( $post_status_info->name ) ); + + if ( $post_status_info->public ) { + $options[ $key ] = \sprintf( + /* translators: 1: Post status label, 2: Post status name, 3: Public yes/no. */ + \__( '%1$s (`%2$s`, public)', 'pronamic-post-expiration' ), + \esc_html( $post_status_info->label ), + \esc_html( $post_status_info->name ) + ); + } } if ( ! \array_key_exists( $current, $options ) ) { diff --git a/languages/pronamic-post-expiration-nl_NL.mo b/languages/pronamic-post-expiration-nl_NL.mo index 975a478a74bfc82950e14c380637e04ed2da6e7c..7c933696e26f57aade8caa87463791cc7679fa2f 100644 GIT binary patch delta 555 zcmZwDze@sP9LMpmo@bVxmLM6FDJWz=K<&2#{Q(UP4bi4XP!MSy4MpJ8Qsd#?8Z{KP z2e#GR5>aDKZ4E(0@2}nv(U*Jf^*qnd^5 c!ZY~)2G!cyR;66t$vVU4z4K|>PSwBk1MyWoRsaA1 delta 569 zcmX}oJxD@P6u|N8dzyW{ECmbt;7JOJ1om<$$F?lAp~a~*90bY8B3hDYD5C9AbGu_g zYuOlWHQMMFK~NAh^gnX(@b3NHdms0l!);nEtNtGJUMnKRm|`>;(~NZw6Y+qP_=ro` z#z71lO8GH@IgIQ5G5Xk_BA+^E8p2B)z#EkNx7e>#T{T!taL`0a_=3{N8=Cl~|Nr1J z`v8YeG_i`(s719kOrR7xLK3Sp%;S~bcaTqgGD+TVw5YFsS;$3ypHjmZLP=nwG!{o` zYy~5jL3&XY{lALR*agy8H>AL*UUS?HDK2&7rN_D_N(Hy{LJCR|uigi6M6abOc`^x$ zA{Xj{p7 tCuKXybjnF2ox6@X;~DSW&+V0Vi-p3z&M@nHHnXLY`{6q\n" "Language-Team: \n" "Language: nl_NL\n" @@ -18,8 +18,8 @@ msgstr "" "X-Domain: pronamic-post-expiration\n" #. Plugin Name of the plugin -#: pronamic-post-expiration.php php/SettingsController.php:95 -#: php/SettingsController.php:96 +#: pronamic-post-expiration.php php/SettingsController.php:102 +#: php/SettingsController.php:103 msgid "Pronamic Post Expiration" msgstr "Pronamic Post Expiration" @@ -44,61 +44,65 @@ msgstr "Pronamic" msgid "https://www.pronamic.eu/" msgstr "https://www.pronamic.nl/" -#: admin/settings-field-post-types-support.php:51 +#: admin/settings-field-post-types-support.php:49 msgid "Post type" msgstr "Berichttype" -#: admin/settings-field-post-types-support.php:52 +#: admin/settings-field-post-types-support.php:50 msgid "Label" msgstr "Label" -#: admin/settings-field-post-types-support.php:53 +#: admin/settings-field-post-types-support.php:51 msgid "Support" msgstr "Support" -#: admin/settings-field-post-types-support.php:54 +#: admin/settings-field-post-types-support.php:52 msgid "Post status" msgstr "Berichtstatus" -#. translators: 1: Post status label, 2: Post status name, 3: Public yes/no. -#: admin/settings-field-post-types-support.php:105 -msgid "%1$s (%2$s) · Public: %3$s" -msgstr "%1$s (%2$s) · Openbaar: %3$s" - -#: admin/settings-field-post-types-support.php:108 -msgid "Yes" -msgstr "Ja" +#. translators: 1: Post status label, 2: Post status name +#: admin/settings-field-post-types-support.php:103 +#| msgid "%1$s (%2$s)" +msgid "%1$s (`%2$s`)" +msgstr "%1$s (`%2$s`)" -#: admin/settings-field-post-types-support.php:108 -msgid "No" -msgstr "Nee" +#. translators: 1: Post status label, 2: Post status name, 3: Public yes/no. +#: admin/settings-field-post-types-support.php:111 +msgid "%1$s (`%2$s`, public)" +msgstr "%1$s (`%2$s`, openbaar)" -#: php/Plugin.php:95 +#: php/Plugin.php:94 msgid "Expired" msgstr "Verlopen" #. translators: %s: count value -#: php/Plugin.php:97 +#: php/Plugin.php:96 msgid "Expired (%s)" msgid_plural "Expired (%s)" msgstr[0] "Verlopen (%s)" msgstr[1] "Verlopen (%s)" -#: php/Plugin.php:166 +#: php/Plugin.php:165 msgid "Expiration" msgstr "Vervaldatum" -#: php/Plugin.php:356 +#: php/Plugin.php:359 msgid "View scheduled expire action" msgstr "Bekijk geplande vervaldatum actie" -#: php/SettingsController.php:71 +#: php/SettingsController.php:78 msgid "General" msgstr "Algemeen" -#: php/SettingsController.php:78 +#: php/SettingsController.php:85 msgid "Post types" msgstr "Berichttypen" +#~ msgid "Yes" +#~ msgstr "Ja" + +#~ msgid "No" +#~ msgstr "Nee" + #~ msgid "View scheduled expire event" #~ msgstr "Bekijk geplande verloop gebeurtenis" diff --git a/languages/pronamic-post-expiration.pot b/languages/pronamic-post-expiration.pot index 97133f7..16a12b1 100644 --- a/languages/pronamic-post-expiration.pot +++ b/languages/pronamic-post-expiration.pot @@ -9,15 +9,15 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-10-24T18:42:22+00:00\n" +"POT-Creation-Date: 2024-12-04T14:36:05+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.11.0\n" "X-Domain: pronamic-post-expiration\n" #. Plugin Name of the plugin #: pronamic-post-expiration.php -#: php/SettingsController.php:95 -#: php/SettingsController.php:96 +#: php/SettingsController.php:102 +#: php/SettingsController.php:103 msgid "Pronamic Post Expiration" msgstr "" @@ -41,58 +41,55 @@ msgstr "" msgid "https://www.pronamic.eu/" msgstr "" -#: admin/settings-field-post-types-support.php:51 +#: admin/settings-field-post-types-support.php:49 msgid "Post type" msgstr "" -#: admin/settings-field-post-types-support.php:52 +#: admin/settings-field-post-types-support.php:50 msgid "Label" msgstr "" -#: admin/settings-field-post-types-support.php:53 +#: admin/settings-field-post-types-support.php:51 msgid "Support" msgstr "" -#: admin/settings-field-post-types-support.php:54 +#: admin/settings-field-post-types-support.php:52 msgid "Post status" msgstr "" -#. translators: 1: Post status label, 2: Post status name, 3: Public yes/no. -#: admin/settings-field-post-types-support.php:105 -msgid "%1$s (%2$s) · Public: %3$s" -msgstr "" - -#: admin/settings-field-post-types-support.php:108 -msgid "Yes" +#. translators: 1: Post status label, 2: Post status name +#: admin/settings-field-post-types-support.php:103 +msgid "%1$s (`%2$s`)" msgstr "" -#: admin/settings-field-post-types-support.php:108 -msgid "No" +#. translators: 1: Post status label, 2: Post status name, 3: Public yes/no. +#: admin/settings-field-post-types-support.php:111 +msgid "%1$s (`%2$s`, public)" msgstr "" -#: php/Plugin.php:95 +#: php/Plugin.php:94 msgid "Expired" msgstr "" #. translators: %s: count value -#: php/Plugin.php:97 +#: php/Plugin.php:96 msgid "Expired (%s)" msgid_plural "Expired (%s)" msgstr[0] "" msgstr[1] "" -#: php/Plugin.php:166 +#: php/Plugin.php:165 msgid "Expiration" msgstr "" -#: php/Plugin.php:356 +#: php/Plugin.php:359 msgid "View scheduled expire action" msgstr "" -#: php/SettingsController.php:71 +#: php/SettingsController.php:78 msgid "General" msgstr "" -#: php/SettingsController.php:78 +#: php/SettingsController.php:85 msgid "Post types" msgstr "" From 63620a3a00cb94047943aefbbf91259fa89452bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reu=CC=88el=20van=20der=20Steege?= Date: Fri, 6 Dec 2024 10:03:40 +0100 Subject: [PATCH 2/3] Use option groups for post status. --- admin/settings-field-post-types-support.php | 64 ++++++++++++-------- languages/pronamic-post-expiration-nl_NL.mo | Bin 1716 -> 1723 bytes languages/pronamic-post-expiration-nl_NL.po | 34 +++++------ languages/pronamic-post-expiration.pot | 17 +++--- 4 files changed, 64 insertions(+), 51 deletions(-) diff --git a/admin/settings-field-post-types-support.php b/admin/settings-field-post-types-support.php index 72f4807..0577e04 100644 --- a/admin/settings-field-post-types-support.php +++ b/admin/settings-field-post-types-support.php @@ -93,30 +93,26 @@ function ( $post_status_object ) { $current = ( null === $post_expiration_info ) ? '' : $post_expiration_info->post_status; - $options = [ - '' => '', + $groups = [ + 'public' => [ + 'label' => __( 'Public', 'pronamic-post-expiration' ), + 'options' => [], + ], + 'non-public' => [ + 'label' => __( 'Non Public', 'pronamic-post-expiration' ), + 'options' => [], + ], ]; foreach ( $post_status_objects as $key => $post_status_info ) { - $options[ $key ] = \sprintf( + $group = $post_status_info->public ? 'public' : 'non-public'; + + $groups[ $group ]['options'][ $key ] = \sprintf( /* translators: 1: Post status label, 2: Post status name */ - \__( '%1$s (`%2$s`)', 'pronamic-post-expiration' ), + \__( '%1$s (%2$s)', 'pronamic-post-expiration' ), \esc_html( $post_status_info->label ), \esc_html( $post_status_info->name ) ); - - if ( $post_status_info->public ) { - $options[ $key ] = \sprintf( - /* translators: 1: Post status label, 2: Post status name, 3: Public yes/no. */ - \__( '%1$s (`%2$s`, public)', 'pronamic-post-expiration' ), - \esc_html( $post_status_info->label ), - \esc_html( $post_status_info->name ) - ); - } - } - - if ( ! \array_key_exists( $current, $options ) ) { - $options[ $current ] = $current; } $name = \sprintf( @@ -126,15 +122,35 @@ function ( $post_status_object ) { ?> > @@ -127,10 +135,6 @@ function ( $post_status_object ) {