Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opravy a texty #78

Merged
merged 2 commits into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "redbit/simpleshop-wp-plugin",
"description": "SimpleShop WordPress Plugin",
"keywords": ["simpleshop", "vyfakturuj", "api", "faktura"],
"homepage": "https://www.simpleshop.cz/category/wordpress-plugin/",
"homepage": "https://podpora.redbit.cz/stitek/wp-plugin/",
"type": "wordpress-plugin",
"license": "MIT",
"authors": [
Expand Down
13 changes: 8 additions & 5 deletions js/gutenberg/ss-gutenberg.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, {useState} from 'react';
import {registerBlockType} from '@wordpress/blocks';
import {__} from '@wordpress/i18n';
import {InspectorControls} from '@wordpress/block-editor';
import {PanelBody, SelectControl, TextControl, DateTimePicker, Button, ToggleControl} from '@wordpress/components';
import {Button, DateTimePicker, PanelBody, SelectControl, TextControl, ToggleControl} from '@wordpress/components';
import v1 from './v1';

const {__experimentalGetSettings} = wp.date;
Expand Down Expand Up @@ -89,7 +89,7 @@ const withInspectorControls = createHigherOrderComponent((BlockEdit) => {


let simpleShopGroupsData = ssGutenbergVariables.groups;
let simpleShopGroups = [{label: 'None', value: ''}];
let simpleShopGroups = [{label: __('Doesn\'t matter', 'simpleshop-cz'), value: ''}];
for (let item in simpleShopGroupsData) {
simpleShopGroups.push({label: simpleShopGroupsData[item], value: item});
}
Expand All @@ -102,7 +102,10 @@ const withInspectorControls = createHigherOrderComponent((BlockEdit) => {
title={__('SimpleShop Settings', 'simpleshop-cz')}
initialOpen={true}
>
<p><a href="https://podpora.redbit.cz/stitek/wp-plugin/">{__('Help - SimpleShop plugin','simpleshop-cz')}</a></p>
<p><a href="https://podpora.redbit.cz/stitek/wp-plugin/">
{__('Help - SimpleShop plugin', 'simpleshop-cz')}
</a>
</p>
<SelectControl
label={__('Group', 'simpleshop-cz')}
value={simpleShopGroup}
Expand Down Expand Up @@ -208,7 +211,7 @@ const EditSimpleShop = (props) => {
return response.json();
})
.then(function (json) {
let select = [{label: __('Select product', 'simpleshop-cz'), value: ''}];
let select = [{label: __('Choose the Product', 'simpleshop-cz'), value: ''}];

Object.keys(json).forEach(function (key) {
select.push(
Expand Down Expand Up @@ -240,7 +243,7 @@ const EditSimpleShop = (props) => {
<>
<SelectControl
className={'simpleshop-form-select'}
label={__('Form', 'simpleshop-cz')}
label={__('SimpleShop Form', 'simpleshop-cz')}
description={__('Select the SimpleShop Form', 'simpleshop-cz')}
options={products}
value={attributes.ssFormId}
Expand Down
4 changes: 3 additions & 1 deletion js/gutenberg/v1.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {__} from '@wordpress/i18n';

export default {
attributes: {
ssFormId: {
type: 'string',
default: __('Choose form', 'simpleshop-cz')
default: '(' + __('Choose the Product at the right panel', 'simpleshop-cz') + ')'
},
},
save: function ({ attributes, className }) {
Expand Down
2 changes: 1 addition & 1 deletion simpleshop-cz.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/*
* Plugin Name: SimpleShop.cz
* Plugin URI: https://www.simpleshop.cz/category/wordpress-plugin/
* Plugin URI: https://podpora.redbit.cz/stitek/wp-plugin/
* Description: Plugin implement SimpleShop.cz into WordPress
* Author: Redbit s.r.o.
* Author URI: https://www.redbit.cz
Expand Down
10 changes: 5 additions & 5 deletions src/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function publishing_actions() {
<script type='text/javascript'>
var sscContentGroups = [];
sscContentGroups.push({
text: <?= __( 'Choose a Group', 'simpleshop-cz' ) ?>,
text: '<?= __( 'Doesn\'t matter', 'simpleshop-cz' ) ?>',
value: ''
});
<?php
Expand All @@ -189,10 +189,10 @@ public function publishing_actions() {
* Add a new TinyMCE button
*/
public function tiny_mce_new_buttons() {
if ( ! $this->loader->get_settings()->is_settings_page() ) {
add_filter( 'mce_external_plugins', [ $this, 'tiny_mce_add_buttons' ] );
add_filter( 'mce_buttons', [ $this, 'tiny_mce_register_buttons' ] );
}
if ( ! $this->loader->get_settings()->is_settings_page() ) {
add_filter( 'mce_external_plugins', [ $this, 'tiny_mce_add_buttons' ] );
add_filter( 'mce_buttons', [ $this, 'tiny_mce_register_buttons' ] );
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function load_block_assets() { // phpcs:ignore
'attributes' => [
'ssFormId' => [
'type' => 'string',
'default' => __( 'Choose form', 'simpleshop-cz' ),
'default' => '(' . __( 'Choose the Product at the right panel', 'simpleshop-cz' ) . ')',
],
],
]
Expand Down
4 changes: 2 additions & 2 deletions src/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Settings {
*/
public function __construct( Plugin $loader ) {
// Set our title
$this->title = 'Settings';
$this->title = __( 'Settings', 'simpleshop-cz' );
$this->register_hooks();
$this->loader = $loader;
}
Expand Down Expand Up @@ -102,7 +102,7 @@ public function init() {
* @since 0.1.0
*/
public function add_options_page() {
$translatedTitle = __( $this->title, 'simpleshop-cz' );
$translatedTitle = $this->title;

add_submenu_page(
'simple_shop_settings',
Expand Down