>>I have never used UTF-8, just ISO-8859-1
If you only need French, or even any european laguage, and the rest of
your data is not Unicode,
don't bother with Unicode/UTF-8. Use ISO-8859-1 just as before.
If you need many different languages supported by different ISO
standards, or you already use a unicode database,
better use UTF-8.
If you use iso-8859-1 and CFMX, use this in your application.cfm file,
otherwise CF will mess up your coding:
<CFSET CFversion = listGetAt(server.coldfusion.productVersion, 1)>
<CFIF CFversion GT 5>
<cfcontent type="text/html; charset=ISO-8859-1">
<cfset setEncoding("url","ISO-8859-1")>
<cfset setEncoding("form","ISO-8859-1")>
</CFIF>
Then, I found easier to maintain one text file per language than data in
a database.
I use one line per text string. Each line is a "\" delimited list of two
elements, the first is the index in the final array,
the second is the content, ie:
1\English
2\Photo Display
3\Details about this photo
4\Show nb. above heads
5\Are you sure you want to delete this photo?
6\Data
7\Areas
8\Delete
9\#
10\Notes
................
1\Français
2\Le trombinoscope
3\Détails au sujet de la photo
4\Afficher les Nº au dessus des têtes
5\Êtes-vous certain de vouloir supprimer cette photo ?
6\Renseignements
7\Zones
8\Suppression
9\Nº
10\Commentaires
............
Then in Application.cfm, initialize the text array application.Atext
with something like:
<CFSET delim = chr(13)&chr(10)>
<CFFILE ACTION="READ"
FILE="#localDirectory#\Text#UserLang#.txt"
VARIABLE="textFile">
<CFLOOP INDEX="line" LIST="#textFile#" DELIMITERS="#delim#">
<CFSET n = listGetAt (line, 1, "\")>
<CFSET application.Atext[session.Alang][n] = listGetAt
(line, 2, "\")>
</CFLOOP>
UserLang could contain "FR" or "EN" and session.Alang 0 or 1
Then use for any string:
#application.Atext[session.Alang][...]# ... being the index of the
string to use.
Just a snip from my own code.
--
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211138
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54