-
Notifications
You must be signed in to change notification settings - Fork 46
Style considerations when exporting #211
Comments
Thanks for creating |
This matter is a lot more complex than it seems and it's hard to please everyone. Running these heuristics would hopefully support some variation accross projects while keeping the style consistent within each of them. |
I would want to have this apply only to the strings added/updated and just keep input file in the format it was. |
|
The part of "keep original file and changes separately" should not be that hard, that's standard patching functionatlity and should be available e.g. as library. Only prio2 would be to detect existing preferences in formatting and apply them to new/changed strings. |
These are all heuristics that could be applied to the original translation files and then used as parameters when exporting the resulting file.
New lines on long strings
See #210.
This heuristic could check whether all
<string>
are in a single line or span accross several lines, and the maximum column to know when to split (e.g. at ≤120 characters).Whether to escape quotes or not
See #209.
Generally quotes are intended to be escaped, as they only ever make sense to be left unescaped when there is more than one whitespace character that should be preserved. Stringlate could automatically detect quotes around multiple spaces (e.g. some people like to leave two spaces after a period like:
and remove them when translating, only to put them back after the translation is done). User quotes would always be escaped.
New lines after
\n
escapeSee #208.
Some projects will just use a really long line. Some will add an actual newline after the
\n
escape, some before.The text was updated successfully, but these errors were encountered: