i18n setfwlocale more lenient in a page than interceptor


Not sure if this is by design but seems like we should be able to override default locale in an interceptor in the same way we can at the page level.

In an interceptor we just load a language value like your normal examples from the DB. en_US

<cfset var locale = settingService.getSettingValue(‘locale’, rc.portal)>

<cfset getPlugin(“i18n”).setfwLocale(locale)>

if I try to modify this to a setting to include a portal code in the mix “main_FSCP_en_US.properties” I get the following.

Error Type: i18n.InvalidLocaleException : [N/A] Error Messages: Specified locale must be of the form language_COUNTRY_VARIANT where language, country and variant are 2 characters each, ISO 3166 standard. The locale tested is: FSCP_en_US

Now if I set this in a page. There is no error and I get access to both the portal specific i18n and default config getResource resources.


<cfset thisLocal = rc.portal.getPortalCode() & ‘_en_US’>
<cfset getPlugin(“i18n”).setfwLocale(thisLocal)>



All seem to work at the page level but I can’t set this in the interceptor level without receiving an error.

Seems like a bug to me… Why should I need to get this plugin twice.

Thank you for your assistance.