Entry

@Serializable
sealed class Entry(source)

Represents a single top-level element in an FTL resource.

Entries can be messages, terms, comments, or junk (unparseable content). The Fluent specification defines the following entry types:

  • Message - A translatable string with optional variants and attributes

  • Term - A reusable value that can be referenced by other messages

  • Comment - A single-line comment (starting with #)

  • GroupComment - A section comment (starting with ##)

  • ResourceComment - A file-level comment (starting with ###)

  • Junk - Content that could not be parsed

Inheritors

Types

Link copied to clipboard
@Serializable
@SerialName(value = "Comment")
data class Comment(val content: String) : Entry

A single-line comment (lines starting with #).

Link copied to clipboard
@Serializable
@SerialName(value = "GroupComment")
data class GroupComment(val content: String) : Entry

A section comment (lines starting with ##).

Link copied to clipboard
@Serializable
@SerialName(value = "Junk")
data class Junk(val content: String, val annotations: List<String> = emptyList()) : Entry

Junk - content that could not be parsed as a valid entry.

Link copied to clipboard
@Serializable
@SerialName(value = "Message")
data class Message(val id: Identifier, val value: Pattern? = null, val attributes: List<Attribute> = emptyList(), val comment: Entry.Comment? = null, val docComment: DocComment? = null) : Entry

A message entry - the primary building block of Fluent translations.

Link copied to clipboard
@Serializable
@SerialName(value = "ResourceComment")
data class ResourceComment(val content: String) : Entry

A file-level comment (lines starting with ###).

Link copied to clipboard
@Serializable
@SerialName(value = "Term")
data class Term(val id: Identifier, val value: Pattern, val attributes: List<Attribute> = emptyList(), val comment: Entry.Comment? = null, val docComment: DocComment? = null) : Entry

A term entry - a reusable value that can be referenced by other messages.