nextcloud-vue icon indicating copy to clipboard operation
nextcloud-vue copied to clipboard

fix(NcCounterBubble): also shorten in German

Open ShGKme opened this issue 2 months ago • 16 comments

☑️ Resolves

  • Browsers decided that in German numbers should not be shortened like 2048 should be 2048 instead of 2K in English
  • This PR uses English style instead of German to shorten the number in German
  • ⚠️ Same problem in Italian. Shall we do the same?
Before After
image image

🏁 Checklist

  • [x] ⛑️ Tests are included or are not applicable
  • [x] 📘 Component documentation has been extended, updated or is not applicable
  • [x] 2️⃣ Backport to stable8 for maintained Vue 2 version or not applicable

ShGKme avatar Oct 01 '25 21:10 ShGKme

/backport to stable8

ShGKme avatar Oct 01 '25 21:10 ShGKme

@marcoambrosini For Italian we keep it in full form, correct?

ShGKme avatar Oct 02 '25 07:10 ShGKme

Honestly, I am not sure about this change. Using 2K is very uncommon in german afaik...

szaimen avatar Oct 02 '25 07:10 szaimen

Isn't there a library for this with already localized short forms? I understand that it would be an extra dependency but I don't feel too great about doing this for every language manually, especially because the thousands are not the only thing that is usually shortened.

kra-mo avatar Oct 02 '25 08:10 kra-mo

I'm sure you've seen this one before :D

kra-mo avatar Oct 02 '25 08:10 kra-mo

Correct for Italian @ShGKme

marcoambrosini avatar Oct 02 '25 12:10 marcoambrosini

@kra-mo we don't do it manually for every language. We are using the native Intl formatter.

The problem is that the default formatter doesn't shorten thousands in German and Italian languages, unlike all the other languages. And as far as I know, it is on purpose.

So the proposal is to use English style shortening for German (and, maybe, Italian).

ShGKme avatar Oct 02 '25 12:10 ShGKme

@kra-mo we don't do it manually for every language. We are using the native Intl formatter.

The problem is that the default formatter doesn't shorten thousands in German and Italian languages, unlike all the other languages. And as far as I know, it is on purpose.

So the proposal is to use English style shortening for German (and, maybe, Italian).

Ah, I see. Maybe ask upstream? Otherwise, my hands are off then :)

kra-mo avatar Oct 02 '25 12:10 kra-mo

Maybe ask upstream?

Upstream is Google, Microsoft, Apple and Mozilla with their browsers, so, I'm unsure if it is an option :)

The question is: do we want to shorten numbers in German (and Italian) or not.

ShGKme avatar Oct 02 '25 14:10 ShGKme

(and in English as well?) it would have to be a lowercase "k", so "2k"

@jancborchardt It uses native browsers formatter, not a custom one. So in English it is K uppercase as defined by the browser. Like in other places (likes/views on social media, YouTube and etc.).

As we are making a custom option for German anyway, I can make it lowercase, but could you provide complete rules in this case? For example, is it always lower case, or only for k.

ShGKme avatar Oct 06 '25 11:10 ShGKme

Note: counter in EN and DE on YouTube. Indeed, it is not shortened with K, as @szaimen noticed.

image image

ShGKme avatar Oct 06 '25 12:10 ShGKme

So in German it is not super common, but if we need a shortened one, "2k" is definitely possible. A more common one would be "2 Tsd." but that doesn’t really shorten it. For million the common one is "2 Mio.", which would shorten it better.

The German page for info on the "thousand" shortening: https://de.wikipedia.org/wiki/Tausend#Gebr%C3%A4uchliche_Abk%C3%BCrzungen_und_Synonyme

jancborchardt avatar Oct 06 '25 12:10 jancborchardt

What we could also do is then simply not shorten the thousands if we think it’s fine. What happens above certain limits like with 10k, 100k etc? At what point does it shorten at all?

jancborchardt avatar Oct 06 '25 12:10 jancborchardt

What we could also do is then simply not shorten the thousands if we think it’s fine. What happens above certain limits like with 10k, 100k etc? At what point does it shorten at all?

Starting 1000000 formatted to 1 Mio.

ShGKme avatar Oct 06 '25 15:10 ShGKme

What we could also do is then simply not shorten the thousands if we think it’s fine.

That is the current state

ShGKme avatar Oct 06 '25 15:10 ShGKme

I think this is then probably fine in German. While for me and likely many others "2 k" would be ok and understandable, the official shortenings should be "Tsd." which is basically not shorter and only useful when writing numbers as text.

susnux avatar Oct 06 '25 16:10 susnux