]> cat aescling's git repositories - mastodon.git/commitdiff
Shorten display of large numbers on public profiles (#4711)
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 27 Aug 2017 15:04:45 +0000 (17:04 +0200)
committerGitHub <noreply@github.com>
Sun, 27 Aug 2017 15:04:45 +0000 (17:04 +0200)
app/views/accounts/_header.html.haml
config/i18n-tasks.yml
config/locales/en.yml

index 8009e903ec11442b4970b31d36aff5b2c342d13e..a6366b0f3e9e85cf1417c9eed6e8d925a9d46873 100644 (file)
     .details-counters
       .counter{ class: active_nav_class(short_account_url(account)) }
         = link_to short_account_url(account), class: 'u-url u-uid' do
-          %span.counter-number= number_with_delimiter account.statuses_count
+          %span.counter-number= number_to_human account.statuses_count
           %span.counter-label= t('accounts.posts')
 
       .counter{ class: active_nav_class(account_following_index_url(account)) }
         = link_to account_following_index_url(account) do
-          %span.counter-number= number_with_delimiter account.following_count
+          %span.counter-number= number_to_human account.following_count
           %span.counter-label= t('accounts.following')
 
       .counter{ class: active_nav_class(account_followers_url(account)) }
         = link_to account_followers_url(account) do
-          %span.counter-number= number_with_delimiter account.followers_count
+          %span.counter-number= number_to_human account.followers_count
           %span.counter-label= t('accounts.followers')
index 849e8116aa5160d8db59b2d8f480324c5591fef0..b51cf46df9531468fb46fd67e1d2541252862660 100644 (file)
@@ -36,7 +36,7 @@ ignore_missing:
   - 'activerecord.attributes.*'
   - 'activerecord.errors.*'
   - '{devise,pagination,doorkeeper}.*'
-  - '{date,datetime,time}.*'
+  - '{date,datetime,time,number}.*'
   - 'simple_form.{yes,no}'
   - 'simple_form.{placeholders,hints,labels}.*'
   - 'simple_form.{error_notification,required}.:'
@@ -50,7 +50,7 @@ ignore_unused:
   - 'activerecord.attributes.*'
   - 'activerecord.errors.*'
   - '{devise,pagination,doorkeeper}.*'
-  - '{date,datetime,time}.*'
+  - '{date,datetime,time,number}.*'
   - 'simple_form.{yes,no}'
   - 'simple_form.{placeholders,hints,labels}.*'
   - 'simple_form.{error_notification,required}.:'
index 96d08e6b2eaf3e2e6d0b0a79c4873dbe329879ca..1a9926edd8a2ec5ffd07fb867562b20f093df421 100644 (file)
@@ -353,6 +353,17 @@ en:
     reblog:
       body: 'Your status was boosted by %{name}:'
       subject: "%{name} boosted your status"
+  number:
+    human:
+      decimal_units:
+        format: "%n%u"
+        units:
+          billion: B
+          million: M
+          quadrillion: Q
+          thousand: K
+          trillion: T
+          unit: ''
   pagination:
     next: Next
     prev: Prev