-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translation error in "Showing" text box #647
Comments
There's a bug in the translation itself, but you're right that the post_type_label should be translated. The translated string is "Afficher tous les postes %s" where the English string is "Showing all %s". |
Fixes #647 The original string was translated incorrectly to French but because of the way it was constructed it couldn't be easily translated correctly anyway. Since the search terms are already on the page I modified the string so it would display how many records had been found.
I fixed it by rewriting this string in #776. We don't need to show the search terms as they're already displayed on the page. It's more useful to show a summary of the search so it shows the post type (Jobs) and the number of records found. |
When filtering with -for example- job types in French, the showing text is wrong because of the way it is coded.
What Happens
It shows:
(poste = job, displayed twice)
What I Expected To Happen
It should show:
Code causing the problem
includes/class-wp-job-manager-ajax.php:178
`$result['showing'][] = $post_type_label;
if ( $search_location ) {
$result['showing'][] = sprintf( __( 'located in “%s”', 'wp-job-manager' ), $search_location );
}
if ( 1 === sizeof( $result['showing'] ) ) {
$result['showing_all'] = true;
}
$result['showing'] = apply_filters( 'job_manager_get_listings_custom_filter_text', sprintf( __( 'Showing all %s', 'wp-job-manager' ), implode( ' ', $result['showing'] ) ) );`
Solution
Do not add the Job label at the end of the text and change the sprintf() text:
`//$result['showing'][] = $post_type_label; //REMOVE THIS LINE
if ( $search_location ) {
$result['showing'][] = sprintf( __( 'located in “%s”', 'wp-job-manager' ), $search_location );
}
if ( 0 === sizeof( $result['showing'] ) ) { //CHANGE HERE
$result['showing_all'] = true;
}
$result['showing'] = apply_filters( 'job_manager_get_listings_custom_filter_text', sprintf( __( 'Showing all %sjobs', 'wp-job-manager' ), implode( ' ', $result['showing'] ) ) ); //ADD THE LABEL IN A TRANSLATABLE STRING`
The text was updated successfully, but these errors were encountered: