diff --git a/app/models/conversation.rb b/app/models/conversation.rb index 7dabd9712..db88caa34 100644 --- a/app/models/conversation.rb +++ b/app/models/conversation.rb @@ -30,7 +30,14 @@ class Conversation < ApplicationRecord def self.grouped_by_increasing_time_interval_for_user(user) nav_conversations = user.conversations.ordered - keys = ["Today", "Yesterday", "This Week", "This Month", "Last Month", "Older"] + keys = [ + I18n.t('models.conversation.groupings.today'), + I18n.t('models.conversation.groupings.yesterday'), + I18n.t('models.conversation.groupings.this_week'), + I18n.t('models.conversation.groupings.this_month'), + I18n.t('models.conversation.groupings.last_month'), + I18n.t('models.conversation.groupings.older'), + ] values = [ nil, Date.current.beginning_of_day, diff --git a/app/models/document.rb b/app/models/document.rb index e8181ab86..43c6e5a15 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -70,7 +70,7 @@ def set_default_bytes end def file_present - errors.add(:file, "must be attached") unless file.attached? + errors.add(:file) unless file.attached? end def wait_for_file_variant_to_process!(variant) diff --git a/app/models/message.rb b/app/models/message.rb index d76b56e2d..cfc764da1 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -49,11 +49,11 @@ def create_conversation end def validate_conversation - errors.add(:conversation, 'is invalid') unless conversation.user == Current.user + errors.add(:conversation) unless conversation.user == Current.user end def validate_assistant - errors.add(:assistant, 'is invalid') unless assistant.user == Current.user + errors.add(:assistant) unless assistant.user == Current.user end def start_assistant_reply diff --git a/app/models/person.rb b/app/models/person.rb index 5ab7be58d..5cf4e8463 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -19,13 +19,13 @@ class Person < ApplicationRecord def personable_id_unchanged if personable_id_changed? && persisted? - errors.add(:personable_id, "cannot be changed after creation") + errors.add(:personable_id) end end def proper_personable_id if personable_id.present? && personable.id.blank? - errors.add(:personable_id, 'must be provided on update') + errors.add(:personable_id) end end end diff --git a/app/views/authentications/new.html.erb b/app/views/authentications/new.html.erb index fcf042545..c1d0a7ca3 100644 --- a/app/views/authentications/new.html.erb +++ b/app/views/authentications/new.html.erb @@ -4,16 +4,16 @@ <%= image_tag("logo.svg", width: "24", height: "24", class: "text-gray-950") %> -

Welcome back

+

<%= t('.welcome_back') %>

<% if Feature.registration? %> - Don't have an account? <%= link_to "Sign up", register_path, class: "underline" %> + <%= t('.dont_have_an_account') %> <%= link_to t('.sign_up'), register_path, class: "underline" %> <% end %> <% if Feature.google_authentication? %> - <%= button_to "Log In with Google", "/auth/google", + <%= button_to t('.login_with_google'), "/auth/google", method: "post", class: %| text-white font-medium @@ -39,16 +39,16 @@ value: params[:email], id: "email", autofocus: params[:email].present? ? false : true, - placeholder: "Email address", + placeholder: t('.email_address'), class: "border border-gray-400 rounded p-3 dark:text-black" %> <%= f.password_field :password, id: "password", autofocus: params[:email].present? ? true : false, - placeholder: "Password", + placeholder: t('.password'), class: "border border-gray-400 rounded p-3 dark:text-black" %> - <%= f.submit "Log In", + <%= f.submit t('.login'), class: %| text-white font-medium bg-brand-blue dark:bg-gray-900 diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f63da0d82..c336a306f 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -49,10 +49,10 @@ | } do %> <%= icon "cog-6-tooth", variant: :outline, size: 18 %> - Settings + <%= t('.settings') %> <% end %> -
  • <%= link_to logout_path, data: { turbo: false } do %><%= icon "arrow-right-start-on-rectangle", variant: :outline, size: 18 %>Logout<% end %>
  • +
  • <%= link_to logout_path, data: { turbo: false } do %><%= icon "arrow-right-start-on-rectangle", variant: :outline, size: 18 %><%= t('.logout') %><% end %>
  • diff --git a/app/views/layouts/settings.html.erb b/app/views/layouts/settings.html.erb index 811a48016..0c1a6f16f 100644 --- a/app/views/layouts/settings.html.erb +++ b/app/views/layouts/settings.html.erb @@ -1,4 +1,4 @@ -<% content_for :title, "Settings — HostedGPT" %> +<% content_for :title, "#{t('.settings')} — HostedGPT" %> <% content_for :nav_column do %>
    <%= link_to root_path, class: "inline-block cursor-pointer py-1 pt-0 align-middle" do %> @@ -13,7 +13,7 @@ tooltip: :bottom %> <% end %> - Settings + <%= t('.settings') %>