Skip to content
Merged
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
2 changes: 1 addition & 1 deletion app/controllers/users/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def renderer_json(settings)

def load_languages
@languages = [[t("devise.registrations.general_settings.interface_language.autodetect"), nil]].concat(
I18n.available_locales.map { |locale| [I18nData.languages(locale)[locale.upcase.to_s]&.capitalize, locale] }
I18n.available_locales.map { |locale| [I18nData.languages(locale)[locale.to_s.first(2).upcase.to_s]&.capitalize, locale] }
)
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/settings/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<% end %>
<tr>
<th><%= User.human_attribute_name(:interface_language) %></th>
<td><%= @user.interface_language.present? ? I18nData.languages(@user.interface_language)[@user.interface_language.to_s]&.capitalize : t("devise.registrations.general_settings.interface_language.autodetect") %></td>
<td><%= @user.interface_language.present? ? I18nData.languages(@user.interface_language)[@user.interface_language.to_s.first(2).upcase.to_s]&.capitalize : t("devise.registrations.general_settings.interface_language.autodetect") %></td>
</tr>
<% if SiteSettings.oidc_enabled? %>
<tr>
Expand Down
17 changes: 7 additions & 10 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,13 @@ class Application < Rails::Application
config.i18n.load_path += Rails.root.glob("config/locales/**/*.{rb,yml}")
config.i18n.fallbacks = true
config.i18n.default_locale = :en
config.i18n.available_locales = [
:cs,
:de,
:en,
:es,
:fr,
:ja,
:nl,
:pl
]
config.i18n.available_locales = begin
if ENV.fetch("EXPERIMENTAL_LANGUAGES", nil) == "enabled"
YAML.load_file(Rails.root.join("config/locales.yml")).values.flatten
else
YAML.load_file(Rails.root.join("config/locales.yml"))["ready"]
end
end

# Don't generate system test files.
config.generators.system_tests = nil
Expand Down
13 changes: 3 additions & 10 deletions config/i18n-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@

# The "main" locale.
base_locale: en

## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
locales: [
cs,
de,
en,
es,
fr,
ja,
nl,
pl
]
# locales: []

## Reporting locale, default: en. Available: en, ru.
# internal_locale: en

Expand Down
2 changes: 1 addition & 1 deletion config/initializers/translation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"helpers"
]
config.source_locale = "en"
config.target_locales = ["ru", "es", "fr", "de", "pl", "pt", "ja", "nl", "cs", "zh-CN"]
config.target_locales = YAML.load_file(Rails.root.join("config/locales.yml")).values.flatten.without(config.source_locale)
end
end
13 changes: 13 additions & 0 deletions config/locales.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ready:
- cs
- de
- en
- es
- fr
- ja
- nl
- pl
experimental:
- pt
- ru
- zh-CN
37 changes: 37 additions & 0 deletions config/locales/collections/pt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
pt:
collections:
collection:
collections_button:
label:
remote_label:
delete_button:
label:
edit_button:
label:
models_button:
label:
remote_label:
no_preview:
create:
success:
destroy:
confirm:
success:
form:
notes:
help_html:
general:
edit:
new:
get_collection:
unknown:
index:
skip_collections:
show:
edit:
unassigned:
caption:
name:
update:
success:
37 changes: 37 additions & 0 deletions config/locales/collections/ru.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
ru:
collections:
collection:
collections_button:
label:
remote_label:
delete_button:
label:
edit_button:
label:
models_button:
label:
remote_label:
no_preview:
create:
success:
destroy:
confirm:
success:
form:
notes:
help_html:
general:
edit:
new:
get_collection:
unknown:
index:
skip_collections:
show:
edit:
unassigned:
caption:
name:
update:
success:
37 changes: 37 additions & 0 deletions config/locales/collections/zh-CN.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
zh-CN:
collections:
collection:
collections_button:
label:
remote_label:
delete_button:
label:
edit_button:
label:
models_button:
label:
remote_label:
no_preview:
create:
success:
destroy:
confirm:
success:
form:
notes:
help_html:
general:
edit:
new:
get_collection:
unknown:
index:
skip_collections:
show:
edit:
unassigned:
caption:
name:
update:
success:
16 changes: 8 additions & 8 deletions config/locales/creators/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ de:
success: Ersteller gelöscht!
form:
avatar:
current:
help:
none:
remove:
current: Derzeit wird `%{filename}` verwendet.
help: Ein quadratisches Profilbild mit den Maßen 256x256px im Format WEBP, PNG, GIF oder JPG.
none: Derzeit nicht festgelegt.
remove: Avatar entfernen
banner:
current:
help:
none:
remove:
current: Derzeit wird `%{filename}` verwendet.
help: Ein Hintergrundbild mit den Maßen 1000x200px im Format WEBP, PNG, GIF oder JPG.
none: Derzeit nicht festgelegt.
remove: Banner entfernen
notes:
help_html: Du kannst <a href="https://www.markdownguide.org/cheat-sheet/" target="markdown">Markdown</a> verwenden.
slug:
Expand Down
48 changes: 48 additions & 0 deletions config/locales/creators/pt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
pt:
creators:
create:
success:
creator:
collections_button:
label:
remote_label:
delete_button:
label:
edit_button:
label:
models_button:
label:
remote_label:
destroy:
confirm:
success:
form:
avatar:
current:
help:
none:
remove:
banner:
current:
help:
none:
remove:
notes:
help_html:
slug:
help:
general:
edit:
new:
get_creator:
unknown:
index:
skip_creators:
show:
edit:
unassigned:
caption:
name:
update:
success:
48 changes: 48 additions & 0 deletions config/locales/creators/ru.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
ru:
creators:
create:
success:
creator:
collections_button:
label:
remote_label:
delete_button:
label:
edit_button:
label:
models_button:
label:
remote_label:
destroy:
confirm:
success:
form:
avatar:
current:
help:
none:
remove:
banner:
current:
help:
none:
remove:
notes:
help_html:
slug:
help:
general:
edit:
new:
get_creator:
unknown:
index:
skip_creators:
show:
edit:
unassigned:
caption:
name:
update:
success:
48 changes: 48 additions & 0 deletions config/locales/creators/zh-CN.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
zh-CN:
creators:
create:
success:
creator:
collections_button:
label:
remote_label:
delete_button:
label:
edit_button:
label:
models_button:
label:
remote_label:
destroy:
confirm:
success:
form:
avatar:
current:
help:
none:
remove:
banner:
current:
help:
none:
remove:
notes:
help_html:
slug:
help:
general:
edit:
new:
get_creator:
unknown:
index:
skip_creators:
show:
edit:
unassigned:
caption:
name:
update:
success:
Loading
Loading