Skip to content

Commit

Permalink
translations
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Aug 11, 2023
1 parent 944e225 commit d40586c
Show file tree
Hide file tree
Showing 20 changed files with 148 additions and 96 deletions.
8 changes: 4 additions & 4 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ def serialized_to_html(serialized_content)

def event_status_label(event)
case event.state
when "published" then gettext("Your event is published")
when "published" then t("events.published")
else
gettext("Your event has not been published")
t("events.unpublished")
end
end

def button_label(event)
case event.state
when "published" then gettext("Unpublish Event")
when "published" then t("events.unpublish")
else
gettext("Publish Event")
t("events.publish")
end
end

Expand Down
12 changes: 6 additions & 6 deletions app/views/articles/mine.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<div class="">
<div class="border-b--- border-gray-200 dark:border-gray-700">
<nav class="-mb-px flex space-x-8 text-2xl" aria-label="Tabs">
<%= link_to "My Articles", mine_articles_path(tab: "all"), class: @tab == "all" ? 'tab-active' : 'tab-default' %>
<%= link_to "Drafts", mine_articles_path(tab: "draft"), class: @tab == "draft" ? 'tab-active' : 'tab-default' %>
<%= link_to "Published", mine_articles_path(tab: "published"), class: @tab == "published" ? 'tab-active' : 'tab-default' %>
<%= link_to t("articles.my_articles"), mine_articles_path(tab: "all"), class: @tab == "all" ? 'tab-active' : 'tab-default' %>
<%= link_to t("articles.drafts"), mine_articles_path(tab: "draft"), class: @tab == "draft" ? 'tab-active' : 'tab-default' %>
<%= link_to t("articles.published"), mine_articles_path(tab: "published"), class: @tab == "published" ? 'tab-active' : 'tab-default' %>
</nav>
</div>
</div>
Expand All @@ -25,7 +25,7 @@
</p>
</div>
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
<%= link_to 'New article',
<%= link_to t('new_article'),
new_article_path,
class: 'inline-flex items-center justify-center rounded-md border border-transparent bg-brand-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2 sm:w-auto'
%>
Expand Down Expand Up @@ -61,10 +61,10 @@
<%= post.state %>
</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 dark:text-gray-200 dark:bg-gray-900 divide-x space-x-2">
<%= link_to 'Edit', edit_article_path(post), class: 'text-brand-600 hover:text-brand-900' %>
<%= link_to t('Edit'), edit_article_path(post), class: 'text-brand-600 hover:text-brand-900' %>
<% if post.slug %>
<%= link_to 'View Article', article_path(post.slug), class: 'text-brand-600 hover:text-brand-900 pl-2' %>
<%= link_to t('articles.view'), article_path(post.slug), class: 'text-brand-600 hover:text-brand-900 pl-2' %>
<% end %>
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@
</div>

<div class="text-sm">
<%= link_to gettext("Forgot your password?"),
<%= link_to t("sessions.forgot_pass"),
new_user_password_path,
class: "font-medium text-pink-600 hover:text-pink-500"
%>
</div>
</div>

<%= f.submit gettext("Sign in"), class: "w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-brand-600 hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-500" %>
<%= f.submit t("sessions.sign_in"), class: "w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-brand-600 hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-500" %>
<% end %>
<%= render "devise/shared/links" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/embeds/_track.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
data-audio-target="play"
class="player-button"
>
<span class="sr-only"><%= gettext("Play") %></span>
<span class="sr-only">Play</span>
<svg
data-audio-target="playicon"
style="display:none"
Expand Down
8 changes: 4 additions & 4 deletions app/views/errors/404.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
<div class="sm:ml-6">
<div class="sm:border-l sm:border-gray-200 sm:pl-6">
<h1 class="text-4xl font-bold tracking-tight text-gray-700 dark:text-gray-100 sm:text-5xl">
<%= gettext("Page not found") %>
<%= t("errors.404.title") %>
</h1>
<p class="mt-1 text-base text-gray-500 dark:text-gray-300">
<%= gettext("Please check the URL in the address bar and try again.") %>
<%= t("errors.404.desc") %>
</p>
</div>
<div class="mt-10 flex space-x-3 sm:border-l sm:border-transparent sm:pl-6">
<a
href="/"
class="inline-flex items-center rounded-md border border-transparent bg-brand-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2"
>
<%= gettext("Go back home") %>
<%= t("errors.404.action") %>
</a>
<a
href="#"
class="inline-flex items-center rounded-md border border-transparent bg-brand-100 px-4 py-2 text-sm font-medium text-brand-700 hover:bg-brand-200 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2"
>
<%= gettext("Contact support") %>
<%= t("errors.404.cta") %>
</a>
</div>
</div>
Expand Down
11 changes: 6 additions & 5 deletions app/views/errors/422.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@
<div class="min-h-full bg-black px-4 py-16 sm:px-6 sm:py-24 md:grid md:place-items-center lg:px-8">
<div class="mx-auto max-w-max">
<main class="sm:flex">
<p class="text-4xl font-bold tracking-tight text-brand-600 sm:text-5xl">500</p>
<p class="text-4xl font-bold tracking-tight text-brand-600 sm:text-5xl">422</p>
<div class="sm:ml-6">
<div class="sm:border-l sm:border-gray-200 sm:pl-6">
<h1 class="text-4xl font-bold tracking-tight text-gray-700 dark:text-gray-100 sm:text-5xl">
<%= gettext("Access denied") %>
<%= t("errors.422.title") %>
</h1>
<p class="mt-1 text-base text-gray-500 dark:text-gray-300">
<%= gettext("Please check the URL in the address bar and try again.") %>
<%= t("errors.422.desc") %>
</p>
</div>
<div class="mt-10 flex space-x-3 sm:border-l sm:border-transparent sm:pl-6">
<a
href="/"
class="inline-flex items-center rounded-md border border-transparent bg-brand-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2"
>
<%= gettext("Go back home") %>
<%= t("errors.422.action") %>
</a>
<a
href="#"
class="inline-flex items-center rounded-md border border-transparent bg-brand-100 px-4 py-2 text-sm font-medium text-brand-700 hover:bg-brand-200 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2"
>
<%= gettext("Contact support") %>
<%= t("errors.422.cta") %>
</a>
</div>
</div>
</main>
</div>
</div>

9 changes: 5 additions & 4 deletions app/views/errors/500.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,28 @@
<div class="sm:ml-6">
<div class="sm:border-l sm:border-gray-200 sm:pl-6">
<h1 class="text-4xl font-bold tracking-tight text-gray-700 dark:text-gray-100 sm:text-5xl">
<%= gettext("Something went wrong") %>
<%= t("errors.500.title") %>
</h1>
<p class="mt-1 text-base text-gray-500 dark:text-gray-300">
<%= gettext("Please check the URL in the address bar and try again.") %>
<%= t("errors.500.desc") %>
</p>
</div>
<div class="mt-10 flex space-x-3 sm:border-l sm:border-transparent sm:pl-6">
<a
href="/"
class="inline-flex items-center rounded-md border border-transparent bg-brand-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2"
>
<%= gettext("Go back home") %>
<%= t("errors.500.action") %>
</a>
<a
href="#"
class="inline-flex items-center rounded-md border border-transparent bg-brand-100 px-4 py-2 text-sm font-medium text-brand-700 hover:bg-brand-200 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2"
>
<%= gettext("Contact support") %>
<%= t("errors.500.cta") %>
</a>
</div>
</div>
</main>
</div>
</div>

4 changes: 2 additions & 2 deletions app/views/event_hosts/_event_host.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<div class="flex space-x-2">
<% if event_host.listed_on_page %>
<span class="inline-flex items-center rounded-full bg-blue-100 px-2.5 py-0.5 text-xs font-medium text-blue-800">
<%= gettext("Listed on page") %>
<%= t("event_hosts.listed") %>
</span>
<% end %>
<% if event_host.event_manager %>
<span class="inline-flex items-center rounded-full bg-green-100 px-2.5 py-0.5 text-xs font-medium text-green-800">
<%= gettext("Event Manager") %>
<%= t("event_hosts.manager") %>
</span>
<% end %>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/views/event_hosts/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<%= form_for [@event, @event_host] do |form| %>
<div class="space-y-2">
<% if form.object.new_record? %>
<%= form.text_field :email, hint: "Añade un host para resaltarlo en la página del evento o para obtener ayuda en la gestión del evento." %>
<%= form.submit gettext("Save"), class: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-brand-600 hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-500" %>
<%= form.text_field :email, hint: t("event_hosts.email_hint") %>
<%= form.submit t("Save"), class: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-brand-600 hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-500" %>
<% else %>

