# i18n and arrays possible bug

**URL:** <https://forum.servoy.com/t/i18n-and-arrays-possible-bug/3261>\
**Category:** Classic Servoy\
**Created:** [December 10, 2004, 4:32pm UTC](https://forum.servoy.com/t/i18n-and-arrays-possible-bug/3261 "2004-12-10T16:32:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morley](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@Morley](https://forum.servoy.com/u/Morley)\
**Post date:** [December 10, 2004, 4:32pm UTC](https://forum.servoy.com/t/i18n-and-arrays-possible-bug/3261/1 "2004-12-10T16:32:02Z")

</div>

The following code works.

```auto
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.

---

<div class="post-metadata">

**Author:** ![bcusick](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bcusick](https://forum.servoy.com/u/bcusick)\
**Post date:** [December 10, 2004, 7:32pm UTC](https://forum.servoy.com/t/i18n-and-arrays-possible-bug/3261/2 "2004-12-10T19:32:06Z")

</div>

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

TRY:

```auto
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));

```

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [December 10, 2004, 10:40pm UTC](https://forum.servoy.com/t/i18n-and-arrays-possible-bug/3261/3 "2004-12-10T22:40:51Z")

</div>

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

````auto

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...
````

---

<div class="post-metadata">

**Author:** ![Morley](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@Morley](https://forum.servoy.com/u/Morley)\
**Post date:** [December 11, 2004, 4:56pm UTC](https://forum.servoy.com/t/i18n-and-arrays-possible-bug/3261/4 "2004-12-11T16:56:38Z")

</div>

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

```also

Rather odd.
```

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [December 13, 2004, 9:50am UTC](https://forum.servoy.com/t/i18n-and-arrays-possible-bug/3261/5 "2004-12-13T09:50:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [December 13, 2004, 9:54am UTC](https://forum.servoy.com/t/i18n-and-arrays-possible-bug/3261/6 "2004-12-13T09:54:13Z")

</div>

![:oops:]( "Embarassed")

forgot about that…
