自定义 Discourse 中的文本

:bookmark: 本指南介绍如何通过管理员界面自定义 Discourse 中的文本,从而更改各种用户界面元素。

:person_raising_hand: 所需用户级别:管理员

在 Discourse 中,您可以通过管理员界面自定义所有文本。这有助于调整用户体验,使其更符合您社区的特定语调或品牌形象。

摘要

本指南将涵盖:

  • 访问文本自定义界面
  • 编辑文本字符串
  • 识别翻译键

访问文本自定义界面

要自定义 Discourse 中的文本,请导航至文本自定义页面:

  1. 前往 Admin(管理员)。
  2. 在侧边栏中,向下滚动到 Appearance(外观)部分,然后点击 Site texts(站点文本)。
    或者
    直接输入屏幕的 URL:https://discourse.example.com/admin/customize/site_texts

您将看到一个可以搜索特定文本字符串进行编辑的页面。

编辑文本字符串

要编辑文本字符串:

  1. 搜索您想要自定义的文本。
  2. 点击 Edit(编辑)。
  3. 输入新值。

例如,您可能想个性化“About Your Site”(关于您的站点)链接:

更改并刷新页面后,文本将会更新:

识别翻译键

如果您需要帮助识别要翻译的字符串,请参阅本指南:Find a translation key with verbose localization

常见问题解答

我能自定义 Discourse 中的所有文本,包括系统消息吗?
是的,您可以自定义几乎所有的文本字符串,包括系统消息、通知和 UI 元素。

我需要刷新页面才能看到更改吗?
是的,更改后,您需要刷新页面才能显示更新后的文本。

74 个赞
Find a translation key with verbose localization
Editing Server.en.yml
Customizable Email Templates
How to change the account confirm email content
[object Object] in top menu even after updating to v1.5.0.beta6 +23
Translate some Entries
Enable changing of trust level badge description text
Export customized text from database into YML
Custom content localization
Changing "Type title, or paste a link here" text
Modifying UI Text
How to add translation client.xx.yml and server.xx.yml files to the server?
Changing the names of things in Discourse
Is it possible to rename the word "Categories" to "Channels"?
Onboarding: Discobot, automated messages, other options?
Interpolation Keys for Customizing Text and System Email Templates
Rename Users to People
Any way to limit posting hours?
Is there a way to rename conventions such as Topic, Category etc
How to create a custom tip/popup when starting a new topic?
Enhancing My engineering Community Landing Page - Technology Support Category
Can I customize the welcome message shown when creating a new topic based on the chosen tag or category?
How can I change my sites local translate to my own settings
Hide ALL replies to Topics in a Category by default using Spoiler Text Plugin
Set up Telegram integration using the discourse-chat-integration plugin
Change sidebar community name
Discourse Gamification
Customize Your Site Branding
Discourse Newsletter Integration
Rename trust levels
Ability to return more than 50 site texts in the admin panel
Make `howto` a synonym for the #how-to tag
Customizing specific system email templates
Customise + New Topic Button
Discourse with a screen reader
Customizing FAQs and Guidelines
Is it possible to customise trust levels?
Discourse Post Voting
Possible to customize the "Log in" button when DiscourseConnect is enabled?
Can't find the customize text topic from link
Understanding post flags in Discourse
How do you modify the Chat Notification Email?
How to choose 'All Categories' & 'All Tags' in their respective dropdown menus, in one go?
Customize Login pop-up box?
Customizing Sign-up and Log in
Thanks for spending time with us PM - how?
Hiding elements of the /about page with CSS?
Misleading text for no results in user directory when ‘enable user directory’ disabled
Change URL or remove Powered by Discourse
Modify the copy of a button
Suggested Topics Not Displaying
Modifying roles and permission
Customize site text on Discourse - pros and cons
Change “search” of search
Password resetting workflow for an entire site
Configuring the default sidebar for your users
Can I force existing members to re-register when they next log in?
Discourse Solved
How to Add Georgian Language Support to the Admin Panel?
How to change the post data from relative data to absolute
Admin-Settable Global Read-Only mode
Configuring auto-bumping for topics
Kanban Board
Hide username from welcome banner
Frontend Nomenclature changeability and supporting case-sensitive tagging
Can I send an automated welcome message to all new users?
Localization Formatting Error in the %{date} function
Discourse Solved
Add another Text Content box to Customize
Accessing a user’s admin page
Changing 'vote' text in topic voting plugin
Discourse Rewind
Is Discourse community use the basic theme?
Is Discourse community use the basic theme?
Show timestamp posted for topic post
Untranslated text when creating a poll: “Allow options to be added or removed after posting”
Missing Discourse Math plugin for translating?
Changing automated Personal Message text
[PAID] - Points & Awards Plugin
Does anyone use the discourse narrative bot for new users?
Someone replied to a topic you are Watching
Where can I edit Discobot welcome post text?
Swedish interface - year of joining
Add localizable strings to themes and theme components
Discourse is ending support for Internet Explorer 11 (IE11) on June 1, 2020
Set up Telegram integration using the discourse-chat-integration plugin
Custom template for PM via API?
How might we better structure #howto?
Can I change the new post's placeholder text?
Change "Invalid Link" message
Customise Login "With JWT" copy
Discord as only Auth method: working, with issues
Number of group owner - standard mail
Where to set login.crowd.name for crowd login account creation?
Slack threads and chat integration plugin transcripts

有没有办法为自定义文本添加超链接?

是的,您可以使用 markdown 链接,例如:
这是一个链接到谷歌!
(原始格式是):

这是一个[链接](https://google.com)到谷歌!
1 个赞

感谢 @Firepup650。我正在尝试更新其中一封电子邮件中的页脚文本,当我剪切并粘贴您的行时,它会显示如下。也许这些 markdown 链接在电子邮件中不起作用?

我试图更新 user_notifications.chat_summary.unsubscribe_no_link

嗯。也许电子邮件模板不同。您能尝试使用原始 HTML 吗?

这是一个指向 Google 的链接
(原始格式是):

这是一个指向 Google 的<a href="https://google.com/">链接</a>!
1 个赞

那奏效了!谢谢你。

1 个赞

我想知道在新管理员侧边栏出现之前,情况是否仍然如此…… :upside_down_face:

我们需要批量修改这些记录

有一个 Globally replace translations 用于在所有地方替换单词。

谢谢,这个作者还是来自我的国家!!

我尝试更改文本,但“保存更改”按钮呈灰色。

我在我们的“需要登录”欢迎页面上应用此功能时遇到问题。它似乎在一个 div 中,但链接似乎不可点击,正如预期的那样。我该如何将链接的目标转义到当前窗口?(右键单击并选择“在新标签页中打开此链接…”当然可以。)

:white_check_mark: 已修复:
我使用了一个指向 target=“_blank” 的锚点 :slight_smile: