House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / onTap

i18n features

Author:
s. isaac dealey
11/12/2005 04:13 PM

> I assume Isaac is really busy or is gone, since I haven't > heard a peep from him on any list in a while. Or both. :) > Anyway, for #2 below, I believe you can do this with the > branding features of onTap. Essentially, with branding you > can "overwrite" the regular values with specific values > for a customer. Check out the documentation on this. Yes, there are several ways this can be accomplished. Personally I think the most elegant method is to use the normally enabled i18n and branding directories with XHTML and simply reset any localization strings a client would like to have changed in the branding directories. So for example, for site-wide localization you may read (and cache) a resource bundle in the /_components/_application/ directory. For the client WidgetWorld you could then reset any particular english-localized string for them in the directory /_components/_brand/www_widgetworld_com/_application/_l10n/en/ (or of course fr for french, de for german, etc.). The branding directory (www_widgetworld_com) is based on the domain used by the server but can be manually set in your /_components/_appsettings.cfm template - I believe the variable is request.tap.path.brand, but check the getting-started documentation to be sure. Localized strings can be set using the function #request.tapi.ls("name" [,"value"] [,overwrite])# where "name" is the canonical name you're using to identify the localized string, value is the localized string and overwrite indicates if an existing value should be overwritten (defaults to true). Essentially request.tapi.ls() works like the ColdFusion native SetVariable() function although it is specifically for setting (and returning) localized strings within the framework. Once you've set these variables you can either use request.tapi.ls() to return them again to the output buffer or you can simply use the name of the variable in the text content of any xhtml element, like so: <cfset request.tapi.ls("%test","this is only a test")> <cfmodule template="#request.tapi.xhtml()#">   <div>%test</div> </cfmodule> The html library will then automatically convert %test to "this is only a test". Note that this does not work with attributes, i.e. <input type="submit" value="%test" /> will not be converted, so you would need to use <input type="submit" value="#request.tapi.ls("%test")#" /> > As for #1, I have no idea if large-scale sites are using > onTap. Isaac would know. I know we are converting a fairly > complicated app to onTap, though it is still in the > planning stages at this point, which probably isn't much > help to you. I wouldn't necessarily know actually, since I don't keep tabs on who downloads it... Although at the moment I'm not aware of any large-scale sites currently using it, which tends to favor the idea that there aren't yet. I know Cedric will be pleased to know that I got a phone call from the folks at New Atlanta the week before the storm to let me know that Vince Bonfanti had taken a personal interest in trying to bridge the gap between BlueDragon and the current version of the framework (and to feel-out the possibility of sales leads). :) Interest in the framework in general has been steadily increasing recently, so I expect to be fielding a lot more questions about its usefulness for various tasks and in the process of course we'll be addressing any barriers to those tasks (i.e. scalability/performance issues) which may come up in pre-adoption testing. s. isaac dealey     434.293.6201 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm


Search ontap

February 11, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29