Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > General > Best Practices

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-14-2008, 07:09 AM   #1
mowgliF
Registered User
 
Join Date: Feb 2008
Posts: 9
Default Strategy for Bilingual Flash site

Hi - I am working on a bilingual site for a client ( a wine producer in France...). It will be in English and French. Obviously, there will be several updates before the site goes live and probably quite a few as well after the site has gone live. I would like to avoid duplicating workload or having 2 versions (i.e 2swf's). In your experience, what is the best way to approach the challenge from a coding strategy viewpoint ?
Thanks
mowgliF is offline   Reply With Quote
Old 04-14-2008, 04:55 PM   #2
Assertnfailure
as[org].addListener(this)
 
Assertnfailure's Avatar
 
Join Date: Dec 2005
Location: LA, California
Posts: 838
Default

If you already know you aren't going to use two seperate swfs, then that pretty much only gives you one option (that I could think of), which is to pull xml from the server which provides all of the text for the swf, and you just pair the nodes to the different text fields.
Assertnfailure is offline   Reply With Quote
Old 05-16-2008, 09:01 AM   #3
Flash Gordon
rather be programming
 
Flash Gordon's Avatar
 
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
Default

That solution is obviously much more elegant, but if you wanted you could also have 2 of the same scene and just attach which ever language you wanted.
eg
ActionScript Code:
function languageFactory(type:String):SceneFactory {    var fac:Function;    switch(type)    {       case "en": fac = enFactory; break;       case "fr": fac = frFactory(); break;     }     return fac; } function enFactory(scene:int):void {    var scene:DisplayObject;    switch(scene)    {       case 0: scene = new HomeEn(); break;       case 1: scene = new ContactEn(); break;     }     return scene; } // var fac:Function = languageFactory("en"); addChild( fac(0) );
something along those lines....Where HomeEn and HomeFr could share the same super class or base class.

But anyway, do you know what are the different glyphs that are needed between EN and FR when embedding a font? Is there a master list somewhere?
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman
Flash Gordon is offline   Reply With Quote
Old 05-19-2008, 11:22 AM   #4
mowgliF
Registered User
 
Join Date: Feb 2008
Posts: 9
Default

FG - Thanks for this very elegant solution. I have already started the project though and decided to allow users to change the language mid-visit. So I went for a solution with a language var which is always checked before xml or html text is loaded. For the navigation, I use a simple function which reloads the navigation buttons whenever the language buttons are clicked on.
This is an OK solution which is not making the code so much heavier.
Thanks again
mowgliF is offline   Reply With Quote
Old 05-30-2008, 01:54 PM   #5
gd2000
Registered User
 
gd2000's Avatar
 
Join Date: Mar 2006
Posts: 18
Default

yup, xml and switch statements are good for this kind of thing

but note the difference in text size for those with restricted space... buttons etc.
gd2000 is offline   Reply With Quote
Old 05-30-2008, 05:26 PM   #6
Flash Gordon
rather be programming
 
Flash Gordon's Avatar
 
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
Default

Quote:
Originally Posted by Flash Gordon View Post
But anyway, do you know what are the different glyphs that are needed between EN and FR when embedding a font? Is there a master list somewhere?
-
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman
Flash Gordon is offline   Reply With Quote
Old 05-30-2008, 11:25 PM   #7
asf8
Senior Member
 
Join Date: Apr 2007
Posts: 3,223
Default

Quote:
Originally Posted by Flash Gordon View Post
But anyway, do you know what are the different glyphs that are needed between EN and FR when embedding a font? Is there a master list somewhere?
http://www.5etdemi.com/blog/archives...hars-in-flash/

Code:
<glyphRange name="French Characters " id="26" >
    <range min="0x0020" max ="0x0020" />
    <range min="0x00C0" max ="0x00C0" />
    <range min="0x00C2" max ="0x00C2" />
    <range min="0x00C4" max ="0x00C4" />
    <range min="0x00C6" max ="0x00CB" />
    <range min="0x00CE" max ="0x00CF" />
    <range min="0x00D4" max ="0x00D4" />
    <range min="0x00D6" max ="0x00D6" />
    <range min="0x00D9" max ="0x00D9" />
    <range min="0x00DB" max ="0x00DC" />
    <range min="0x00E0" max ="0x00E0" />
    <range min="0x00E2" max ="0x00E2" />
    <range min="0x00E4" max ="0x00E4" />
    <range min="0x00E6" max ="0x00EB" />
    <range min="0x00EE" max ="0x00EF" />
    <range min="0x00F4" max ="0x00F4" />
    <range min="0x00F6" max ="0x00F6" />
    <range min="0x00F9" max ="0x00F9" />
    <range min="0x00FB" max ="0x00FC" />
    <range min="0x0152" max ="0x0153" />
</glyphRange>
or maybe try to "Include these characters" when you embed.

Quote:
àâäùæçéèêëîï?ôöœùûüÜÛÙŒÔÏÎËÊÈÉßÇÆÄÂÀ
I am not French so maybe there are more ?
asf8 is offline   Reply With Quote
Old 05-31-2008, 12:44 AM   #8
Flash Gordon
rather be programming
 
Flash Gordon's Avatar
 
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
Default

Cool, but how does that relate the embedded button?


Which one of those do I have to use for what font? Like what glyphs do I need from French? How about Spanish? etc It would be great if there was a master list somewhere.

Thanks for your help

EDIT: http://livedocs.adobe.com/flash/9.0/...=00000894.html
on the right track now...cool But I'll be back with more questions shortly.
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman

Last edited by Flash Gordon; 05-31-2008 at 12:52 AM..
Flash Gordon is offline   Reply With Quote
Old 05-31-2008, 01:21 AM   #9
Flash Gordon
rather be programming
 
Flash Gordon's Avatar
 
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
Default

This is what I've been looking for:
http://tlt.its.psu.edu/suggestions/i...age/index.html
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman
Flash Gordon is offline   Reply With Quote
Old 06-01-2008, 02:39 PM   #10
asf8
Senior Member
 
Join Date: Apr 2007
Posts: 3,223
Default

Quote:
Originally Posted by Flash Gordon View Post
It would be great if there was a master list somewhere. Thanks for your help. EDIT: on the right track now...cool
Glad to help. I am trying to figure out this whole topic also ;-)

Quote:
Originally Posted by Flash Gordon View Post
This is what I've been looking for:
http://tlt.its.psu.edu/suggestions/i...age/index.html
Nice link Here are some more:

http://www.alanwood.net/unicode/ (under characters)
http://www.eki.ee/letter/
http://unicode.org/charts/

Also here is a COOL function for creating the XML needed for adding to the UnicodeTable.xml

Custom character-set embedding in Flash
http://www.psyked.co.uk/adobe/flash/...g-in-flash.htm

ActionScript Code:
var myString:String = " abcdABCD"; var nameOfFontSet:String = "abcdABCD Character Set" var fontSetID:Number = 50 generateCharSet(nameOfFontSet, fontSetID, myString); function generateCharSet(setName, setID, chars) {     var outputXML:String = "<glyphRange name=\""+setName+"\" id=\""+setID+"\">\n";     var numberOfChars:Number = chars.length;     for (var i:Number = 0; i<=numberOfChars-1; i++) {         var charCode:Number = chars.charCodeAt(i);         var hexCode:String = convertTo4DigitHexValue(charCode.toString(16));         outputXML += "\t<range min=\"0x"+hexCode+"\" max=\"0x"+hexCode+"\" />\n";     }     outputXML += "</glyphRange>";     trace("outputXML:\n"+outputXML);     XML_Output_txt.text = outputXML; } function convertTo4DigitHexValue(hexValue:String):String {     var hexLength:Number = hexValue.length;     var numberOfLeadingZerosRequired:Number = 4-hexLength;     for (var i:Number = 0; i<=numberOfLeadingZerosRequired-1; i++) {         hexValue = "0"+hexValue;     }     return hexValue; }

Outputs:

Code:
<glyphRange name="abcdABCD Character Set" id="50">
	<range min="0x0020" max="0x0020" />
	<range min="0x0061" max="0x0061" />
	<range min="0x0062" max="0x0062" />
	<range min="0x0063" max="0x0063" />
	<range min="0x0064" max="0x0064" />
	<range min="0x0041" max="0x0041" />
	<range min="0x0042" max="0x0042" />
	<range min="0x0043" max="0x0043" />
	<range min="0x0044" max="0x0044" />
</glyphRange>
Keep us posted with anything you discover or come up with regarding this subject!!
asf8 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
flash menu in php site.. alexz ActionScript 2.0 1 11-16-2005 01:47 PM
[Q] Do we need those forums??? CyanBlue General Chat 59 07-27-2004 12:13 PM
centering a flash site scwcca ActionScript 1.0 (and below) 22 07-09-2004 03:17 PM
Flash MX Developers Exam VitiminJ General Chat 34 05-05-2004 02:27 PM


All times are GMT. The time now is 12:43 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.