diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index 2ee5e4c3..3eedaacb 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -20,7 +20,7 @@ def show def update if @album.update(album_params) - flash[:success] = t("success.update") + flash[:success] = t("notice.updated") else flash_errors_message(@album) end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index acfe4e17..7814be8a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base include Pagy::Backend include SessionsHelper - helper_method :native_app?, :need_transcode?, :render_flash, :mobile? + helper_method :native_app?, :need_transcode?, :render_flash, :mobile?, :dialog? before_action :find_current_session before_action :find_current_request_details @@ -83,6 +83,10 @@ def mobile? browser.device.mobile? end + def dialog? + is_a? Dialog::DialogController + end + private def find_current_session diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index 582d6f67..6cbda923 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -17,7 +17,7 @@ def show def update if @artist.update(artist_params) - flash[:success] = t("success.update") + flash[:success] = t("notice.updated") else flash_errors_message(@artist) end diff --git a/app/controllers/current_playlist/songs_controller.rb b/app/controllers/current_playlist/songs_controller.rb index 4139d5a7..b3e0d8d5 100644 --- a/app/controllers/current_playlist/songs_controller.rb +++ b/app/controllers/current_playlist/songs_controller.rb @@ -19,7 +19,7 @@ def create @playlist.playlists_songs.create(song_id: @song.id, position: @current_song_position + 1) end - flash.now[:success] = t("success.add_to_playlist") + flash.now[:success] = t("notice.added_to_playlist") redirect_to action: "index", should_play_all: params[:should_play] if @playlist.songs.count == 1 rescue ActiveRecord::RecordNotUnique diff --git a/app/controllers/playlists/songs_controller.rb b/app/controllers/playlists/songs_controller.rb index b76eb001..e6105ddd 100644 --- a/app/controllers/playlists/songs_controller.rb +++ b/app/controllers/playlists/songs_controller.rb @@ -13,7 +13,7 @@ def create @song = Song.find(params[:song_id]) @playlist.songs.push(@song) - flash[:success] = t("success.add_to_playlist") + flash[:success] = t("notice.added_to_playlist") rescue ActiveRecord::RecordNotUnique flash[:error] = t("error.already_in_playlist") ensure @@ -22,7 +22,7 @@ def create def destroy @playlist.songs.destroy(@song) - flash.now[:success] = t("success.delete_from_playlist") + flash.now[:success] = t("notice.deleted_from_playlist") # for refresh playlist content, when remove last song from playlist redirect_to action: "index" if @playlist.songs.empty? diff --git a/app/controllers/playlists_controller.rb b/app/controllers/playlists_controller.rb index d702ff94..5ed65444 100644 --- a/app/controllers/playlists_controller.rb +++ b/app/controllers/playlists_controller.rb @@ -12,7 +12,7 @@ def create @playlist = Current.user.playlists.new playlist_params if @playlist.save - flash[:success] = t("success.create") + flash[:success] = t("notice.created") else flash_errors_message(@playlist) end @@ -22,7 +22,7 @@ def create def update if @playlist.update(playlist_params) - flash[:success] = t("success.update") + flash[:success] = t("notice.updated") else flash_errors_message(@playlist) end diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index aaf1df3b..17c2c3bc 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -10,7 +10,7 @@ def update setting = Setting.instance if setting.update(setting_params) - flash.now[:success] = t("success.update") + flash.now[:success] = t("notice.updated") else flash_errors_message(setting, now: true) end diff --git a/app/controllers/users/settings_controller.rb b/app/controllers/users/settings_controller.rb index 092bc65d..6867f31f 100644 --- a/app/controllers/users/settings_controller.rb +++ b/app/controllers/users/settings_controller.rb @@ -6,7 +6,7 @@ class Users::SettingsController < ApplicationController def update return unless @user.update(user_setting_params) - flash.now[:success] = t("success.update") + flash.now[:success] = t("notice.updated") end private diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index fba40622..1a164c81 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -20,7 +20,7 @@ def create @user = User.new user_params if @user.save - flash[:success] = t("success.create") + flash[:success] = t("notice.created") redirect_to users_path else flash_errors_message(@user, now: true) @@ -29,7 +29,7 @@ def create def update if @user.update(user_params) - flash.now[:success] = t("success.update") + flash.now[:success] = t("notice.updated") else flash_errors_message(@user, now: true) end @@ -40,7 +40,7 @@ def destroy raise BlackCandy::Forbidden if @user == Current.user @user.destroy - flash.now[:success] = t("success.delete") + flash.now[:success] = t("notice.deleted") end private diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d2ccbed8..beef4888 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -78,7 +78,7 @@ def is_active?(controller: "", path: "") def page_title_tag(title) title_suffix = " - #{t(:app_name)}" - title = "#{title}#{title_suffix unless native_app?}" + title = "#{title}#{title_suffix unless native_app? || dialog?}" content_for(:title, title) end diff --git a/app/views/albums/_filters.html.erb b/app/views/albums/_filters.html.erb index 3e3748fb..fd2d2c50 100644 --- a/app/views/albums/_filters.html.erb +++ b/app/views/albums/_filters.html.erb @@ -10,7 +10,7 @@
- <%= t("label.genre") %> + <%= t("field.genre") %> <%= icon_tag "expand-more" %> @@ -26,7 +26,7 @@
- <%= t("label.year") %> + <%= t("field.year") %> <%= icon_tag "expand-more" %> diff --git a/app/views/albums/show.html.erb b/app/views/albums/show.html.erb index f90b27f1..c267b817 100644 --- a/app/views/albums/show.html.erb +++ b/app/views/albums/show.html.erb @@ -13,7 +13,7 @@
<%= button_to( - t("label.play_all"), + t("button.play_all"), current_playlist_album_path(@album), method: :put, form_class: "u-display-inline-block", @@ -78,7 +78,7 @@ class: "c-dropdown__item" ) %> <%= button_to( - t("label.play_next"), + t("button.play_next"), current_playlist_songs_path(song_id: song.id), form_class: "c-dropdown__item", form: { @@ -90,7 +90,7 @@ } ) %> <%= button_to( - t("label.play_last"), + t("button.play_last"), current_playlist_songs_path(song_id: song.id, location: "last"), form_class: "c-dropdown__item", form: { diff --git a/app/views/current_playlist/songs/_song.html.erb b/app/views/current_playlist/songs/_song.html.erb index 13da9f8c..538f0ff1 100644 --- a/app/views/current_playlist/songs/_song.html.erb +++ b/app/views/current_playlist/songs/_song.html.erb @@ -27,7 +27,7 @@
<%= link_to t("label.add_to_playlist"), dialog_playlists_path(song_id: song.id, referer_url: current_url), data: {"turbo-frame" => ("turbo-dialog" unless native_app?)}, class: "c-dropdown__item" %> - <%= button_to t("label.delete"), current_playlist_song_path(song), method: :delete, form_class: "c-dropdown__item", form: {data: {"turbo-frame" => "turbo-playlist"}} %> + <%= button_to t("button.delete"), current_playlist_song_path(song), method: :delete, form_class: "c-dropdown__item", form: {data: {"turbo-frame" => "turbo-playlist"}} %>
diff --git a/app/views/current_playlist/songs/index.html.erb b/app/views/current_playlist/songs/index.html.erb index c8b6b0d0..d8226e40 100644 --- a/app/views/current_playlist/songs/index.html.erb +++ b/app/views/current_playlist/songs/index.html.erb @@ -13,7 +13,7 @@
<%= icon_tag "more-vertical", title: t("label.more") %>
- <%= button_to t("label.clear"), current_playlist_songs_path, method: :delete, form_class: "c-dropdown__item" %> + <%= button_to t("button.clear"), current_playlist_songs_path, method: :delete, form_class: "c-dropdown__item" %>
diff --git a/app/views/dialog/albums/edit.html.erb b/app/views/dialog/albums/edit.html.erb index 1f25d3b4..084d417f 100644 --- a/app/views/dialog/albums/edit.html.erb +++ b/app/views/dialog/albums/edit.html.erb @@ -2,10 +2,10 @@ <%= form_with model: @album, data: {"turbo-frame" => "_top", "turbo-action" => ("replace" if native_app?), "test-id" => "album_edit_form"}, class: "c-form" do |form| %>
- <%= form.label :cover_image, t("label.album_cover") %> + <%= form.label :cover_image, t("field.album_cover") %> <%= form.file_field :cover_image, accept: "image/png, image/jpeg", class: "c-input" %>
- <%= form.submit t("label.save"), class: "c-button c-button--primary c-button--full-width" %> + <%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width" %>
<% end %> diff --git a/app/views/dialog/artists/edit.html.erb b/app/views/dialog/artists/edit.html.erb index 50bdd9c7..647ae2bd 100644 --- a/app/views/dialog/artists/edit.html.erb +++ b/app/views/dialog/artists/edit.html.erb @@ -2,10 +2,10 @@ <%= form_with model: @artist, data: {"turbo-frame" => "_top", "turbo-action" => ("replace" if native_app?), "test-id" => "artist_edit_form"}, class: "c-form" do |form| %>
- <%= form.label :cover_image, t("label.artist_cover") %> + <%= form.label :cover_image, t("field.artist_cover") %> <%= form.file_field :cover_image, accept: "image/png, image/jpeg", class: "c-input" %>
- <%= form.submit t("label.save"), class: "c-button c-button--primary c-button--full-width" %> + <%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width" %>
<% end %> diff --git a/app/views/dialog/playlists/edit.html.erb b/app/views/dialog/playlists/edit.html.erb index bcf17049..fc6cb589 100644 --- a/app/views/dialog/playlists/edit.html.erb +++ b/app/views/dialog/playlists/edit.html.erb @@ -10,11 +10,11 @@ } ) do |form| %>
- <%= form.label :name, t("label.name") %> + <%= form.label :name, t("field.name") %> <%= form.text_field :name, class: "c-input" %>
- <%= form.submit t("label.save"), class: "c-button c-button--primary c-button--full-width" %> + <%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width" %>
<% end %> diff --git a/app/views/dialog/playlists/new.html.erb b/app/views/dialog/playlists/new.html.erb index e2d19815..005a83c1 100644 --- a/app/views/dialog/playlists/new.html.erb +++ b/app/views/dialog/playlists/new.html.erb @@ -2,11 +2,11 @@ <%= form_with model: @playlist, class: "c-form", data: {"turbo-frame" => "_top", "turbo-action" => ("replace" if native_app?)} do |form| %>
- <%= form.label :name, t("label.name") %> + <%= form.label :name, t("field.name") %> <%= form.text_field :name, class: "c-input" %>
- <%= form.submit t("label.save"), class: "c-button c-button--primary c-button--full-width" %> + <%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width" %>
<% end %> diff --git a/app/views/favorite_playlist/songs/index.html.erb b/app/views/favorite_playlist/songs/index.html.erb index 93c66572..2bfdec6f 100644 --- a/app/views/favorite_playlist/songs/index.html.erb +++ b/app/views/favorite_playlist/songs/index.html.erb @@ -12,7 +12,7 @@
<% unless @songs.blank? %> <%= button_to( - t("label.play_all"), + t("button.play_all"), current_playlist_playlist_path(@playlist), method: :put, class: "c-button c-button--primary", @@ -27,7 +27,7 @@ } } ) %> - <%= button_to t("label.clear"), favorite_playlist_songs_path, class: "c-button c-button--secondary", form_class: "u-display-inline-block", method: :delete %> + <%= button_to t("button.clear"), favorite_playlist_songs_path, class: "c-button c-button--secondary", form_class: "u-display-inline-block", method: :delete %> <% end %>
diff --git a/app/views/media_syncing/_button.html.erb b/app/views/media_syncing/_button.html.erb index 800eabb5..0ab395cf 100644 --- a/app/views/media_syncing/_button.html.erb +++ b/app/views/media_syncing/_button.html.erb @@ -1,7 +1,7 @@
<% if syncing %> <%= button_to( - t("label.syncing"), + t("button.syncing"), false, class: "c-button c-button--secondary", data: {"test-id" => "media_sync_button"}, @@ -9,12 +9,12 @@ ) %> <% else %> <%= button_to( - t("label.sync"), + t("button.sync"), media_syncing_path, class: "c-button c-button--secondary", data: { "test-id" => "media_sync_button", - "turbo-submits-with" => t("label.syncing") + "turbo-submits-with" => t("button.syncing") } ) %> <% end %> diff --git a/app/views/media_syncing/_syncing.turbo_stream.erb b/app/views/media_syncing/_syncing.turbo_stream.erb index 512c1c2b..fdd8fdc4 100644 --- a/app/views/media_syncing/_syncing.turbo_stream.erb +++ b/app/views/media_syncing/_syncing.turbo_stream.erb @@ -1,5 +1,5 @@ <%= turbo_stream.replace "turbo-media-syncing-button", partial: "media_syncing/button", locals: {syncing: syncing} %> <% unless syncing %> - <%= render_flash(message: t("text.sync_completed")) %> + <%= render_flash(message: t("notice.sync_completed")) %> <% end %> diff --git a/app/views/playlists/songs/_song.html.erb b/app/views/playlists/songs/_song.html.erb index 603b35f1..ee8f4714 100644 --- a/app/views/playlists/songs/_song.html.erb +++ b/app/views/playlists/songs/_song.html.erb @@ -34,7 +34,7 @@ class: "c-dropdown__item" ) %> <%= button_to( - t("label.play_next"), + t("button.play_next"), current_playlist_songs_path(song_id: song.id), form_class: "c-dropdown__item", form: { @@ -46,7 +46,7 @@ } ) %> <%= button_to( - t("label.play_last"), + t("button.play_last"), current_playlist_songs_path(song_id: song.id, location: "last"), form_class: "c-dropdown__item", form: { @@ -58,7 +58,7 @@ } ) %> <%= button_to( - t("label.delete"), + t("button.delete"), playlist_song_path(playlist, song), method: :delete, form_class: "c-dropdown__item" diff --git a/app/views/playlists/songs/index.html.erb b/app/views/playlists/songs/index.html.erb index 938f03c5..c9e76fc0 100644 --- a/app/views/playlists/songs/index.html.erb +++ b/app/views/playlists/songs/index.html.erb @@ -14,7 +14,7 @@
<% unless @songs.blank? %> <%= button_to( - t("label.play_all"), + t("button.play_all"), current_playlist_playlist_path(@playlist), method: :put, class: "c-button c-button--primary", @@ -38,9 +38,9 @@
<% unless @songs.blank? %> - <%= button_to t("label.clear"), playlist_songs_path(@playlist), method: :delete, form_class: "c-dropdown__item" %> + <%= button_to t("button.clear"), playlist_songs_path(@playlist), method: :delete, form_class: "c-dropdown__item" %> <% end %> - <%= button_to t("label.delete"), playlist_path(@playlist), method: :delete, form_class: "c-dropdown__item" %> + <%= button_to t("button.delete"), playlist_path(@playlist), method: :delete, form_class: "c-dropdown__item" %>
diff --git a/app/views/search/albums/index.html.erb b/app/views/search/albums/index.html.erb index bad7d5a5..e497e7b8 100644 --- a/app/views/search/albums/index.html.erb +++ b/app/views/search/albums/index.html.erb @@ -1,4 +1,4 @@ -

<%= t("text.search_results", query: params[:query]) %>

+

<%= t("label.search_results_for", query: params[:query]) %>

<%= t("label.albums") %>

<%= render partial: "albums/album", collection: @albums %> diff --git a/app/views/search/artists/index.html.erb b/app/views/search/artists/index.html.erb index 8aba3b3c..88afed8c 100644 --- a/app/views/search/artists/index.html.erb +++ b/app/views/search/artists/index.html.erb @@ -1,4 +1,4 @@ -

<%= t("text.search_results", query: params[:query]) %>

+

<%= t("label.search_results_for", query: params[:query]) %>

<%= t("label.artists") %>

<%= render partial: "artists/artist", collection: @artists %> diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb index a8ddde8a..e64f81f9 100644 --- a/app/views/search/index.html.erb +++ b/app/views/search/index.html.erb @@ -1,7 +1,7 @@ <% page_title_tag t("label.search_results") %> <% if [@albums, @artists, @songs, @playlists].any?(&:present?) %> -

<%= t("text.search_results", query: params[:query]) %>

+

<%= t("label.search_results_for", query: params[:query]) %>

<% if @albums.present? %>
@@ -53,5 +53,5 @@ <%= render partial: "search/songs/table", locals: {songs: @songs} %> <% end %> <% else %> -

<%= t("text.no_search_results", query: params[:query]) %>

+

<%= t("label.no_search_results", query: params[:query]) %>

<% end %> diff --git a/app/views/search/playlists/index.html.erb b/app/views/search/playlists/index.html.erb index 430cd294..3f7cced4 100644 --- a/app/views/search/playlists/index.html.erb +++ b/app/views/search/playlists/index.html.erb @@ -1,4 +1,4 @@ -

<%= t("text.search_results", query: params[:query]) %>

+

<%= t("label.search_results_for", query: params[:query]) %>

<%= t("label.playlists") %>

diff --git a/app/views/search/songs/_table.html.erb b/app/views/search/songs/_table.html.erb index f24ad7f8..9f03601a 100644 --- a/app/views/search/songs/_table.html.erb +++ b/app/views/search/songs/_table.html.erb @@ -1,7 +1,7 @@
-
<%= t("label.name") %>
+
<%= t("field.name") %>
<%= t("label.artist") %>
<%= t("label.album") %>
<%= t("label.duration") %>
diff --git a/app/views/search/songs/index.html.erb b/app/views/search/songs/index.html.erb index 399e3251..4d08d3e2 100644 --- a/app/views/search/songs/index.html.erb +++ b/app/views/search/songs/index.html.erb @@ -1,3 +1,3 @@ -

<%= t("text.search_results", query: params[:query]) %>

+

<%= t("label.search_results_for", query: params[:query]) %>

<%= t("label.songs") %>

<%= render partial: "search/songs/table", locals: {songs: @songs} %> diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index b6d1d1bf..62771b79 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,15 +1,15 @@ <%= form_with scope: :session, url: sessions_path, class: "c-form", data: {controller: "form", action: "turbo:submit-end->form#reset"} do |form| %>
- <%= form.label :email %> + <%= form.label :email, t("field.email") %> <%= form.email_field :email, value: params[:email], autofocus: true, class: "c-input" %>
- <%= form.label :password %> + <%= form.label :password, t("field.password") %> <%= form.password_field :password, class: "c-input" %>
- <%= form.submit t("label.login"), class: "c-button c-button--primary c-button--full-width" %> + <%= form.submit t("button.login"), class: "c-button c-button--primary c-button--full-width" %>
<% end %> diff --git a/app/views/settings/_form.html.erb b/app/views/settings/_form.html.erb index 48e9e2a9..21582ee1 100644 --- a/app/views/settings/_form.html.erb +++ b/app/views/settings/_form.html.erb @@ -6,13 +6,13 @@ <%= form_with model: Setting, url: setting_path, method: :put, class: "c-form" do |form| %>
- <%= form.label :media_path %> + <%= form.label :media_path, t("field.media_path") %> <%= form.text_field :media_path, value: Setting.media_path, class: "c-input" %>
- <%= form.label :enable_media_listener %> + <%= form.label :enable_media_listener, t("field.enable_media_listener") %> <%= form.check_box :enable_media_listener %>
<% if MediaListener.running? %> @@ -25,7 +25,7 @@ <%= t("text.enable_media_listener") %>
- <%= form.submit t("label.save"), class: "c-button c-button--primary c-button--full-width" %> + <%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width" %>
<% end %> @@ -34,11 +34,11 @@

<%= t("label.integration") %>

<%= form_with model: Setting, url: setting_path, method: :put, class: "c-form" do |form| %>
- <%= form.label :discogs_token %> + <%= form.label :discogs_token, t("field.discogs_token") %> <%= form.text_field :discogs_token, value: Setting.discogs_token, class: "c-input" %>
- <%= form.submit t("label.save"), class: "c-button c-button--primary c-button--full-width", data: {"test-id" => "setting_discogs_token_save_button"} %> + <%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width", data: {"test-id" => "setting_discogs_token_save_button"} %>
<% end %> @@ -48,17 +48,17 @@

<%= t("text.transcoding") %>

<%= form_with model: Setting, url: setting_path, method: :put, class: "c-form" do |form| %>
- <%= form.label :allow_transcode_lossless %> + <%= form.label :allow_transcode_lossless, t("field.allow_transcode_lossless") %> <%= form.check_box :allow_transcode_lossless %>
<%= t("text.allow_transcode_lossless") %>
- <%= form.label :transcode_bitrate %> + <%= form.label :transcode_bitrate, t("field.transcode_bitrate") %> <%= form.select :transcode_bitrate, Setting::AVAILABLE_BITRATE_OPTIONS.map { |option| ["#{option} kbps", option] }, selected: Setting.transcode_bitrate, class: "c-input" %>
- <%= form.submit t("label.save"), class: "c-button c-button--primary c-button--full-width" %> + <%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width" %>
<% end %>
diff --git a/app/views/shared/_search_bar.html.erb b/app/views/shared/_search_bar.html.erb index 952fc458..89157d22 100644 --- a/app/views/shared/_search_bar.html.erb +++ b/app/views/shared/_search_bar.html.erb @@ -20,7 +20,7 @@ <%= link_to t("label.settings"), setting_path, class: "c-dropdown__item" %> <%= link_to t("label.manage_users"), users_path, class: "c-dropdown__item" if is_admin? %> <%= link_to t("label.update_profile"), edit_user_path(Current.user), class: "c-dropdown__item" %> - <%= button_to t("label.logout"), Current.session, method: :delete, form_class: "c-dropdown__item" %> + <%= button_to t("button.logout"), Current.session, method: :delete, form_class: "c-dropdown__item" %>
diff --git a/app/views/shared/_sort_select.html.erb b/app/views/shared/_sort_select.html.erb index a1b9de65..73fa38fc 100644 --- a/app/views/shared/_sort_select.html.erb +++ b/app/views/shared/_sort_select.html.erb @@ -6,7 +6,7 @@ <% option.values.each do |sort_value| %> <%= link_to url_for(controller: params[:controller], action: :index, **filter_sort_params(sort: sort_value)), class: "c-dropdown__item", data: {"turbo-action" => ("replace" if native_app?)} do %> - <%= t("label.#{sort_value}") %> + <%= t("field.#{sort_value}") %> <% if params[:sort] == sort_value || (params[:sort].blank? && sort_value == option.default.name) %> <%= icon_tag("check", size: "small", class: "u-ml-narrow") %> <% end %> diff --git a/app/views/songs/_filters.html.erb b/app/views/songs/_filters.html.erb index a46a0e81..6838358e 100644 --- a/app/views/songs/_filters.html.erb +++ b/app/views/songs/_filters.html.erb @@ -10,7 +10,7 @@
- <%= t("label.genre") %> + <%= t("field.genre") %> <%= icon_tag "expand-more" %> @@ -26,7 +26,7 @@
- <%= t("label.year") %> + <%= t("field.year") %> <%= icon_tag "expand-more" %> diff --git a/app/views/songs/_song.html.erb b/app/views/songs/_song.html.erb index a460b3d9..71cd8295 100644 --- a/app/views/songs/_song.html.erb +++ b/app/views/songs/_song.html.erb @@ -35,7 +35,7 @@ class: "c-dropdown__item" ) %> <%= button_to( - t("label.play_next"), + t("button.play_next"), current_playlist_songs_path(song_id: song.id), form_class: "c-dropdown__item", form: { @@ -47,7 +47,7 @@ } ) %> <%= button_to( - t("label.play_last"), + t("button.play_last"), current_playlist_songs_path(song_id: song.id, location: "last"), form_class: "c-dropdown__item", form: { diff --git a/app/views/songs/_table.html.erb b/app/views/songs/_table.html.erb index 7e47e584..2ae23cde 100644 --- a/app/views/songs/_table.html.erb +++ b/app/views/songs/_table.html.erb @@ -5,7 +5,7 @@
-
<%= t("label.name") %>
+
<%= t("field.name") %>
<%= t("label.artist") %>
<%= t("label.album") %>
<%= t("label.duration") %>
diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index cd8a153e..45ca89a2 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -1,17 +1,17 @@ <%= form_with model: user, class: "c-form", id: "turbo-user-form" do |form| %>
- <%= form.label :email %> + <%= form.label :email, t("field.email") %> <%= form.email_field :email, class: "c-input" %>
- <%= form.label :password %> + <%= form.label :password, t("field.password") %> <%= form.password_field :password, class: "c-input" %>
- <%= form.label :password_confirmation %> + <%= form.label :password_confirmation, t("field.password_confirmation") %> <%= form.password_field :password_confirmation, class: "c-input" %>
- <%= form.submit t("label.save"), class: "c-button c-button--primary c-button--full-width" %> + <%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width" %>
<% end %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 002788fb..2646f4eb 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -3,7 +3,7 @@

<%= t("label.users") %>

- <%= link_to t("label.add_user"), new_user_path, class: "c-button c-button--primary" %> + <%= link_to t("label.add"), new_user_path, class: "c-button c-button--primary" %>

@@ -16,7 +16,7 @@ <%= user.email %> <% end %> <%= button_to user_path(user), method: :delete, class: "c-button c-button--icon" do %> - <%= icon_tag "delete", size: "small", title: t("label.delete") %> + <%= icon_tag "delete", size: "small", title: t("button.delete") %> <% end %> <% end %> diff --git a/app/views/users/settings/_form.html.erb b/app/views/users/settings/_form.html.erb index af85e60b..b32cf469 100644 --- a/app/views/users/settings/_form.html.erb +++ b/app/views/users/settings/_form.html.erb @@ -1,7 +1,7 @@

<%= t("label.personal") %>

<%= form_with model: user, url: user_setting_path(user), method: :put, class: "c-form" do |form| %>
- <%= form.label :theme %> + <%= form.label :theme, t("field.theme") %> <% User::AVAILABLE_THEME_OPTIONS.each do |option| %>
<%= form.radio_button :theme, option, checked: user.theme == option %> @@ -10,6 +10,6 @@ <% end %>
- <%= form.submit t("label.save"), class: "c-button c-button--primary c-button--full-width", data: {"test-id" => "setting_theme_save_button"} %> + <%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width", data: {"test-id" => "setting_theme_save_button"} %>
<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 9b8ce9fd..68f7e8e3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,79 +1,31 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# The following keys must be escaped otherwise they will not be retrieved by -# the default I18n backend: -# -# true, false, on, off, yes, no -# -# Instead, surround them with single quotes. -# -# en: -# 'true': 'foo' -# -# To learn more, please read the Rails Internationalization guide -# available at https://guides.rubyonrails.org/i18n.html. - en: app_name: 'Black Candy' + label: - login: 'Login' - logout: 'Logout' users: 'Users' - current: 'Current' playlists: 'Playlists' favorites: 'Favorites' albums: 'Albums' artists: 'Artists' songs: 'Songs' settings: 'Settings' - create: 'Create' - play_all: 'Play all' - clear: 'Clear' - delete: 'Delete' - rename: 'Rename' tracks: 'Tracks' - save: 'Save' - sync: 'Sync' - syncing: 'Syncing...' integration: 'Integration' - close: 'Close' - more: 'More' appears_on: 'Appears On' - name: 'Name' duration: 'Duration' actions: 'Actions' - edit: 'Edit' transcoding: 'Transcoding' home: 'Home' recently_added: 'Recently Added' recently_played: 'Recently Played' library: 'Library' - add: 'Add' create_playlist: 'Create Playlist' edit_playlist: 'Edit Playlist' - no_items: 'No items' - add_to_playlist: 'Add to playlist' - update_profile: 'Update profile' - manage_users: 'Manage users' - add_user: 'Add user' + no_items: 'No Items' + add_to_playlist: 'Add To Playlist' + update_profile: 'Update Profile' + manage_users: 'Manage Users' create_user: 'Create User' - media_path: 'Media path' no_repeat_mode: 'No repeat mode' repeat_mode: 'Repeat mode' single_mode: 'Single mode' @@ -86,27 +38,56 @@ en: expand_player: 'Expand player' collapse_player: 'Collapse player' personal: 'Personal' - see_all: 'See All' edit_album: 'Edit Album' edit_artist: 'Edit Artist' album: 'Album' - album_cover: 'Album Cover' - album_name: 'Album Name' - album_year: 'Album Year' artist: 'Artist' - artist_cover: 'Artist Cover' - artist_name: 'Artist Name' sort: 'Sort' - year: 'Year' - genre: 'Genre' - created_at: 'Created At' asc: 'Ascending' desc: 'Descending' + search_results: 'Search Results' + disc: 'Disc %{number}' + more: 'More' + see_all: 'See All' + add: 'Add' clear_filters: 'Clear Filters' + edit: 'Edit' + close: 'Close' + no_search_results: "No search results for \"%{query}\"" + search_results_for: "Search results for \"%{query}\"" + + button: + login: 'Login' + logout: 'Logout' + play_all: 'Play All' + clear: 'Clear' + delete: 'Delete' + save: 'Save' + sync: 'Sync' + syncing: 'Syncing...' play_next: 'Play Next' play_last: 'Play Last' - search_results: 'Search Results' - disc: 'Disc %{number}' + + field: + name: 'Name' + media_path: 'Media Path' + album_cover: 'Album Cover' + artist_cover: 'Artist Cover' + album_name: 'Album Name' + album_year: 'Album Year' + artist_name: 'Artist Name' + created_at: 'Created At' + year: 'Year' + genre: 'Genre' + email: 'Email' + password: 'Password' + theme: 'Theme' + enable_media_listener: 'Enable Media Listener' + discogs_token: 'Discogs Token' + allow_transcode_lossless: 'Allow Transcode Lossless' + transcode_bitrate: 'Transcode Bitrate' + password_confirmation: 'Password Confirmation' + error: login: 'Wrong email or password' forbidden: "Sorry, you do not have permission to visit that" @@ -115,23 +96,24 @@ en: internal_server_error: "We're sorry, but something went wrong" already_in_playlist: "Add to playlist failed, song is already in playlist" syncing_in_progress: "Syncing in progress, please wait" - success: - delete: 'Deleted successfully' - create: 'Created successfully' - update: 'Updated successfully' - add_to_playlist: 'Added to playlist successfully' - delete_from_playlist: 'Deleted from playlist successfully' + + notice: + deleted: 'Deleted successfully' + created: 'Created successfully' + updated: 'Updated successfully' + added_to_playlist: 'Added to playlist successfully' + deleted_from_playlist: 'Deleted from playlist successfully' + sync_completed: "Media sync completed" + text: - search_results: "Search results for \"%{query}\"" - no_search_results: "No search results for \"%{query}\"" transcoding: "Black candy will transcode formats that are not supported by the browser by default." allow_transcode_lossless: "Will transcode lossless format to mp3 to reduce bandwidth." - sync_completed: "Media sync completed" enable_media_listener: "Media listener can automatically sync with library changes." media_listener_running: "Listener is running" - errors: - messages: - not_exist: 'does not exist' - unreadable: 'is unreadable' - invalid_content_type: "has an invalid content type" \ No newline at end of file + activerecord: + errors: + messages: + not_exist: 'does not exist' + unreadable: 'is unreadable' + invalid_content_type: "has an invalid content type" \ No newline at end of file diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 5611c51f..0ecf4ff7 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -11,7 +11,7 @@ class ApplicationHelperTest < ActionView::TestCase end test "empty alert tag" do - assert_includes empty_alert_tag, "No items" + assert_includes empty_alert_tag, "No Items" assert_includes empty_alert_tag, "c-overlay" assert_not_includes empty_alert_tag, "c-icon" assert_includes empty_alert_tag(has_icon: true), "c-icon" diff --git a/test/system/album_test.rb b/test/system/album_test.rb index 356a8a16..79e23592 100644 --- a/test/system/album_test.rb +++ b/test/system/album_test.rb @@ -23,7 +23,7 @@ class AlbumSystemTest < ApplicationSystemTestCase login_as users(:visitor1) visit album_url(@album) - click_on "Play all" + click_on "Play All" # assert current playlist have all songs in album @album.songs.each do |song| @@ -71,7 +71,7 @@ class AlbumSystemTest < ApplicationSystemTestCase visit album_url(@album) first(:test_id, "album_song_menu").click - click_on "Add to playlist" + click_on "Add To Playlist" find(:test_id, "dialog_playlist", text: playlist_name).click # assert the song added to the playlist diff --git a/test/system/current_playlist_test.rb b/test/system/current_playlist_test.rb index fbec9da6..07b30c7d 100644 --- a/test/system/current_playlist_test.rb +++ b/test/system/current_playlist_test.rb @@ -21,7 +21,7 @@ class CurrentPlaylistSystemTest < ApplicationSystemTestCase click_on "Clear" assert_selector(:test_id, "current_playlist_song", count: 0) - assert_text("No items") + assert_text("No Items") end test "player is stopped after clear current playlist" do @@ -62,7 +62,7 @@ class CurrentPlaylistSystemTest < ApplicationSystemTestCase assert_difference -> { playlist.songs.count } do first(:test_id, "current_playlist_song_menu").click - click_on "Add to playlist" + click_on "Add To Playlist" find(:test_id, "dialog_playlist", text: playlist_name).click end end diff --git a/test/system/favorite_playlist_test.rb b/test/system/favorite_playlist_test.rb index b937b75c..85e6ddf2 100644 --- a/test/system/favorite_playlist_test.rb +++ b/test/system/favorite_playlist_test.rb @@ -19,7 +19,7 @@ class FavoritePlaylistSystemTest < ApplicationSystemTestCase end test "play all songs in playlist" do - click_on "Play all" + click_on "Play All" # assert current playlist have all songs in playlist assert_selector(:test_id, "current_playlist", visible: true) @@ -35,7 +35,7 @@ class FavoritePlaylistSystemTest < ApplicationSystemTestCase click_on "Clear" assert_selector(:test_id, "playlist_song", count: 0) - assert_text("No items") + assert_text("No Items") end test "play song in playlist" do @@ -69,7 +69,7 @@ class FavoritePlaylistSystemTest < ApplicationSystemTestCase assert_difference -> { playlist.songs.count } do first(:test_id, "playlist_song_menu").click - click_on "Add to playlist" + click_on "Add To Playlist" find(:test_id, "dialog_playlist", text: playlist_name).click end end diff --git a/test/system/playlist_test.rb b/test/system/playlist_test.rb index 7ad2961e..ee9a196c 100644 --- a/test/system/playlist_test.rb +++ b/test/system/playlist_test.rb @@ -16,7 +16,7 @@ class PlaylistSystemTest < ApplicationSystemTestCase end test "play all songs in playlist" do - click_on "Play all" + click_on "Play All" # assert current playlist have all songs in playlist assert_selector(:test_id, "current_playlist", visible: true) @@ -90,7 +90,7 @@ class PlaylistSystemTest < ApplicationSystemTestCase assert_difference -> { playlist.songs.count } do first(:test_id, "playlist_song_menu").click - click_on "Add to playlist" + click_on "Add To Playlist" find(:test_id, "dialog_playlist", text: playlist_name).click end end diff --git a/test/system/songs_test.rb b/test/system/songs_test.rb index 0132d9ef..74cc3e4f 100644 --- a/test/system/songs_test.rb +++ b/test/system/songs_test.rb @@ -52,7 +52,7 @@ class SongsSystemTest < ApplicationSystemTestCase assert_difference -> { playlist.songs.count } do first(:test_id, "song_menu").click - click_on "Add to playlist" + click_on "Add To Playlist" find(:test_id, "dialog_playlist", text: playlist_name).click end end diff --git a/test/system/users_test.rb b/test/system/users_test.rb index 2055c67e..ad6240c5 100644 --- a/test/system/users_test.rb +++ b/test/system/users_test.rb @@ -17,11 +17,11 @@ class UsersSystemTest < ApplicationSystemTestCase test "add user" do visit users_url - click_on "Add user" + click_on "Add" fill_in "Email", with: "system_test@test.com" fill_in "Password", with: "foobar" - fill_in "Password confirmation", with: "foobar" + fill_in "Password Confirmation", with: "foobar" click_on "Save" assert_text("Created successfully")