2 Replies Latest reply on Jan 21, 2007 1:54 PM by cheftimo

    Problems with Flex localized app

    cheftimo Level 2
      Hello all -

      I am in the planning phase of a new bilingual Flex site - it will work like this ColdFusion/HTML version of the proposed home page: http://www.coinonia.org/.

      My experience with compiled languages is limited to having created a few SWFs in the past using Flash, so I am still confused about compiler arguments, path issues and such. For practice, I am trying to create a sample localized application from the Flex Developer’s Guide: this is a very simple application that just contains one form – you can see it here: http://livedocs.macromedia.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context =LiveDocs_Book_Parts&file=l10n_076_3.html.

      In the FB2 project, I have the Resource Bundles (.properties files) in the same folder as LocalizedForm.mxml. The compiler does not find the resource keys.

      My questions:

      1. It looks like I am supposed to create a ‘locale’ directory: Where? How do I name it? What is its structure?

      2. Since Flex does not support dynamic retrieval of resources at run time, I have to create one SWF for each language/locale. The documentation shows how to compile these using an mxmlc command line. How would I do this in FB2? Two projects with different compiler args? That seems kind of MickeyMouse; there must be a better way.

      Any ideas/suggestions would be greatly appreciated.

      Carlos

      NOTE: I am posting this in both ‘Flex 2 General Discussion’ and ‘Flex Builder 2’ forums.
        • 1. Re: Problems with Flex localized app
          phi2265 Level 1
          im not sure i understand what you're trying to do, but you can load dynamic content at runtime. flex data services further supports data driven applications, you might want to look into that. i am actually developing a website for a hispanic newspaper, i've been planning on being able to switch languages.. i dont see why it would be a problem.

          my advice is just to get down and dirty with the code and see what you can come up with.. i havent found any restrictions to what i want to do yet.... flex is pretty amazing.
          • 2. Problems with Flex localized app
            cheftimo Level 2
            Hello, phi2265 et al –

            Sorry, perhaps I didn’t do a good job of explaining what I am looking for from this forum’s participants, so here are some additional comments:

            Yes, Flex allows you to load dynamic content at runtime – but not in the case of these Resource Bundles. This is copied from LiveDocs: The localization feature currently supports static inclusion of localized resources and not dynamic retrieval of resources at run time. -- You must create one SWF file for each locale.

            It looks like this applies, even if you are using Flex Data Services. phi2265, you might be in for a surprise. If you haven’t already, you might want to look at this whole section of LiveDocs: ‘Flex 2 Developer’s Guide > Customizing the User Interface > Localizing Flex Applications’.

            I suppose I could do my new site as a Flex/ColdFusion project, but I can see writing lots and lots of code and maybe things getting a little messy, so I am trying to find the way to have Flex deal directly with the Resource Bundles.

            The documentation tells you how to generate the SWFs for each locale using the mxmlc command line. I invested in FB2 precisely to avoid dealing with the command line, but I haven’t been able to figure out how to do this in FB – and that’s where I am looking for help; if anyone has any ideas on this, I am all ears (or eyes). I have been able to make FB generate the SWFs correctly, but by editing the app.mxml before compiling each one (or having one app.mxml file for each SWF). The Europeans have been creating multilingual sites at least since the 80s, but mostly by actually having a separate site/URL for each language (talk about high maintenance!); that is something I don't want to do.

            Yes, I agree “Flex is pretty amazing”, which is why I am putting in a lot of time to learn it. But, frankly, its implementation of I18N/L10N leaves a lot to be desired at this point.

            Anyway, I hope to hear from someone out there.

            phi2265: I would love to hear/see more about your Hispanic newspaper project; I hope you can share some of that. And just out of curiosity, you might want to check out this bilingual site I made recently: http://www.directoriocolombiano.com/ - if you see it, I would like to know what you think of the way switching languages works there.

            Regards to all,

            Carlos