Copy `welcome_message` translation override to `welcome_message_invite_only` (#6949)


Copy welcome_message translation override to welcome_message_invite_only (#6949)

This commit copies login_required.welcome_message translation override to login_required.welcome_message_invite_only if the login_required.welcome_message_invite_only override is blank. This is done so as to ensure that login page customization remains same after this commit.

diff --git a/db/migrate/20190125103246_copy_login_required_welcome_message.rb b/db/migrate/20190125103246_copy_login_required_welcome_message.rb
new file mode 100644
index 0000000..1d6c54a
--- /dev/null
+++ b/db/migrate/20190125103246_copy_login_required_welcome_message.rb
@@ -0,0 +1,11 @@
+class CopyLoginRequiredWelcomeMessage < ActiveRecord::Migration[5.2]
+  def change
+    execute <<~SQL
+      INSERT INTO translation_overrides (locale, translation_key, value, created_at, updated_at)
+      SELECT locale, 'login_required.welcome_message_invite_only', value, created_at, updated_at
+      FROM translation_overrides
+      WHERE translation_key = 'login_required.welcome_message'
+      AND NOT EXISTS (SELECT 1 FROM translation_overrides WHERE translation_key = 'login_required.welcome_message_invite_only');
+    SQL
+  end

GitHub sha: 244628ed

1 Like

UX: better help text for private invite-only instance
Approved #2


This commit has been mentioned on Discourse Meta. There might be relevant details there: