Skip to content

Commit

Permalink
QTS: merge qts textdomain to qtranslate, update l10n (#1120)
Browse files Browse the repository at this point in the history
* remove qts textdomain, merge with qtranslate, cleanup
* update all po/mo files with new pot file, include existing qts translations
  • Loading branch information
spleen1981 authored Mar 12, 2022
1 parent 8f482fa commit c12cbc3
Show file tree
Hide file tree
Showing 71 changed files with 38,193 additions and 30,607 deletions.
Binary file modified lang/qtranslate-ar.mo
Binary file not shown.
2,091 changes: 1,243 additions & 848 deletions lang/qtranslate-ar.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-az_AZ.mo
Binary file not shown.
2,221 changes: 1,289 additions & 932 deletions lang/qtranslate-az_AZ.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-bg_BG.mo
Binary file not shown.
2,324 changes: 1,341 additions & 983 deletions lang/qtranslate-bg_BG.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-bn.mo
Binary file not shown.
1,836 changes: 883 additions & 953 deletions lang/qtranslate-bn.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-ca.mo
Binary file not shown.
2,335 changes: 1,352 additions & 983 deletions lang/qtranslate-ca.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-cs_CZ.mo
Binary file not shown.
2,226 changes: 1,311 additions & 915 deletions lang/qtranslate-cs_CZ.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-da_DK.mo
Binary file not shown.
2,299 changes: 1,321 additions & 978 deletions lang/qtranslate-da_DK.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-de_DE.mo
Binary file not shown.
2,680 changes: 1,681 additions & 999 deletions lang/qtranslate-de_DE.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-el.mo
Binary file not shown.
2,130 changes: 1,261 additions & 869 deletions lang/qtranslate-el.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-eo.mo
Binary file not shown.
1,970 changes: 1,172 additions & 798 deletions lang/qtranslate-eo.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-es_ES.mo
Binary file not shown.
2,321 changes: 1,338 additions & 983 deletions lang/qtranslate-es_ES.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-fr_FR.mo
Binary file not shown.
2,296 changes: 890 additions & 1,406 deletions lang/qtranslate-fr_FR.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-hr.mo
Binary file not shown.
2,096 changes: 1,207 additions & 889 deletions lang/qtranslate-hr.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-hu_HU.mo
Binary file not shown.
2,768 changes: 1,535 additions & 1,233 deletions lang/qtranslate-hu_HU.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-id_ID.mo
Binary file not shown.
2,304 changes: 1,328 additions & 976 deletions lang/qtranslate-id_ID.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-it_IT.mo
Binary file not shown.
3,053 changes: 1,855 additions & 1,198 deletions lang/qtranslate-it_IT.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-ja.mo
Binary file not shown.
2,298 changes: 1,320 additions & 978 deletions lang/qtranslate-ja.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-mk_MK.mo
Binary file not shown.
2,283 changes: 1,325 additions & 958 deletions lang/qtranslate-mk_MK.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-ms_MY.mo
Binary file not shown.
2,323 changes: 1,340 additions & 983 deletions lang/qtranslate-ms_MY.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-nl_NL.mo
Binary file not shown.
2,720 changes: 1,685 additions & 1,035 deletions lang/qtranslate-nl_NL.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-nl_NL_formal.mo
Binary file not shown.
1,031 changes: 278 additions & 753 deletions lang/qtranslate-nl_NL_formal.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-pl_PL.mo
Binary file not shown.
2,302 changes: 1,324 additions & 978 deletions lang/qtranslate-pl_PL.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-pt_BR.mo
Binary file not shown.
2,055 changes: 1,216 additions & 839 deletions lang/qtranslate-pt_BR.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-pt_PT.mo
Binary file not shown.
2,848 changes: 1,701 additions & 1,147 deletions lang/qtranslate-pt_PT.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-ro_RO.mo
Binary file not shown.
2,313 changes: 1,331 additions & 982 deletions lang/qtranslate-ro_RO.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-ru_RU.mo
Binary file not shown.
904 changes: 281 additions & 623 deletions lang/qtranslate-ru_RU.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-sl_SI.mo
Binary file not shown.
1,818 changes: 943 additions & 875 deletions lang/qtranslate-sl_SI.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-sr_RS.mo
Binary file not shown.
2,297 changes: 1,336 additions & 961 deletions lang/qtranslate-sr_RS.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-sv_SE.mo
Binary file not shown.
2,123 changes: 1,242 additions & 881 deletions lang/qtranslate-sv_SE.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-tr_TR.mo
Binary file not shown.
2,222 changes: 1,291 additions & 931 deletions lang/qtranslate-tr_TR.po

Large diffs are not rendered by default.

Binary file modified lang/qtranslate-zh_CN.mo
Binary file not shown.
988 changes: 278 additions & 710 deletions lang/qtranslate-zh_CN.po

Large diffs are not rendered by default.

472 changes: 271 additions & 201 deletions lang/qtranslate.pot

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions modules/slugs/includes/class-qtranslate-slug.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ function init() {
return;
}

load_plugin_textdomain( 'qts', false, basename( plugin_dir_path( dirname( __FILE__ ) ) ) . '/languages' );

if ( is_admin() ) {
include_once( dirname( __FILE__ ) . '/qtranslate-slug-settings.php' );
}
Expand Down Expand Up @@ -917,6 +915,7 @@ public function _get_page_link( $link, $id ) {
*
* @return string the link translated
*/
//TODO: review this function vs get_term_link(), e.g. checks and error handling may be unneeded here
public function term_link( $link, $term, $taxonomy ) {
global $wp_rewrite;

Expand All @@ -934,7 +933,7 @@ public function term_link( $link, $term, $taxonomy ) {
}

if ( ! is_object( $term ) ) {
$term = new WP_Error( 'invalid_term', __( 'Empty Term', 'qts' ) );
$term = new WP_Error( 'invalid_term', __( 'Empty Term' ) );
}

if ( is_wp_error( $term ) ) {
Expand Down Expand Up @@ -1113,17 +1112,17 @@ public function add_slug_meta_box() {
$context = apply_filters( "qts_admin_meta_box_context", "side" );
$priority = apply_filters( "qts_admin_meta_box_priority", "high" );

add_meta_box( 'qts_sectionid', __( 'Slug QTS', 'qts' ), array(
add_meta_box( 'qts_sectionid', __( 'Slugs per language', 'qtranslate' ), array(
&$this,
'draw_meta_box'
), 'post', $context, $priority );
add_meta_box( 'qts_sectionid', __( 'Slug QTS', 'qts' ), array(
add_meta_box( 'qts_sectionid', __( 'Slugs per language', 'qtranslate' ), array(
&$this,
'draw_meta_box'
), 'page', $context, $priority );

foreach ( get_post_types( array( '_builtin' => false ) ) as $ptype ) {
add_meta_box( 'qts_sectionid', __( 'Slug QTS', 'qts' ), array(
add_meta_box( 'qts_sectionid', __( 'Slugs per language', 'qtranslate' ), array(
&$this,
'draw_meta_box'
), $ptype, $context, $priority );
Expand Down Expand Up @@ -1322,7 +1321,7 @@ public function show_term_fields( $term ) {
$value = ( $slug ) ? htmlspecialchars( $slug, ENT_QUOTES ) : '';

echo "<tr class=\"form-field form-required\">" . PHP_EOL;
echo "<th scope=\"row\"><label for=\"qts_{$lang}_slug\">" . sprintf( __( 'Slug (%s)', 'qts' ), $q_config['language_name'][ $lang ] ) . "</label></th>" . PHP_EOL;
echo "<th scope=\"row\"><label for=\"qts_{$lang}_slug\">" . sprintf( __( 'Slug' ) . ' (%s)', $q_config['language_name'][ $lang ] ) . "</label></th>" . PHP_EOL;
echo "<td><input type=\"text\" name=\"qts_{$lang}_slug\" value=\"" . urldecode( $value ) . "\" /></td></tr>" . PHP_EOL;

}
Expand All @@ -1341,7 +1340,7 @@ public function show_term_fields( $term ) {

$value = ( $slug ) ? htmlspecialchars( $slug, ENT_QUOTES ) : '';

echo "<label for=\"qts_{$lang}_slug\">" . sprintf( __( 'Slug (%s)', 'qts' ), $q_config['language_name'][ $lang ] ) . "</label>" . PHP_EOL;
echo "<label for=\"qts_{$lang}_slug\">" . sprintf( __( 'Slug' ) . ' (%s)', $q_config['language_name'][ $lang ] ) . "</label>" . PHP_EOL;
echo "<input type=\"text\" name=\"qts_{$lang}_slug\" value=\"" . urldecode( $value ) . "\" aria-required=\"true\">" . PHP_EOL;
echo '</div>';
}
Expand Down Expand Up @@ -1510,8 +1509,8 @@ public function taxonomy_columns( $columns ) {
unset( $columns['slug'] );
unset( $columns['posts'] );

$columns['qts-slug'] = __( 'Slug', 'qts' );
$columns['posts'] = __( 'Posts', 'qts' );
$columns['qts-slug'] = __( 'Slug' );
$columns['posts'] = __( 'Posts' );

return $columns;
}
Expand Down Expand Up @@ -1750,6 +1749,7 @@ private function ignore_rewrite_caller() {
*
* @return string
*/
//TODO: $link seems to be unused (always false), to be removed and function cleaned up
private function get_category_parents( $id, $link = false, $separator = '/', $nicename = false, $visited = array() ) {
$chain = '';
$parent = get_category( $id );
Expand Down
6 changes: 3 additions & 3 deletions modules/slugs/includes/qtranslate-slug-settings-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/
function qts_options_page_sections() {
$sections = array();
$sections['post_types'] = __( 'Post types', 'qts' );
$sections['taxonomies'] = __( 'Taxonomies', 'qts' );
$sections['post_types'] = __( 'Post types', 'qtranslate' );
$sections['taxonomies'] = __( 'Taxonomies', 'qtranslate' );

return $sections;
}
Expand All @@ -22,7 +22,7 @@ function get_multi_txt_choices() {

$choices = array();
foreach ( $q_config['enabled_languages'] as $lang ) {
$label = sprintf( __( 'Slug', 'qts' ) . ' (%s)', $q_config['language_name'][ $lang ] );
$label = sprintf( __( 'Slug' ) . ' (%s)', $q_config['language_name'][ $lang ] );
$choices[] = "$label|$lang"; // prints: 'Slug (English)|en'
}

Expand Down
29 changes: 11 additions & 18 deletions modules/slugs/includes/qtranslate-slug-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ function qts_get_settings() {
function qts_section_fn( $section_id = '' ) {
switch ( $section_id ) {
case 'post_types':
echo "<p>" . __( 'For example, the post_type <kbd>books</kbd>, in Spanish would be displayed as <code>https://example.org/es/libros/post-type-name/</code>. If you leave this blank will use the default option when you <a href="https://developer.wordpress.org/reference/functions/register_post_type/">registered</a> the post_type.', 'qts' ) . "</p>";
echo "<p>" . __( 'For example, the post_type <kbd>books</kbd>, in Spanish would be displayed as <code>https://example.org/es/libros/post-type-name/</code>. If you leave this blank will use the default option when you <a href="https://developer.wordpress.org/reference/functions/register_post_type/">registered</a> the post_type.', 'qtranslate' ) . "</p>";
break;

case 'taxonomies':
echo "<p>" . __( 'For example, the taxonomy <kbd>category</kbd>, in Spanish would be displayed as <code>https://example.org/es/categoria/taxonomy-name/</code>. If you leave this blank will use the default option when you <a href="https://developer.wordpress.org/reference/functions/register_taxonomy/">registered</a> the taxonomy (if you previously setup a base permastruct for <u>categories</u> or <u>tags</u> in <a href="options-permalink.php">permalinks</a> page, these bases will be overwritten by the translated ones).', 'qts' ) . "</p>";
echo "<p>" . __( 'For example, the taxonomy <kbd>category</kbd>, in Spanish would be displayed as <code>https://example.org/es/categoria/taxonomy-name/</code>. If you leave this blank will use the default option when you <a href="https://developer.wordpress.org/reference/functions/register_taxonomy/">registered</a> the taxonomy (if you previously setup a base permastruct for <u>categories</u> or <u>tags</u> in <a href="options-permalink.php">permalinks</a> page, these bases will be overwritten by the translated ones).', 'qtranslate' ) . "</p>";
break;
}
}
Expand Down Expand Up @@ -74,7 +74,7 @@ function qts_show_form_field( $args = array() ) {
case "multi-text":
foreach ( $choices as $item ) {
$item = explode( "|", $item ); // cat_name|cat_slug
$item[0] = esc_html__( $item[0], 'qts' );
$item[0] = esc_html( $item[0] );

if ( ! empty( $options[ $id ] ) ) {
foreach ( $options[ $id ] as $option_key => $option_val ) {
Expand Down Expand Up @@ -102,8 +102,8 @@ function qts_show_form_field( $args = array() ) {
case 'select':
echo "<select id='$id' class='select$field_class' name='" . QTS_OPTIONS_NAME . "[$id]'>";
foreach ( $choices as $item ) {
$value = esc_attr( $item, 'qts' );
$item = esc_html( $item, 'qts' );
$value = esc_attr( $item );
$item = esc_html( $item );

$selected = ( $options[ $id ] == $value ) ? 'selected="selected"' : '';
echo "<option value='$value' $selected>$item</option>";
Expand All @@ -117,7 +117,7 @@ function qts_show_form_field( $args = array() ) {
foreach ( $choices as $item ) {

$item = explode( "|", $item );
$item[0] = esc_html( $item[0], 'qts' );
$item[0] = esc_html( $item[0] );

$selected = ( $options[ $id ] == $item[1] ) ? 'selected="selected"' : '';
echo "<option value='$item[1]' $selected>$item[0]</option>";
Expand All @@ -135,7 +135,7 @@ function qts_show_form_field( $args = array() ) {
foreach ( $choices as $item ) {

$item = explode( "|", $item );
$item[0] = esc_html( $item[0], 'qts' );
$item[0] = esc_html( $item[0] );

$checked = '';

Expand All @@ -154,8 +154,8 @@ function qts_show_form_field( $args = array() ) {
foreach ( $choices as $index => $item ) {

$item = explode( "|", $item );
$item_key = ( count( $item ) > 1 ) ? esc_html( $item[0], 'qts' ) : esc_html( end( $item ), 'qts' );
$item_value = ( count( $item ) > 1 ) ? esc_html( $item[1], 'qts' ) : esc_html( end( $item ), 'qts' );
$item_key = ( count( $item ) > 1 ) ? esc_html( $item[0] ) : esc_html( end( $item ) );
$item_value = ( count( $item ) > 1 ) ? esc_html( $item[1] ) : esc_html( end( $item ) );

$checked = '';

Expand Down Expand Up @@ -190,7 +190,7 @@ function qts_show_settings_page() {
}
QTX_Admin_Settings::open_section( 'slugs' );
?>
<p class="heading"><?php _e( 'If you activated previously the <a href="options-permalink.php">pretty permalinks</a>, in this section you can translate the <abbr title="en inglés, Universal Resource Locator">URLs</abbr> <strong>bases</strong> for <a href="https://developer.wordpress.org/reference/functions/register_post_type/#parameters">public</a> post_types, categories, tags and taxonomies.', 'qts' ); ?> </p>
<p class="heading"><?php _e( 'If you activated previously the <a href="options-permalink.php">pretty permalinks</a>, in this section you can translate the <abbr title="en inglés, Universal Resource Locator">URLs</abbr> <strong>bases</strong> for <a href="https://developer.wordpress.org/reference/functions/register_post_type/#parameters">public</a> post_types, categories, tags and taxonomies.', 'qtranslate' ); ?> </p>

<?php foreach ( $settings_output['qts_page_sections'] as $id => $title ) { ?>
<h2><?php echo $title; ?></h2>
Expand Down Expand Up @@ -219,8 +219,7 @@ function qts_validate_options( $input ) {
foreach ( $q_config['enabled_languages'] as $lang ) {
$slugs_lookup_array[ $lang ] = array();
}
// TODO: errors are not displayed, earlier hook to be evaluated
$errors = &$q_config['url_info']['errors'];

$valid_input = array();

// collect only the values we expect and fill the new $valid_input array
Expand All @@ -240,10 +239,6 @@ function qts_validate_options( $input ) {
// accept the input only when numeric!
$input[ $option['id'] ] = trim( $input[ $option['id'] ] ); // trim whitespace
$valid_input[ $option['id'] ] = ( is_numeric( $input[ $option['id'] ] ) ) ? $input[ $option['id'] ] : 'Expecting a Numeric value!';
// register error
if ( is_numeric( $input[ $option['id'] ] ) == false ) {
$errors[] = $option['id'] . ': ' . __( 'Expecting a Numeric value! Please fix.', 'qts' );
}
break;
default:
// accept the input only after stripping out all html, extra white space etc!
Expand Down Expand Up @@ -346,8 +341,6 @@ function qts_validate_options( $input ) {
$valid_input[ $option['id'] ] = $checkboxarray;
}
break;
default:
$errors[] = $option['id'] . ': ' . __( 'Unknown field type.', 'qts' );
endswitch;
endforeach;

Expand Down
Binary file removed modules/slugs/languages/qts-es_ES.mo
Binary file not shown.
142 changes: 0 additions & 142 deletions modules/slugs/languages/qts-es_ES.po

This file was deleted.

Binary file removed modules/slugs/languages/qts-pt_PT.mo
Binary file not shown.
Loading

0 comments on commit c12cbc3

Please sign in to comment.