Support » Requests and Feedback » Digit Localization/Translation

  • WordPress has provided number_format_i18n for formating numbers based on locale, but there is no method for traslating digits of numbers.

    What we need is only on filter for applying to the output of number_format_i18n function.

    function number_format_i18n( $number, $decimals = null ) {
    	global $wp_locale;
    	// let the user override the precision only
    	$decimals = ( is_null( $decimals ) ) ? $wp_locale->number_format['decimals'] : intval( $decimals );
    
      $num = number_format( $number, $decimals, $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
      return apply_filters( 'number_format_i18n', $num );  // here a filter can translate the digits
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • That’s the thing I was looking for for a while.

    It means till now there’s no way to translate numbers/digits in own languuage. 🙁

    bluebird2

    (@bluebird2)

    This is a necessary change. It makes WP more available to the users who do not write in European languages.

    kambiz.k

    (@kambizk)

    Here is the ticket on the WordPress Trac, including the patch:
    http://trac.wordpress.org/ticket/7753

    Sabuj Kundu

    (@manchumahara)

    Hi, this is really a big issue who wants to use wordpress in his own language not only translating common string but dates and number in his own.

    @kambiz.k
    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Digit Localization/Translation’ is closed to new replies.