Support » Plugin: Restrict Categories » Translations

  • I have modified the plugin to accept translations. You have to add

    /* Load translation, if it exists */
    
    function restrict_init() {
    
    	$plugin_dir = basename(dirname(__FILE__));
    
    	load_plugin_textdomain( 'restrict-categories', null, $plugin_dir.'/languages/' );
    
    }
    
    add_action('plugins_loaded', 'restrict_init');

    Then yo have to create the languages dir with the po and mo files:

    Spanish:
    restrict-categories-es_ES.mo
    and
    restrict-categories-es_ES.po

    msgid ""
    
    msgstr ""
    
    "Project-Id-Version: Restrict Categories\n"
    
    "Report-Msgid-Bugs-To: \n"
    
    "POT-Creation-Date: Thu Oct 30 2014 10:20:23 GMT+0100 (Hora estándar romance)\n"
    
    "PO-Revision-Date: Thu Oct 30 2014 10:31:32 GMT+0100 (Hora estándar romance)\n"
    
    "Last-Translator: admin <angelmoure@gmail.com>\n"
    
    "Language-Team: \n"
    
    "Language: Spanish\n"
    
    "Plural-Forms: nplurals=2; plural=n != 1\n"
    
    "MIME-Version: 1.0\n"
    
    "Content-Type: text/plain; charset=UTF-8\n"
    
    "Content-Transfer-Encoding: 8bit\n"
    
    "X-Poedit-SourceCharset: UTF-8\n"
    
    "X-Poedit-Basepath: .\n"
    
    "X-Poedit-SearchPath-0: .\n"
    
    "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
    
    "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
    
    "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
    
    "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
    
    "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
    
    "X-Loco-Target-Locale: es_ES\n"
    
    "X-Generator: Loco - https://localise.biz/"
    
    #: /restrict-categories.php:110
    
    msgid "Security check"
    
    msgstr "Comprobar seguridad"
    
    #: /restrict-categories.php:129
    
    msgid "Restrict Categories reset"
    
    msgstr "Reset Restrict Categories"
    
    #: /restrict-categories.php:153
    
    msgid "Settings"
    
    msgstr "Ajustes"
    
    #: /restrict-categories.php:326 /restrict-categories.php:326 /restrict-categories.
    
    #: php:358
    
    msgid "Restrict Categories"
    
    msgstr "Restringe Categorías"
    
    #: /restrict-categories.php:362
    
    #, php-format
    
    msgid "Search results for \"%s\""
    
    msgstr ""
    
    "Resultados de la búsqueda para \n"
    
    "\"%s\""
    
    #: /restrict-categories.php:363
    
    msgid "View All Users"
    
    msgstr "Ver Todos los Usuarios"
    
    #: /restrict-categories.php:369
    
    msgid "Roles"
    
    msgstr "Roles"
    
    #: /restrict-categories.php:370
    
    msgid "Users"
    
    msgstr "Usuarios"
    
    #: /restrict-categories.php:403
    
    msgid "Search Users"
    
    msgstr "Buscar Usuarios"
    
    #: /restrict-categories.php:421
    
    msgid "Reset to Default Settings"
    
    msgstr "Resetar Ajustes por Defecto"
    
    #: /restrict-categories.php:422
    
    msgid ""
    
    "This option will reset all changes you have made to the default "
    
    "configuration.  <strong>You cannot undo this process</strong>."
    
    msgstr ""
    
    "Esta opción resetará todos los cambios que has hecho a la configuración "
    
    "Incial. \n"
    
    "<strong>Este proceso no se podrá deshacer!</strong>."
    
    #: /restrict-categories.php:424
    
    msgid "Reset"
    
    msgstr "Reset"
    
    #: /restrict-categories.php:720
    
    msgid "Select All"
    
    msgstr "Seleccionar Todo"
    
    #: /restrict-categories.php:776
    
    #, php-format
    
    msgid "1 item"
    
    msgid_plural "%s items"
    
    msgstr[0] "1 ítem"
    
    msgstr[1] "%s items"
    
    #: /restrict-categories.php:794
    
    msgid "Go to the first page"
    
    msgstr "Ir a la primera página"
    
    #: /restrict-categories.php:801
    
    msgid "Go to the previous page"
    
    msgstr "Ir a la página anterior"
    
    #: /restrict-categories.php:810
    
    msgid "Current page"
    
    msgstr "página actual"
    
    #: /restrict-categories.php:817
    
    #, php-format
    
    msgctxt "paging"
    
    msgid "%1$s of %2$s"
    
    msgstr "%1$s de %2$s"
    
    #: /restrict-categories.php:821
    
    msgid "Go to the next page"
    
    msgstr "Ir a la siguiente página"
    
    #: /restrict-categories.php:828
    
    msgid "Go to the last page"
    
    msgstr "Ir a la última página"

    https://wordpress.org/plugins/restrict-categories/

  • The topic ‘Translations’ is closed to new replies.