Skip to content

Commit

Permalink
Update index path
Browse files Browse the repository at this point in the history
  • Loading branch information
CuddlyBunion341 committed Oct 22, 2024
1 parent e71bf60 commit 4e0a3d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/controllers/moirai/translation_files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def show

def load_file_paths
i18n_file_paths = I18n.load_path
@file_paths = i18n_file_paths.select { |path| (path.start_with? Rails.root.to_s) && path.end_with?(".yml", ".yaml") }
# @file_paths = i18n_file_paths.select { |path| (path.start_with? Rails.root.to_s) && path.end_with?(".yml", ".yaml") }
@file_paths = i18n_file_paths.select { |path| path.end_with?(".yml", ".yaml") }
end

def generate_file_hashes
Expand Down
13 changes: 9 additions & 4 deletions app/views/moirai/translation_files/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<% @file_paths.each do |file| %>
<% file_hash = Digest::SHA256.hexdigest(file) %>
<%= link_to File.basename(file), translation_file_path(file_hash) %>
<% end %>
<h1>Translation fiels</h1>
<ul>
<% @file_paths.each do |file| %>
<% file_hash = Digest::SHA256.hexdigest(file) %>
<li>
<%= link_to (file), translation_file_path(file_hash) %>
</li>
<% end %>
</ul>

0 comments on commit 4e0a3d9

Please sign in to comment.