Add support for bulk-updating multi-line translations

http://manage.dimagi.com/default.asp?146611

@amsagoff this seems like a new feature since the old parser definitely did not support multi-line translations with un-escaped newline characters. Does this seem like a win to you?
Not sure where I'd fall on the feature/bug line but also not sure it
matters :) Happy to see this get out! Will assume you're working with
Christy to make the call on QA

On Thu, Nov 13, 2014 at 7:48 AM, Daniel Miller <notifications@github.com>
wrote:

> In src/javaRosa.js:
>
> > -                        val = cells[1 + j * languages.length + k];
> > +        var forms = ["default", "audio", "image" , "video"],
> > +            languages = Itext.getLanguages(),
> > +            nextRow = tsv.makeRowParser(str),
> > +            header = nextRow(),
> > +            i, cells, head, item;
> > +
> > +        if (header) {
> > +            header = _.map(header, function (val) {
> > +                var formlang = val.split("-");
> > +                if (forms.indexOf(formlang[0]) === -1 ||
> > +                        languages.indexOf(formlang[1]) === -1) {
> > +                    return null;
> > +                }
> > +                return {form: formlang[0], lang: formlang[1]};
> > +            });
>
> Previously the header row was ignored and the form/lang was derived from
> the XForm's list of languages and a hard-coded list of forms (see
> exportCols above). This seemed fragile since rearranging columns in the
> Excel file would reassign translations in a surprising way. The header row
> is now used to determine itext form/lang info. A side effect of this new
> implementation is that translation values with languages not in this
> XForm's list of languages will be ignored (previously they would have been
> stuffed into the wrong language or into a different itext form, which was
> just plain wrong).
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dimagi/Vellum/pull/267/files#r20273589>.
>