Skip to content

Languages & Extensions

Chiri Vulpes edited this page Jun 6, 2023 · 9 revisions

Wayward's language JSON files are used to provide new languages. They are also used to extend/tweak existing languages, such as changing the default translations for things in existing languages (sort of like a language patch) and translating new content that is added.

Generating language JSON template files with +mod create

In a console, simply run a command to set up a language in your mod. For more information on this command, see this guide.

cd "C:/Program Files (x86)/Steam/steamapps/common/Wayward/mods"
..\bin\wayward.cmd +mod create HelloWorld +language

Table of Contents

Required Properties

name or extends

A language file must have exactly one of either name or extends.

  • name — This file defines a new language by this name.
  • extends — This file extends an existing language by this name.

dictionaries

An object containing dictionaries. A dictionary is a key-value pair of the dictionary name, and the entries (or translations) in the dictionary.

As a simple example, let's say you want to change the name of the branch item. Your dictionaries would look like the following:

"dictionaries": {
    "items": {
        "branch": ["stick", "Useful for playing fetch."]
    }
}

A translation is always either a string "some text here" or an array of strings ["some text here", "more text", "etc"]. "text" is functionally equivalent to ["text"]. Each string in an array of strings is a different part of the translation, for example:

  • Entries in the item, creature, and doodad dictionaries are [Name, Description].
  • Entries in the book dictionary are [Author, Text].
  • Entries in the helpArticle dictionary are [Name, Summary, Subtitle, Text].
  • Entries in the humanName dictionary are actually any number of different names that can be used.

pluralizationRules

This object contains "pluralization" rules for the language, affecting how nouns are automatically reformatted by the game — how they're pluralized, and what articles are attached.

pluralRules

An object containing mappings from a singular noun to a plural noun. In pluralization, if one rule matches, no other rules will be used.

singularRules

An object containing mappings from a plural noun to a singular noun.

irregularRules

An array containing 2-length tuples of a singular noun and its plural form, for the game to translate between.

uncountables

An object containing nouns that are not "countable" — IE, their singular and plural forms are identical.

articleRules

When including a noun in a sentence, sometimes an article is attached. Using English as an example, this is "a" and "an", depending on whether or not the first sound in the word is a consonant sound or a vowel sound. In the default English language, we the following rules:

"articleRules": [
	[1, "/^(?=[aeiou])/", "an "],
	[1, "/^(?![aeiou])/", "a "]
]

In other words, this property takes an array of article rules, where an article rule is a 3-length tuple of:

  1. The "count" that this article rule should be applied to:
    • An exact count — for example, 0, 1, 20 etc
    • Any number at least a given value — for example, { min: 5 }
    • Any number between a given minimum and maximum, inclusive — for example, { min: 5, max: 10 }
  2. A regular expression determining which nouns to match.
  3. The article to replace the regular expression with when matched.

Next:

Getting Started

Mod Content

Script Documentation

(apologies for all the missing guides, we'll get to them at some point)

Clone this wiki locally