Plugin Directory

Changeset 2746019


Ignore:
Timestamp:
06/21/2022 05:54:56 PM (4 years ago)
Author:
jvsan
Message:

internationalization fix

Location:
custom-ajax-search-results/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • custom-ajax-search-results/trunk/casr.php

    r2742539 r2746019  
    66 * Version: 1.0.0
    77 * Author URI: https://linkedin.com/in/joaovpdls
    8  * Text Domain: casr
     8 * Text Domain: custom-ajax-search-results
    99 * Domain Path: /languages
    1010 * License: GPLv2 or later
     
    1919
    2020function casr_load_text_domain() {
    21   load_plugin_textdomain( 'casr', false, plugin_basename( __DIR__ ) . '/languages/' );
     21  load_plugin_textdomain( 'custom-ajax-search-results', false, plugin_basename( __DIR__ ) . '/languages/' );
    2222}
    2323
  • custom-ajax-search-results/trunk/includes/class-casr-register-settings.php

    r2742539 r2746019  
    1818        register_setting( 'casr_options_group', 'casr-placeholder', $args = array(
    1919            'type' => 'string',
    20             'default' => __( 'Type here', 'casr' ),
     20            'default' => __( 'Type here', 'custom-ajax-search-results' ),
    2121            'sanitize_callback' => 'sanitize_text_field',
    2222        ) );
    2323        register_setting( 'casr_options_group', 'casr-search-button', $args = array(
    2424            'type' => 'string',
    25             'default' => __( 'Search', 'casr' ),
     25            'default' => __( 'Search', 'custom-ajax-search-results' ),
    2626            'sanitize_callback' => 'sanitize_text_field',
    2727        ) );
    2828        register_setting( 'casr_options_group', 'casr-loading-text', $args = array(
    2929            'type' => 'string',
    30             'default' => __( 'Loading...', 'casr' ),
     30            'default' => __( 'Loading...', 'custom-ajax-search-results' ),
    3131            'sanitize_callback' => 'sanitize_text_field',
    3232        ) );
    3333        register_setting( 'casr_options_group', 'casr-read-more-text', $args = array(
    3434            'type' => 'string',
    35             'default' => __( 'Read more', 'casr' ),
     35            'default' => __( 'Read more', 'custom-ajax-search-results' ),
    3636            'sanitize_callback' => 'sanitize_text_field',
    3737        ) );
  • custom-ajax-search-results/trunk/includes/class-casr-search-form.php

    r2742539 r2746019  
    2626            'loading_image' => $image_url ) );
    2727
    28         $placeholder = get_option( 'casr-placeholder', __( 'Type here', 'casr' ) );
    29         $search_text = get_option( 'casr-search-button', __( 'Search', 'casr' ) );
    30         $loading = get_option( 'casr-loading-text', __( 'Loading...', 'casr' ) );
     28        $placeholder = get_option( 'casr-placeholder', __( 'Type here', 'custom-ajax-search-results' ) );
     29        $search_text = get_option( 'casr-search-button', __( 'Search', 'custom-ajax-search-results' ) );
     30        $loading = get_option( 'casr-loading-text', __( 'Loading...', 'custom-ajax-search-results' ) );
    3131   
    3232        $search_form = '<form id="casr-search-form" class="wp-block-search__inside-wrapper">';
  • custom-ajax-search-results/trunk/includes/class-casr-search-results.php

    r2742539 r2746019  
    3535                    <?php include plugin_dir_path( __FILE__ ) . 'reusable/casr-content.php'; ?>
    3636                    <?php if (  $casr_search->max_num_pages > 1 ) :
    37                     echo wp_kses( '<center id="casr-center"><button id="casr-load-more">', $arr ) . esc_html__( 'More posts', 'casr' ) . wp_kses( '</button></center>', $arr );
     37                    echo wp_kses( '<center id="casr-center"><button id="casr-load-more">', $arr ) . esc_html__( 'More posts', 'custom-ajax-search-results' ) . wp_kses( '</button></center>', $arr );
    3838                    endif; ?>
    3939                </div>
     
    4141            <?php
    4242            else: ?>
    43                 <h3><?php esc_html_e( 'Nothing found', 'casr' ) ?></h3>
    44                 <p><?php esc_html_e( 'Please, try again!', 'casr' ) ?></p>
     43                <h3><?php esc_html_e( 'Nothing found', 'custom-ajax-search-results' ) ?></h3>
     44                <p><?php esc_html_e( 'Please, try again!', 'custom-ajax-search-results' ) ?></p>
    4545            <?php
    4646            endif; ?>
     
    6969        include plugin_dir_path( __FILE__ ) . 'reusable/casr-content.php';
    7070        if (  $page < $casr_search->max_num_pages ) :
    71             echo wp_kses( '<center id="casr-center"><button id="casr-load-more">', $arr ) . esc_html__( 'More posts', 'casr' ) . wp_kses( '</button></center>', $arr );
     71            echo wp_kses( '<center id="casr-center"><button id="casr-load-more">', $arr ) . esc_html__( 'More posts', 'custom-ajax-search-results' ) . wp_kses( '</button></center>', $arr );
    7272        endif;
    7373       
  • custom-ajax-search-results/trunk/includes/class-casr-settings-page.php

    r2742539 r2746019  
    3636
    3737            <nav class="nav-tab-wrapper">
    38                 <a href="?page=<?php echo esc_html( $this->slug ); ?>" class="nav-tab <?php if( $tab === null ):?>nav-tab-active<?php endif; ?>"><?php esc_html_e( 'Search form', 'casr' ) ?></a>
    39                 <a href="?page=<?php echo esc_html( $this->slug ); ?>&tab=post-list" class="nav-tab <?php if( $tab === 'post-list' ):?>nav-tab-active<?php endif; ?>"><?php esc_html_e( 'Post list', 'casr' ) ?></a>
     38                <a href="?page=<?php echo esc_html( $this->slug ); ?>" class="nav-tab <?php if( $tab === null ):?>nav-tab-active<?php endif; ?>"><?php esc_html_e( 'Search form', 'custom-ajax-search-results' ) ?></a>
     39                <a href="?page=<?php echo esc_html( $this->slug ); ?>&tab=post-list" class="nav-tab <?php if( $tab === 'post-list' ):?>nav-tab-active<?php endif; ?>"><?php esc_html_e( 'Post list', 'custom-ajax-search-results' ) ?></a>
    4040            </nav>
    4141
     
    5858    function casr_post_list_tab_form() {
    5959        ?>
    60             <p><?php esc_html_e( 'On the section below, you can customize the content for the posts retrieved by user query', 'casr' ) ?></p>
     60            <p><?php esc_html_e( 'On the section below, you can customize the content for the posts retrieved by user query', 'custom-ajax-search-results' ) ?></p>
    6161            <form method="post" action="options.php">
    6262            <?php settings_fields( 'casr_second_options_group' ); ?>
     
    6464                    <tr>                                                                                                                           
    6565                        <td>
    66                             <label for="casr-post-title"><b><?php esc_html_e( 'Post title (with link)','casr' ) ?></b></label>
     66                            <label for="casr-post-title"><b><?php esc_html_e( 'Post title (with link)','custom-ajax-search-results' ) ?></b></label>
    6767                        </td>
    6868                        <td>
     
    7272                    <tr>                                                                                                                           
    7373                        <td>
    74                             <label for="casr-post-title-no-link"><b><?php esc_html_e( 'Post title (no link)','casr' ) ?></b></label>
     74                            <label for="casr-post-title-no-link"><b><?php esc_html_e( 'Post title (no link)','custom-ajax-search-results' ) ?></b></label>
    7575                        </td>
    7676                        <td>
     
    8080                    <tr>
    8181                        <td>
    82                             <label for="casr-excerpt"><b><?php esc_html_e( 'Excerpt','casr' ) ?></b></label>
     82                            <label for="casr-excerpt"><b><?php esc_html_e( 'Excerpt','custom-ajax-search-results' ) ?></b></label>
    8383                        </td>
    8484                        <td>
     
    8888                    <tr>
    8989                        <td>
    90                             <label for="casr-read-more-option"><b><?php esc_html_e( 'Read more link','casr' ) ?></b></label>
     90                            <label for="casr-read-more-option"><b><?php esc_html_e( 'Read more link','custom-ajax-search-results' ) ?></b></label>
    9191                        </td>
    9292                        <td>
     
    110110                    <tr>
    111111                        <td>
    112                             <label for="first_field_id"><b><?php esc_html_e( 'Search form placeholder', 'casr' ) ?></b></label>
     112                            <label for="first_field_id"><b><?php esc_html_e( 'Search form placeholder', 'custom-ajax-search-results' ) ?></b></label>
    113113                        </td>
    114114                        <td>
    115                             <input type = 'text' class="regular-text" id="first_field_id" name="casr-placeholder" value="<?php echo esc_attr( get_option( 'casr-placeholder' ) ); ?>">
     115                            <input type = 'text' class="regular-text" id="first_field" name="casr-placeholder" value="<?php echo esc_attr( get_option( 'casr-placeholder' ) ); ?>">
    116116                        </td>
    117117                    </tr>
    118118                    <tr>
    119119                        <td>
    120                             <label for = "second_field_id"><b><?php esc_html_e( 'Search button text', 'casr' ) ?></b></label>
     120                            <label for = "second_field_id"><b><?php esc_html_e( 'Search button text', 'custom-ajax-search-results' ) ?></b></label>
    121121                        </td> 
    122122                        <td>             
    123                             <input type = 'text' class="regular-text" id="second_field_id" name="casr-search-button" value="<?php echo esc_attr( get_option( 'casr-search-button' ) ); ?>">
     123                            <input type = 'text' class="regular-text" id="second_field" name="casr-search-button" value="<?php echo esc_attr( get_option( 'casr-search-button' ) ); ?>">
    124124                        </td>
    125125                    </tr>
    126126                    <tr>
    127127                        <td>   
    128                             <label for = "third_field_id"><b><?php esc_html_e( 'Loading text', 'casr' ) ?></b></label>
     128                            <label for = "third_field_id"><b><?php esc_html_e( 'Loading text', 'custom-ajax-search-results' ) ?></b></label>
    129129                        </td>
    130130                        <td>   
    131                             <input type = 'text' class="regular-text" id="third_field_id" name="casr-loading-text" value="<?php echo esc_attr( get_option( 'casr-loading-text' ) ); ?>">
     131                            <input type = 'text' class="regular-text" id="third_field" name="casr-loading-text" value="<?php echo esc_attr( get_option( 'casr-loading-text' ) ); ?>">
    132132                        </td>
    133133                    </tr>
    134134                    <tr>
    135135                        <td>
    136                             <label for = "third_field_id"><b><?php esc_html_e('Read more text', 'casr') ?></b></label>
     136                            <label for = "third_field_id"><b><?php esc_html_e('Read more text', 'custom-ajax-search-results') ?></b></label>
    137137                        </td>
    138138                        <td>
    139                             <input type = 'text' class="regular-text" id="fourth_field_id" name="casr-read-more-text" value="<?php echo esc_attr( get_option( 'casr-read-more-text' ) ); ?>">
     139                            <input type = 'text' class="regular-text" id="fourth_field" name="casr-read-more-text" value="<?php echo esc_attr( get_option( 'casr-read-more-text' ) ); ?>">
    140140                        </td> 
    141141                    </tr>
    142142                </table>
    143143       
    144                 <h2 style = "margin-top: 30px;"><?php esc_html_e( 'Content', 'casr' ) ?></h2>
    145                 <p><?php esc_html_e( 'Select the post types that you want to display in search results', 'casr' ) ?></p> 
     144                <h2 style = "margin-top: 30px;"><?php esc_html_e( 'Content', 'custom-ajax-search-results' ) ?></h2>
     145                <p><?php esc_html_e( 'Select the post types that you want to display in search results', 'custom-ajax-search-results' ) ?></p> 
    146146       
    147147                <div style="display: flex; flex-direction: column; gap: 5px;">
    148148                    <div>   
    149                         <input type="radio" name="casr-content-type" id="post" value="post" <?php if ( 'post' == get_option('casr-content-type') ) echo esc_html( 'checked="checked"' );  ?>/><label for="post"><?php esc_html_e( 'Posts', 'casr')  ?></label>
     149                        <input type="radio" name="casr-content-type" id="post" value="post" <?php if ( 'post' == get_option('casr-content-type') ) echo esc_html( 'checked="checked"' );  ?>/><label for="post"><?php esc_html_e( 'Posts', 'custom-ajax-search-results')  ?></label>
    150150                    </div>
    151151                    <div>
    152                         <input type="radio" name="casr-content-type" id="page" value="page" <?php if ( 'page' == get_option('casr-content-type') ) echo esc_html( 'checked="checked"' );  ?>/><label for="page"><?php esc_html_e( 'Pages', 'casr' ) ?></label>
     152                        <input type="radio" name="casr-content-type" id="page" value="page" <?php if ( 'page' == get_option('casr-content-type') ) echo esc_html( 'checked="checked"' );  ?>/><label for="page"><?php esc_html_e( 'Pages', 'custom-ajax-search-results' ) ?></label>
    153153                    </div>
    154154                    <div>
    155                         <input type="radio" name="casr-content-type" id="any" value="any" <?php if ( 'any' == get_option('casr-content-type') ) echo esc_html( 'checked="checked"' );  ?>/><label for="any"><?php esc_html_e( 'Show all', 'casr' ) ?></label>
     155                        <input type="radio" name="casr-content-type" id="any" value="any" <?php if ( 'any' == get_option('casr-content-type') ) echo esc_html( 'checked="checked"' );  ?>/><label for="any"><?php esc_html_e( 'Show all', 'custom-ajax-search-results' ) ?></label>
    156156                    </div>
    157157                </div>
    158158       
    159                 <div style="background-color: white; border: 1px solid black; border-radius: 15px; margin-top: 30px; padding: 20px;"><?php esc_html_e( 'Use the shortcode', 'casr' ) ?> <em>[my-search-form]</em> <?php esc_html_e( 'to insert our custom search form anywhere you want', 'casr' ) ?>.</div>
     159                <div style="background-color: white; border: 1px solid black; border-radius: 15px; margin-top: 30px; padding: 20px;"><?php esc_html_e( 'Use the shortcode', 'custom-ajax-search-results' ) ?> <em>[my-search-form]</em> <?php esc_html_e( 'to insert our custom search form anywhere you want', 'custom-ajax-search-results' ) ?>.</div>
    160160       
    161161                <?php submit_button(); ?>
  • custom-ajax-search-results/trunk/includes/class-casr.php

    r2742557 r2746019  
    1313     * Plugin properties
    1414     */
    15     const VERSION = '1.0.0';
     15    const VERSION = '1.0.1';
    1616    const SLUG = 'custom-ajax-search-results';
    1717    const PLUGIN_FILE = self::SLUG . '/casr.php';
     
    6868    function casr_add_plugin_page_settings_link($links, $file) {
    6969        if ( $file == self::PLUGIN_FILE ) {
    70             $settings_link = '<a href="' . admin_url( 'options-general.php?page=' ) . self::SLUG . '">' . esc_html__( 'Settings', 'casr' ) . '</a>';
     70            $settings_link = '<a href="' . admin_url( 'options-general.php?page=' ) . self::SLUG . '">' . esc_html__( 'Settings', 'custom-ajax-search-results' ) . '</a>';
    7171            array_unshift( $links, $settings_link );
    7272        }
  • custom-ajax-search-results/trunk/includes/reusable/casr-ajax-get-settings.php

    r2742539 r2746019  
    55$arr = array( 'center' => array( 'id' => array() ), 'button' => array( 'id' => array() ) );
    66$default_posts_per_page = get_option( 'posts_per_page' );
    7 $read_more = get_option( 'casr-read-more-text', __( 'Read more', 'casr' ) );
     7$read_more = get_option( 'casr-read-more-text', __( 'Read more', 'custom-ajax-search-results' ) );
    88$post_type = get_option( 'casr-content-type', 'any' );
    99$post_title = get_option( 'casr-post-title' );
  • custom-ajax-search-results/trunk/includes/reusable/casr-content.php

    r2742539 r2746019  
    77    $casr_search->the_post(); ?>
    88        <div class="casr-post" id="post-<?php echo esc_html( $i ) ?>">
    9             <?php if( $i > 0 ): echo wp_kses_post( "<hr class='casr-hr'/>" ); endif;
     9            <?php if( $i > 0 ): echo wp_kses_post( '<hr class="casr-hr"/>' ); endif;
    1010
    1111            if ( $post_title == 1 ): ?>
    12             <h2><a href="<?php the_permalink(); ?>" target="_blank" rel="noopener nofollow"><?php the_title(); ?></a></h2>
     12                <h2><a href="<?php the_permalink(); ?>" target="_blank" rel="noopener nofollow"><?php the_title(); ?></a></h2>
    1313            <?php
    1414            else: ?>
    15             <h2><?php the_title(); ?></h2>
     15                <h2><?php the_title(); ?></h2>
    1616            <?php endif;
    1717
    1818            if ( $post_excerpt == 1 ):
    19             the_excerpt();
     19            the_excerpt();
    2020            endif; 
    2121
    2222            if ( $read_more_option == 1 ): ?>
    23             <p class="casr-read-more"><a href="<?php the_permalink(); ?>" target="_blank" rel="noopener nofollow"><?php echo esc_html( $read_more ); ?></a></p>
     23                <p class="casr-read-more"><a href="<?php the_permalink(); ?>" target="_blank" rel="noopener nofollow"><?php echo esc_html( $read_more ); ?></a></p>
    2424            <?php endif; ?>
    2525        </div>
  • custom-ajax-search-results/trunk/languages/casr.pot

    r2742539 r2746019  
    1 # C.A.S.R. Pot
     1# Custom Ajax Search Results Pot
    22# Copyright 2022 ...
    3 # This file is distributed under the GNU General Public License v3 or later.
     3# This file is distributed under the GNU General Public License v2 or later.
    44msgid ""
    55msgstr ""
    6 "Project-Id-Version: C.A.S.R. Pot v1.0.0\n"
    7 "POT-Creation-Date: 2022-24-05 15:25+0100\n"
     6"Project-Id-Version: Custom Ajax Search Results Pot v1.0.0\n"
     7"POT-Creation-Date: 2022-06-21 14:35+0300\n"
    88"PO-Revision-Date: \n"
    99"Last-Translator: João Santos <[email protected]>\n"
     
    2323"X-Poedit-Country: UNITED STATES\n"
    2424"X-Poedit-Bookmarks: \n"
     25
     26#: includes/class-casr-register-settings.php:20
     27#: includes/class-casr-search-form.php:28
     28msgid "Type here"
     29msgstr ""
     30
     31#: includes/class-casr-register-settings.php:25
     32#: includes/class-casr-search-form.php:29
     33msgid "Search"
     34msgstr ""
     35
     36#: includes/class-casr-register-settings.php:30
     37#: includes/class-casr-search-form.php:30
     38msgid "Loading..."
     39msgstr ""
     40
     41#: includes/class-casr-register-settings.php:35
     42#: includes/reusable/casr-ajax-get-settings.php:7
     43msgid "Read more"
     44msgstr ""
     45
     46#: includes/class-casr-search-results.php:37
     47#: includes/class-casr-search-results.php:71
     48msgid "More posts"
     49msgstr ""
     50
     51#: includes/class-casr-search-results.php:43
     52msgid "Nothing found"
     53msgstr ""
     54
     55#: includes/class-casr-search-results.php:44
     56msgid "Please, try again!"
     57msgstr ""
     58
     59#: includes/class-casr-settings-page.php:38
     60msgid "Search form"
     61msgstr ""
     62
     63#: includes/class-casr-settings-page.php:39
     64msgid "Post list"
     65msgstr ""
     66
     67#: includes/class-casr-settings-page.php:60
     68msgid ""
     69"On the section below, "
     70"you can customize the "
     71"content for the posts "
     72"retrieved by user query"
     73msgstr ""
     74
     75#: includes/class-casr-settings-page.php:66
     76msgid ""
     77"Post title (with link)"
     78msgstr ""
     79
     80#: includes/class-casr-settings-page.php:74
     81msgid ""
     82"Post title (no link)"
     83msgstr ""
     84
     85#: includes/class-casr-settings-page.php:82
     86msgid "Excerpt"
     87msgstr ""
     88
     89#: includes/class-casr-settings-page.php:90
     90msgid "Read more link"
     91msgstr ""
     92
     93#: includes/class-casr-settings-page.php:112
     94msgid ""
     95"Search form placeholder"
     96msgstr ""
     97
     98#: includes/class-casr-settings-page.php:120
     99msgid "Search button text"
     100msgstr ""
     101
     102#: includes/class-casr-settings-page.php:128
     103msgid "Loading text"
     104msgstr ""
     105
     106#: includes/class-casr-settings-page.php:136
     107msgid "Read more text"
     108msgstr ""
     109
     110#: includes/class-casr-settings-page.php:144
     111msgid "Content"
     112msgstr ""
     113
     114#: includes/class-casr-settings-page.php:145
     115msgid ""
     116"Select the post types "
     117"that you want to display "
     118"in search results"
     119msgstr ""
     120
     121#: includes/class-casr-settings-page.php:149
     122msgid "Posts"
     123msgstr ""
     124
     125#: includes/class-casr-settings-page.php:152
     126msgid "Pages"
     127msgstr ""
     128
     129#: includes/class-casr-settings-page.php:155
     130msgid "Show all"
     131msgstr ""
     132
     133#: includes/class-casr-settings-page.php:159
     134msgid "Use the shortcode"
     135msgstr ""
     136
     137#: includes/class-casr-settings-page.php:159
     138msgid ""
     139"to insert our custom "
     140"search form anywhere you "
     141"want"
     142msgstr ""
     143
     144#: includes/class-casr.php:70
     145msgid "Settings"
     146msgstr ""
     147
     148#. Name of the plugin
     149msgid "Custom AJAX Search Results (C.A.S.R.)"
     150msgstr ""
     151
     152#. Description of the plugin
     153msgid "Insert a search bar with AJAX search results anywhere you want with a shortcode"
     154msgstr ""
  • custom-ajax-search-results/trunk/readme.txt

    r2742539 r2746019  
    25254. Search results example 2
    26265. Nothing found
     27
     28== Changelog ==
     29= 1.0.1 =
     30* Fixed internationalization errors.
     31
     32= 1.0.0 =
     33* Initial release.
     34
     35== Upgrade Notice ==
     36= 1.0.1 =
     37* Update for proper internationalization.
Note: See TracChangeset for help on using the changeset viewer.