Problems with language and translations
-
There are problems with translations with this plugin.
Over the posts and meda list page, there are some not translated links:
All | Published | Trash | Draft | PendingI searched in the source code, i found the cause but i have little problems finding a solution.
this is the file:class-view-own-posts-media-only.php
the incriminated code is in various places…
code (line 201):
if ($type['status'] == NULL): $class = (empty($wp_query->query_vars['post_status']) || $wp_query->query_vars['post_status'] == NULL) ? ' class="current"' : ''; $views['all'] = sprintf(__('<a>All <span class="count">(%d)</span></a>', 'all'), admin_url('edit.php?post_type=post'), $result->found_posts); elseif ($type['status'] == 'publish'): $class = (!empty($wp_query->query_vars['post_status']) && $wp_query->query_vars['post_status'] == 'publish') ? ' class="current"' : ''; $views['publish'] = sprintf(__('<a>Published <span class="count">(%d)</span></a>', 'publish'), admin_url('edit.php?post_status=publish&post_type=post'), $result->found_posts); elseif ($type['status'] == 'draft'): $class = (!empty($wp_query->query_vars['post_status']) && $wp_query->query_vars['post_status'] == 'draft') ? ' class="current"' : ''; $views['draft'] = sprintf(__('<a>Draft' . ((sizeof($result->posts) > 1) ? "s" : "") . ' <span class="count">(%d)</span></a>', 'draft'), admin_url('edit.php?post_status=draft&post_type=post'), $result->found_posts); elseif ($type['status'] == 'pending'): $class = (!empty($wp_query->query_vars['post_status']) && $wp_query->query_vars['post_status'] == 'pending') ? ' class="current"' : ''; $views['pending'] = sprintf(__('<a>Pending <span class="count">(%d)</span></a>', 'pending'), admin_url('edit.php?post_status=pending&post_type=post'), $result->found_posts); elseif ($type['status'] == 'trash'): $class = (!empty($wp_query->query_vars['post_status']) && $wp_query->query_vars['post_status'] == 'trash') ? ' class="current"' : ''; $views['trash'] = sprintf(__('<a>Trash <span class="count">(%d)</span></a>', 'trash'), admin_url('edit.php?post_status=trash&post_type=post'), $result->found_posts); endif;
Code (line 258):
$views['all'] = "<a>" . sprintf(__('All <span class="count">(%s)</span>'), number_format_i18n($_total_posts)) . '</a>'; Code (line 268): $views['detached'] = '<a>' . sprintf(__('Unattached <span class="count">(%s)</span>'), $total_orphans) . '</a>';
After some searches i found how wordpress handles those strings,
for media library table in this file:
wp-admin\includes\class-wp-media-list-table.php
Code (line 58):
$type_links['all'] = "<a>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '</a>';
for posts table in this file:
wp-admin\includes\class-wp-posts-list-table.php
Code (line 149)
$status_links['all'] = "<a>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '</a>';
In wordpress source i can find only the code for “All” link… and i cant understand how to modify the code in the plugin source.
please if someone could help me with this i will be very craceful!
Thanks![Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
http://wordpress.org/extend/plugins/view-own-posts-media-only/
- The topic ‘Problems with language and translations’ is closed to new replies.