Digit Localization/Translation (5 posts)

  1. kambiz.k
    Posted 7 years ago #

    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
  2. tazme
    Posted 7 years ago #

    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. :(

  3. bluebird2
    Posted 7 years ago #

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

  4. kambiz.k
    Posted 7 years ago #

    Here is the ticket on the WordPress Trac, including the patch:

  5. Sabuj Kundu
    Posted 7 years ago #

    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.


Topic Closed

This topic has been closed to new replies.

About this Topic