i18n and arrays possible bug

The following code works.

var max = controller.getMaxRecordIndex();
var x = 'x';
var title = i18n.getI18NMessage('7office.dlg.modelflags');
var msg = i18n.getI18NMessage('7office.dlg.modelflagsmsg', new Array(max, x));

Here’s the i18n key:```

Use this record as a model and set all {0} current records to the same settings? ```

Here’s the issue. I only need one variable. If I leave out the second I get an error.

Possible bug.

Morley - arrays are zero-based (they start with zero, not one).

TRY:

var max = controller.getMaxRecordIndex();
var x = 'x';
var title = i18n.getI18NMessage('7office.dlg.modelflags');
var msg = i18n.getI18NMessage('7office.dlg.modelflagsmsg', new Array(1, x));

hmm, what you say is thatvar msg = i18n.getI18NMessage('7office.dlg.modelflagsmsg', new Array(max, x)); works and this```
var msg = i18n.getI18NMessage(‘7office.dlg.modelflagsmsg’, new Array(max));


What if you try this:```
var msg = i18n.getI18NMessage('7office.dlg.modelflagsmsg', new Array(max+''));
``` because that worked for me but is not really how it should be...

Yes```
var msg = i18n.getI18NMessage(‘7office.dlg.modelflagsmsg’, new Array(max+‘’));


Rather odd.

no it is not odd..

look at the javascript Array constructors:

new Array(number initialLength);
new Array(arguments…)

so you can never make an new Array with just one number. Because that means that it will make an array that has the initial size.

:oops:

forgot about that…