From a5378cfd1ac6bd8d32ca70da100676a2f0571513 Mon Sep 17 00:00:00 2001 From: Tim Fischbach Date: Fri, 7 Jun 2024 12:56:50 +0200 Subject: [PATCH] Replace mentions of Twitter with X Use X icon instead of Twitter bird. --- .../pageflow/social_share_links_helper.rb | 2 +- .../entries/share_menu/_twitter_link.html.erb | 16 +++------------- config/locales/de.yml | 1 - config/locales/en.yml | 1 - config/locales/new/twitter_to_x.de.yml | 6 ++++++ config/locales/new/twitter_to_x.en.yml | 6 ++++++ entry_types/scrolled/config/locales/de.yml | 6 ------ entry_types/scrolled/config/locales/en.yml | 6 ------ .../config/locales/new/twitter_to_x.de.yml | 12 ++++++++++++ .../config/locales/new/twitter_to_x.en.yml | 12 ++++++++++++ .../package/spec/entryState/sharing-spec.js | 8 ++++---- .../src/contentElements/twitterEmbed/editor.js | 2 ++ .../src/contentElements/twitterEmbed/icon.svg | 4 +++- .../contentElements/twitterEmbed/pictogram.svg | 18 ++++-------------- .../scrolled/package/src/entryState/sharing.js | 4 ++-- .../src/frontend/icons/social/twitter.svg | 16 +++------------- .../package/src/testHelpers/normalizeSeed.js | 2 +- .../entry_json_seed_helper_spec.rb | 2 +- pageflow.gemspec | 2 +- 19 files changed, 61 insertions(+), 65 deletions(-) create mode 100644 config/locales/new/twitter_to_x.de.yml create mode 100644 config/locales/new/twitter_to_x.en.yml create mode 100644 entry_types/scrolled/config/locales/new/twitter_to_x.de.yml create mode 100644 entry_types/scrolled/config/locales/new/twitter_to_x.en.yml diff --git a/app/helpers/pageflow/social_share_links_helper.rb b/app/helpers/pageflow/social_share_links_helper.rb index 1d9daf3d83..195a52f4de 100644 --- a/app/helpers/pageflow/social_share_links_helper.rb +++ b/app/helpers/pageflow/social_share_links_helper.rb @@ -8,7 +8,7 @@ module SocialShareLinksHelper google: 'https://plus.google.com/share?url=%{url}', linked_in: 'https://www.linkedin.com/shareArticle?mini=true&url=%{url}', telegram: 'tg://msg?text=%{url}', - twitter: 'https://twitter.com/intent/tweet?url=%{url}', + twitter: 'https://x.com/intent/post?url=%{url}', whats_app: 'WhatsApp://send?text=%{url}' }.freeze diff --git a/app/views/pageflow/entries/share_menu/_twitter_link.html.erb b/app/views/pageflow/entries/share_menu/_twitter_link.html.erb index 7d20cb06d2..eed94507d6 100644 --- a/app/views/pageflow/entries/share_menu/_twitter_link.html.erb +++ b/app/views/pageflow/entries/share_menu/_twitter_link.html.erb @@ -1,19 +1,9 @@ <%= social_share_link(:twitter, entry) do %> - - - - - + viewBox="0 0 512 512"> + <%= t('pageflow.public.share_on_twitter') %> -

Twitter

+

X

