Skip to content

Commit

Permalink
Fix admin I18n key missing issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Oct 30, 2022
1 parent cd42ace commit 86e7230
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 47 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/plugins_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def show
def create
if Homeland::Plugin.install(params[:file])
Homeland.reboot
redirect_to admin_plugins_path, notice: t("view.admin.plugin_was_install_success")
redirect_to admin_plugins_path, notice: t("views.admin.plugin_was_install_success")
else
redirect_to admin_plugins_path, alert: t("views.admin.plugin_was_install_error")
end
Expand Down
11 changes: 6 additions & 5 deletions app/views/admin/site_configs/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% content_for :sitemap do %>
<span class="current"><%= t("admin.site_configs.settings") %></span>
<% end %>
<div class="btn-group mb-3">
<div class="mb-3 btn-group">
<% @setting_groups.each_key do |name| %>
<a href="<%= admin_site_configs_path(scope: name) %>" class="btn btn-secondary<% " active" if params[:scope] == name.to_s %>"><%= t("setting.scope.#{name}") %></a>
<% end %>
Expand All @@ -16,15 +16,16 @@
<% next if !Setting.use_recaptcha? && key.in?(%w[recaptcha_key recaptcha_secret]) %>
<% if !Setting::SYSTEM_KEYS.include?(key) %>
<li class="list-group-item">
<div class="mb-1">
<%= icon_tag("cog") %><a href="<%= edit_admin_site_config_path(key) %>" class="ml-1"><%= key %></a>
<div class="flex items-center mb-1 space-x-2 dark:text-gray-50">
<%= icon_tag("cog") %>
<a href="<%= edit_admin_site_config_path(key) %>" class="ml-1 font-bold uppercase"><%= key %></a>
<% if key == "timezone" %>
<div class="badge">
<div class="badge dark:text-gray-500">
Current Timezone: <%= Time.zone %>
</div>
<% end %>
</div>
<div class="text-gray"><%= raw t("setting.#{key}") %></div>
<div class="text-gray dark:text-gray-500"><%= raw t("setting.#{key}") %></div>
</li>
<% end %>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ test:

