Professional Web Applications Themes

Localization - Macromedia ColdFusion

I am trying to figure out how to make multiple languages for the cf site I am currently working on, where I can easily edit the languages. I have heard things about Resource Bundles and resx files, but I've also heard that Coldfusion doesn't support them. My first idea, was to store the different languages in an include file inside a variable, the only problem with that is that I have to manually edit every single language if I want to change or add something. My other guess was to use a database, the problem with that is that my ...

  1. #1

    Default Localization

    I am trying to figure out how to make multiple languages for the cf site I am
    currently working on, where I can easily edit the languages. I have heard
    things about Resource Bundles and resx files, but I've also heard that
    Coldfusion doesn't support them.

    My first idea, was to store the different languages in an include file inside
    a variable, the only problem with that is that I have to manually edit every
    single language if I want to change or add something.

    My other guess was to use a database, the problem with that is that my site
    will have thousands of phrases, for several languages, and doing a select for
    this on every page load wouldn't be too good.

    I've also heard about using some type of bundle for CF where the languages are
    stored in the application variables. Once again, the problem with this is that
    I'll have thousands of phrases for several languages, and my memory is low, so
    I can't use the application variables.

    Does anybody have any clues or experiences on approaching this? If there is a
    solution using javaobjects, please let me know as well, that is perfectly fine.

    superbullet Guest

  2. #2

    Default Re: Localization

    first question, have you internationalized your app? that should be the first
    step, not localization (l10n). you're doing it backwards.

    next, yes cf can use http://www.sustainablegis.com/blog/cfg11n/index.cfm.

    PaulH Guest

  3. #3

    Default Re: Localization

    Paul, thanks for the reply.

    I decided to store the information in a database. The problem now is that I
    can't select utf-8 data from my database unless I use the connect string in the
    Coldfusion Administrator. My question is, how can I retrieve the data without
    using the connect string in the administrator? I am creating an app for people
    who mainly do not have access to the administrator, although unicode is a
    necessity.

    I set my MySQL 4.1.11 database to use utf-8 character set. And it stores it
    correctly, atleast when I insert it via the MySQL Query Browser, but when I
    retrieve the data using Coldfusion it comes out in ????????? question marks,
    unless I put this in the connect string: useUnicode=true&characterEncoding=utf8
    and use this query before displaying the data: SET NAMES 'utf8';

    Is there any way to do this without using the administrator connection string?
    Help me out Paul.

    superbullet Guest

  4. #4

    Default Re: Localization

    you really can't. if you don't add that connection string to the mysql DSN
    you'll always get garbaged unicode data. why can't you just set up the DSN
    correctly?

    i suppose you might try doing it via the mysql jdbc driver directly (basically
    port java sql to cf) but depending on the host, this might not be available &
    is certainly much more work.

    PaulH Guest

  5. #5

    Default Re: Localization

    You know what Paul, you're 100% right.

    I thought about this, and I figured if the people that use my app have to
    setup a datasource, then setting up a connection string won't hurt, since it is
    in the same category, and every host will do it for you without a problem.
    Paul, I did all of this, and I am still getting garbage data, unless I run this
    query before selecting the data:

    <cfquery>
    SET NAMES 'utf8';
    </cfquery

    I am using MySQL 4.1.11, the most recent stable version. I don't understand
    why this query has to be ran, then if I delete the query, the data is still
    good, but if I reset the connection string, then parts of the data will become
    ?? question marks. You understand what I'm saying? Maybe when I reset the
    connection string, the administrator changes the SET NAMES in the mysql
    database? Any clues how to get this data returned without running this query
    first?

    Also, I noticed alot of you guys have always been posting to use
    <cfprocessingdirective>, setencoding, and <cfcontent>, before using Unicode,
    but it works perfectly fine without it, so why use all of these tags and
    functions? Just wondering.

    superbullet Guest

  6. #6

    Default Re: Localization

    1st double check your connection string. next try adding those "mystery" tags &
    functions to your cf page (<cfprocessingdirective>, setencoding(), and
    <cfcontent>, these are all doented), finally see if
    http://bugs.mysql.com/bug.php?id=9091 applies to your case.

    PaulH Guest

Similar Threads

  1. Localization
    By Ian.S in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 1
    Last Post: October 20th, 02:47 PM
  2. localization and internationalization
    By jeubanks in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: May 13th, 03:49 PM
  3. Components localization
    By Grokwik in forum Macromedia Flash Data Integration
    Replies: 0
    Last Post: March 21st, 07:07 PM
  4. Japanese Localization
    By Friesen in forum Macromedia Director Basics
    Replies: 1
    Last Post: February 12th, 01:55 AM
  5. help with localization
    By Joe Glover in forum ASP.NET General
    Replies: 2
    Last Post: July 9th, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139