17 lines
699 B
Plaintext
17 lines
699 B
Plaintext
|
<div class="dropdown dropdown-end">
|
||
|
<div tabindex="0" role="button" class="btn btn-ghost btn-circle">
|
||
|
<% if I18n.locale.to_s == 'en' %>
|
||
|
🇺🇸
|
||
|
<% else %>
|
||
|
🇨🇳
|
||
|
<% end %>
|
||
|
</div>
|
||
|
<ul tabindex="0" class="dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-52">
|
||
|
<%= link_to url_for(locale: :en), class: "#{I18n.locale == :en ? 'active' : ''}" do %>
|
||
|
<li><span class="flex items-center gap-2">🇺🇸 English</span></li>
|
||
|
<% end %>
|
||
|
<%= link_to url_for(locale: :'zh-CN'), class: "#{I18n.locale == :'zh-CN' ? 'active' : ''}" do %>
|
||
|
<li><span class="flex items-center gap-2">🇨🇳 简体中文</span></li>
|
||
|
<% end %>
|
||
|
</ul>
|
||
|
</div>
|