Terms

Introduction

A term is a special type of string that is evaluated against the environmental context in addition to the active locale. Identifiers for terms are prefixed with the dollar character ($).

Terms are intended to represent domain-specific terminology used by a module or application.

Naming Convention

Term identifiers must be lower case, alphanumeric, begin with a dollar character ($) and a letter, and may include underscores (e.g. $my_term_identifier).

When to use terms

A string is the best way to represent some text that needs to be translated to another language when the active locale changes. However, sometimes you may need to modify a string based on different conditions, even within a single locale. This is where terms come in.

For example, you may want to replace the word "course" with the word "program" for the en-US locale, but only for users with a given flag on their account.

Leveraging environmental contexts, terms can be customized based on any number of conditions.

Working with terms

Last updated