Update seeded categories and topics

(Gerhard Schlager) #1

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: FEATURE: Locale support for seeded categories and topics (#7110) · discourse/discourse@3fd04df · GitHub

23 Likes

Updated Terms of Service Template
How to automatically have FAQ and Categories "About" localized
(Neemias Freitas) #2

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

(Gerhard Schlager) #3

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

(Neemias Freitas) #4

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

Only found the one in English:

0 Likes

(Kris) #5

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:

4 Likes

(Neemias Freitas) #6

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.

2 Likes

(Sam Saffron) #7

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

(Jeff Atwood) #8

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

2 Likes

(Sam Saffron) #9

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

(Jeff Atwood) #10

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

1 Like

(Stephen) #11

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

0 Likes

(Sam Saffron) #12

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

(Stephen) #13

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.

1 Like

(Sam Saffron) #14

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

(Gerhard Schlager) #15

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.

6 Likes