Notifications
Clear all

[Closed] Just reached 10K posts, but stat display is strange

12 Posts
4 Users
0 Reactions
1,104 Views
Posts: 60
Topic starter
(@le-bear)
Trusted Member
Joined: 8 years ago

This week-end, my forum went pass 10 000 posts. But the display is a bit strange.

What can I do to improve that ?

11 Replies
Posts: 60
Topic starter
(@le-bear)
Trusted Member
Joined: 8 years ago

I found the place where that number is formatted:

/wp-content/plugins/wpforo/includes/functions.php:function wpforo_print_number
and modified it by commenting out the nested if statements. now I have what I wanted.

1 Reply
RealAct
(@realact)
Joined: 6 years ago

Reputable Member
Posts: 233

@le-bear I believe you really wouldn't need to modify the code for that. You could change that in the “WPForo Phrases” area.

Posts: 996
Moderator
(@martin)
Support Team
Joined: 8 years ago

@le-bear,

This is a translation issue. The phrase is incorrectly translated. The {number} should not be translated, this is a key for the number conversion. Now it's translated in the translation file and the functions cannot detect to replace it. You should install Loco Translate plugin and find it in the translation file, then change the translated {numéro} to {number}

Posts: 60
Topic starter
(@le-bear)
Trusted Member
Joined: 8 years ago

You're right, it's a translation issue. So, what I did finally, was to NOT translate that word in this function, because it should not be. I don't know if "number" is used in another context in which "numéro" would be correct, but if it is the case, what I did preserve the translation in other places.

if( $n > 1000000000000 ) {
		$number = round( ( $n / 1000000000000 ), 1 ) . ' ' . str_replace( '{number}', '', '{number}T' );
	} else if( $n > 1000000000 ) {
		$number = round( ( $n / 1000000000 ), 1 ) . ' ' . str_replace( '{number}', '', '{number}B' );
	} else if( $n > 1000000 ) {
		$number = round( ( $n / 1000000 ), 1 ) . ' ' . str_replace( '{number}', '', '{number}M' );
	} else if( $n > 10000 ){
                $number = round( ( $n / 1000 ), 1 ) . ' ' . str_replace( '{number}', '', '{number}K' );
        }
        $number = ( $number ) ? $number : number_format( $n );

Now, I understand this little modification could be overwritten by an update, so is there a way to put that somewhere else ? An even better solution would be to incorporate this change to WPForo to make this "problem" disappear for good.

Posts: 60
Topic starter
(@le-bear)
Trusted Member
Joined: 8 years ago

Posted by: @martin

The phrase is incorrectly translated.

Sorry, in fact, the phrase is CORRECTLY translated. Thing is, it's translated in a function where it should NOT be. In my book the word for that is "bug".

 

1 Reply
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10586

@le-bear,

Martin means that the {number} should not be translated in the plugin .PO/.MO files. You should install the Loco Translate plugin, open the language file you use for wpForo, find the {number}K {number{M}, etc. in the phrase list and change the translated {numéro} value to {numéro}.

So this is the problem caused by translation maker. The person who has translated wpForo to your language didn't understand that the {number} should not be translated.

Page 1 / 2