Hi,
I am struggling to determine what is the best option for the following:
If a site has to provide multiple languages, how would one go about
displaying the language info in selects.
Ex the information is stored in the db like:
table_1
id int
language_id tinyint
lang_string nvarchar [40]
I came up with two possible scenarios (pseudo code):
1. In Application.cfc
<cfquery name="q" datasource...>
select * from table_1 order by id, language_id
</cfquery>
stick it in applications scope
<cfset application.q = q />
Then on each page where where language dependent info needs to be displayed
run a QofQ:
<cfquery name="q" dbtype="query".>
select * from q
where language_id=#lang_id#
</cfquery>
display it ...
<cfselect name=".." query="q" ...>
</cfselect>
2. In Application.cfc loop through the available languages and stick each
language in it's own application scope query
<cfloop index="i"...>
<cfquery name="q#i#" datasource...>
select * from table_1 where language_id = #i#
</cfquery>
stick it in applications scope
<cfset application.q#i# = q#i# />
</cfloop>
and then:
<cfselect name=".." query="application.q#lang_id#" ...></cfselect>
where lang_id is the user selected language
What do you think? Are there any better solutions?
Thanks
Victor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254925
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4