Skip to content

How to Contribute a New Language

Andrew Gardner edited this page Nov 13, 2015 · 2 revisions

How to Contribute a New Language to VegAssist

This guide assumes you don't really know much about coding, but would like to contribute some search phrases to VegAssist. Don't worry - there's no way you can screw this up! Here's the simplest way to contribute:

Sign up for a GitHub Account

A necessary first step, and a simple process. You've probably done this on dozens of sites before 😸

Navigate to the filters directory

Go to the filters directory of the VegAssist GitHub repository: https://github.com/plorry/VegAssist/tree/master/filters

You will see a list of language files, such as english.js. (.js refers to the file type; these are Javascript files!)

Create a new file

Press the + button, above the file list. (The hover-over text will say Create a new file here.

You'll want to name your file for the language you are submitting. If you are submitting phrases in Seitanese, for example, choose this as the name for the file: seitanese.js. Remember to end it with the .js file extension.

Populate that file with phrases

Copy and paste this into the blank file, to use as your template:

module.exports = [

]

Then, in between the brackets, write out a list of phrases in your language that roughly correspond to variations of "i want to go vegan" or "help me go vegan". (It's best that the phrases be all lowercase - no need to capitalize anything). Surround each phrase with quotation marks ", and put a comma , after each phrase except for the last one. Your finished file might look something like this:

module.exports = [
    "help me become a vegan",
    "i want to be a vegan",
    "i want to go vegan"
]

Note that each line is surrounded in quotes, and that they are all followed by a comma, except for the last line.

Submit the file to be Merged!

Proceed to fill out the lower fields in the form, to give your changes a title and description. These can be really simple: French language added or something.

You can now submit the file! Follow the forms to create a Pull Request. This simply means that you have some changes that you are requesting to be merged into the project. That's great! We'll be notified that there's a new pull request, review your file, and either suggest some changes, or merge it in!

Congrats, you've just contributed to the open-source (& vegan) community!