Copy link to clipboard
Copied
I am on this project where we need to allow users from French speaking countries to be able to view the webpages and surf the site in French. I am kind of lost on the best appraoch to get this done. Please any one has an idea of where to start?
The site is working now in English and there is a databse (MS SQL Server 2005) set up also in English.
Thanks
Copy link to clipboard
Copied
Well it's certainly no small task you're undertaking there, but there are a couple of ways of doing it as far as I know.
The first is to store all the phrases in all languages in an XML file, then pull the correct outputs depending on the current language. For example: (pseudo, obv)
<xml>
<dict lang="EN-US">
<phrase id="1" value="Hello there. Welcome!" />
<phrase id="2" value="Sorry to see you go, goodbye!" />
</dict>
<dict lang="FR">
<phrase id="1" value="Bonjour. Bienvenue!" />
<phrase id="2" value="Ah, le chat des ami. Au revoir!" />
</dict>
<dict lang="ES">
<phrase id="1" value="Hola! Bienvenido!" />
<phrase id="2" value="Lo siento, pero tu hermana es muy guapa!" />
</dict>
</xml>
You then load each language into a structure in the APPLICATION scope (call it APPLICATION.LANG), then pretty much everywhere in your code you need to output something you'd instead do:
<cfoutput>#APPLICATION.LANG[SESSION.language].phrase1#</cfoutput>
Or similar.
The other approach is similar, but involves having the phrases saved in database tables and doing a similar thing.
And sadly no, you'll struggle to find anything that can reliably translate for you - certainly not a database.
O
PS languages are not my strong point, as you may have noticed.
Copy link to clipboard
Copied
For stuff like generic prompts, the XML route is fine, but if it's a content-driven site, that's only a small slice of the task at hand.
Creating a multi-lingual site is no small undertaking, and "how to do it?" is a question well beyond the remit of a community forum. It's one of those questions that if you don't know the answer already, then you probably aren't the best person to be asking the question. I don't mean that to be flippant or rude, but this sort of thing is a) complicated; b) well-trod ground; c) the sort of thing that companies base their business model on. It's not trivial.
My advice to you is to look for a multi-lingual capable CMS, or get a consultancy firm in that has a track record with this sort of thing (depending on your budget).
Oh, and the way you get your content translated into other languages is to send the text to a translation company, wherein there are humans trained in translation (and expert spellers and grammaterians and copy writers in their specialist language) who will do the work. Machine translations are fine for ordering a beer in a foreign country, but completely inadequate for professional translations. Just today I had an example of Google Translate providing a translation that meant the exact opposite of the original text. At best, machine translations sound like how those non-local-language-speaking tourists do when asking for directions or ordering a meal. Not how one wants one's website to come across.
--
Adam
Copy link to clipboard
Copied
the "standard" approach (ie java) is to use resource bundles (rb). rb have a
decent support environment (plenty of tools for managing them, java & cf based
ones). you do not want to be managing this sort of thing w/notepad.
if you really must use XML then at least use the XLIFF standard.
and you really want to be dealing w/locales not languages, spanish in spain
isn't quite the same as spanish in mexico for instance.
Copy link to clipboard
Copied
first off try reading thru this (chapter 50):
http://www.forta.com/books/0321515463/CFWACK8-2-EChapters.pdf
then try some of the postings here:
http://www.sustainablegis.com/blog/cfg11n/
post back here w/any questions.
basic quick & dirty internationalization (i18n) advice:
- french? which french? english? who's english? you want to be dealing w/locales
not languages.
- hire a professional translator (and before you ask, no, none of the developers
or their relatives or significant others should be doing this job). a good
professional translator will understand cultural context & should help keep you
away from insulting too many people.
- as adam as pointed out, machine translators are for the birds (though single
words are usually ok), so NEVER use google translation for anything serious. at
best, your website will look silly. at worst, you could kill someone.
- make sure your database & cf code is ready for i18n (just use Unicode(c))
- don't forget about dates/currency/numeric formatting, text sorting, etc.
translation is isn't all there is about i18n (really, read that chapter).
Copy link to clipboard
Copied
Thanks PaulH, the forta book is very helpful
Copy link to clipboard
Copied
ahem, i'm the author of that chapter
Copy link to clipboard
Copied
ahem, i'm the author of that chapter
Hahaha! ... now that is funny
Find more inspiration, events, and resources on the new Adobe Community
Explore Now