How to translate multiline strings

Issue #312 resolved
Wenjie Wu created an issue

method libraryImportHint MicroBlocksLibraryPropertiesFrame {
    return (localized (join
            'If you are adding a library that''s built-in into MicroBlocks, you '
            'can just enter its name.'
            (newline)
            'If your library is in the Libraries folder in your local '
            'MicroBlocks project folder, you need to prefix it with a slash (/).'
            (newline)
            'If the library is hosted online, please input its full URL.'
        ))
}

I found the code for this text, how should it appear in the translation file?

Comments (6)

  1. John Maloney repo owner

    The translation system doesn't currently support multiline strings. I will change the above code to localize each line separately. Let me know if you come across other cases.

  2. John Maloney repo owner

    Changed the code to localize single-line strings. New code is:

        return (join
                (localized 'If you are adding a library that''s built into MicroBlocks, you can just enter its name.')
                (newline)
                (localized 'If your library is in the Libraries folder in your local MicroBlocks project folder, you need to prefix it with a slash (/).')
                (newline)
                (localized 'If the library is hosted online, please input its full URL.')
            )
    

    This will be in the next Pilot release. (Note: You can test the Pilot release in the browser using "Run Pilot in browser" button on the Downloads page.)

  3. Log in to comment