30 July 2012

Free localization tools: Excel macro for automatic word wrapping

Gamescom 2012 is about to start and we wanted to celebrate with a special gift. One of the Excel macros we have developed deals with the crazy manual line breaks videogame text sometimes require. All you have to do is point this Excel macro to your text and it will format it for you, respecting your limits and paragraphs!

[ DOWNLOAD MACRO](assets/CutText.xls) ## ## All the settings, in short ## =CutText(YourCell;MaxChar;MaxLines;MinRagg;Italian) - for use inside the CutText.xls file =CutText.xls!CutText(YourCell;MaxChar;MaxLines;MinRagg;Italian) - for use from any file, while keeping CutText.xls open YourCell = the cell you want to format MaxChar = maximum characters per line (or position of a cell with such limit) MaxLines = maximum lines (or position of a cell with such limit) MinRagg = activate minimum raggedness mode Italian = stops articles from being split from the following word ## In detail: YourCell + MaxChar ## In order to use it, just type =CutText.xls!CutText(YourCell;MaxChar) Where YourCell is the cell you want to have with linebreaks and MaxChar is the maximum number of characters per line. Obviously, the text inside YourCell shouldn't have hard line returns of his own but, if you want the text to be split into paragraphs, leave them in and they will be transposed by the macro. MaxChar can be a numerical value, but also point to a cell with said limit. Very useful for files with multiple line lengths! Assuming that macros are enabled in your system, the formula will be replaced with the formatted text. **Now, just copy and paste it as value where needed and you're done!** ## In detail: YourCell + MaxChar + MaxLines ## =CutText.xls!CutText(YourCell;MaxChar;MaxLines) If you cannot exceed a specified number of lines, fill in this setting and -should the text be too long- the macro will issue a warning. Then go and fix it :) MaxLines can be a numerical value, but also point to a cell with said limit. ## In detail: YourCell + MaxChar + MaxLines + MinRagg ## =CutText.xls!CutText(YourCell;MaxChar;MaxLines;MinRagg) By the default, the macro [uses a "greedy" algorithm](http://en.wikipedia.org/wiki/Word_wrap#Minimum_length), trying to fit as many characters per line as possible. By setting this value as TRUE, it will try to fill each line equally. MinRagg can only be set as TRUE or FALSE (default). Users of localized Excel versions should check their relevant counterpart (VERO/FALSO for Italian) Should this fail due to line limits, it will revert to greedy and, should it fail again, issue a warning. ## In detail: YourCell + MaxChar + MaxLines + MinRagg + Italian ## =CutText.xls!CutText(YourCell;MaxChar;MaxLines;MinRagg;Italian) This is only relevant for Italian. Activate this flag if you prefer articles (il, lo, la, i gli, le) never to appear at the end of a line. Italian can only be set as TRUE or FALSE (default)

[ DOWNLOAD MACRO](assets/CutText.xls) ## Happy localization and thank you to Gian Maria Battistini for creating the macro and tweaking it for public use!

(cover credits)