Skip to content

Commit 92ee130

Browse files
committed
Add baskets_count and locale-aware formatting
Introduce NumberHelper#format_number (comma for :en, apostrophe otherwise). Add data.site.baskets_count and pass formatted value to the homepage subtitle; update locale strings to use the %{baskets_count} placeholder.
1 parent b7f734e commit 92ee130

6 files changed

Lines changed: 11 additions & 4 deletions

File tree

data/site.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: "CSA Admin"
2+
baskets_count: 140000
23
host: "https://csa-admin.org"
34
thumbnail: "logo.svg"
45
favicon: "_favicon_template.svg"

helpers/number_helper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module NumberHelper
2+
def format_number(number)
3+
delimiter = I18n.locale == :en ? ',' : "'"
4+
number.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1' + delimiter).reverse
5+
end
6+
end

locales/de.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ de:
6060
description: Open-Source-Webanwendung für effiziente Solawi-Verwaltung (Solidarische Landwirtschaft). Vereinfachen Sie Ihre Abläufe – Demo jetzt anfordern!
6161
title: "CSA Admin - Effizientere Verwaltung Ihrer Solawi"
6262
path: /solawi
63-
subtitle: Seit 2014 nutzen %{orgs_link} CSA Admin, um ihre täglichen Aufgaben zu erleichtern und die jährliche Verteilung von über <strong>100.000 Anteilen</strong> zu verwalten. Schließen Sie sich ihnen an!
63+
subtitle: Seit 2014 nutzen %{orgs_link} CSA Admin, um ihre täglichen Aufgaben zu erleichtern und die jährliche Verteilung von über <strong>%{baskets_count} Anteilen</strong> zu verwalten. Schließen Sie sich ihnen an!
6464
subtitle_orgs_link: zahlreiche&nbsp;Organisationen
6565
title: Effizientere %{org_name}&#8209;Verwaltung.

locales/en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ en:
6060
description: Open-source web app to efficiently manage your CSA (Community Supported Agriculture). Simplify your operations and request a demo today!
6161
title: "CSA Admin - Streamline your CSA management"
6262
path: ""
63-
subtitle: "Since 2014, %{orgs_link} have been using CSA Admin to facilitate their daily tasks and manage the annual distribution of over <strong>100,000 baskets</strong>. Join them!"
63+
subtitle: "Since 2014, %{orgs_link} have been using CSA Admin to facilitate their daily tasks and manage the annual distribution of over <strong>%{baskets_count} baskets</strong>. Join them!"
6464
subtitle_orgs_link: many&nbsp;organizations
6565
title: Streamline your&nbsp;%{org_name} management.

locales/fr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ fr:
6060
description: Application web open source pour gérer efficacement votre ACP (Agriculture Contractuelle de Proximité). Simplifiez vos opérations, demandez une démo!
6161
title: CSA Admin - Simplifiez la gestion de votre ACP
6262
path: /acp
63-
subtitle: Depuis 2014, %{orgs_link} utilisent CSA Admin pour faciliter leurs tâches quotidiennes et gérer la distribution annuelle de plus de <strong>100'000 paniers</strong>. Rejoignez-les !
63+
subtitle: Depuis 2014, %{orgs_link} utilisent CSA Admin pour faciliter leurs tâches quotidiennes et gérer la distribution annuelle de plus de <strong>%{baskets_count} paniers</strong>. Rejoignez-les !
6464
subtitle_orgs_link: de&nbsp;nombreuses&nbsp;organisations
6565
title: Simplifiez la gestion de votre&nbsp;%{org_name}.

source/_index.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</h1>
44

55
<h2 class="mt-4 mx-auto md:w-4/6 text-center md:leading-normal text-xl font-light">
6-
<%= I18n.t 'subtitle', orgs_link: link_to(t('subtitle_orgs_link'), '#organizations') %>
6+
<%= I18n.t 'subtitle', orgs_link: link_to(t('subtitle_orgs_link'), '#organizations'), baskets_count: format_number(data.site.baskets_count) %>
77
</h2>
88

99
<div class="mt-12 md:mt-8 block text-center">

0 commit comments

Comments
 (0)