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 Likes

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 Like

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 Like

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 Likes

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 Likes

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 Likes

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

3 Likes

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 Like

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

1 Like

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 Likes

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 Likes

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 Likes

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 Likes

@gerhard I am using this rake command to regenerate faq, tos, and privacy policy pages. However, when I access the pages I get a 404 error. I have tried running the command as follows

rake i18n:reseed[en]

and

rake i18n:reseed["en"]

My default locale is English (US). My original pages have been long deleted so I need to regenerate them.

2 Likes

I think what I would do is create those pages by hand. You could copy them from here, try.discourse.org, a new site, or Google for guidelines for what those pages should include.

1 Like

This should point you in the right direction.

6 Likes

2 posts were merged into an existing topic: Discourse setup - about page