How to modify email templates

Hi guys,

We need to do the following related to the content of the emails sent automatically to users and texts on site:

  1. Modify english versions
  2. Modify translated versions
  3. Add new languages
    What is the general approach to take? And any pointers to ensure compatibility with future Sharetribe releases when it comes to translations?

Thanks!

Hey there,

if you don’t want to use a translation solution (such as WebTranslate It), you can simply edit files in the /config/locales folder, and deploy your updates.

You can edit all the *en.yml files.

You can edit the yml file for that language.

If that language isn’t supported at all yet, you can add a new yml file with the correct locale name and first row in the /config/locales (just copy/paste the English one as a basis for example, and edit). You should then add that new language to the available_locales.rb configuration file (this file).

If future updates of Sharetribe impact your own changes, you’ll have to manage this manually carefully when you update your Sharetribe version.

1 Like

Thanks @thomasmalbaux ,

  1. If I continue to contribute to WTI, how do I merge my changes from Sharetribe into my Bitbucket configurations? Sorry, this may sound like a very dumb question but I have not done it before.

  2. How do we modify the list of languages actually used in the platform, as well as the order between them?

Duc

Duc,

You could either update from the latest master branch and locales files from the Sharetribe repository, or use the WebTranslate It API and a sync CLI tool such as wti-pull (that’s what we use at Sharetribe, documentation is quite clear and easy to use) to update your files directly from WebTranslate It.

How to merge the updates within your own repository/fork/branches really depends on your setup so I’m not gonna be able to help with that.

Languages of a community and their order is set in the communities.settings fields, so you can update it with regular Rails commands (or possibly directly into the database, even though this is less secure and more risky).

Hopefully this helps.

1 Like