Skip to content

Handling the Hash Symbol (#) in the Parser: Avoiding Text Deletion in Translations  #39

@Kortvk

Description

@Kortvk

In the parser, the hash symbol (#) is treated as a delimiter, and any text following it—including the # symbol itself—is removed from the final translation. This behavior creates a problem when attempting to include the # character as part of the translation.

To address this issue, two key questions must be considered:

  1. How to include the hash symbol in translations?
    A solution might involve escaping the # symbol (e.g., \#) or introducing a configuration option that distinguishes a literal # from one intended as a delimiter. This would ensure the # character is correctly interpreted and preserved in the output.

  2. Why is comment = not sufficient for handling comments?
    The comment = property, as defined in the Twine format, provides a structured way to include notes about resource keys. However, inline comments using # might still be required for specific workflows, legacy systems, or contextual notes during development. Without proper handling of the # character, this functionality is lost.

Implementing a robust mechanism for processing the # symbol ensures compatibility with both Twine standards and practical use cases requiring special character handling or inline comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions