I18n skeleton / example application

Hi Everyone,
I must be having a “brain-no-worky” kind of day…

Is there a skeleton app for internalisation/localisation? Or perhaps a presentation / tutorial / etc?

I just cannot seem to get my head around how to “enable it”.

(BTW I am new to Coldbox : which doesn’t help me, either!)

I have installed the default skeleton application.
I have installed i18n via install cbi18n
I have included the cbi18n object into moduleSettings of /config/Coldbox.cfc

I have created a json file “main_en_US.json” with nested key/values:

{
	"general": {
		"message1": "This is Menu1 in English/US"
	}
}

I have added <p>#$r(resource=general.message1)#</p> into /views/main/index.cfm

But am getting the following error.
variable [GENERAL] doesn't exist

The i18n book/documentation states there are two models registered and
they can either be injected, called via our mixin helpers or added via our ColdBox Delegates:

It then gives example code - for each method and Once you have access to those objects you can leverage their methods to your ❤️'s content.

That’s awesome - but what it doesn’t do - is let me know where I need to place this code.

I did try adding

i18n()
resourceService()

to the index.cfm - but that didn;t work telling me No matching function [I18N] found

As always Thanks!

You need to quote “general.message1”. The error you are receiving is because you are using it as a variable

1 Like

Awesome - thanks very much @jclausen!