<% end %> diff --git a/config/locales/de.yml b/config/locales/de.yml index e0271a9aa1..6860a1f5e8 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -451,7 +451,6 @@ de: facebook: Facebook linked_in: LinkedIn telegram: Telegram (nur Mobilgeräte) - twitter: Twitter whats_app: WhatsApp (nur Mobilgeräte) type_names: paged: Seitenbasiert / klassisch diff --git a/config/locales/en.yml b/config/locales/en.yml index 6c3373bc04..9a76324f3f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -451,7 +451,6 @@ en: facebook: Facebook linked_in: LinkedIn telegram: Telegram (only mobile) - twitter: Twitter whats_app: WhatsApp (only mobile) type_names: paged: Page-based / Classic diff --git a/config/locales/new/twitter_to_x.de.yml b/config/locales/new/twitter_to_x.de.yml new file mode 100644 index 0000000000..3ef6b4bdaa --- /dev/null +++ b/config/locales/new/twitter_to_x.de.yml @@ -0,0 +1,6 @@ +de: + activerecord: + values: + pageflow/entry: + share_providers: + twitter: X diff --git a/config/locales/new/twitter_to_x.en.yml b/config/locales/new/twitter_to_x.en.yml new file mode 100644 index 0000000000..8dc9329931 --- /dev/null +++ b/config/locales/new/twitter_to_x.en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + values: + pageflow/entry: + share_providers: + twitter: X diff --git a/entry_types/scrolled/config/locales/de.yml b/entry_types/scrolled/config/locales/de.yml index 27d7716d67..e2988e76f5 100644 --- a/entry_types/scrolled/config/locales/de.yml +++ b/entry_types/scrolled/config/locales/de.yml @@ -545,12 +545,6 @@ de: label: Konversation ausblenden hideMedia: label: Medien ausblenden - url: - label: Tweet-URL - description: Bettet Inhalte von Twitter ein - name: Tweet - tabs: - general: Twitter-Embed videoEmbed: attributes: aspectRatio: diff --git a/entry_types/scrolled/config/locales/en.yml b/entry_types/scrolled/config/locales/en.yml index 13c5e0145d..c6a458d2be 100644 --- a/entry_types/scrolled/config/locales/en.yml +++ b/entry_types/scrolled/config/locales/en.yml @@ -536,12 +536,6 @@ en: label: Hide Conversation hideMedia: label: Hide Media - url: - label: Tweet URL - description: Embed content from Twitter - name: Tweet - tabs: - general: Twitter Embed videoEmbed: attributes: aspectRatio: diff --git a/entry_types/scrolled/config/locales/new/twitter_to_x.de.yml b/entry_types/scrolled/config/locales/new/twitter_to_x.de.yml new file mode 100644 index 0000000000..57b965b1bd --- /dev/null +++ b/entry_types/scrolled/config/locales/new/twitter_to_x.de.yml @@ -0,0 +1,12 @@ +de: + pageflow_scrolled: + editor: + content_elements: + twitterEmbed: + attributes: + url: + label: Post-URL + description: Bettet Inhalte von X ein + name: X Post + tabs: + general: X Embed diff --git a/entry_types/scrolled/config/locales/new/twitter_to_x.en.yml b/entry_types/scrolled/config/locales/new/twitter_to_x.en.yml new file mode 100644 index 0000000000..219ea004f9 --- /dev/null +++ b/entry_types/scrolled/config/locales/new/twitter_to_x.en.yml @@ -0,0 +1,12 @@ +de: + pageflow_scrolled: + editor: + content_elements: + twitterEmbed: + attributes: + url: + label: Post URL + description: Embed content from X + name: X Post + tabs: + general: X Embed diff --git a/entry_types/scrolled/package/spec/entryState/sharing-spec.js b/entry_types/scrolled/package/spec/entryState/sharing-spec.js index e5f821fff0..54d046bfa2 100644 --- a/entry_types/scrolled/package/spec/entryState/sharing-spec.js +++ b/entry_types/scrolled/package/spec/entryState/sharing-spec.js @@ -61,8 +61,8 @@ describe('useShareProviders', () => { iconName: 'facebook' }, { - name: 'Twitter', - url: 'https://twitter.com/intent/tweet?url=%{url}', + name: 'X', + url: 'https://x.com/intent/post?url=%{url}', iconName: 'twitter' } ]; @@ -93,8 +93,8 @@ describe('useShareProviders', () => { iconName: 'facebook' }, { - name: 'Twitter', - url: 'https://twitter.com/intent/tweet?url=%{url}', + name: 'X', + url: 'https://x.com/intent/post?url=%{url}', iconName: 'twitter' }, { diff --git a/entry_types/scrolled/package/src/contentElements/twitterEmbed/editor.js b/entry_types/scrolled/package/src/contentElements/twitterEmbed/editor.js index e54df5909f..1a07b7f241 100644 --- a/entry_types/scrolled/package/src/contentElements/twitterEmbed/editor.js +++ b/entry_types/scrolled/package/src/contentElements/twitterEmbed/editor.js @@ -13,6 +13,8 @@ editor.contentElementTypes.register('twitterEmbed', { supportedHosts: [ 'http://twitter.com', 'https://twitter.com', + 'http://x.com', + 'https://x.com' ], displayPropertyName: 'displayTweetId', required: true, diff --git a/entry_types/scrolled/package/src/contentElements/twitterEmbed/icon.svg b/entry_types/scrolled/package/src/contentElements/twitterEmbed/icon.svg index f8a11295a5..4451a1a341 100644 --- a/entry_types/scrolled/package/src/contentElements/twitterEmbed/icon.svg +++ b/entry_types/scrolled/package/src/contentElements/twitterEmbed/icon.svg @@ -1 +1,3 @@ - + diff --git a/entry_types/scrolled/package/src/contentElements/twitterEmbed/pictogram.svg b/entry_types/scrolled/package/src/contentElements/twitterEmbed/pictogram.svg index d87ab9d685..5c31733bdc 100644 --- a/entry_types/scrolled/package/src/contentElements/twitterEmbed/pictogram.svg +++ b/entry_types/scrolled/package/src/contentElements/twitterEmbed/pictogram.svg @@ -1,14 +1,4 @@ - - - - - - - \ No newline at end of file + + + diff --git a/entry_types/scrolled/package/src/entryState/sharing.js b/entry_types/scrolled/package/src/entryState/sharing.js index 6f65e4a197..fc4f87e2cf 100644 --- a/entry_types/scrolled/package/src/entryState/sharing.js +++ b/entry_types/scrolled/package/src/entryState/sharing.js @@ -22,7 +22,7 @@ import {useEntryMetadata} from "./metadata"; * { * iconName: 'twitter', * name: 'Twitter', - * url: https://twitter.com/intent/tweet?url=%{url} + * url: https://x.com/intent/post?url=%{url} * } * ] */ @@ -56,7 +56,7 @@ export function useShareProviders({isPhonePlatform}) { }, twitter: { iconName: 'twitter', - name: 'Twitter', + name: 'X', url: urlTemplates.twitter }, whats_app: { diff --git a/entry_types/scrolled/package/src/frontend/icons/social/twitter.svg b/entry_types/scrolled/package/src/frontend/icons/social/twitter.svg index c1cb54c0a1..3cd4502dc1 100644 --- a/entry_types/scrolled/package/src/frontend/icons/social/twitter.svg +++ b/entry_types/scrolled/package/src/frontend/icons/social/twitter.svg @@ -1,14 +1,4 @@ - - - - - - \ No newline at end of file + viewBox="0 0 512 512" > + + diff --git a/entry_types/scrolled/package/src/testHelpers/normalizeSeed.js b/entry_types/scrolled/package/src/testHelpers/normalizeSeed.js index 6ca4f7cef7..15171bb915 100644 --- a/entry_types/scrolled/package/src/testHelpers/normalizeSeed.js +++ b/entry_types/scrolled/package/src/testHelpers/normalizeSeed.js @@ -181,7 +181,7 @@ function normalizeShareUrlTemplates(shareUrlTemplates) { google: 'https://plus.google.com/share?url=%{url}', linked_in: 'https://www.linkedin.com/shareArticle?mini=true&url=%{url}', telegram: 'tg://msg?text=%{url}', - twitter: 'https://twitter.com/intent/tweet?url=%{url}', + twitter: 'https://x.com/intent/post?url=%{url}', whats_app: 'WhatsApp://send?text=%{url}' } } diff --git a/entry_types/scrolled/spec/helpers/pageflow_scrolled/entry_json_seed_helper_spec.rb b/entry_types/scrolled/spec/helpers/pageflow_scrolled/entry_json_seed_helper_spec.rb index bfa32a6819..8dd4919dfa 100644 --- a/entry_types/scrolled/spec/helpers/pageflow_scrolled/entry_json_seed_helper_spec.rb +++ b/entry_types/scrolled/spec/helpers/pageflow_scrolled/entry_json_seed_helper_spec.rb @@ -344,7 +344,7 @@ def render(helper, entry, options = {}) prettyUrl: 'http://test.host/test', shareUrlTemplates: { email: 'mailto:?body=%{url}', - twitter: 'https://twitter.com/intent/tweet?url=%{url}', + twitter: 'https://x.com/intent/post?url=%{url}', whats_app: 'WhatsApp://send?text=%{url}' } }) diff --git a/pageflow.gemspec b/pageflow.gemspec index cd81797564..70bc5f5b47 100644 --- a/pageflow.gemspec +++ b/pageflow.gemspec @@ -131,7 +131,7 @@ Gem::Specification.new do |s| s.add_dependency 'http_accept_language', '~> 2.0' # Shared translations - s.add_dependency 'pageflow-public-i18n', '~> 1.25' + s.add_dependency 'pageflow-public-i18n', '~> 1.26' # Password encryption s.add_dependency 'bcrypt', '~> 3.1.7'