diff --git a/mod-list.html b/mod-list.html
index 9d8433b3..22b01ff6 100644
--- a/mod-list.html
+++ b/mod-list.html
@@ -418,6 +418,7 @@
| libpacman-v1.js | Library for making mods | mollthecoder |
| libpixeltracking.js | Library for tracking pixels | mollthecoder |
| maxColorOffset.js | Adds a property to specify how much a pixel’s color can be randomly offset from the element color | Alice |
+| modlangs.js | Adds a customisable property in an element to allow for translations in mods. See the file for instructions on how to implement. | SquareScreamYT |
| nested_for_reaction_example.js | An example of using a nested for loop to add reactions. It makes various things kill plants | Alice |
| nv7.js | Adds a giant Nv7 image [Large] | Nv7 |
| place_all_elements.js | Experimental function that places every pixel | Alice |
diff --git a/mods/modlangs.js b/mods/modlangs.js
new file mode 100644
index 00000000..264e09ac
--- /dev/null
+++ b/mods/modlangs.js
@@ -0,0 +1,53 @@
+function add_lang(langcode) {
+ for (element in elements) {
+ if (elements[element]["name_"+langcode]) {
+ lang[element] = elements[element]["name_"+langcode];
+ }
+ }
+}
+
+/*
+INSTRUCTIONS
+
+put this code at the top of your mod:
+set langcode to whatever language code (zh_cn is simplified chinese)
+
+
+
+langcode = "zh_cn"
+
+var mods_to_include = ["mods/modlangs.js"]
+
+var mods_included = mods_to_include.map(mod => enabledMods.includes(mod));
+var all_mods_included = mods_included.reduce(function(a,b) { return a && b });
+
+if(!all_mods_included) {
+ var mods_needed = mods_to_include.filter(function(modPath) { return !(enabledMods.includes(modPath)) });
+
+ mods_needed.forEach(function(modPath) {
+ enabledMods.splice(enabledMods.indexOf("mods/modlangs"),0,modPath);
+ });
+ localStorage.setItem("enabledMods", JSON.stringify(enabledMods));
+}
+
+runAfterLoad(function() {
+ add_lang(langcode)
+})
+
+
+
+then you can add the name_ + langcode to your element like this:
+
+elements.eat = {
+ color: ["#ffba79","#efff79"],
+ tool: function(pixel) {
+ if (elements[pixel.element].isFood || elements[pixel.element].category === "food" || eLists.JUICEMIXABLE.includes(pixel.element) || elements[pixel.element].id === elements.uranium.id || elements[pixel.element].id === elements.mercury.id) {
+ deletePixel(pixel.x, pixel.y);
+ }
+ },
+ category: "tools",
+ desc: "Eats pixels.",
+ name_zh_cn: "吃"
+}
+
+*/