Use custom translation override file


(Anton) #42

Why don't you override particular strings with JS?


#44

Oh I think I understand it.
If I update Discourse via command line, there will be no problem. Right?

Yes this plugin will be really cool.
Each forum has own identity… so there will be various preferences on expressions.
Especially for non-English community, translators definitely have different preferences on specific words.


#45

I have no idea about Discourse structure.

How can I use JavaScript to override particular strings?


(Marcin Rataj) #46

Correct.

I agree.

@sam: I’d like to create a proper plugin, perhaps you have an example (or any resource I should look at) on how a plugin can override only specific labels from client.xx_XX.yml server.xx_XX.yml ? I imagine not everything can be done in JS.


(Sam Saffron) #47

@riking had a sample for this stuff somewhere afaik


(Marcin Rataj) #48

Indeed, now I see how over-engineered was my ‘hack’.

I updated discourse-locale-override to follow the structure of a regular Discourse plugin.
As a plugin boilerplate, it now supports overriding only a specific label,
and works fine with /admin/update.


(Anton) #49

It would be nicer if we were able to override labels in GUI though.


(Christopher Heald) #50

We successfully used discourse-locale-override to change the name of several of the interface elements on our Discourse instance.

For English language overrides, you need to work from a copy of the English locale file (client.en.yml), edit any of the strings that you want to override, and remove any strings that you aren’t overriding. Next, create your own fork of discourse-locale-override, and place your client.en.yml file in the ‘config/locales’ folder of your own fork of discourse-locale-override. I would strongly advise you to run your new YML file through http://www.yamllint.com/.

Then, as per the plugin instructions, add - git clone https://github.com/YourGitHubAccount/discourse-locale-override.git to the plugins section of your app.yml, and then rebuild your app with ./launcher rebuild app.


(system) #51