Skip to content

Commit d063df6

Browse files
committed
Move language translation keys under better_together namespace
1 parent 4add9dd commit d063df6

File tree

7 files changed

+32
-18
lines changed

7 files changed

+32
-18
lines changed

app/helpers/better_together/form_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def language_select_field(form: nil, field_name: :locale, selected_locale: I18n.
2323

2424
def locale_options_for_select(selected_locale = I18n.locale)
2525
options_for_select(
26-
I18n.available_locales.map { |locale| [I18n.t("locales.#{locale}", locale:), locale] },
26+
I18n.available_locales.map { |locale| [I18n.t("better_together.languages.#{locale}", locale:), locale] },
2727
selected_locale
2828
)
2929
end

app/helpers/better_together/translatable_fields_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def tab_button(locale, unique_locale_attribute, translation_present) # rubocop:t
4040
type: 'button',
4141
aria: { controls: "#{unique_locale_attribute}-field",
4242
selected: locale.to_s == I18n.locale.to_s }) do
43-
(t("locales.#{locale}") + translation_indicator(translation_present)).html_safe
43+
(t("better_together.languages.#{locale}") + translation_indicator(translation_present)).html_safe
4444
end
4545
end
4646

@@ -73,7 +73,7 @@ def dropdown_menu(_attribute, locale, unique_locale_attribute, base_url) # ruboc
7373
content_tag(:ul, class: 'dropdown-menu') do
7474
I18n.available_locales.reject { |available_locale| available_locale == locale }.map do |available_locale|
7575
content_tag(:li) do
76-
link_to "AI Translate from #{I18n.t("locales.#{available_locale}")}", '#ai-translate',
76+
link_to "AI Translate from #{I18n.t("better_together.languages.#{available_locale}")}", '#ai-translate',
7777
class: 'dropdown-item',
7878
data: {
7979
'better_together--translation-target' => 'aiTranslate',

app/views/layouts/better_together/_locale_switcher.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="localeDropdownMenuLink">
77
<% I18n.available_locales.each do | locale | %>
88
<li>
9-
<%# link_to t("locales.#{locale}"), { locale: locale }, class: "dropdown-item" %>
10-
<%= link_to t("locales.#{locale}"), params.permit(:locale).to_h.merge(locale: locale), class: "dropdown-item #{'active' if locale === I18n.locale}" %>
9+
<%# link_to t("better_together.languages.#{locale}"), { locale: locale }, class: "dropdown-item" %>
10+
<%= link_to t("better_together.languages.#{locale}"), params.permit(:locale).to_h.merge(locale: locale), class: "dropdown-item #{'active' if locale === I18n.locale}" %>
1111
</li>
1212
<% end %>
1313
</ul>

config/locales/en.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ en:
2424
last_message: "Last message"
2525
empty:
2626
no_messages: "No messages yet. Why not start the conversation?"
27+
languages:
28+
en: English
29+
es: Español
30+
fr: Français
2731
platform_invitation:
2832
title: "You're invited to join %{platform}"
2933
platform_role_html: "You have been granted the <strong>%{role}</strong> role in the <strong>%{platform}</strong> platform."
@@ -133,6 +137,20 @@ en:
133137
failed_tracking: "Failed to track share."
134138
error_tracking: "Error tracking share:"
135139
ga_not_initialized: "Google Analytics not initialized."
140+
wizard:
141+
host_setup:
142+
welcome:
143+
choose_language: "Welcome! Let's start by choosing your language."
144+
language_intro: "This is the language we'll use to guide you through setup and the default language for your platform. You can add more languages later."
145+
select_language: "Select Your Language"
146+
land_acknowledgment:
147+
title: "Land Acknowledgment"
148+
body: "We respectfully acknowledge the lands where we work, and the histories, relationships, and responsibilities tied to them. If your community has its own land acknowledgment, you can add it to your platform’s welcome page."
149+
data_sovereignty:
150+
title: "Your Data, Your Control"
151+
body: "Your data belongs to you and your community. It will be stored locally on community-controlled infrastructure, not harvested or shared. You can export, move, or delete it at any time."
152+
learn_more_link: "Learn more about data sovereignty"
153+
continue_button: "Continue"
136154
date:
137155
abbr_day_names:
138156
- Sun
@@ -316,10 +334,6 @@ en:
316334
none_yet: "None yet"
317335
new_resource: "New %{resource}"
318336
view_all: "View All"
319-
locales:
320-
en: English
321-
es: Español
322-
fr: Français
323337
navbar:
324338
toggle_navigation: "Toggle navigation"
325339
my_profile: "My Profile"

config/locales/es.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ es:
2424
last_message: "Último mensaje"
2525
empty:
2626
no_messages: "Aún no hay mensajes. ¿Por qué no iniciar la conversación?"
27+
languages:
28+
en: English
29+
es: Español
30+
fr: Français
2731
platform_invitation:
2832
title: "Estás invitado a unirte a %{platform}"
2933
platform_role_html: "Se te ha otorgado el rol de <strong>%{role}</strong> en la plataforma <strong>%{platform}</strong>."
@@ -308,10 +312,6 @@ es:
308312
none_yet: "Ninguno aún"
309313
new_resource: "Nuevo %{resource}"
310314
view_all: "Ver todo"
311-
locales:
312-
en: English
313-
es: Español
314-
fr: Français
315315
navbar:
316316
toggle_navigation: "Alternar navegación"
317317
my_profile: "Mi Perfil"

config/locales/fr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ fr:
2525
create_conversation: "Créer la Conversation"
2626
empty:
2727
no_messages: "Pas encore de messages. Pourquoi ne pas commencer la conversation ?"
28+
languages:
29+
en: English
30+
es: Español
31+
fr: Français
2832
platform_invitation:
2933
title: "Vous êtes invité à rejoindre %{platform}"
3034
platform_role_html: "Vous avez reçu le rôle de <strong>%{role}</strong> dans la plateforme <strong>%{platform}</strong>."
@@ -310,10 +314,6 @@ fr:
310314
none_yet: "Aucun pour l'instant"
311315
new_resource: "Nouveau %{resource}"
312316
view_all: "Voir tout"
313-
locales:
314-
en: English
315-
es: Español
316-
fr: Français
317317
number:
318318
currency:
319319
format:

spec/dummy/config/i18n-tasks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# config/i18n-tasks.yml
22
base_locale: en
3-
locales:
3+
locales:
44
- en
55
- es
66
- fr

0 commit comments

Comments
 (0)