how is the `custom` argument used in i18n()?

how is the `custom` argument used in i18n()?

nlooijenlooije Posts: 50Questions: 11Answers: 0

Hi, I am adding internationalization but I don't understand the function syntax of the i18n() function as described in the reference manual.

i18n( custom, token [, default] )

custom:

User defined string for this token. While it would be possible to check for this value outside the method, it is a common action to check for custom text values on objects (e.g. field configuration objects), so this is provided to simplify that logic. If not null or undefined, this value will be returned.

token:

The JS object notation string for the value that is to be loaded. For example for i18n.create.button, create.button would be given here.

The examples only use the custom argument:

editor.i18n('edit.button');

This would (and does for me) return the string 'edit.button' which is not what is needed

Instead i have to set:

editor.i18n(null, 'edit.button')

which does correctly return the string 'Update' as I would expect.

What is the usage of the custom argument?

Sign In or Register to comment.