From 60890b10eeca477e4730e2b34c775e680cf58c15 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Wed, 9 Apr 2025 14:11:32 -0500 Subject: [PATCH] Remove translations feature --- app/assets/stylesheets/translations.css | 35 ------------------------- app/helpers/translations_helper.rb | 29 -------------------- app/views/collections/edit.html.erb | 2 -- app/views/first_runs/show.html.erb | 3 --- app/views/sessions/new.html.erb | 2 -- app/views/users/edit.html.erb | 3 --- app/views/users/new.html.erb | 3 --- 7 files changed, 77 deletions(-) delete mode 100644 app/assets/stylesheets/translations.css delete mode 100644 app/helpers/translations_helper.rb diff --git a/app/assets/stylesheets/translations.css b/app/assets/stylesheets/translations.css deleted file mode 100644 index 93c34e258..000000000 --- a/app/assets/stylesheets/translations.css +++ /dev/null @@ -1,35 +0,0 @@ -@layer components { - /* Language translations */ - .lanuage-list-menu { - --max-width: 40ch; - - background-color: var(--color-subtle); - border: 1px solid var(--color-subtle-dark); - border-radius: 0.5em; - inset: auto; - inline-size: max-content; - margin-inline: var(--inline-space); - max-inline-size: 40ch; - overflow: clip; - position: absolute; - z-index: 1; - - @media (max-width: 70ch) { - max-inline-size: calc(var(--max-width) - var(--inline-space)); - } - - .popover-orientation-top & { - inset-block-end: 100%; - } - } - - .language-list { - display: grid; - gap: var(--block-space-half) var(--inline-space); - grid-template-rows: min-content; - grid-template-columns: min-content 1fr; - justify-content: start; - margin: 0; - text-align: start; - } -} diff --git a/app/helpers/translations_helper.rb b/app/helpers/translations_helper.rb deleted file mode 100644 index f50a397e2..000000000 --- a/app/helpers/translations_helper.rb +++ /dev/null @@ -1,29 +0,0 @@ -module TranslationsHelper - TRANSLATIONS = { - user_name: { "🇺🇸": "Enter your name", "🇪🇸": "Introduce tu nombre", "🇫🇷": "Entrez votre nom", "🇮🇳": "अपना नाम दर्ज करें", "🇩🇪": "Geben Sie Ihren Namen ein", "🇧🇷": "Insira seu nome" }, - email_address: { "🇺🇸": "Enter your email address", "🇪🇸": "Introduce tu correo electrónico", "🇫🇷": "Entrez votre adresse courriel", "🇮🇳": "अपना ईमेल पता दर्ज करें", "🇩🇪": "Geben Sie Ihre E-Mail-Adresse ein", "🇧🇷": "Insira seu endereço de email" }, - password: { "🇺🇸": "Enter your password", "🇪🇸": "Introduce tu contraseña", "🇫🇷": "Saisissez votre mot de passe", "🇮🇳": "अपना पासवर्ड दर्ज करें", "🇩🇪": "Geben Sie Ihr Passwort ein", "🇧🇷": "Insira sua senha" }, - collection_name: { "🇺🇸": "Give it a name", "🇪🇸": "Dale un nombre", "🇫🇷": "Donnez lui un nom", "🇮🇳": "इसे एक नाम दें", "🇩🇪": "Gib ihm einen Namen", "🇧🇷": "Dê-lhe um nome" } - } - - def translations_for(translation_key) - tag.dl(class: "language-list") do - TRANSLATIONS[translation_key].map do |language, translation| - concat tag.dt(language) - concat tag.dd(translation, class: "margin-none") - end - end - end - - def translation_button(translation_key) - tag.div(class: "position-relative", data: { controller: "popover", action: "keydown.esc->popover#close click@document->popover#closeOnClickOutside", popover_orientation_top_class: "popover-orientation-top" }) do - tag.button(type: "button", class: "btn", tabindex: -1, data: { action: "popover#toggle" }) do - concat image_tag("globe.svg", class: "icon", role: "presentation") - concat tag.span("Translate", class: "for-screen-reader") - end + - tag.dialog(class: "lanuage-list-menu popover shadow", data: { popover_target: "menu" }) do - translations_for(translation_key) - end - end - end -end diff --git a/app/views/collections/edit.html.erb b/app/views/collections/edit.html.erb index 84e7a7d54..61fe4ca81 100644 --- a/app/views/collections/edit.html.erb +++ b/app/views/collections/edit.html.erb @@ -16,8 +16,6 @@
<%= form_with model: @collection, class: "flex flex-column gap txt-large", data: { controller: "form" } do |form| %>
- <%= translation_button(:collection_name) %> -