RE: [coldbox:24008] [ColdBox-3.8.1.00076] Changing the location of resource bundles

What does your config look like? Can you show how you are loading your bundles manually?

What is the full stack trace of the error?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad,

On “onAppInit” we are calling our function to load the translations. This function will get the translations from MongoDB, write the files on the location specified by us and then load the bundle like this:

<cfset resourceBundle.loadBundle(ExpandPath(’#settingService.getSetting(“uploadPath”)#\includes\i18n’) & “main”, arguments.locale, true) />

The locale is specified by the language that is loaded, in this case we are using “en_GB” to test.

This is the stacktrace of the error we are getting when not putting an empty file in the default bundle location:

And what of your config?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Woops forgot that. here it is:

Just noticed by going through these again that there is a setting “defaultResourceBundle”. I suspect when changing that one we can make Coldbox look in the right folder.
However is it possible to make Coldbox not load resource bundles automatically?

function configure()
{
// coldbox directives
coldbox = {
//Development Settings
appName = “appname”,
debugMode = false,
debugPassword = “password”,
reinitPassword = “”,
handlersIndexAutoReload = false,

//Implicit Events
defaultEvent = “main.index”,
requestStartHandler = “main.onRequestStart”,
requestEndHandler = “main.onRequestEnd”,
applicationStartHandler = “main.onAppInit”,
applicationEndHandler = “main.onAppEnd”,
sessionStartHandler = “main.onSessionStart”,
sessionEndHandler = “main.onSessionEnd”,
missingTemplateHandler = “main.onMissingTemplate”,

//Error/Exception Handling
exceptionHandler = “main.onException”,
onInvalidEvent = “main.pageNotFound”,
customErrorTemplate = “…themes/default/views/error/error.cfm”,

//Application Aspects
handlerCaching = false,
eventCaching = false,

// Views handling
viewsExternalLocation = “…/themes/default/views”,
viewsLocation = “…/themes/default/views”,

contentPageLocation = “…/static/”
};

// debugger
debugger = {
expandedInfoPanel = false,
expandedRCPanel = true
};

//Datasources
datasources = {
defaultDSN = {name=“webdata”}
};

// environment settings, create a detectEnvironment() method to detect it yourself.
// create a function with the name of the environment so it can be executed if that environment is detected
// the value of the environment is a list of regex patterns to match the cgi.http_host.
environments = {
development = “^local.”,
staging = “www.site.local”,
training = “^training.”,
preview = “preview.”
};

//i18n & Localization
i18n = {
defaultResourceBundle = “includes/i18n/main”,
defaultLocale = “en_GB”,
localeStorage = “cookie”,
unknownTranslation = “NOT FOUND
};

//Interceptor Settings
interceptorSettings = {
throwOnInvalidStates = false,
customInterceptionPoints = “”
};

//Register interceptors as an array, we need order
interceptors = [
// multidomain SES
{class=“coldbox.system.interceptors.MultiDomainSES”},
//SES
{class=“coldbox.system.interceptors.SES”}
];

//Layout Settings
layoutSettings = {
defaultLayout = “”,
defaultView = “”
};

//LogBox DSL
logBox = {
// Define Appenders
appenders = {
coldboxTracer = { class=“coldbox.system.logging.appenders.ColdboxTracerAppender” }
},
// Root Logger
root = { levelmax=“INFO”, appenders="*" },
// Implicit Level Categories
info = [ “coldbox.system” ]
};

// Module Directives
modules = {
//Turn to false in production
autoReload = false,
// An array of modules names to load, empty means all of them
include = [],
// An array of modules names to NOT load, empty means none
exclude = []
};

Just set the defaultResourceBundle to an empty string. You can see here in the code, it is only loaded if you have the setting set to something:

https://github.com/ColdBox/coldbox-platform/blob/3.8.1/system/plugins/i18n.cfc#L106

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

That seems to be working fine. Thanks for the tip!