pqMMA
(Chris Palmquist)
2021 年 2 月 25 日午前 2:19
1
I know that Discourse lets use now change text almost everyone on the site through the admin panel, but is there a way to do something like find and replace all?
I know categories and topics are fundamental to how Discourse was built, but what if I wanted to match the experience of the forum I’m migrated to and instead wanted to use ‘Forums’ to replace ‘Categories’ and ‘Threads’ to replace to ‘Topics’. ?
Falco
(Falco)
2021 年 2 月 25 日午前 2:48
3
There is no easy way to do a bulk translation. It would also be a little confusing because the URLs would not reflect the changes.
「いいね!」 2
pfaffman
(Jay Pfaffman)
2021 年 2 月 25 日午前 2:49
4
I think that you could do it with a plugin that replaced the locale. I do think it would be confusing for people.
私も同様のことをしたいと考えています。標準またはビジネスプランでこれを実装する方法があれば、素晴らしいでしょう!
pfaffman
(Jay Pfaffman)
2022 年 5 月 23 日午後 4:33
8
セルフホスティングであれば、ある程度簡単になります。おそらくレールコンソールで行いますが、プラグインも別の方法です。
何を置き換えたいですか?
「いいね!」 1
「Topic」を「Thread」に置き換えたいのですが、コマンドはありますか?
pfaffman
(Jay Pfaffman)
2022 年 5 月 23 日午後 5:05
11
それを簡単に行う方法が見つかりません。変更したいすべてのインスタンスをオーバーライドするプラグインが最も簡単だと思います。テキストエディターで実行できます。おそらく数時間かかるでしょう。数年前なら5時間だったかもしれません。GitHub - discourse/discourse-plugin-skeleton: Template for Discourse plugins から始めて、config/locales/client.en.yml をスケルトンの config/locales にコピーし、変更したくない文字列を削除し、変更したい文字列を編集します。ただし、Rails にすべての文字列を取得させる方法があるはずです(ああ、これがあります:https://stackoverflow.com/questions/37842701/how-to-list-all-available-locale-keys-in-rails)。そして、それらすべてをループ処理し、文字列を取得して、変更したいものに TranslationOverride を挿入できます。しかし、プラグインの方法の方がおそらく良いでしょう。手動で調整して、何を変更しているかを確認したいからです。
ただし、「topic」を「thread」に変更しようとするのは悪い考えです。良い結果は生まれません。Discourse にはスレッド形式のディスカッションがないため、トピックと呼ばれています。「topic」を含む新しい文字列が追加されることはめったにありませんが、時間の経過とともに忍び込む可能性があります。
わかりました。今日中に試してみます。簡単なことにしては、やりすぎかもしれませんね。JSとPythonは少し知っていますが、Rubyには触れたことがありません。
ご協力ありがとうございました!
「いいね!」 1
pfaffman
(Jay Pfaffman)
2022 年 5 月 23 日午後 5:49
13
まったくその通りです。フォーラムを成功させるために役立つと思われる、他のあらゆることに時間を使うことをお勧めします。
「いいね!」 2
Lhc_fl
(Linca)
2024 年 7 月 10 日午前 10:12
14
念のためお知らせしますが、これを解決できるプラグインを作成しました。
「いいね!」 3