Skip to content

Commit

Permalink
fix: Add null coalesce to avoide PHP notice
Browse files Browse the repository at this point in the history
  • Loading branch information
seebeen committed Dec 18, 2021
1 parent 1171eac commit 686fc7e
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 36 deletions.
46 changes: 31 additions & 15 deletions languages/serbian-addons-for-woocommerce
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the same license as the Serbian Addons for WooCommerce plugin.
msgid ""
msgstr ""
"Project-Id-Version: Serbian Addons for WooCommerce 1.0.0\n"
"Project-Id-Version: Serbian Addons for WooCommerce 1.1.1\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/serbian-woocommerce\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2021-12-17T11:38:02+01:00\n"
"POT-Creation-Date: 2021-12-18T22:55:57+01:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.4.0\n"
"X-Domain: serbian-addons-for-woocommerce\n"
Expand Down Expand Up @@ -54,35 +54,46 @@ msgstr ""
msgid "Companies"
msgstr ""

#: lib/Admin/Settings.php:41
#: lib/Admin/Settings.php:29
msgid "Field removal"
msgstr ""

#: lib/Admin/Settings.php:32
msgid "Remove unneeded fields from the checkout page"
msgstr ""

#: lib/Admin/Settings.php:33
msgid "Removes Address 2 and State fields"
msgstr ""

#: lib/Admin/Settings.php:48
msgid "Transliterate currency symbol"
msgstr ""

#: lib/Admin/Settings.php:44
#: lib/Admin/Settings.php:51
msgid "Transliterate currency symbol to latin script"
msgstr ""

#: lib/CustomerType/FieldCustomizer.php:28
#: lib/CustomerType/FieldCustomizer.php:46
msgid "Customer type"
msgstr ""

#: lib/CustomerType/FieldDisplay.php:21
#: lib/CustomerType/FieldDisplay.php:74
#: lib/CustomerType/FieldDisplay.php:102
#: lib/CustomerType/FieldCustomizer.php:71
msgid "Company Number"
msgstr ""

#: lib/CustomerType/FieldDisplay.php:22
#: lib/CustomerType/FieldDisplay.php:79
msgid "Tax Identification Number"
#: lib/CustomerType/FieldCustomizer.php:81
msgid "Tax Number"
msgstr ""

#: lib/CustomerType/FieldDisplay.php:95
msgid "Entity type"
#: lib/CustomerType/FieldDisplay.php:94
msgctxt "Address display"
msgid "Company Number"
msgstr ""

#: lib/CustomerType/FieldDisplay.php:107
msgid "Tax Number"
#: lib/CustomerType/FieldDisplay.php:99
msgctxt "Address display"
msgid "Tax Identification Number"
msgstr ""

#: lib/CustomerType/FieldValidation.php:49
Expand All @@ -106,3 +117,8 @@ msgstr ""
#: lib/Utils/helpers.php:7
msgid "Company"
msgstr ""

#: lib/Utils/Installer.php:63
#: lib/Utils/Installer.php:64
msgid "Settings"
msgstr ""
Binary file modified languages/serbian-addons-for-woocommerce-sr_RS.mo
Binary file not shown.
32 changes: 17 additions & 15 deletions languages/serbian-addons-for-woocommerce-sr_RS.po
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: Serbian Addons for WooCommerce\n"
"POT-Creation-Date: 2021-12-18 14:26+0100\n"
"PO-Revision-Date: 2021-12-18 14:26+0100\n"
"POT-Creation-Date: 2021-12-18 22:56+0100\n"
"PO-Revision-Date: 2021-12-18 22:59+0100\n"
"Last-Translator: Sibin Grasic <sibin.grasic@oblak.studio>\n"
"Language-Team: Sibin Grasic <sibin.grasic@oblak.studio>\n"
"Language: sr_RS\n"
Expand All @@ -17,8 +17,8 @@ msgstr ""
"X-Poedit-WPHeader: serbian-addons-for-woocommerce.php\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
"_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.min.js\n"
"X-Poedit-SearchPathExcluded-1: vendor\n"
Expand Down Expand Up @@ -66,33 +66,28 @@ msgstr "Преслови валуту"
msgid "Transliterate currency symbol to latin script"
msgstr "Пресловљава валуту у латиницу"

