From d937a59997f60e9aa7a022d84792fc50473bf3d5 Mon Sep 17 00:00:00 2001 From: Marcin Mikołajczak Date: Tue, 28 Nov 2017 11:30:18 +0100 Subject: i18n: 🇵🇱 (#5841) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Mikołajczak --- config/locales/pl.yml | 28 ++++++++++++++++++++++++++++ config/locales/simple_form.pl.yml | 2 ++ 2 files changed, 30 insertions(+) (limited to 'config/locales') diff --git a/config/locales/pl.yml b/config/locales/pl.yml index a738fcea1..1f284cd9f 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -343,6 +343,8 @@ pl: invalid_reset_password_token: Token do resetowania hasła jest nieprawidłowy lub utracił ważność. Spróbuj uzyskać nowy. login: Zaloguj się logout: Wyloguj się + migrate_account: Przenieś konto + migrate_account_html: Jeżeli chcesz skonfigurować przekierowanie z obecnego konta na inne, możesz skonfigurować to tutaj. register: Rejestracja resend_confirmation: Ponownie prześlij instrukcje weryfikacji reset_password: Zresetuj hasło @@ -425,12 +427,37 @@ pl: muting: Lista wyciszonych upload: Załaduj in_memoriam_html: Ku pamięci. + invites: + delete: Usuń + expires_in: + '1800': 30 minutach + '21600': 6 godzinach + '3600': godzinie + '43200': 12 godzinach + '86400': dobie + expires_in_prompt: Nigdy + generate: Wygeneruj + max_uses: + few: "%{count} użycia" + many: "%{count} użyć" + one: jedno użycie + other: "%{count} użyć" + max_uses_prompt: Bez ograniczenia + prompt: Wygeneruj odnośniki i udostępnij je innym, aby pozwolić na rejestrację na instancji + table: + expires_at: Wygaśnie po + uses: Użycia + title: Zaproś użytkowników landing_strip_html: "%{name} ma konto na %{link_to_root_path}. Możesz je śledzić i wejść z nim w interakcję jeśli masz konto gdziekolwiek w Fediwersum." landing_strip_signup_html: Jeśli jeszcze go nie masz, możesz stworzyć konto. media_attachments: validations: images_and_video: Nie możesz załączyć pliku wideo do wpisu, który zawiera już zdjęcia too_many: Nie możesz załączyć więcej niż 4 plików + migrations: + acct: nazwa@domena nowego konta + currently_redirecting: 'Obecnie Twoje konto przekierowuje do:' + proceed: Zapisz moderation: title: Moderacja notification_mailer: @@ -549,6 +576,7 @@ pl: export: Eksportowanie danych followers: Autoryzowani śledzący import: Importowanie danych + migrate: Migracja konta notifications: Powiadomienia preferences: Preferencje settings: Ustawienia diff --git a/config/locales/simple_form.pl.yml b/config/locales/simple_form.pl.yml index 8b539662c..507e46469 100644 --- a/config/locales/simple_form.pl.yml +++ b/config/locales/simple_form.pl.yml @@ -34,10 +34,12 @@ pl: data: Dane display_name: Widoczna nazwa email: Adres e-mail + expires_in: Wygaśnie po filtered_languages: Filtrowane języki header: Nagłówek locale: Język locked: Ustaw konto jako prywatne + max_uses: Maksymalna liczba użyć new_password: Nowe hasło note: Biogram otp_attempt: Kod uwierzytelnienia dwustopniowego -- cgit From 1b57d4dd3a64cdafd74a12ff67502795b06a4eb2 Mon Sep 17 00:00:00 2001 From: nullkal Date: Tue, 28 Nov 2017 22:31:23 +0900 Subject: Fix account migration feature (#5837) * Make removable account migration * Fix error during update of account migration setting * Add notice when update account migration setting --- app/controllers/settings/migrations_controller.rb | 15 ++++++++------- app/models/form/migration.rb | 4 +--- config/locales/en.yml | 1 + 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'config/locales') diff --git a/app/controllers/settings/migrations_controller.rb b/app/controllers/settings/migrations_controller.rb index 711ba338f..b18403a7f 100644 --- a/app/controllers/settings/migrations_controller.rb +++ b/app/controllers/settings/migrations_controller.rb @@ -12,13 +12,10 @@ class Settings::MigrationsController < ApplicationController def update @migration = Form::Migration.new(resource_params) - if @migration.valid? - if current_account.moved_to_account_id != @migration.account&.id - current_account.update!(moved_to_account: @migration.account) - ActivityPub::UpdateDistributionWorker.perform_async(@account.id) - end - - redirect_to settings_migration_path + if @migration.valid? && migration_account_changed? + current_account.update!(moved_to_account: @migration.account) + ActivityPub::UpdateDistributionWorker.perform_async(current_account.id) + redirect_to settings_migration_path, notice: I18n.t('migrations.updated_msg') else render :show end @@ -29,4 +26,8 @@ class Settings::MigrationsController < ApplicationController def resource_params params.require(:migration).permit(:acct) end + + def migration_account_changed? + current_account.moved_to_account_id != @migration.account&.id + end end diff --git a/app/models/form/migration.rb b/app/models/form/migration.rb index 53cee7ee1..b74987337 100644 --- a/app/models/form/migration.rb +++ b/app/models/form/migration.rb @@ -5,8 +5,6 @@ class Form::Migration attr_accessor :acct, :account - validates :acct, presence: true - def initialize(attrs = {}) @account = attrs[:account] @acct = attrs[:account].acct unless @account.nil? @@ -22,6 +20,6 @@ class Form::Migration private def set_account - self.account = ResolveRemoteAccountService.new.call(acct) if account.nil? && acct.present? + self.account = (ResolveRemoteAccountService.new.call(acct) if account.nil? && acct.present?) end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 2b7e9f2e2..d6f18e859 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -460,6 +460,7 @@ en: acct: username@domain of the new account currently_redirecting: 'Your profile is set to redirect to:' proceed: Save + updated_msg: Your account migration setting successfully updated! moderation: title: Moderation notification_mailer: -- cgit From 15fab79cfa5b732e9d7816f162272d72cf06c733 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Tue, 28 Nov 2017 23:41:02 +0900 Subject: Show "expired" in invite index (#5838) * Show "expired" in invite index * "Force expire" -> "Deactivate" --- app/models/invite.rb | 6 +++++- app/views/admin/invites/_invite.html.haml | 10 +++++++--- app/views/invites/_invite.html.haml | 10 +++++++--- config/locales/en.yml | 3 ++- 4 files changed, 21 insertions(+), 8 deletions(-) (limited to 'config/locales') diff --git a/app/models/invite.rb b/app/models/invite.rb index ceca04686..7626f4cfa 100644 --- a/app/models/invite.rb +++ b/app/models/invite.rb @@ -27,13 +27,17 @@ class Invite < ApplicationRecord end def valid_for_use? - (max_uses.nil? || uses < max_uses) && (expires_at.nil? || expires_at >= Time.now.utc) + (max_uses.nil? || uses < max_uses) && !expired? end def expire! touch(:expires_at) end + def expired? + !expires_at.nil? && expires_at < Time.now.utc + end + private def set_code diff --git a/app/views/admin/invites/_invite.html.haml b/app/views/admin/invites/_invite.html.haml index 81edfd912..9555a8976 100644 --- a/app/views/admin/invites/_invite.html.haml +++ b/app/views/admin/invites/_invite.html.haml @@ -7,9 +7,13 @@ = invite.uses = " / #{invite.max_uses}" unless invite.max_uses.nil? %td - - if invite.expires_at.nil? - ∞ + - if invite.expired? + = t('invites.expired') - else - = l invite.expires_at + - if invite.expires_at.nil? + ∞ + - else + %time.formatted{ datetime: invite.expires_at.iso8601, title: l(invite.expires_at) } + = l invite.expires_at %td= table_link_to 'link', public_invite_url(invite_code: invite.code), public_invite_url(invite_code: invite.code) %td= table_link_to 'times', t('invites.delete'), invite_path(invite), method: :delete if policy(invite).destroy? diff --git a/app/views/invites/_invite.html.haml b/app/views/invites/_invite.html.haml index d794d72e4..3f5f7936c 100644 --- a/app/views/invites/_invite.html.haml +++ b/app/views/invites/_invite.html.haml @@ -3,9 +3,13 @@ = invite.uses = " / #{invite.max_uses}" unless invite.max_uses.nil? %td - - if invite.expires_at.nil? - ∞ + - if invite.expired? + = t('invites.expired') - else - = l invite.expires_at + - if invite.expires_at.nil? + ∞ + - else + %time.formatted{ datetime: invite.expires_at.iso8601, title: l(invite.expires_at) } + = l invite.expires_at %td= table_link_to 'link', public_invite_url(invite_code: invite.code), public_invite_url(invite_code: invite.code) %td= table_link_to 'times', t('invites.delete'), invite_path(invite), method: :delete if policy(invite).destroy? diff --git a/config/locales/en.yml b/config/locales/en.yml index d6f18e859..2719a4f8c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -432,7 +432,8 @@ en: upload: Upload in_memoriam_html: In Memoriam. invites: - delete: Delete + delete: Deactivate + expired: Expired expires_in: '1800': 30 minutes '21600': 6 hours -- cgit