插件的翻译问题仅查看自己的后期媒体

时间:2013-05-09 15:22:50

标签: wordpress wordpress-plugin translation

使用THIS PLUGIN

进行翻译时出现问题

在帖子和meda列表页面上,有一些未翻译的链接: 全部|发布|垃圾|草稿|未决

我搜索了源代码,我找到了原因,但我找不到解决方案的问题。 这是文件:class-view-own-posts-media-only.php

有罪的代码在不同的地方......

代码(第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 href="%s"' . $class . '>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 href="%s"' . $class . '>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 href="%s"' . $class . '>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 href="%s"' . $class . '>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 href="%s"' . $class . '>Trash <span class="count">(%d)</span></a>', 'trash'), admin_url('edit.php?post_status=trash&post_type=post'), $result->found_posts);
endif;

代码(第258行):

$views['all'] = "<a href='upload.php'$class>" . sprintf(__('All <span class="count">(%s)</span>'), number_format_i18n($_total_posts)) . '</a>';

代码(第268行):

$views['detached'] = '<a href="upload.php?detached=1"' . ( $detached ? ' class="current"' : '' ) . '>' . sprintf(__('Unattached <span class="count">(%s)</span>'), $total_orphans) . '</a>';

经过一些搜索,我发现wordpress如何处理这些字符串,

此文件中的媒体库表:wp-admin\includes\class-wp-media-list-table.php

代码(第58行):

$type_links['all'] = "<a href='upload.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '</a>';

此文件中的帖子表:wp-admin\includes\class-wp-posts-list-table.php

代码(第149行)

$status_links['all'] = "<a href='edit.php?post_type=$post_type{$allposts}'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '</a>';

在wordpress源码中,我只能找到“全部”链接的代码......我无法理解如何修改插件源代码。

如果有人可以帮助我,我会非常蠢事! 谢谢!

0 个答案:

没有答案