From f1953ad106ab55e1f4fb20c85e1b9b955469b709 Mon Sep 17 00:00:00 2001 From: Ozh Date: Sun, 10 Feb 2013 22:03:02 +0000 Subject: [PATCH] Translation plural forms + deprecate function yourls_plural() git-svn-id: http://yourls.googlecode.com/svn/trunk@874 12232710-3e20-11de-b438-597f59cd7555 --- admin/index.php | 2 +- admin/plugins.php | 4 ++-- includes/functions-formatting.php | 1 + includes/functions-html.php | 2 +- includes/functions.php | 4 ++-- yourls-infos.php | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/admin/index.php b/admin/index.php index a8d6a17..6290009 100644 --- a/admin/index.php +++ b/admin/index.php @@ -220,7 +220,7 @@

%d to %d of %d URLs' ), $display_on_page, $max_on_page, $total_items ); if( $total_items_clicks !== false ) - echo ", " . yourls__('counting') . " $total_items_clicks " . yourls_plural(yourls__('click'), $total_items_clicks); + echo ", " . sprintf( yourls__('counting 1 click', 'counting %s clicks', $total_items_clicks ), $total_items_clicks ); ?>.

%d links, %d clicks, and counting!' ), number_format( $total_urls ), number_format( $total_clicks ) ); ?>

diff --git a/admin/plugins.php b/admin/plugins.php index febca0e..5e3202b 100644 --- a/admin/plugins.php +++ b/admin/plugins.php @@ -67,11 +67,11 @@ uasort( $plugins, 'yourls_plugins_sort_callback' ); $count = count( $plugins ); + $plugins_count = sprintf( yourls_n( '%s plugin', '%s plugins', $count ), $count ); $count_active = yourls_has_active_plugins(); - $plugins_count = $count.' '.yourls_plural( yourls__('plugin'), $count ); ?> -

%d installed, and %d activated', $plugins_count, $count_active ); ?>

+

%s installed, and %s activated', $plugins_count, $count_active ); ?>

diff --git a/includes/functions-formatting.php b/includes/functions-formatting.php index ea662fc..f2edb74 100644 --- a/includes/functions-formatting.php +++ b/includes/functions-formatting.php @@ -126,6 +126,7 @@ function yourls_sanitize_date_for_sql( $date ) { // Return word or words if more than one function yourls_plural( $word, $count=1 ) { + yourls_deprecated_function( __FUNCTION__, '1.6', 'yourls_n' ); return $word . ($count > 1 ? 's' : ''); } diff --git a/includes/functions-html.php b/includes/functions-html.php index 148c4e6..dafb6e5 100644 --- a/includes/functions-html.php +++ b/includes/functions-html.php @@ -264,7 +264,7 @@ function yourls_html_tfooter( $params = array() ) {