Update seeded categories and topics

Discourse ships with a couple of categories and topics, but they usually are in English. No matter what language your forum is using. That is going to change.

Up until now configuring DISCOURSE_DEFAULT_LOCALE in app.yml was the only way to change that. And you had to do it before bootstrapping the container.

Wizard

Changing the default language in the wizard will automatically translate all seeded categories and topics as long as you didn’t already edit them manually.

Manual update

You can find a new “Replace Text…” button in the “Admin > Customize > Text Content” section (/admin/customize/site_texts). Clicking on it brings up a dialog where you can select the content you’d like to update.

image

The dialog shows you only the categories and topics it could find. Some might be missing if you manually deleted any of them or when your forum was created a long time ago, because we didn’t keep track of “Welcome topics” in the past.

Clicking “Replace” will update the selected content with the latest translations for the current default locale. It will create new revisions for updated posts, so you will be able to see the diff and revert changes in the post’s revision history.

Rake task

The old rake task for updating some topics (FAQ, Terms of Service, Privacy Policy) has been replaced by a new one:

./launcher enter app
rake i18n:reseed[locale]

:warning: It updates all seeded categories and topics without checking if you manually edited them or not. So be careful!

Notes

There are currently no translations for the “Admin Quick Start Guide”, but I’m planning to make it translatable in the near future. Stay tuned.

And here’s the commit in case you are interested: https://github.com/discourse/discourse/commit/3fd04df781f1cb736228e3212ef79ab2ee20326e

30 个赞

Are the translations for these assets also on Transifex? I look forward to making these changes, but if the translation is just as reliable as the rest of the site… oh boy…

I’ve been translating, reviewing and proofreading everything from scratch on Transifex for the last couple of weeks now, and if this is also there, it’d be perfect. :slight_smile:

1 个赞

No, assets aren’t localized. Transifex doesn’t support that. :frowning: But the seeded topics use only one image with English text in it. I guess we can live with that for know.

1 个赞

Well, then where are the translations? I can’t see to find them on Github…

Only found the one in English:
https://github.com/discourse/discourse/blob/master/docs/ADMIN-QUICK-START-GUIDE.md

Oh by assets did you mean the text of the translations? I think @gerhard assumed you meant images.

Check the note in the original post:

5 个赞

Yes, by “assets” I mean the actual text. Sorry about that. :confused:

I did a bit of research and found them on Transifex. Those specific docs will be huuuge to translate. God help me. :stuck_out_tongue:

As for the actual assets, yes, I guess we can live with that forever haha. There’s no need to localize them. Like, ever.

3 个赞

This text is somewhat confusing to me, @codinghorror can you think of something better?

Maybe Reset Seeded Translations.../ Reset Translations... ?

Interestingly if we go with Reset Translations... we can use the same dialog to reset overrides in bulk.

3 个赞

I think there is a lot of value in a “reset all translations”, though I guess technically it would be “reset all text”?

3 个赞

We could possibly give up this button altogether and only trigger the UI when you switch “default locale” on the site.

So if you HAD to reseed you could flick to french, ignore … flick to english?

1 个赞

I think “reset all customized text” is still a good idea.

1 个赞

Assuming that these documents will continue to evolve in places would ‘refresh’ be a better word? They aren’t necessarily going to revert, right?

I think they are going to revert, but need @gerhard to confirm, I think it takes whatever text is in the various topics and overwrites with what we have in core. It would remove all the changes you made to the TOS and so on.

3 个赞

I get what’s happening, but my point is that if I build a site in 2014 and customise the ToS, and in the five years which follow the model ToS in core updated, then that button isn’t reverting it to the original ToS I had, it’s replacing it with a model document which is five years newer.

It’s being replaced, maybe refreshed, but not reset.

2 个赞

Yes it is … one thing we should confirm here is that the replacement is done as an edit, at least that way you have a chance of recovering the diff.

3 个赞

I thought about doing that, but I didn’t want to add a special case in the site settings code just for default_locale and triggering the reseed manually without changing the locale can be useful in other situations as well. For example: Replacing topics with new text shipped in core like we did with the ToS a few months ago.

I did add a link to the site setting’s description:

image

And the wizard automatically reseeds everything when the language is changed.

I like “replace” and “refresh”… I knew “reseed” was too technical and probably isn’t even a real word, but I couldn’t think of something better. :blush:

Yes, it’s creating a new revision.

7 个赞

@gerhard 我正在使用此 rake 命令重新生成 faq、tos 和隐私政策页面。但是,当我访问这些页面时,我收到 404 错误。我尝试运行命令如下:

rake i18n:reseed[en]

rake i18n:reseed["en"]

我的默认区域设置为美式英语。我的原始页面早已被删除,因此我需要重新生成它们。

2 个赞

我认为我会手动创建那些页面。你可以从这里复制,try.discourse.org,一个新网站,或者在 Google 上搜索这些页面应包含的内容指南。

1 个赞

这应该能给你指明正确的方向。

6 个赞

2 篇帖子已合并到现有主题:Discourse 设置 - 关于页面