More consistent trailing newlines support
By Edouard on March 30, 2023
We have updated our file handlers to detect if the file uploaded ends with a newline or not. Then, when generating your language files, we will generate a file ending with a newline if the uploaded file had a newline or with no trailing newline if there was no trailing newline in the original language file.
This feature is available for all our supported language files.
That setting will be detected and set every time a new language file is uploaded. What you upload is what you will get in terms of trailing newline. This is a parameter that is read in the uploaded language file each time and will change the setting on your master language file if it differs.
We’ve also run a migration to check if your file currently ends with a newline or not, and we’ve set that setting for you. This way a trailing newline won’t magically appear to our users not wanting one.
If you were using a trailing newline and our file handler was removing it all the time, you initially won’t have a newline in your files (as if nothing had changed), but once you re-upload your master language file with a trailing newline, you’ll get a trailing newline in all your master and target language files.
We have also plans to bring feature to other file specificities (does the uploaded file include a BOM or not, how is the file indented — how many tabs or spaces, etc).