×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    103

    Question Question regarding multilanguage support at runtime in symbian

    Hi to all,
    Hope you all will be fine. I am working on application that switch language on run time when user selects language. I am following this link

    It is said that

    Third Step: And edit your LOC file as follows:
    Fourth Step: <AppName>aif.rss file should look like as follows to localize your application’s caption.
    In Third step there was no loc file in my project. So i created it in inc folder of carbide C++ project explorer. It looks like this

    Code:
     
    #ifndef LOCALIZATION_LOC_
    #define LOCALIZATION_LOC_
    
    //01 = (British) English
    #ifdef
    LANGUAGE_01
    #include
    "MTN_STK_Menu.l01"
    #endif
    //37 = Arabic
    #ifdef
    LANGUAGE_37
    #include
    "MTN_STK_Menu.l37"
    #endif
    
    
    #endif /* LOCALIZATION_LOC_ */
    Regarding fourth step there is no <AppName>aif.rss file in my project. Do i create it by my self ? Yes but there is <AppName>.rss file exist. Do these files are same ? Can i put fourth step code in my <AppName>.rss file or i should create <AppName>aif.rss file ? If i create <AppName>aif.rss file then please tell me in which folder i place it ?.

    Thank you.

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,173

    Re: Question regarding multilanguage support at runtime in symbian

    in Third step there was no loc file in my project. So i created it in inc folder of carbide C++ project explorer.
    Generally, .loc file is created in "data" folder as it can contain the string related data (resources). It can also be created in a folder named "loc" (e.g) under the project directory itself. To connect .loc file with .rss, just include the header file of .loc in your .rss

  3. #3
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    103

    Re: Question regarding multilanguage support at runtime in symbian

    Hi
    Good to hear you againThanks. Ok i move it to data folder. Actually i saw the localization example that comes with the SDK. In that example the loc file is created in the inc folder and there is also aif folder in which <AppName>aif.rss file is present. Actually I am confuse about the aif folder. May be it is about old days that you create aif folder but now may be trend is change and you place <AppName>aif.rss somewhere else. OK i do two things

    1. move loc file to data folder.
    2. Create aif folder and then create <AppName>aif.rss file in it.

    is it right to do? I mean by doing this am i following the standard Symbian convention?

    Thanks

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,173

    Re: Question regarding multilanguage support at runtime in symbian

    Frankly speaking, I don't know about any <AppName>aif.rss file types. Never seen them. So, can't tell you where they should be and how they should be created.

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: Question regarding multilanguage support at runtime in symbian

    Basically it does not matter where the loc files are, I often place them in include folder. anyway, just add the files in somewhere which path is included in the include paths. Then do add the language's in your mmp file as well. Then just compile (or clean before compiling).

    Then you should be having RXX files, where the XX is the language number, add these to your pkg file to get them to device.

    I have no clue whatsoever what that aif file could be, though pre-3rd edition there was aif files for icons, with 3rd ed onwards you would specify the icon & name in resources, thus if you want to have different ones for different languages, then also copy the registration resource language specific RXX files with your pkg, if not, then just use the R01 for default English one.

  6. #6
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    103

    Re: Question regarding multilanguage support at runtime in symbian

    Hi,
    I encountered a line in the link


    #if !defined(__WINS__) && !defined(__WINSCW__)
    // Device
    CompleteWithAppPath(resFileName);
    #else
    // Emulator
    resFileName.Insert(0, KEmulatorPath);
    #endif

    if (iOffset) iCoeEnv->DeleteResourceFile(iOffset);
    iOffset = iCoeEnv->AddResourceFileL(resFileName);
    }
    i think first time iOffset is false, because when i will call ChooseLanguage() i will pass it to either (01)English or (37)Arabic. beause if iOffset is true first time then what resource file it will try to remove? first time there is no resource file(Am i right?).

    The problem is i am having error at line below because i have no KEmulatorPath value

    Code:
    resFileName.Insert(0, KEmulatorPath);
    I want to ask what is the value of KEmeulatorPath? Can any one tell me what it will be like C:\S60\Devices...... ? where emulator resides after installing. It must be something like

    Code:
    _LIT(KEmulatorPath, "C:\devices\S60...");   // what is the path?
    Thanks

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,173

    Re: Question regarding multilanguage support at runtime in symbian

    I want to ask what is the value of KEmeulatorPath? Can any one tell me what it will be like C:\S60\Devices...... ? where emulator resides after installing. It must be something like
    KEmeulatorPath should be the path for your resource files (for emulator/ WINSCW build) on system. So, you can try for
    Code:
    _LIT(KEmulatorPath, "\\resource\\apps");

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Question regarding multilanguage support at runtime in symbian

    Note that the aif (Application Information File) is deprecated starting from S60 3rd edition. The registration resource replaces it. The article you are reading is obsolete, consider locating an other one.
    For a starter note that HelloWorldBasic in the SDK already supports multiple languages, you can check the mechanism there.

  9. #9
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    103

    Re: Question regarding multilanguage support at runtime in symbian

    I saw the HelloWorldBasic. But in the sample application the creator just created the .rls file instead of .r01 files like

    HelloWorldBasic_01.rls (new format)(header files)
    HelloWorldBasic_09.rls

    instead of
    HelloWorldBasic.l01 (older format)(simply text files)
    HelloWorldBasic.l09

    But when i run the HelloWorldBasic then in the emulator there is no language selection menu. Its just English. Where are the other languages in the application?

    Thanks

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Question regarding multilanguage support at runtime in symbian

    Neither the AIF-approach would do that.
    This approach is about installing multiple resource files on the device with .rxy extension where xy-s are the language codes, and then the device picks the language which is the "closest" to its current language. This approach is not about switching the language from code.

  11. #11
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    103

    Re: Question regarding multilanguage support at runtime in symbian

    Hi,
    Hmm it means if i follow this approach then it depends on the language of phone. If phone language is set to English then it picks the English resource file, and if i set other phone language then it will pich other language resource file. Is it?

    And if i want to do, that, in application user select language then i have to do it by my self. Just tell me is this possible? that in the application(at run time) at very first screen i give option to user to select language?

    What is in my mind is that suppose i have a list with two options. English and Arabic. Language selection is only for first time. User is not allowed to change language after selecting it once. When user select English then i will have to read all strings from file with English text, and if user select Arabic then i will have to read all strings from Arabic file.

    Like when user select Arabic then the instance of new view is created with a file pass to its constructor. And in the list where we create list items like

    Code:
    // construct listbox item array
    CDesCArray *itemList = new (ELeave) CDesCArrayFlat(3);
    TBuf<32> item;
    TInt idx=1;
    // append items to the listbox, incrementing numbering
    item.Format(KListItemFormat, idx, _L("first item"));
    itemList->AppendL(item); idx++;
    item.Format(KListItemFormat, idx, _L("another item"));
    itemList->AppendL(item); idx++;
    item.Format(KListItemFormat, idx, _L("last item"));
    itemList->AppendL(item); idx++;
    // set items and ownership
    list->Model()->SetItemTextArray(itemList);
    instead of using line

    Code:
    item.Format(KListItemFormat, idx, _L("first item"));
    replace it with something like this

    Code:
    item.Format(KListItemFormat, idx, get text from the appropriate file);
    and tell me one thing also that, can i do it with resource file. Like instead of making list dynamically i created it from resource file. And on selection of language i switch the file. Like if English is selected then English.rls is selected by framework and if Arabic is selected the Arabic.rls is selected by framework using #ifdef macros. Is it possible?

    If reading strings from file option is better then please provide some link that describes that how to read strings from file in Symbian.

    Thanks.

Similar Threads

  1. Question regarding Creating a selection listbox runtime
    By sbhavikb in forum Symbian User Interface
    Replies: 4
    Last Post: 2011-04-25, 08:19
  2. Beginner question regarding Web Runtime widgets
    By gautam.venkatakrishnan in forum Symbian
    Replies: 2
    Last Post: 2010-08-06, 19:20
  3. Problem choosing in Multilanguage at runtime
    By damodharan in forum Symbian
    Replies: 0
    Last Post: 2008-11-13, 07:12
  4. Replies: 0
    Last Post: 2006-06-24, 15:07

Posting Permissions

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