El orden de visualización de insignias difiere entre las configuraciones regionales en inglés y chino simplificado

Hi,

I noticed a discrepancy in the badge display order between English and Simplified Chinese locales on the /badges page.


Issue:

  • In English mode, badges are displayed in the correct order (e.g., TS1 appears before TS2).
  • In Simplified Chinese mode, the order is reversed (TS2 appears before TS1), even though the position values in the database are the same.
  • This behavior is consistent on the official Discourse forum, so it is not related to custom settings.

Steps to Reproduce:

  1. Go to the /badges page on a Discourse instance.
  2. Switch the interface language to English and note the badge order.
  3. Switch the interface language to Simplified Chinese and note that the order of the same badges is reversed.

Expected Behavior:
Badges should always be displayed according to their position values, no matter which language is selected.

Thank you for looking into this!

1 me gusta

I think they are in alphabetical order (per color: bronze first, then silver, finally gold).

I don’t think it’s a bug that badges are ordered alphabetically. There are some other topics about cases where the alphabetical order does not lead to the best positioning, like Very teeny tiny minor issue with the default badge ordering & Badge order doesn't make sense.
I think you could change the order with CSS (Trust levels order exhibition in the badges page - #3 by awesomerobot) or use the suggestion to add numbers in front by customizing the text.

2 Me gusta

That would make sense, since 基 starts with a ‘j’ but 成 starts with a ‘c’, assuming Discourse uses Pinyin for this.

EDIT: From what I can see, Discourse uses localeCompare.

Thanks for the report!

I’m adding a pr-welcome here in case anyone wants to have a stab at it.

1 me gusta

We could change the names to TL1-Basic, TL2-Member, TL3-Regular, and TL4-Leader. Then the alphabetical order would always be the same as the trust level order. (I would also find it helpful on the user cards, as it would make it easier to see the TL without knowing the ‘name’ in the current language.)

But the trust level badges are not the only ones in the wrong order:
In German, for example, the badge for 150 solutions is also shown before the one for 50.

And I think the other topics about the order of the Posting badges also address the same issue: alphabetical order doesn’t always feel logical.

I see, that makes sense.
Still, in my view, since it isn’t currently possible to manually adjust the badge order in the admin interface, wouldn’t it be a bit more reasonable to sort them by their position values rather than alphabetically?
That might help keep the order consistent across different languages and make it easier for people to get familiar with and use Discourse.

2 Me gusta