diff --git a/Gemfile.lock b/Gemfile.lock index 74ad026..6163663 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,11 +75,11 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - acts_as_list (1.2.1) + acts_as_list (1.2.2) activerecord (>= 6.1) activesupport (>= 6.1) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) ancestry (4.3.3) activerecord (>= 5.2.6) base64 (0.2.0) @@ -88,8 +88,8 @@ GEM bindex (0.8.1) bootsnap (1.18.3) msgpack (~> 1.2) - builder (3.2.4) - concurrent-ruby (1.3.1) + builder (3.3.0) + concurrent-ruby (1.3.3) connection_pool (2.4.1) crass (1.0.6) css_parser (1.17.1) @@ -104,7 +104,7 @@ GEM dotenv (= 3.1.2) railties (>= 6.1) drb (2.2.1) - erubi (1.12.0) + erubi (1.13.0) ffi (1.17.0-aarch64-linux-gnu) ffi (1.17.0-arm-linux-gnu) ffi (1.17.0-arm64-darwin) @@ -116,7 +116,7 @@ GEM htmlentities (4.3.4) i18n (1.14.5) concurrent-ruby (~> 1.0) - image_processing (1.12.2) + image_processing (1.13.0) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) importmap-rails (2.0.1) @@ -124,7 +124,7 @@ GEM activesupport (>= 6.0.0) railties (>= 6.0.0) io-console (0.7.2) - irb (1.13.1) + irb (1.14.0) rdoc (>= 4.0.0) reline (>= 0.4.2) jbuilder (2.12.0) @@ -142,6 +142,7 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) + logger (1.6.0) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -151,15 +152,15 @@ GEM net-pop net-smtp marcel (1.0.4) - mini_magick (4.12.0) + mini_magick (4.13.2) mini_mime (1.1.5) - minitest (5.23.1) + minitest (5.24.1) mobility (1.3.0.rc3) i18n (>= 0.6.10, < 2) request_store (~> 1.0) msgpack (1.7.2) mutex_m (0.2.0) - net-imap (0.4.12) + net-imap (0.4.14) date net-protocol net-pop (0.1.2) @@ -169,19 +170,19 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.3) - nokogiri (1.16.5-aarch64-linux) + nokogiri (1.16.7-aarch64-linux) racc (~> 1.4) - nokogiri (1.16.5-arm-linux) + nokogiri (1.16.7-arm-linux) racc (~> 1.4) - nokogiri (1.16.5-arm64-darwin) + nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.5-x86-linux) + nokogiri (1.16.7-x86-linux) racc (~> 1.4) - nokogiri (1.16.5-x86_64-darwin) + nokogiri (1.16.7-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.5-x86_64-linux) + nokogiri (1.16.7-x86_64-linux) racc (~> 1.4) - pg (1.5.6) + pg (1.5.7) pg_search (2.3.6) activerecord (>= 5.2) activesupport (>= 5.2) @@ -200,11 +201,11 @@ GEM railties (>= 7.0.0) psych (5.1.2) stringio - public_suffix (5.0.5) + public_suffix (6.0.1) puma (6.4.2) nio4r (~> 2.0) - racc (1.8.0) - rack (3.0.11) + racc (1.8.1) + rack (3.1.7) rack-session (2.0.0) rack (>= 3.0.0) rack-test (2.1.0) @@ -248,23 +249,25 @@ GEM redis-client (>= 0.22.0) redis-client (0.22.2) connection_pool - reline (0.5.8) + reline (0.5.9) io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) - ruby-vips (2.2.1) + ruby-vips (2.2.2) ffi (~> 1.12) - sidekiq (7.2.4) + logger + sidekiq (7.3.0) concurrent-ruby (< 2) connection_pool (>= 2.3.0) + logger rack (>= 2.2.4) - redis-client (>= 0.19.0) + redis-client (>= 0.22.2) stimulus-rails (1.3.3) railties (>= 6.0.0) - stringio (3.1.0) + stringio (3.1.1) thor (1.3.1) timeout (0.4.1) - turbo-rails (2.0.5) + turbo-rails (2.0.6) actionpack (>= 6.0.0) activejob (>= 6.0.0) railties (>= 6.0.0) @@ -279,7 +282,7 @@ GEM websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.15) + zeitwerk (2.6.17) PLATFORMS aarch64-linux diff --git a/app/controllers/languages_controller.rb b/app/controllers/languages_controller.rb index 1dc0315..c550cc7 100644 --- a/app/controllers/languages_controller.rb +++ b/app/controllers/languages_controller.rb @@ -12,10 +12,30 @@ class LanguagesController < ApplicationController private def accept_language - @accept_language ||= request.env['HTTP_ACCEPT_LANGUAGE'].to_s.split(',').map { |l| - lang, q_factor = l.split(';q=') - [lang, (q_factor || '1').to_f] - }.sort_by { |_, q| -q }.map(&:first).first&.split('-')&.first + @accept_language ||= first_matching_language + end + + + def first_matching_language + accept_languages = request.env['HTTP_ACCEPT_LANGUAGE'].to_s.split(',').map { |l| + lang, q_factor = l.split(';q=') + [lang, (q_factor || '1').to_f] + }.sort_by { |_, q| -q }.map(&:first) + + available_languages = I18n.t('languages').keys.map(&:to_s) + + accept_languages.each do |lang| + return lang if available_languages.include?(lang) + + lang_part = lang.split('-').first + if available_languages.include?(lang_part) + return lang_part + else + wildcard_match = available_languages.find { |l| l.start_with?("#{lang_part}-") } + return wildcard_match if wildcard_match + end + end + 'en' end diff --git a/app/javascript/application.js b/app/javascript/application.js index 0459aee..7154fab 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -23,6 +23,7 @@ function shuffle_cards() { const cards = document.querySelectorAll('.card__container') const card_ids = Array.from(cards).map(card => card.getAttribute('data-id')) let shown_cards = JSON.parse(localStorage.getItem('shown_cards')) || []; + let cards_not_shown = card_ids.filter(id => !shown_cards.includes(id)); if (cards_not_shown.length <= 0) { diff --git a/config/importmap.rb b/config/importmap.rb index 7460d16..210ae2a 100644 --- a/config/importmap.rb +++ b/config/importmap.rb @@ -10,7 +10,7 @@ pin "stimulus-use" # @0.52.2 pin "@rails/request.js", to: "@rails--request.js.js" # @0.0.9 pin "@rails/activestorage", to: "@rails--activestorage.js" # @7.1.3 pin "tom-select" # @2.3.1 -pin "trix" # @2.1.1 +pin "trix" # @2.1.3 # site_helper pin "application", preload: false diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 466bb25..8f4680e 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1,3 +1,12 @@ # Czech (cs_CZ) cs: - \ No newline at end of file + can_you_spot_the_link: Co mají společného? + hello: Ahoj! + please_select_a_language_to_get_started: Vyberte jazyk a pusťte se do toho. + confirm: Potvrdit + get_started: Začít + drag_to_reveal: Přetažením odhalíte + shuffle_cards: Zamíchat karty + spot_another_link: Další souvislosti + challange_a_friend: Vyzvat přátele + learn_more: Dozvědět se více \ No newline at end of file diff --git a/config/locales/da.yml b/config/locales/da.yml index 698dfa0..cf637f3 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -1,15 +1,13 @@ # Danish (da_DK) da: - can_you_spot_the_link: Kan du spotte linket? - - start: - hello: Hej! - please_select_a_language_to_get_started: Vælg venligst et sprog for at komme i gang. - confirm: Bekræft - - intro: - get_started: Kom i gang - msg: | - Fattigdom og klimaforandringer er blandt verdens største udfordringer, men heldigvis sker der transformation. - - Se om du kan finde sammenhængen mellem vores partnere initiativer, der ændrer spillereglerne, og deres bemærkelsesværdige indvirkning. + can_you_spot_the_link: Kan du se linket? + hello: Hej! + please_select_a_language_to_get_started: Vælg et sprog for at komme i gang. + confirm: Bekræft + get_started: Kom godt i gang + drag_to_reveal: Træk for at vise + shuffle_cards: Bland kort + spot_another_link: Få øje på et andet link + challange_a_friend: Giv en ven en udfordring + learn_more: Læs mere + \ No newline at end of file diff --git a/config/locales/de.yml b/config/locales/de.yml index 3746015..9f77a19 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1,3 +1,12 @@ # German, Germany (de_DE) de: - \ No newline at end of file + can_you_spot_the_link: Kannst du die Verbindung erkennen? + hello: Hallo! + please_select_a_language_to_get_started: Wähl eine Sprache aus, um loszulegen. + confirm: Bestätigen + get_started: Los gehts + drag_to_reveal: Zum Aufdecken ziehen + shuffle_cards: Karten mischen + spot_another_link: Eine andere Verbindung erkennen + challange_a_friend: Freund*innen herausfordern + learn_more: Mehr lesen \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 640339c..47b2879 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3,6 +3,17 @@ en: project_name: IKEA Foundation Week 2024 client_name: IKEA Foundation + can_you_spot_the_link: Can you spot the link? + hello: Hello! + please_select_a_language_to_get_started: Please select a language to get started. + confirm: Confirm + get_started: Get started + learn_more: Learn more + spot_another_link: Spot another link + challange_a_friend: Challenge a friend + drag_to_reveal: Drag to reveal + shuffle_cards: Shuffle cards + languages: en: English zh: 中文 @@ -11,7 +22,8 @@ en: da: Dansk nl: Nederlands fi: Suomi - fr: Français + fr-CA: Français canadien + fr-FR: Français de: Deutsch hu: Magyar it: Italiano @@ -36,7 +48,8 @@ en: da: Danish nl: Dutch fi: Finnish - fr: French + fr-CA: Français canadien + fr-FR: French de: German hu: Hungarian it: Italian @@ -62,7 +75,8 @@ en: da: 🇩🇰 nl: 🇳🇱 fi: 🇫🇮 - fr: 🇫🇷 + fr-CA: 🇨🇦 + fr-FR: 🇫🇷 de: 🇩🇪 hu: 🇭🇺 it: 🇮🇹 @@ -78,22 +92,6 @@ en: es: 🇪🇸 sv: 🇸🇪 uk: 🇺🇦 - - can_you_spot_the_link: Can you spot the link? - - - hello: Hello! - please_select_a_language_to_get_started: Please select a language to get started. - confirm: Confirm - - get_started: Get started - - learn_more: Learn more - spot_another_link: Spot another link - challange_a_friend: Challenge a friend - - drag_to_reveal: Drag to reveal - shuffle_cards: Shuffle cards ui: 'yes': Yes diff --git a/config/locales/es.yml b/config/locales/es.yml index 43b5b8c..5217932 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1,2 +1,12 @@ # Spanish, Spain (es_ES) es: + can_you_spot_the_link: ¿Puedes ver la conexión? + hello: ¡Hola! + please_select_a_language_to_get_started: Selecciona un idioma para empezar. + confirm: Confirmar + get_started: Primeros pasos + drag_to_reveal: Arrastra para mostrar + shuffle_cards: Barajar cartas + spot_another_link: Encontrar otro enlace + challange_a_friend: Retar a un amigo + learn_more: Leer más \ No newline at end of file diff --git a/config/locales/fi.yml b/config/locales/fi.yml index f41f0f9..a25fa1f 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1,2 +1,13 @@ # Finnish (fi_FI) fi: + can_you_spot_the_link: Tunnistatko asioiden välisen yhteyden? + hello: Hei! + please_select_a_language_to_get_started: Aloita valitsemalla kieli. + confirm: Vahvista + get_started: Aloita + drag_to_reveal: Paljasta vetämällä + shuffle_cards: Sekoita kortit + spot_another_link: Tunnista toinen yhteys + challange_a_friend: Haasta kaveri + learn_more: Lue lisää + \ No newline at end of file diff --git a/config/locales/fr-CA.yml b/config/locales/fr-CA.yml new file mode 100644 index 0000000..1efc8b0 --- /dev/null +++ b/config/locales/fr-CA.yml @@ -0,0 +1,11 @@ +fr-CA: + can_you_spot_the_link: Le lien est-il visible? + hello: Bonjour! + please_select_a_language_to_get_started: Veuillez choisir une langue pour commencer. + confirm: Confirmer + get_started: Commencer + drag_to_reveal: Faites glisser pour afficher + shuffle_cards: Mélangez les cartes + spot_another_link: Autre lien + challange_a_friend: Défiez un ami + learn_more: Lire la suite \ No newline at end of file diff --git a/config/locales/fr-FR.yml b/config/locales/fr-FR.yml new file mode 100644 index 0000000..cf74350 --- /dev/null +++ b/config/locales/fr-FR.yml @@ -0,0 +1,11 @@ +fr-FR: + can_you_spot_the_link: Le lien est-il visible? + hello: Bonjour! + please_select_a_language_to_get_started: Merci de choisir une langue pour commencer. + confirm: Confirmer + get_started: C'est parti + drag_to_reveal: Faire glisser pour dévoiler la carte + shuffle_cards: Mélanger les cartes + spot_another_link: Autre lien + challange_a_friend: Défier un(e) ami(e) + learn_more: Lire la suite \ No newline at end of file diff --git a/config/locales/fr.yml b/config/locales/fr.yml deleted file mode 100644 index 8ef3177..0000000 --- a/config/locales/fr.yml +++ /dev/null @@ -1,3 +0,0 @@ -# French, Canada (fr_CA) -# French, France (fr_FR) -fr: diff --git a/config/locales/hr.yml b/config/locales/hr.yml index def1ec4..969d69f 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -1,3 +1,13 @@ # Croatian (hr_HR) hr: + can_you_spot_the_link: Možeš li uočiti poveznicu? + hello: Bok! + please_select_a_language_to_get_started: Odaberi jezik za početak. + confirm: Potvrdi + get_started: Početak + drag_to_reveal: Povuci za otkrivanje + shuffle_cards: Promiješaj karte + spot_another_link: Uoči još jednu poveznicu + challange_a_friend: Izazovi prijatelja + learn_more: Saznaj više \ No newline at end of file diff --git a/config/locales/hu.yml b/config/locales/hu.yml index a375a73..6680a0b 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -1,3 +1,12 @@ # Hungarian (hu_HU) hu: - \ No newline at end of file + can_you_spot_the_link: Te tudod, mi köti össze ezt a két dolgot? + hello: Szia! + please_select_a_language_to_get_started: A kezdéshez válassz nyelvet. + confirm: Megerősítés + get_started: Kezdés + drag_to_reveal: Húzd el a megjelenítéshez + shuffle_cards: Kártyák keverése + spot_another_link: Találd ki, mi köt össze két másik dolgot + challange_a_friend: Hívd ki egy barátodat + learn_more: Olvasnivalók \ No newline at end of file diff --git a/config/locales/it.yml b/config/locales/it.yml index 0100e9f..2212e7c 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1,3 +1,12 @@ # Italian (it_IT) it: - \ No newline at end of file + can_you_spot_the_link: Riesci a trovare il legame? + hello: Ciao! + please_select_a_language_to_get_started: Seleziona una lingua per iniziare. + confirm: Conferma + get_started: Inizia + drag_to_reveal: Trascina per visualizzare + shuffle_cards: Mischia le carte + spot_another_link: Trova un altro legame + challange_a_friend: Sfida un amico + learn_more: Scopri di più \ No newline at end of file diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 9793c25..f570d86 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1,2 +1,12 @@ # Japanese (ja_JP) ja: + can_you_spot_the_link: リンクを見つけられますか? + hello: こんにちは! + please_select_a_language_to_get_started: 言語を選択して開始してください。 + confirm: 確定 + get_started: スタート + drag_to_reveal: ドラッグして表示 + shuffle_cards: カードをシャッフルする + spot_another_link: 別のリンクを見つける + challange_a_friend: 友人に働きかけよう + learn_more: もっと見る \ No newline at end of file diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 581eedf..8d46b15 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -1,3 +1,12 @@ # Korean (ko_KR) ko: - \ No newline at end of file + can_you_spot_the_link: 연관성을 찾을 수 있나요? + hello: 안녕하세요! + please_select_a_language_to_get_started: 시작하려면 언어를 선택하세요. + confirm: 확인 + get_started: 시작하기 + drag_to_reveal: 드래그하여 보기 + shuffle_cards: 카드 섞기 + spot_another_link: 다른 링크 찾기 + challange_a_friend: 친구와 대결하기 + learn_more: 더 보기 \ No newline at end of file diff --git a/config/locales/nb.yml b/config/locales/nb.yml index 7676857..9c0b48c 100644 --- a/config/locales/nb.yml +++ b/config/locales/nb.yml @@ -1,3 +1,12 @@ # Norwegian Bokmål (nb_NO) nb: - \ No newline at end of file + can_you_spot_the_link: Kan du finne koblingen? + hello: Hallo! + please_select_a_language_to_get_started: Velg et språk for å komme i gang. + confirm: Bekreft + get_started: Kom i gang + drag_to_reveal: Dra for å vise + shuffle_cards: Bland kortene + spot_another_link: Finn en annen kobling + challange_a_friend: Utfordre en venn + learn_more: Les mer \ No newline at end of file diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 774e66e..a458184 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1,3 +1,13 @@ # Dutch (nl_NL) nl: - \ No newline at end of file + can_you_spot_the_link: Kun je de link zien? + hello: Hallo! + please_select_a_language_to_get_started: Selecteer een taal om te beginnen. + confirm: Bevestigen + get_started: Aan de slag + drag_to_reveal: Sleep om te onthullen + shuffle_cards: Schud kaarten + spot_another_link: Ontdek een andere link + challange_a_friend: Daag een vriend uit + learn_more: Lees meer + \ No newline at end of file diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 6252fc9..42edc0b 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1,3 +1,12 @@ # Polish (pl_PL) pl: - \ No newline at end of file + can_you_spot_the_link: Czy widzisz związek? + hello: Cześć! + please_select_a_language_to_get_started: Wybierz język, aby rozpocząć. + confirm: Potwierdź + get_started: Zaczynamy + drag_to_reveal: Przeciągnij, aby odkryć + shuffle_cards: Tasuj karty + spot_another_link: Znajdź inny związek + challange_a_friend: Zapytaj znajomego + learn_more: Przeczytaj więcej \ No newline at end of file diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 3bacdae..2424f8e 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -1,3 +1,12 @@ # Portuguese (pt_PT) pt: - \ No newline at end of file + can_you_spot_the_link: Sabe qual é a relação? + hello: Olá. + please_select_a_language_to_get_started: Escolha um idioma para começar. + confirm: Confirmar + get_started: Começar + drag_to_reveal: Arrastar para revelar + shuffle_cards: Baralhar as cartas + spot_another_link: Descobrir outra relação + challange_a_friend: Desafiar um amigo + learn_more: Ler mais \ No newline at end of file diff --git a/config/locales/ro.yml b/config/locales/ro.yml index f626c5c..0c50811 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -1,3 +1,12 @@ # Romanian (ro_RO) ro: - \ No newline at end of file + can_you_spot_the_link: Poți să găsești legătura? + hello: Salut! + please_select_a_language_to_get_started: Selectează o limbă pentru a începe. + confirm: Confirmă + get_started: Începe + drag_to_reveal: Trage pentru a dezvălui + shuffle_cards: Amestecă bine cartonașele + spot_another_link: Găsește o altă legătură + challange_a_friend: Provoacă un prieten + learn_more: Citește mai multe \ No newline at end of file diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 63d8ca5..b94ceb6 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -1,3 +1,12 @@ # Slovak (sk_SK) sk: - \ No newline at end of file + can_you_spot_the_link: Dokážete nájsť súvislosť? + hello: Dobrý deň! + please_select_a_language_to_get_started: Na začiatku si vyberte jazyk. + confirm: Potvrdiť + get_started: Poďme na to! + drag_to_reveal: Potiahnite a odhaľte + shuffle_cards: Zamiešať karty + spot_another_link: Objaviť ďalšiu súvislosť + challange_a_friend: Vyzvať priateľa + learn_more: Zistiť viac \ No newline at end of file diff --git a/config/locales/sl.yml b/config/locales/sl.yml index f0daa9c..d1fc35b 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -1,3 +1,12 @@ # Slovenian (sl_SL) sl: - \ No newline at end of file + can_you_spot_the_link: Ali opaziš povezavo? + hello: Hej! + please_select_a_language_to_get_started: Za začetek izberi jezik. + confirm: Potrdi + get_started: Za začetek + drag_to_reveal: Povleci in razkrij + shuffle_cards: Premešaj kartice + spot_another_link: Odkrij drugo povezavo + challange_a_friend: Izzovi prijatelja/-ico + learn_more: Spoznaj več \ No newline at end of file diff --git a/config/locales/sr.yml b/config/locales/sr.yml index d2ead37..2471520 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -1,3 +1,12 @@ # Serbian, Serbia, Latin (sr_RS) sr: - \ No newline at end of file + can_you_spot_the_link: Možeš li da vidiš vezu? + hello: Zdravo! + please_select_a_language_to_get_started: Izaberi jezik da započneš. + confirm: Potvrdi + get_started: Započni + drag_to_reveal: Prevuci da otkriješ + shuffle_cards: Promešaj kartice + spot_another_link: Uoči još jednu vezu + challange_a_friend: Izazovi prijatelja + learn_more: Pročitaj više \ No newline at end of file diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 8db983b..ff0b59e 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -1,3 +1,12 @@ # Swedish (sv_SE) sv: - \ No newline at end of file + can_you_spot_the_link: Kan du se sambandet? + hello: Hej! + please_select_a_language_to_get_started: Välj språk för att komma igång. + confirm: Bekräfta + get_started: Kom igång + drag_to_reveal: Dra för att visa + shuffle_cards: Blanda korten + spot_another_link: Se ett annat samband + challange_a_friend: Utmana en vän + learn_more: Läs mer \ No newline at end of file diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 45ae6b9..5e83d8f 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -1,3 +1,12 @@ # Ukrainian (uk_UA) uk: - \ No newline at end of file + can_you_spot_the_link: Чи бачите ви зв’язок? + hello: Привіт! + please_select_a_language_to_get_started: Оберіть мову, щоб почати. + confirm: Підтвердити + get_started: Початок роботи + drag_to_reveal: Перетягніть, щоб відкрити + shuffle_cards: Перемішайте карти + spot_another_link: Знайдіть інший зв’язок + challange_a_friend: Киньте виклик другу + learn_more: Докладніше \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index f01fe57..6b80820 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1,3 +1,12 @@ # Chinese (zh_CN) zh: - \ No newline at end of file + can_you_spot_the_link: 你能找到其中的联系吗 + hello: 嗨! + please_select_a_language_to_get_started: 请选择一种语言以开始。 + confirm: 确认 + get_started: 开始 + drag_to_reveal: 拖动以显示 + shuffle_cards: 洗牌 + spot_another_link: 发现另一个联系 + challange_a_friend: 挑战一位朋友 + learn_more: 阅读更多 \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index e74a3ff..e1df15e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,7 +8,7 @@ Rails.application.routes.draw do get 'admin', to: redirect('/admin/en') namespace :admin do - scope ':locale', constraints: { locale: /en|zh|hr|cs|da|nl|fi|fr|fr|de|hu|it|ja|ko|nb|pl|pt|ro|sr|sk|sl|es|sv|uk/ } do + scope ':locale', constraints: { locale: /en|zh|hr|cs|da|nl|fi|fr-CA|fr-FR|de|hu|it|ja|ko|nb|pl|pt|ro|sr|sk|sl|es|sv|uk/ } do # Assets resources :assets do @@ -50,7 +50,7 @@ Rails.application.routes.draw do get 'login/verification', to: 'sessions#verification' end - scope ':locale', constraints: { locale: /en|zh|hr|cs|da|nl|fi|fr|fr|de|hu|it|ja|ko|nb|pl|pt|ro|sr|sk|sl|es|sv|uk/ } do + scope ':locale', constraints: { locale: /en|zh|hr|cs|da|nl|fi|fr-CA|fr-FR|de|hu|it|ja|ko|nb|pl|pt|ro|sr|sk|sl|es|sv|uk/ } do get '', to: 'site#index' get '*url', to: 'site#page', constraints: lambda { |req| req.path.exclude?('storage') } end diff --git a/vendor/javascript/trix.js b/vendor/javascript/trix.js index 734aee1..833da09 100644 --- a/vendor/javascript/trix.js +++ b/vendor/javascript/trix.js @@ -1,2 +1,2 @@ -var t="2.1.1";const o="[data-trix-attachment]",s={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},a={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,htmlAttributes:["language"],text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(t){return r(t.parentNode)===a[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(t){return r(t.parentNode)===a[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},r=t=>{var o;return null==t||null===(o=t.tagName)||void 0===o?void 0:o.toLowerCase()},l=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),c=l&&parseInt(l[1]);var h={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:c&&c>12,samsungAndroid:c&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:"undefined"!=typeof InputEvent&&["data","getTargetRanges","inputType"].every((t=>t in InputEvent.prototype))},d={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption…",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL…",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"};const m=[d.bytes,d.KB,d.MB,d.GB,d.TB,d.PB];var p={prefix:"IEC",precision:2,formatter(t){switch(t){case 0:return"0 ".concat(d.bytes);case 1:return"1 ".concat(d.byte);default:let o;"SI"===this.prefix?o=1e3:"IEC"===this.prefix&&(o=1024);const s=Math.floor(Math.log(t)/Math.log(o)),a=(t/Math.pow(o,s)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(a," ").concat(m[s])}}};const L="\ufeff",M=" ",g=function(t){for(const o in t){const s=t[o];this[o]=s}return this},j=document.documentElement,W=j.matches,f=function(t){let{onElement:o,matchingSelector:s,withCallback:a,inPhase:l,preventDefault:c,times:h}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const d=o||j,m=s,p="capturing"===l,u=function(t){null!=h&&0==--h&&u.destroy();const o=A(t.target,{matchingSelector:m});null!=o&&(null==a||a.call(o,t,o),c&&t.preventDefault())};return u.destroy=()=>d.removeEventListener(t,u,p),d.addEventListener(t,u,p),u},b=function(t){let{onElement:o,bubbles:s,cancelable:a,attributes:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const c=null!=o?o:j;s=!1!==s,a=!1!==a;const h=document.createEvent("Events");return h.initEvent(t,s,a),null!=l&&g.call(h,l),c.dispatchEvent(h)},v=function(t,o){if(1===(null==t?void 0:t.nodeType))return W.call(t,o)},A=function(t){let{matchingSelector:o,untilNode:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.parentNode;if(null!=t){if(null==o)return t;if(t.closest&&null==s)return t.closest(o);for(;t&&t!==s;){if(v(t,o))return t;t=t.parentNode}}},x=t=>document.activeElement!==t&&y(t,document.activeElement),y=function(t,o){if(t&&o)for(;o;){if(o===t)return!0;o=o.parentNode}},C=function(t){var o;if(null===(o=t)||void 0===o||!o.parentNode)return;let s=0;for(t=t.previousSibling;t;)s++,t=t.previousSibling;return s},k=t=>{var o;return null==t||null===(o=t.parentNode)||void 0===o?void 0:o.removeChild(t)},R=function(t){let{onlyNodesOfType:o,usingFilter:s,expandEntityReferences:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const l=(()=>{switch(o){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(t,l,null!=s?s:null,!0===a)},E=t=>{var o;return null==t||null===(o=t.tagName)||void 0===o?void 0:o.toLowerCase()},S=function(t){let o,s,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"object"==typeof t?(a=t,t=a.tagName):a={attributes:a};const l=document.createElement(t);if(null!=a.editable&&(null==a.attributes&&(a.attributes={}),a.attributes.contenteditable=a.editable),a.attributes)for(o in a.attributes)s=a.attributes[o],l.setAttribute(o,s);if(a.style)for(o in a.style)s=a.style[o],l.style[o]=s;if(a.data)for(o in a.data)s=a.data[o],l.dataset[o]=s;return a.className&&a.className.split(" ").forEach((t=>{l.classList.add(t)})),a.textContent&&(l.textContent=a.textContent),a.childNodes&&[].concat(a.childNodes).forEach((t=>{l.appendChild(t)})),l};let q;const D=function(){if(null!=q)return q;q=[];for(const t in a){const o=a[t];o.tagName&&q.push(o.tagName)}return q},w=t=>B(null==t?void 0:t.firstChild),T=function(t){let{strict:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{strict:!0};return o?B(t):B(t)||!B(t.firstChild)&&function(t){return D().includes(E(t))&&!D().includes(E(t.firstChild))}(t)},B=t=>F(t)&&"block"===(null==t?void 0:t.data),F=t=>(null==t?void 0:t.nodeType)===Node.COMMENT_NODE,P=function(t){let{name:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t)return O(t)?t.data===L?!o||t.parentNode.dataset.trixCursorTarget===o:void 0:P(t.firstChild)},I=t=>v(t,o),N=t=>O(t)&&""===(null==t?void 0:t.data),O=t=>(null==t?void 0:t.nodeType)===Node.TEXT_NODE,U={level2Enabled:!0,getLevel(){return this.level2Enabled&&h.supportsInputEvents?2:0},pickFiles(t){const o=S("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});o.addEventListener("change",(()=>{t(o.files),k(o)})),k(document.getElementById(this.fileInputId)),document.body.appendChild(o),o.click()}};var V={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:"\n"},_={bold:{tagName:"strong",inheritable:!0,parser(t){const o=window.getComputedStyle(t);return"bold"===o.fontWeight||o.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:t=>"italic"===window.getComputedStyle(t).fontStyle},href:{groupTagName:"a",parser(t){const s="a:not(".concat(o,")"),a=t.closest(s);if(a)return a.getAttribute("href")}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}},J={getDefaultHTML:()=>'
\n\n