Expand Down
2 changes: 0 additions & 2 deletions app/views/events/_attendees_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
<button
type="button"
phx-click="open_modal"
phx-target={@myself}
class="inline-flex items-center justify-center rounded-md border border-transparent bg-brand-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2 sm:w-auto"
>
Add user
Expand Down
4 changes: 2 additions & 2 deletions app/views/events/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="p-5">
<h2 class="mx-0 mt-0 mb-4 font-sans text-2xl font-bold leading-none">
<% if @event.id %>
<%= gettext("Edit Event") %>
<%= t("events.edit") %>
<% else %>
<%= gettext("Create Event") %>
<%= t("events.create") %>
<% end %>
</h2>

Expand Down
14 changes: 7 additions & 7 deletions app/views/events/mine.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<div class="">
<div class="border-b--- border-gray-200 dark:border-gray-700">
<nav class="-mb-px flex space-x-8 text-2xl " aria-label="Tabs">
<%= link_to gettext("My Events"), mine_events_path(tab: "all"), class: tab_class(@tab == "all") %>
<%= link_to gettext("Drafts"), mine_events_path(tab: "drafts"), class: tab_class(@tab == "drafts") %>
<%= link_to gettext("Published"), mine_events_path(tab: "published"), class: tab_class(@tab == "published") %>
<%= link_to gettext("Events I manage"), mine_events_path(tab: "manager"), class: tab_class(@tab == "manager") %>
<%= link_to t("events.my_events"), mine_events_path(tab: "all"), class: tab_class(@tab == "all") %>
<%= link_to t("events.drafts"), mine_events_path(tab: "drafts"), class: tab_class(@tab == "drafts") %>
<%= link_to t("events.published"), mine_events_path(tab: "published"), class: tab_class(@tab == "published") %>
<%= link_to t("events.manager"), mine_events_path(tab: "manager"), class: tab_class(@tab == "manager") %>
</nav>
</div>
</div>
Expand All @@ -18,11 +18,11 @@
<%= @tab.capitalize %> Events
</h1>
<p class="mt-2 text-sm text-gray-700 dark:text-gray-300">
<%= gettext("Your articles.") %>
<%= t("events.your_events") %>
</p>
</div>
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
<%= link_to "New event", new_event_path(), class: "brand-button" %>
<%= link_to t("events.new_event"), new_event_path(), class: "brand-button" %>
</div>
</div>
<div class="mt-8 flex flex-col">
Expand Down Expand Up @@ -72,7 +72,7 @@
<%= event.state %>
</td>
<td class="relative whitespace-nowrap py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6 dark:text-gray-200 dark:bg-gray-900">
<%= link_to gettext("Edit"), edit_event_path(event), class: "link" %>
<%= link_to t("edit"), edit_event_path(event), class: "link" %>
</td>
</tr>
<% end %>
Expand Down
9 changes: 6 additions & 3 deletions app/views/purchases/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
<h3 class="truncate text-sm font-medium text-gray-900 dark:text-gray-100"> Tickets </h3>
<span class="inline-block flex-shrink-0 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800"> Admin </span>
</div>
<p class="mt-1 truncate text-sm text-gray-500 dark:text-gray-300"> Has comprado Tickets </p>
<p class="mt-1 truncate text-sm text-gray-500 dark:text-gray-300">
<%= t("purchases.your_tickets") %>
</p>
</div>
<svg class="h-10 w-10 flex-shrink-0 rounded-full text-gray-800 dark:text-gray-100" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M16.5 6v.75m0 3v.75m0 3v.75m0 3V18m-9-5.25h5.25M7.5 15h3M3.375 5.25c-.621 0-1.125.504-1.125 1.125v3.026a2.999 2.999 0 010 5.198v3.026c0 .621.504 1.125 1.125 1.125h17.25c.621 0 1.125-.504 1.125-1.125v-3.026a2.999 2.999 0 010-5.198V6.375c0-.621-.504-1.125-1.125-1.125H3.375z"></path>
Expand All @@ -25,15 +27,16 @@
<% end %>
</li>
<li class="col-span-1 divide-y divide-gray-200 rounded-lg bg-white dark:bg-gray-800 dark:hover:bg-gray-700 shadow">
<a href="#" navigate{item[:href]}="">
<%= link_to music_purchases_path do %>
<div class="flex w-full items-center justify-between space-x-6 p-6">
<div class="flex-1 truncate">
<div class="flex items-center space-x-3">
<h3 class="truncate text-sm font-medium text-gray-900 dark:text-gray-100"> Music </h3>
<span class="inline-block flex-shrink-0 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800"> Admin </span>
</div>
<p class="mt-1 truncate text-sm text-gray-500 dark:text-gray-300"> Has comprado Music </p>
<p class="mt-1 truncate text-sm text-gray-500 dark:text-gray-300">
<%= t("purchases.your_music") %>
</p>
</div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 9l10.5-3m0 6.553v3.75a2.25 2.25 0 01-1.632 2.163l-1.32.377a1.803 1.803 0 11-.99-3.467l2.31-.66a2.25 2.25 0 001.632-2.163zm0 0V2.25L9 5.25v10.303m0 0v3.75a2.25 2.25 0 01-1.632 2.163l-1.32.377a1.803 1.803 0 01-.99-3.467l2.31-.66A2.25 2.25 0 009 15.553z"></path>
Expand Down
10 changes: 5 additions & 5 deletions app/views/purchases/music.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
/>
</svg>
<%= link_to "#", class: "ml-4 text-sm font-medium text-gray-500 dark:text-gray-300 hover:text-gray-700 hover:text-gray-300" do %>
<%= gettext("Music") %>
<%= t("purchases.music") %>
<% end %>
</div>
</li>
</ol>
</nav>

