Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing gettext invocations in core components #5665

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions installer/templates/phx_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,23 @@ defmodule <%= @web_namespace %>.CoreComponents do
<.flash
id="client-error"
kind={:error}
title="We can't find the internet"
title=<%= if @gettext do %>{dgettext("errors", "We can't find the internet")}<% else %>"We can't find the internet"<% end %>
phx-disconnected={show(".phx-client-error #client-error")}
phx-connected={hide("#client-error")}
hidden
>
Attempting to reconnect <.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" />
<%= if @gettext do %><%%= dgettext("errors", "Attempting to reconnect") %><%= "\n" <> String.duplicate("\s", 8) %><% else %>Attempting to reconnect <% end %><.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" />
</.flash>

<.flash
id="server-error"
kind={:error}
title="Something went wrong!"
title=<%= if @gettext do %>{dgettext("errors", "Something went wrong!")}<% else %>"Something went wrong!"<% end %>
phx-disconnected={show(".phx-server-error #server-error")}
phx-connected={hide("#server-error")}
hidden
>
Hang in there while we get back on track
<%= if @gettext do %><%%= dgettext("errors", "Hang in there while we get back on track") %><% else %>Hang in there while we get back on track<% end %>
<.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" />
</.flash>
</div>
Expand Down
12 changes: 6 additions & 6 deletions priv/templates/phx.gen.live/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -147,28 +147,28 @@ defmodule <%= @web_namespace %>.CoreComponents do
def flash_group(assigns) do
~H"""
<div id={@id}>
<.flash kind={:info} title="Success!" flash={@flash} />
<.flash kind={:error} title="Error!" flash={@flash} />
<.flash kind={:info} title=<%= if @gettext do %>{dgettext("errors", "Success!")}<% else %>"Success!"<% end %> flash={@flash} />
<.flash kind={:error} title=<%= if @gettext do %>{dgettext("errors", "Error!")}<% else %>"Error!"<% end %> flash={@flash} />
<.flash
id="client-error"
kind={:error}
title="We can't find the internet"
title=<%= if @gettext do %>{dgettext("errors", "We can't find the internet")}<% else %>"We can't find the internet"<% end %>
phx-disconnected={show(".phx-client-error #client-error")}
phx-connected={hide("#client-error")}
hidden
>
Attempting to reconnect <.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" />
<%= if @gettext do %><%%= dgettext("errors", "Attempting to reconnect") %><%= "\n" <> String.duplicate("\s", 8) %><% else %>Attempting to reconnect <% end %><.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" />
</.flash>

<.flash
id="server-error"
kind={:error}
title="Something went wrong!"
title=<%= if @gettext do %>{dgettext("errors", "Something went wrong!")}<% else %>"Something went wrong!"<% end %>
phx-disconnected={show(".phx-server-error #server-error")}
phx-connected={hide("#server-error")}
hidden
>
Hang in there while we get back on track
<%= if @gettext do %><%%= dgettext("errors", "Hang in there while we get back on track") %><% else %>Hang in there while we get back on track<% end %>
<.icon name="hero-arrow-path" class="ml-1 h-3 w-3 animate-spin" />
</.flash>
</div>
Expand Down
Loading