Commit 52faab14 authored by lucha's avatar lucha

[auto] plugin: bogo 3.1.4

parent 60c172b8
......@@ -62,7 +62,9 @@ function bogo_admin_enqueue_scripts( $hook_suffix ) {
'orderby' => 'value',
) ),
'locales' => $locales,
'selectorLegend' => __( 'Displayed on pages in', 'bogo' ),
'selectorLegend' =>
/* translators: followed by available languages list */
__( 'Displayed on pages in', 'bogo' ),
'cbPrefix' => 'menu-item-bogo-locale',
) );
}
......@@ -332,8 +334,12 @@ function bogo_tools_page() {
'<a href="%1$s" class="sitelang" aria-label="%3$s">%2$s</a>',
$sitelang_link,
esc_html( __( 'Set as Site Language', 'bogo' ) ),
esc_attr(
sprintf( __( 'Set %s as Site Language', 'bogo' ), $language ) ) );
esc_attr( sprintf(
/* translators: %s: language name */
__( 'Set %s as Site Language', 'bogo' ),
$language
) )
);
$deactivate_link = menu_page_url( 'bogo', false );
$deactivate_link = add_query_arg(
......@@ -345,7 +351,11 @@ function bogo_tools_page() {
$deactivate_link,
esc_html( __( 'Deactivate', 'bogo' ) ),
esc_attr( sprintf(
__( 'Deactivate %s language pack', 'bogo' ), $language ) ) );
/* translators: %s: language name */
__( 'Deactivate %s language pack', 'bogo' ),
$language
) )
);
$row_actions = array( $sitelang_link, $deactivate_link );
}
......@@ -359,8 +369,12 @@ function bogo_tools_page() {
'<a href="%1$s" class="sitelang" aria-label="%3$s">%2$s</a>',
$sitelang_link,
esc_html( __( 'Set as Site Language', 'bogo' ) ),
esc_attr(
sprintf( __( 'Set %s as Site Language', 'bogo' ), $language ) ) );
esc_attr( sprintf(
/* translators: %s: language name */
__( 'Set %s as Site Language', 'bogo' ),
$language
) )
);
$delete_link = menu_page_url( 'bogo', false );
$delete_link = add_query_arg(
......@@ -368,14 +382,21 @@ function bogo_tools_page() {
$delete_link );
$delete_link = wp_nonce_url( $delete_link, 'bogo-tools' );
$delete_confirm = sprintf( __( "You are about to delete %s language pack.\n 'Cancel' to stop, 'OK' to delete.", 'bogo' ), $language );
$delete_confirm = sprintf(
/* translators: %s: language name */
__( "You are about to delete %s language pack.\n 'Cancel' to stop, 'OK' to delete.", 'bogo' ),
$language );
$delete_link = sprintf( '<a href="%1$s" class="delete" onclick="if (confirm(\'%3$s\')){return true;} return false;" aria-label="%4$s">%2$s</a>',
$delete_link,
esc_html( __( 'Delete', 'bogo' ) ),
esc_js( $delete_confirm ),
esc_attr(
sprintf( __( 'Delete %s language pack', 'bogo' ), $language ) ) );
esc_attr( sprintf(
/* translators: %s: language name */
__( 'Delete %s language pack', 'bogo' ),
$language
) )
);
$row_actions = array( $sitelang_link, $delete_link );
}
......@@ -409,9 +430,12 @@ function bogo_tools_page() {
$install_link = sprintf( '<a href="%1$s" class="install" aria-label="%3$s">%2$s</a>',
$install_link,
esc_html( __( 'Install', 'bogo' ) ),
esc_attr(
sprintf( __( 'Install %s language pack', 'bogo' ),
bogo_get_language( $locale ) ) ) );
esc_attr( sprintf(
/* translators: %s: language name */
__( 'Install %s language pack', 'bogo' ),
bogo_get_language( $locale )
) )
);
$row_actions = array( $install_link );
}
......
......@@ -256,8 +256,13 @@ function bogo_l10n_meta_box( $post ) {
echo '<li>';
if ( $edit_link ) {
echo sprintf( '<a href="%1$s" target="_blank">%2$s</a>',
esc_url( $edit_link ), get_the_title( $translation->ID ) );
echo sprintf(
'<a href="%1$s" target="_blank">%2$s <span class="screen-reader-text">%3$s</span></a>',
esc_url( $edit_link ),
get_the_title( $translation->ID ),
/* translators: accessibility text */
esc_html( __( '(opens in a new window)', 'bogo' ) )
);
} else {
echo get_the_title( $translation->ID );
}
......
......@@ -7,10 +7,10 @@ Author: Takayuki Miyoshi
Author URI: https://ideasilo.wordpress.com/
Text Domain: bogo
Domain Path: /languages/
Version: 3.1.3
Version: 3.1.4
*/
define( 'BOGO_VERSION', '3.1.3' );
define( 'BOGO_VERSION', '3.1.4' );
define( 'BOGO_PLUGIN', __FILE__ );
......
......@@ -48,6 +48,7 @@ function bogo_languages() {
'es_AR' => __( 'Spanish (Argentina)', 'bogo' ),
'es_CL' => __( 'Spanish (Chile)', 'bogo' ),
'es_CO' => __( 'Spanish (Colombia)', 'bogo' ),
'es_CR' => __( 'Spanish (Costa Rica)', 'bogo' ),
'es_GT' => __( 'Spanish (Guatemala)', 'bogo' ),
'es_MX' => __( 'Spanish (Mexico)', 'bogo' ),
'es_PE' => __( 'Spanish (Peru)', 'bogo' ),
......@@ -109,6 +110,7 @@ function bogo_languages() {
'ps' => __( 'Pashto', 'bogo' ),
'pt_BR' => __( 'Portuguese (Brazil)', 'bogo' ),
'pt_PT' => __( 'Portuguese (Portugal)', 'bogo' ),
'pt_PT_ao90' => __( 'Portuguese (Portugal) (Ao90)', 'bogo' ),
'rhg' => __( 'Rohingya', 'bogo' ),
'ro_RO' => __( 'Romanian', 'bogo' ),
'ru_RU' => __( 'Russian', 'bogo' ),
......
......@@ -6,7 +6,7 @@ function bogo_rest_api_init() {
register_rest_route( 'bogo/v1',
'/languages',
array(
'methods' => 'GET',
'methods' => WP_REST_Server::READABLE,
'callback' => 'bogo_rest_languages',
)
);
......@@ -14,17 +14,17 @@ function bogo_rest_api_init() {
register_rest_route( 'bogo/v1',
'/posts/(?P<id>\d+)/translations',
array(
'methods' => 'GET',
'methods' => WP_REST_Server::READABLE,
'callback' => 'bogo_rest_post_translations',
)
);
$locale_pattern = '[a-z]{2}(?:_[A-Z]{2}(?:_[A-Za-z]+)?)?';
$locale_pattern = '[a-z]{2}(?:_[A-Z]{2}(?:_[A-Za-z0-9]+)?)?';
register_rest_route( 'bogo/v1',
'/posts/(?P<id>\d+)/translations/(?P<locale>' . $locale_pattern . ')',
array(
'methods' => 'POST',
'methods' => WP_REST_Server::CREATABLE,
'callback' => 'bogo_rest_create_post_translation',
)
);
......
......@@ -2,8 +2,8 @@
Contributors: takayukister
Tags: multilingual, localization, language, locale, admin
Requires at least: 4.5
Tested up to: 4.8.1
Stable tag: 3.1.3
Tested up to: 4.9
Stable tag: 3.1.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Donate link: https://pledgie.com/campaigns/17860
......@@ -61,6 +61,11 @@ Here are some technical details for those interested. Bogo plugin assigns [one l
== Changelog ==
= 3.1.4 =
* Ease restrictions on locale code to accept special cases like "pt_PT_ao90".
* Add screenreader accessibility text "(opens in a new window)" to target=blank links.
= 3.1.3 =
* Avoid warnings in cases there is empty $row_actions for some reason.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment