From e985ad87397d4b574b20c46a18f62511f8127acc Mon Sep 17 00:00:00 2001 From: Ozh Date: Wed, 13 Feb 2013 08:04:44 +0000 Subject: [PATCH] Use yourls_number_format_i18n() to properly format numbers according to locale git-svn-id: http://yourls.googlecode.com/svn/trunk@878 12232710-3e20-11de-b438-597f59cd7555 --- admin/index.php | 5 ++--- includes/functions-html.php | 2 +- includes/functions-l10n.php | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/admin/index.php b/admin/index.php index 6290009..fb7789c 100644 --- a/admin/index.php +++ b/admin/index.php @@ -218,13 +218,12 @@ if ( !$is_bookmark ) { ?>

%d to %d of %d URLs' ), $display_on_page, $max_on_page, $total_items ); + printf( yourls__('Display %s to %s of %s URLs' ), $display_on_page, $max_on_page, $total_items ); if( $total_items_clicks !== false ) 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 ) ); ?>

- +

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

diff --git a/includes/functions-html.php b/includes/functions-html.php index 7ec0b35..34b07c0 100644 --- a/includes/functions-html.php +++ b/includes/functions-html.php @@ -523,7 +523,7 @@ function yourls_table_add_row( $keyword, $url, $title = '', $ip, $clicks, $times ), 'clicks' => array( 'template' => '%clicks%', - 'clicks' => number_format( $clicks, 0, '', '' ), + 'clicks' => yourls_number_format_i18n( $clicks, 0, '', '' ), ), 'actions' => array( 'template' => '%actions% ', diff --git a/includes/functions-l10n.php b/includes/functions-l10n.php index 7506840..1bbd6e0 100644 --- a/includes/functions-l10n.php +++ b/includes/functions-l10n.php @@ -575,8 +575,8 @@ function yourls_number_format_i18n( $number, $decimals = 0 ) { if( !isset( $yourls_locale_formats ) ) $yourls_locale_formats = new YOURLS_Locale_Formats(); - $formatted = number_format( $number, absint( $decimals ), $yourls_locale_formats->number_format['decimal_point'], $yourls_locale_formats->number_format['thousands_sep'] ); - return apply_filters( 'number_format_i18n', $formatted ); + $formatted = number_format( $number, abs( intval( $decimals ) ), $yourls_locale_formats->number_format['decimal_point'], $yourls_locale_formats->number_format['thousands_sep'] ); + return yourls_apply_filters( 'number_format_i18n', $formatted ); } /** -- 2.45.0