# 翻訳済み文字列の一括置換？

**URL:** <https://meta.discourse.org/t/bulk-replacement-in-translated-strings/181080>\
**Category:** Support\
**Created:** [2021 年 2 月 25 日午前 2:19 UTC](https://meta.discourse.org/t/bulk-replacement-in-translated-strings/181080 "2021-02-25T02:19:38Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2022 年 5 月 23 日午後 5:05 UTC](https://meta.discourse.org/t/bulk-replacement-in-translated-strings/181080/11 "2022-05-23T17:05:35Z")

</div>

それを簡単に行う方法が見つかりません。変更したいすべてのインスタンスをオーバーライドするプラグインが最も簡単だと思います。テキストエディターで実行できます。おそらく数時間かかるでしょう。数年前なら5時間だったかもしれません。[GitHub - discourse/discourse-plugin-skeleton: Template for Discourse plugins](https://github.com/discourse/discourse-plugin-skeleton) から始めて、`config/locales/client.en.yml` をスケルトンの `config/locales` にコピーし、変更したくない文字列を削除し、変更したい文字列を編集します。ただし、Rails にすべての文字列を取得させる方法があるはずです（ああ、これがあります：[https://stackoverflow.com/questions/37842701/how-to-list-all-available-locale-keys-in-rails）。そして、それらすべてをループ処理し、文字列を取得して、変更したいものに](https://stackoverflow.com/questions/37842701/how-to-list-all-available-locale-keys-in-rails%EF%BC%89%E3%80%82%E3%81%9D%E3%81%97%E3%81%A6%E3%80%81%E3%81%9D%E3%82%8C%E3%82%89%E3%81%99%E3%81%B9%E3%81%A6%E3%82%92%E3%83%AB%E3%83%BC%E3%83%97%E5%87%A6%E7%90%86%E3%81%97%E3%80%81%E6%96%87%E5%AD%97%E5%88%97%E3%82%92%E5%8F%96%E5%BE%97%E3%81%97%E3%81%A6%E3%80%81%E5%A4%89%E6%9B%B4%E3%81%97%E3%81%9F%E3%81%84%E3%82%82%E3%81%AE%E3%81%AB) `TranslationOverride` を挿入できます。しかし、プラグインの方法の方がおそらく良いでしょう。手動で調整して、何を変更しているかを確認したいからです。

ただし、「topic」を「thread」に変更しようとするのは悪い考えです。良い結果は生まれません。Discourse にはスレッド形式のディスカッションがないため、トピックと呼ばれています。「topic」を含む新しい文字列が追加されることはめったにありませんが、時間の経過とともに忍び込む可能性があります。

---

_[View the full topic](https://meta.discourse.org/t/bulk-replacement-in-translated-strings/181080)._