<h1 class="mt-2 text-2xl font-bold leading-7 text-gray-900 dark:text-gray-100 dark:text-gray-100 sm:truncate sm:text-3xl sm:tracking-tight">
<%= gettext("My Purchased music") %>
<%= t("purchases.my_music") %>
</h1>
</div>
</div>
Expand All @@ -44,7 +44,7 @@
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
<div class="px-4 sm:px-0">
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
<%= t("Purchased Music", section: @section) %>
<%= t("purchases.my_music", section: @section) %>
</h2>

<div class="sm:block">
Expand All @@ -53,7 +53,7 @@
<%= link_to music_purchases_path(tab: "albums"),
phx_click: "section-change", phx_value_section: "all_music",
class: "border-transparent text-gray-500 dark:text-gray-200 hover:text-gray-700 hover:text-gray-300 hover:border-gray-200 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm" do %>
<%= gettext("Purchased albums") %>
<%= t("purchases.purchased_albums") %>
<!--<span class="bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-gray-100 text-gray-900 dark:text-gray-100 hidden ml-2 py-0.5 px-2.5 rounded-full text-xs font-medium md:inline-block">2</span>-->
<% end %>
<!--<%= link_to "#", phx_click: "section-change", phx_value_section: "pending_orders",
Expand All @@ -65,7 +65,7 @@
phx_click: "section-change",
phx_value_section: "all_tracks",
class: "border-transparent text-gray-500 dark:text-gray-200 hover:text-gray-700 hover:text-gray-300 hover:border-gray-200 whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm" do %>
<%= gettext("Purchased individual Tracks") %>
<%= t("purchases.purchased_tracks") %>
<!--<span class="hidden bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-gray-100 text-gray-900 dark:text-gray-100 hidden ml-2 py-0.5 px-2.5 rounded-full text-xs font-medium md:inline-block">4</span>-->
<% end %>
</nav>
Expand Down
Loading

0 comments on commit d40586c

Please sign in to comment.