production:
<<: *default
database: homeland-dev
50 changes: 26 additions & 24 deletions config/locales/admin.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,29 @@ en:
A reboot command has been initiated, and the Homeland is restarting in the
background. You can refresh the page and determine whether the restart is
complete by boot time.
views.admin.node_was_successfully_created: Node was successfully created.
views.admin.location_was_update_successfully: Location was update successfully.
view.admin.plugin_was_install_success: Plugin was install successfully, if page not refresh, please refresh it.
views.admin.plugin_was_install_error: Plugin was install error, please check the zip to determine that is correct.
views.admin.plugn_was_uninstall_successfully: Plugn was uninstall successfully.
views.admin.plugn_was_uninstall_error: Plugn was uninstall error.
views.admin.update_successfully: Update successfully.
views.admin.topic_created_successfully: Topic created successfully.
views.admin.topic_updated_successfully: Topic updated successfully.
views.admin.user_updated_successfully: User updated successfully.
views.admin.recent_10_replies_has_been_deleted_successfully: >-
Recent 10 replies has been deleted successfully, now %{name} still %{count}
replies
views.admin.node_update_successfully: Node was successfully updated.
views.admin.recent_10_topics_has_been_deleted_successfully: >-
Recent 10 topics has been deleted successfully, now %{name} still have
%{count} topics.
views.admin.recent_10_photos_has_been_deleted_successfully: >-
Recent 10 photos has been deleted successfully, now %{name} still have
%{count} photos.
views.admin.recent_10_notes_has_been_deleted_successfully: >-
Recent 10 notes has been deleted successfully, now %{user} still have
%{count} notes.
views.admin.oauth_applications: OAuth Applications
views:
admin:
node_was_successfully_created: Node was successfully created.
location_was_update_successfully: Location was update successfully.
plugin_was_install_success: Plugin was install successfully, if page not refresh, please refresh it.
plugin_was_install_error: Plugin was install error, please check the zip to determine that is correct.
plugn_was_uninstall_successfully: Plugn was uninstall successfully.
plugn_was_uninstall_error: Plugn was uninstall error.
update_successfully: Update successfully.
topic_created_successfully: Topic created successfully.
topic_updated_successfully: Topic updated successfully.
user_updated_successfully: User updated successfully.
recent_10_replies_has_been_deleted_successfully: >-
Recent 10 replies has been deleted successfully, now %{name} still %{count}
replies
node_update_successfully: Node was successfully updated.
recent_10_topics_has_been_deleted_successfully: >-
Recent 10 topics has been deleted successfully, now %{name} still have
%{count} topics.
recent_10_photos_has_been_deleted_successfully: >-
Recent 10 photos has been deleted successfully, now %{name} still have
%{count} photos.
recent_10_notes_has_been_deleted_successfully: >-
Recent 10 notes has been deleted successfully, now %{user} still have
%{count} notes.
oauth_applications: OAuth Applications
36 changes: 19 additions & 17 deletions config/locales/admin.zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,22 @@ zh-CN:
topic_list: 话题列表
check_photo: 瀏覽圖片
reboot_successfully: 已经发起了重启命令,Homeland 在后台异步重启,你可以刷新页面,通过服务启动时间变化来确定重启是否完成。
views.admin.comment_was_successfully_updated: Comment was successfully updated.
views.admin.location_was_update_successfully: 城市创建成功。
views.admin.node_was_successfully_created: 节点创建成功。
view.admin.plugin_was_install_success: 插件安装成功,如果页面没有刷新,请手动刷新。
views.admin.plugin_was_install_error: 插件安装失败,请检查 zip 包是否为正确的 Homeland 插件格式。
views.admin.plugn_was_uninstall_successfully: 插件卸载成功。
views.admin.plugn_was_uninstall_error: 插件卸载失败。
views.admin.update_successfully: 更新成功。
views.admin.topic_created_successfully: 话题创建成功。
views.admin.topic_updated_successfully: 话题更新成功。
views.admin.user_updated_successfully: 用户更新成功。
views.admin.recent_10_replies_has_been_deleted_successfully: 成功删除最近 10 条回复,目前 %{name} 还有 %{count} 条。
views.admin.node_update_successfully: 节点更新成功。
views.admin.recent_10_topics_has_been_deleted_successfully: 成功删除最近 10 条话题,目前 %{name} 还有 %{count} 条。
views.admin.recent_10_photos_has_been_deleted_successfully: 成功删除最近 10 条图片,目前 %{name} 还有 %{count} 条。
views.admin.recent_10_notes_has_been_deleted_successfully: 成功删除最近 10 条笔记,目前 %{name} 还有 %{count} 条。
views.admin.oauth_applications: OAuth 应用
views:
admin:
comment_was_successfully_updated: Comment was successfully updated.
location_was_update_successfully: 城市创建成功。
node_was_successfully_created: 节点创建成功。
plugin_was_install_success: 插件安装成功,如果页面没有刷新,请手动刷新。
plugin_was_install_error: 插件安装失败,请检查 zip 包是否为正确的 Homeland 插件格式。
plugn_was_uninstall_successfully: 插件卸载成功。
plugn_was_uninstall_error: 插件卸载失败。
update_successfully: 更新成功。
topic_created_successfully: 话题创建成功。
topic_updated_successfully: 话题更新成功。
user_updated_successfully: 用户更新成功。
recent_10_replies_has_been_deleted_successfully: 成功删除最近 10 条回复,目前 %{name} 还有 %{count} 条。
node_update_successfully: 节点更新成功。
recent_10_topics_has_been_deleted_successfully: 成功删除最近 10 条话题,目前 %{name} 还有 %{count} 条。
recent_10_photos_has_been_deleted_successfully: 成功删除最近 10 条图片,目前 %{name} 还有 %{count} 条。
recent_10_notes_has_been_deleted_successfully: 成功删除最近 10 条笔记,目前 %{name} 还有 %{count} 条。
oauth_applications: OAuth 应用

0 comments on commit 86e7230

Please sign in to comment.