Plugin Directory

Changeset 1772316


Ignore:
Timestamp:
11/21/2017 01:14:24 PM (8 years ago)
Author:
rapidweb
Message:

Adding internationalisation

Location:
permissions-editor-for-ninja-forms/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • permissions-editor-for-ninja-forms/trunk/penf_role_matrix.php

    r1771338 r1772316  
    22global $wp_roles;
    33?>
    4 <h1>Permissions Editor for Ninja Forms</h1>
    5 <p>Simply use the matrix below to select the Ninja Forms capabilities that you wish to enable the different user roles to have access to.</p>
    6 <p>Please note that 'View Menu' is required for any other capabilities and will be completed automatically upon selection of other capabilities.</p>
    7 <h2>Overview of each capability:</h2>
     4<h1><?= __('Permissions Editor for Ninja Forms', 'permissions-editor-for-ninja-forms') ?></h1>
     5<p><?= __('Simply use the matrix below to select the Ninja Forms capabilities that you wish to enable the different user roles to have access to.', 'permissions-editor-for-ninja-forms') ?></p>
     6<p><?= __('Please note that \'View Menu\' is required for any other capabilities and will be completed automatically upon selection of other capabilities.', 'permissions-editor-for-ninja-forms') ?></p>
     7<h2><?= __('Overview of each capability:', 'permissions-editor-for-ninja-forms') ?></h2>
    88<ul>
    9     <li><strong>Manage</strong> - enables the user to add new forms, edit/manage existing forms and access the Ninja Forms 'Add-ons'</li>
    10     <li><strong>Submissions</strong> - enables the user to view the submissions from form users</li>
    11     <li><strong>Import / Export</strong> - provides the user with access to the Import / Export options for Ninja Forms</li>
    12     <li><strong>Settings</strong> - provides user with access to the Ninja Forms settings</li>
     9    <li><strong><?= __('Manage', 'permissions-editor-for-ninja-forms') ?></strong> - <?= __('enables the user to add new forms, edit/manage existing forms and access the Ninja Forms \'Add-ons\'', 'permissions-editor-for-ninja-forms') ?></li>
     10    <li><strong><?= __('Submissions', 'permissions-editor-for-ninja-forms') ?></strong> - <?= __('enables the user to view the submissions from form users', 'permissions-editor-for-ninja-forms') ?></li>
     11    <li><strong><?= __('Import / Export', 'permissions-editor-for-ninja-forms') ?></strong> - <?= __('provides the user with access to the Import / Export options for Ninja Forms', 'permissions-editor-for-ninja-forms') ?></li>
     12    <li><strong><?= __('Settings', 'permissions-editor-for-ninja-forms') ?></strong> - <?= __('provides user with access to the Ninja Forms settings', 'permissions-editor-for-ninja-forms') ?></li>
    1313</ul>
    1414<form method="post" action="<?php echo esc_url(admin_url('admin-post.php')); ?>">
  • permissions-editor-for-ninja-forms/trunk/permissions-editor-for-ninja_forms.php

    r1771338 r1772316  
    33Plugin Name: Permissions Editor for Ninja Forms
    44Description: This plugin enables you to select the Ninja Forms capabilities that you wish to enable different WordPress user roles to have access to.
    5 Version: 1.0.0
     5Version: 1.1.0
    66Author: Rapid Web Ltd
    77Author URI: http://rapidweb.biz
     8Text Domain: penf
     9Domain Path: /languages
    810*/
    911
     12function penf_load_plugin_textdomain() {
     13    load_plugin_textdomain('permissions-editor-for-ninja-forms', false, basename(dirname(__FILE__)).'/languages/' );
     14}
     15add_action('plugins_loaded', 'penf_load_plugin_textdomain' );
     16
    1017function penf_get_caps() {
    11     return ['penf_manage' => 'Manage',
    12             'penf_submissions' => 'Submissions',
    13             'penf_import' => 'Import / Export',
    14             'penf_settings' => 'Settings',
    15             'penf_view_menu' => 'View Menu'];
     18    return ['penf_manage' => __('Manage', 'permissions-editor-for-ninja-forms'),
     19            'penf_submissions' => __('Submissions', 'permissions-editor-for-ninja-forms'),
     20            'penf_import' => __('Import / Export', 'permissions-editor-for-ninja-forms'),
     21            'penf_settings' => __('Settings', 'permissions-editor-for-ninja-forms'),
     22            'penf_view_menu' => __('View Menu', 'permissions-editor-for-ninja-forms')];
    1623}
    1724
    1825function penf_build_menu()
    1926{
    20     add_options_page( 'Permissions Editor for Ninja Forms',
    21                      'Permissions Editor for Ninja Forms',
     27    add_options_page( __('Permissions Editor for Ninja Forms', 'permissions-editor-for-ninja-forms'),
     28                      __('Permissions Editor for Ninja Forms', 'permissions-editor-for-ninja-forms'),
    2229                      'manage_options',
    2330                      'penf_role_matrix', 'penf_role_matrix' );
     
    2835function penf_role_matrix() {
    2936    if (!current_user_can('manage_options'))  {
    30         wp_die('You do not have sufficient permissions to access this page.');
     37        wp_die(__('You do not have sufficient permissions to access this page.', 'permissions-editor-for-ninja-forms'));
    3138    }
    3239   
     
    4148    if (!is_plugin_active('ninja-forms/ninja-forms.php')) {
    4249        deactivate_plugins(plugin_basename(__FILE__));
    43         wp_die('<p>The <strong>Permissions Editor for Ninja Forms</strong> plugin requires the Ninja Forms plugin. Please install and activate the Ninja Forms plugin and then try again.</p>', 'Ninja Forms is not installed!', ['response' => 200, 'back_link' => true]);
     50        wp_die(
     51            __('<p>The <strong>Permissions Editor for Ninja Forms</strong> plugin requires the Ninja Forms plugin. Please install and activate the Ninja Forms plugin and then try again.</p>', 'permissions-editor-for-ninja-forms'),
     52            __('Ninja Forms is not installed!', 'permissions-editor-for-ninja-forms'),
     53            ['response' => 200, 'back_link' => true]
     54        );
    4455    }
    4556
     
    5566    ?>
    5667    <div class="notice notice-info is-dismissible">
    57         <p>The <strong>Permissions Editor for Ninja Forms</strong> plugin has been deactivated, because the Ninja Forms plugin is no longer active.</p>
     68        <?= __('<p>The <strong>Permissions Editor for Ninja Forms</strong> plugin has been deactivated, because the Ninja Forms plugin is no longer active.</p>', 'permissions-editor-for-ninja-forms') ?>
    5869    </div>
    5970    <?php
     
    6576
    6677    if (!current_user_can('manage_options'))  {
    67         wp_die('You do not have sufficient permissions to perform this action.');
     78        wp_die(__('You do not have sufficient permissions to perform this action.', 'permissions-editor-for-ninja-forms'));
    6879    }
    6980
  • permissions-editor-for-ninja-forms/trunk/readme.txt

    r1771338 r1772316  
    44Requires at least: 4.1
    55Tested up to: 4.8.1
    6 Stable tag: 1.0.0
     6Stable tag: 1.1.0
    77License: LGPL-3.0
    88License URI: https://opensource.org/licenses/LGPL-3.0
Note: See TracChangeset for help on using the changeset viewer.