@AntonKhorev commented on this pull request.
> + <% Locale.available
+ .map { |locale| Language.find_by(:code => locale.to_s) }
+ .select { |locale| locale }
+ .sort_by { |locale| locale[:english_name] }
+ .each do |language| %>
+ <option class="form-select" value="<%= language.code %>" <%=
"selected" if I18n.locale.to_s == language.code %>><%= language.name %></option>
Using Language table is probably a bad idea. I tried this:
```suggestion
<% Locale.available
.select { |locale| I18n.exists?
"shared.language_selector.language", :locale => locale, :fallback => false }
.sort_by { |locale| locale.to_s == "en" ? "English" :
t(".language", :locale => locale) }
.each do |locale| %>
<option class="form-select" value="<%= locale.to_s %>" <%= "selected"
if I18n.locale.to_s == locale.to_s %>><%= locale.to_s == "en" ? "English" :
t(".language", :locale => locale) %></option>
```
with this in locale file:
```
share:
language_selector:
language: THIS LANGUAGE NAME
```
Now translators have to add whatever is the appropriate representation of their
language there, and then it will appear in the selector.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5201#pullrequestreview-2375354012
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/5201/review/2375354...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev