@@ -73,7 +73,7 @@ defmodule <%= @web_namespace %>.CoreComponents do
73
73
phx-click = { JS . exec ( "data-cancel" , to: "##{ @ id } " ) }
74
74
type = "button "
75
75
class = "-m-3 flex-none p-3 opacity-20 hover:opacity-40 "
76
- aria-label = <%= if @gettext do % > { gettext ( "close" ) } <% else %> "close" <% end %>
76
+ aria-label = <%= maybe_heex_attr_gettext. ("close " , @gettext) % >
77
77
>
78
78
< . icon name = "hero-x-mark-solid " class = "h-5 w-5 " />
79
79
</ button >
@@ -127,7 +127,7 @@ defmodule <%= @web_namespace %>.CoreComponents do
127
127
<%%= @ title %>
128
128
</ p >
129
129
< p class = "mt-2 text-sm leading-5 " > <%%= msg %> </ p >
130
- < button type = "button " class = "group absolute top-1 right-1 p-2 " aria-label = <%= if @gettext do % > { gettext ( "close" ) } <% else %> "close" <% end %> >
130
+ < button type = "button " class = "group absolute top-1 right-1 p-2 " aria-label = <%= maybe_heex_attr_gettext. ("close " , @gettext) % > >
131
131
< . icon name = "hero-x-mark-solid " class = "h-5 w-5 opacity-40 group-hover:opacity-70 " />
132
132
</ button >
133
133
</ div >
@@ -147,28 +147,29 @@ defmodule <%= @web_namespace %>.CoreComponents do
147
147
def flash_group ( assigns ) do
148
148
~H"""
149
149
< div id = { @ id } >
150
- < . flash kind = { :info } title = "Success! " flash = { @ flash } />
151
- < . flash kind = { :error } title = "Error! " flash = { @ flash } />
150
+ < . flash kind = { :info } title = <%= maybe_heex_attr_gettext.( "Success! " , @gettext) % > flash={ @ flash } />
151
+ < .flash kind = { :error } title=<%= maybe_heex_attr_gettext . ( "Error!" , @ gettext ) %> flash={ @ flash } />
152
152
< . flash
153
153
id = "client-error "
154
154
kind = { :error }
155
- title = "We can't find the internet "
155
+ title = <%= maybe_heex_attr_gettext.( "We can't find the internet " , @gettext) % >
156
156
phx-disconnected={ show ( ".phx-client-error #client-error" ) }
157
157
phx-connected={ hide ( "#client-error" ) }
158
158
hidden
159
159
>
160
- Attempting to reconnect < . icon name = "hero-arrow-path " class = "ml-1 h-3 w-3 animate-spin " />
160
+ <%= maybe_eex_gettext . ( "Attempting to reconnect" , @ gettext ) %>
161
+ < . icon name = "hero-arrow-path " class = "ml-1 h-3 w-3 animate-spin " />
161
162
</ . flash >
162
163
163
164
< . flash
164
165
id = "server-error "
165
166
kind = { :error }
166
- title = "Something went wrong! "
167
+ title = <%= maybe_heex_attr_gettext.( "Something went wrong! ", @gettext) % >
167
168
phx-disconnected={ show ( ".phx-server-error #server-error" ) }
168
169
phx-connected={ hide ( "#server-error" ) }
169
170
hidden
170
171
>
171
- Hang in there while we get back on track
172
+ <%= maybe_eex_gettext . ( " Hang in there while we get back on track" , @ gettext ) %>
172
173
< . icon name = "hero-arrow-path " class = "ml-1 h-3 w-3 animate-spin " />
173
174
</ . flash >
174
175
</ div >
@@ -479,7 +480,7 @@ defmodule <%= @web_namespace %>.CoreComponents do
479
480
< tr >
480
481
< th :for ={ col <- @ col } class="p-0 pb-4 pr-6 font-normal" >< % % = col [ :label ] % > < /th >
481
482
< th :if ={ @ action != [ ] } class="relative p-0 pb-4" >
482
- < span class ="sr-only" >< % = if @ gettext do % > < % % = gettext ( "Actions" ) % > < % else % > Actions < % end % > < /span >
483
+ < span class ="sr-only" >< % = maybe_eex_gettext . ( "Actions" , @ gettext ) % > < /span >
483
484
< /th >
484
485
< /tr >
485
486
< /thead >
0 commit comments