How to translate multiline strings
Issue #312
resolved
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)
-
repo owner -
reporter Ok, I will.
-
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.)
-
repo owner Pilot webapp 1.1.91 has been updated with this change.
-
reporter That’s great, I will update the translation files later and submit a pull request.
-
reporter - changed status to resolved
- Log in to comment
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.