User blog:Rail/Contributing to Dev Wiki

When you are writing codes for your wiki such as styles with CSS, functionality improvements or entire new tools with JavaScript, or advanced templates using Lua, you might at some point find yourself wanting to share your work with the broader Fandom community and let other wikis use your codes.

Previously wikis used to do that by copying codes from each other and applying them in their own applications. Currently, there is a much better option for that, and it’s contributing your work to Dev Wiki.

It’s a place where you can add your code, and it can then be used by wikis and users across Fandom without manually copying everything. Instead, they can only use imports (smaller functions loading the code from Dev Wiki) and always enjoy the up-to-date best version of your code.

However, there are things you might want to consider and best practices to follow.

Firstly, you should check out Dev Wiki’s coding conventions page, where general recommendations are listed.

When your code introduces interface changes, new text or adds a completely new tool, you should consider following Dev Wiki’s instructions for how to make your code internationalized, so members of the Dev Wiki community can translate text used by your code into their native languages and make your work more accessible to wikis in all languages.

For example, when you’re writing a JavaScript code that adds a new option in pages’ “Edit” Dropdown like this:

You can use I18n-js library from Dev Wiki to easily and quickly make your script translatable:

Let’s quickly take a look what changed here:
 * Main code is not located inside a function  with   parameter, which is a bridge between your code and the i18n-js library
 * After the  code ends, there is an   statement loading I18n-js code. Don’t worry! If there is already i18n-js loaded, it won’t break anything.
 * Then, a special hook is used to wait until all I18n-js elements are ready to go.
 * Upon hook being executed, it runs a function loading text from Dev Wiki and launches your  function.

This means text parts of your code will be stored on Dev Wiki separately from the programmatic code in a page following this naming scheme:, so in this case –  , as   is what we ask   function to load.