#: lib/CustomerType/FieldCustomizer.php:28
#: lib/CustomerType/FieldCustomizer.php:46
msgid "Customer type"
msgstr "Купујем као"

#: lib/CustomerType/FieldCustomizer.php:53 lib/CustomerType/FieldDisplay.php:98
#: lib/CustomerType/FieldCustomizer.php:71
msgid "Company Number"
msgstr "Матични број"

#: lib/CustomerType/FieldCustomizer.php:63
#: lib/CustomerType/FieldDisplay.php:103
#: lib/CustomerType/FieldCustomizer.php:81
msgid "Tax Number"
msgstr "ПИБ"

#: lib/CustomerType/FieldDisplay.php:70
#: lib/CustomerType/FieldDisplay.php:94
msgctxt "Address display"
msgid "Company Number"
msgstr "МБ"

#: lib/CustomerType/FieldDisplay.php:75
#: lib/CustomerType/FieldDisplay.php:99
msgctxt "Address display"
msgid "Tax Identification Number"
msgstr "ПИБ"

#: lib/CustomerType/FieldDisplay.php:91
msgid "Entity type"
msgstr "Тип купца"

#: lib/CustomerType/FieldValidation.php:49
#: lib/CustomerType/FieldValidation.php:87
msgid "Company number is invalid"
Expand All @@ -107,6 +102,10 @@ msgstr "ПИБ није валидан"
msgid "Company name is required"
msgstr "Морате унети име фирме"

#: lib/Utils/Installer.php:63 lib/Utils/Installer.php:64
msgid "Settings"
msgstr "Подешавања"

#: lib/Utils/helpers.php:6
msgid "Person"
msgstr "Физичко лице"
Expand All @@ -121,7 +120,7 @@ msgstr "Српски додаци за WooCommerce"

#. Plugin URI of the plugin/theme
msgid "https://oblak.studio/open-source/srpski-woocommerce"
msgstr ""
msgstr "https://oblak.studio/open-source/srpski-woocommerce"

#. Description of the plugin/theme
msgid ""
Expand All @@ -138,3 +137,6 @@ msgstr "Облак Студио"
#. Author URI of the plugin/theme
msgid "https://oblak.studio"
msgstr "https://oblak.studio"

#~ msgid "Entity type"
#~ msgstr "Тип купца"
6 changes: 3 additions & 3 deletions lib/CustomerType/FieldDisplay.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public function modifyFormattedAddress($address, $customer_id, $address_type) {
}

public function modifyAddressReplacements($replacements, $args) {
$replacements['{type}'] = $args['type'];
$replacements['{mb}'] = $args['mb'];
$replacements['{pib}'] = $args['pib'];
$replacements['{type}'] = $args['type'] ?? "\n";
$replacements['{mb}'] = $args['mb'] ?? "\n";
$replacements['{pib}'] = $args['pib'] ?? "\n";

return $replacements;
}
Expand Down
4 changes: 1 addition & 3 deletions lib/Utils/Installer.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<?php
namespace Oblak\WCRS\Utils;

use Automattic\Jetpack\Constants;

class Installer {
public static function init() {
add_action('init', [__CLASS__, 'check_version']);
add_action('plugin_action_links_' . WCRS_PLUGIN_BASENAME, [__CLASS__, 'plugin_action_links']);
}

public static function check_version() {
if (!Constants::is_defined('IFRAME_REQUEST') && version_compare(get_option('wcrs_version', '0.0.1'), WCSRB()->version, '<')) {
if (defined('IFRAME_REQUEST') && version_compare(get_option('wcrs_version', '0.0.1'), WCSRB()->version, '<')) {
self::install();
do_action('wcrs_updated');
}
Expand Down

0 comments on commit 686fc7e

Please sign in to comment.