Search code examples
ioslocalizationlocalizable.strings

Is there a way to comment inside a Twine Localization file?


I've started using this sweet script Twine to help manage localizations. it makes it really easy to have specific comments about your localizations like:

[[Settings]]
    [Contact]
        en = Contact
        comment = Settings Section Header

But I'm wonder if there is a way to use general comments in the files. I've tried a few common ones that aren't working like:

[[Settings]]
# This is a Comment
// This is a Comment
    [Contact]
        en = Contact
        comment = Settings Section Header

Both cause the script to crash and fail.


Solution

  • In case anyone comes looking. As of today, its not supported. There is an issue tracking the feature. They are currently looking for someone to implement it. It doesn't look to be a simple task. Because the strings.txt files are read/write, the parser would need to take comments into account at multiple points of the process. And if lines were added the parser would need to know where to put the comment in relation.

    You can follow along the development here: https://github.com/mobiata/twine/issues/8