Strings
Introduction
The most basic element supported by ESCL is a plain string. A string represents a line of text containing any character supported by the current locale, and may also include clauses to enable dynamic processing.
Naming Convention
String identifiers must be lower case, alphanumeric, begin with a letter, and may include underscores (e.g. my_string_identifier
).
Simple strings
In this example, the hello_message
identifier represents the string Hello, World!
. This string requires no processing or formatting and will be returned verbatim.
hello_message: `Hello, World!`
Compound strings
A compound string is a string that is constructed by combining one or more strings. Using a clause, we can pass in the identifier of another string to insert it in place. Each string is processed independently before being combined.
In this example, tos_message
will become Please accept our Terms of Service
for en-US and Accepter nos conditions d'utilisation, s'il vous plaît
for fr-CA.
tos_name: `Terms of Service`,
tos_message: `Please accept our { tos_name }`
tos_name: `conditions d'utilisation`,
tos_message: `Accepter nos { tos_name }, s'il vous plaît`
Aliases
An alias is a string that contains a single clause which references another string without any additions or modifications.
hello_message: `Hello, World!`,
hi_message: `{ hello_message }`
Last updated