diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index 6a65f44da3..5d36a0ec42 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -21,6 +21,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { length } from 'stringz'; import { countableText } from '../util/counter'; import Icon from 'mastodon/components/icon'; +import { publish_button_text } from 'mastodon/initial_state'; const allowedAroundShortCode = '><\u0085\u0020\u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\u0009\u000a\u000b\u000c\u000d'; @@ -211,13 +212,14 @@ class ComposeForm extends ImmutablePureComponent { const disabled = this.props.isSubmitting; let publishText = ''; + let publishButtonText = publish_button_text || intl.formatMessage(messages.publish); if (this.props.isEditing) { publishText = intl.formatMessage(messages.saveChanges); } else if (this.props.privacy === 'private' || this.props.privacy === 'direct') { - publishText = {intl.formatMessage(messages.publish)}; + publishText = {publishButtonText}; } else { - publishText = this.props.privacy !== 'unlisted' ? intl.formatMessage(messages.publishLoud, { publish: intl.formatMessage(messages.publish) }) : intl.formatMessage(messages.publish); + publishText = this.props.privacy !== 'unlisted' ? intl.formatMessage(messages.publishLoud, { publish: publishButtonText }) : publishButtonText; } return ( diff --git a/app/javascript/mastodon/initial_state.js b/app/javascript/mastodon/initial_state.js index 62fd4ac720..677439dacb 100644 --- a/app/javascript/mastodon/initial_state.js +++ b/app/javascript/mastodon/initial_state.js @@ -80,6 +80,7 @@ * @property {boolean=} use_pending_items * @property {string} version * @property {boolean} translation_enabled + * @property {string} publish_button_text */ /** @@ -132,5 +133,6 @@ export const usePendingItems = getMeta('use_pending_items'); export const version = getMeta('version'); export const translationEnabled = getMeta('translation_enabled'); export const languages = initialState?.languages; +export const publish_button_text = getMeta('publish_button_text'); export default initialState; diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index 431d33bcd9..85e6cfc6af 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -31,6 +31,7 @@ class Form::AdminSettings media_cache_retention_period content_cache_retention_period backups_retention_period + publish_button_text ).freeze INTEGER_KEYS = %i( diff --git a/app/serializers/initial_state_serializer.rb b/app/serializers/initial_state_serializer.rb index 8d3f4f87df..3a36349a62 100644 --- a/app/serializers/initial_state_serializer.rb +++ b/app/serializers/initial_state_serializer.rb @@ -32,6 +32,7 @@ class InitialStateSerializer < ActiveModel::Serializer activity_api_enabled: Setting.activity_api_enabled, single_user_mode: Rails.configuration.x.single_user_mode, translation_enabled: TranslationService.configured?, + publish_button_text: Setting.publish_button_text, } if object.current_account diff --git a/app/views/admin/settings/appearance/show.html.haml b/app/views/admin/settings/appearance/show.html.haml index d321c4b04b..8ff1f7e084 100644 --- a/app/views/admin/settings/appearance/show.html.haml +++ b/app/views/admin/settings/appearance/show.html.haml @@ -30,5 +30,8 @@ = fa_icon 'trash fw' = t('admin.site_uploads.delete') + .fields-group + = f.input :publish_button_text, wrapper: :with_block_label + .actions = f.button :button, t('generic.save_changes'), type: :submit diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 6edf7b4e9e..101801fad2 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -82,6 +82,7 @@ en: mascot: Overrides the illustration in the advanced web interface. media_cache_retention_period: Downloaded media files will be deleted after the specified number of days when set to a positive value, and re-downloaded on demand. profile_directory: The profile directory lists all users who have opted-in to be discoverable. + publish_button_text: Overrides the text of the publish button. require_invite_text: When sign-ups require manual approval, make the “Why do you want to join?” text input mandatory rather than optional site_contact_email: How people can reach you for legal or support inquiries. site_contact_username: How people can reach you on Mastodon. diff --git a/config/settings.yml b/config/settings.yml index ec8fead0f5..407db244d1 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -70,6 +70,7 @@ defaults: &defaults show_domain_blocks_rationale: 'disabled' require_invite_text: false backups_retention_period: 7 + publish_button_text: '' development: <<: *defaults