diff --git a/etc/options.php b/etc/options.php index df81e32..eaa9db8 100644 --- a/etc/options.php +++ b/etc/options.php @@ -142,6 +142,20 @@ function orphang_indicator_options() { 'type' => 'heading', 'label' => __( 'Miscellaneous', 'sierotki' ), ), + /** + * Replace in Translations functions. + * + * Since 3.0.5 + */ + array( + 'name' => 'gettext', + 'type' => 'checkbox', + 'th' => __( 'Translation functions', 'sierotki' ), + 'description' => __( 'Enabled the substitution of orphans in Translations functions. Read more.', 'sierotki' ), + 'sanitize_callback' => 'absint', + 'default' => 1, + 'classes' => array( 'switch-button' ), + ), /** * Since 2.6.8 */ diff --git a/includes/iworks/class-iworks-orphan.php b/includes/iworks/class-iworks-orphan.php index ebb686d..3337cbc 100644 --- a/includes/iworks/class-iworks-orphan.php +++ b/includes/iworks/class-iworks-orphan.php @@ -77,6 +77,14 @@ public function __construct() { * iWorks Rate Class */ add_filter( 'iworks_rate_notice_logo_style', array( $this, 'filter_plugin_logo' ), 10, 2 ); + /** + * Replace in Translations functions. + * + * Since 3.0.5 + */ + if ( $this->options->get_option( 'gettext' ) ) { + add_filter( 'gettext', array( $this, 'filter_gettext' ), 10, 3 ); + } } /** @@ -676,5 +684,13 @@ public function filter_plugin_logo( $logo, $plugin ) { return $logo; } + /** + * Replace in Translations functions. + * + * Since 3.0.5 + */ + public function filter_gettext( $translation, $text, $domain ) { + return $this->unconditional_replacement( $translation ); + } } diff --git a/languages/sierotki.pot b/languages/sierotki.pot index dbd31c4..67074f0 100644 --- a/languages/sierotki.pot +++ b/languages/sierotki.pot @@ -1,14 +1,14 @@ -# Copyright (C) 2022 Marcin Pietrzak +# Copyright (C) 2023 Marcin Pietrzak # This file is distributed under the same license as the Orphans package. msgid "" msgstr "" "Project-Id-Version: Orphans PLUGIN_VERSION\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/sierotki-dev\n" -"POT-Creation-Date: 2022-11-20 19:14:56+00:00\n" +"POT-Creation-Date: 2023-01-11 07:45:36+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: 2023-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: en\n" @@ -120,119 +120,130 @@ msgstr "" msgid "Miscellaneous" msgstr "" -#: etc/options.php:151 +#: etc/options.php:153 +msgid "Translation functions" +msgstr "" + +#: etc/options.php:154 +msgid "" +"Enabled the substitution of orphans in Translations functions. Read more." +msgstr "" + +#: etc/options.php:165 msgid "Author description" msgstr "" -#: etc/options.php:152 +#: etc/options.php:166 msgid "Enabled the substitution of orphans in the author description." msgstr "" -#: etc/options.php:159 +#: etc/options.php:173 msgid "Ignore language" msgstr "" -#: etc/options.php:161 +#: etc/options.php:175 msgid "Allow to use plugin with another languages then Polish." msgstr "" -#: etc/options.php:168 +#: etc/options.php:182 msgid "Menu Title" msgstr "" -#: etc/options.php:170 +#: etc/options.php:184 msgid "Enabled the substitution of orphans in the menu title." msgstr "" -#: etc/options.php:177 +#: etc/options.php:191 msgid "Keep numbers together" msgstr "" -#: etc/options.php:179 +#: etc/options.php:193 msgid "Allow to keep together phone number or strings with space between numbers." msgstr "" -#: etc/options.php:185 +#: etc/options.php:199 msgid "Protect tag attributes" msgstr "" -#: etc/options.php:187 +#: etc/options.php:201 msgid "Allow to ignore spaces in \"class\", \"style\" and \"data-*\" attributes." msgstr "" -#: etc/options.php:194 +#: etc/options.php:208 msgid "User definied orphans" msgstr "" -#: etc/options.php:196 +#: etc/options.php:210 msgid "Use a comma to separate orphans." msgstr "" -#: etc/options.php:203 +#: etc/options.php:217 msgid "Entries custom fields" msgstr "" -#: etc/options.php:205 +#: etc/options.php:219 msgid "Use a comma to separate custom fields name." msgstr "" -#: etc/options.php:213 etc/options.php:350 +#: etc/options.php:227 etc/options.php:364 msgid "We are waiting for your message" msgstr "" -#: etc/options.php:219 +#: etc/options.php:233 msgid "I love what I do!" msgstr "" -#: etc/options.php:232 +#: etc/options.php:246 msgid "Integrations" msgstr "" -#: etc/options.php:237 +#: etc/options.php:251 msgid "Advanced Custom Fields" msgstr "" -#: etc/options.php:242 +#: etc/options.php:256 msgid "Text" msgstr "" -#: etc/options.php:243 +#: etc/options.php:257 msgid "Enabled the substitution of orphans in text fields." msgstr "" -#: etc/options.php:251 +#: etc/options.php:265 msgid "Textarea" msgstr "" -#: etc/options.php:252 +#: etc/options.php:266 msgid "Enabled the substitution of orphans in textarea fields. (Include WYSIWYG)." msgstr "" -#: etc/options.php:260 +#: etc/options.php:274 msgid "WYSIWYG" msgstr "" -#: etc/options.php:261 +#: etc/options.php:275 msgid "Enabled the substitution of orphans in WYSIWYG fields." msgstr "" -#: etc/options.php:314 +#: etc/options.php:328 msgid "Below are some links to help spread this plugin to other users" msgstr "" -#: etc/options.php:316 +#: etc/options.php:330 msgid "Give it a five stars on WordPress.org" msgstr "" -#: etc/options.php:317 +#: etc/options.php:331 msgid "Link to it so others can easily find it" msgstr "" -#: etc/options.php:352 +#: etc/options.php:366 msgid "WordPress Help Forum" msgstr "" -#: includes/iworks/class-iworks-orphan.php:497 +#: includes/iworks/class-iworks-orphan.php:505 #: includes/iworks/rate/rate.php:124 msgid "Settings" msgstr "" @@ -390,12 +401,12 @@ msgstr "" msgid "http://iworks.pl/" msgstr "" -#: etc/options.php:317 +#: etc/options.php:331 msgctxt "plugin home page on WordPress.org" msgid "https://wordpress.org/plugins/sierotki/" msgstr "" -#: etc/options.php:352 +#: etc/options.php:366 msgctxt "link to support forum on WordPress.org" msgid "https://wordpress.org/support/plugin/sierotki/" msgstr "" diff --git a/package.json b/package.json index 3b2b6c3..58695bf 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "title": "Orphans", "description": "Plugin fix orphans position and replace space after orphan to hard space, to avoid ne break incorrect position.", "tagline": "Plugin supports some of the grammatical rules of the Polish language.", - "version": "3.0.4", + "version": "3.0.5", "homepage": "https://wordpress.org/plugins/sierotki/", "tagline": "", "repository": { diff --git a/readme.txt b/readme.txt index 65acd5b..41706cb 100644 --- a/readme.txt +++ b/readme.txt @@ -128,6 +128,9 @@ function remove_iworks_orphan_terms( $terms ) { == Changelog == += 3.0.5 - 2023-01-11 = +* The translation function now includes the ability to replace text. The default setting is off. + = 3.0.4 - 2022-11-20 = * Handle space after year for short year format "r.". Props for [Mastafu Design](https://wordpress.org/support/users/mastafu/) * Added integration with "Goodlayers Core" on `gdlr_core_escape_content` filter.