1. #1
    Sencha User
    Join Date
    Dec 2008
    Location
    Sofia
    Posts
    140
    Vote Rating
    3
    mx_starter is on a distinguished road

      0  

    Default Unanswered: Advice needed - how to implement a multi-language form-field

    Unanswered: Advice needed - how to implement a multi-language form-field


    Hello,
    i have a simple form which will serve as a CMS tool for updating a site.
    The site itself is maintained in 2 languages - lets say - ENG and FR.

    So - a user has to create an article, whose title must be entered in English and French.
    Which means - the appropriate field (or fields) must keep / submit two different values.

    My plan is to create 2 different fields (one for every languge) and to hide/show the appropriate one dynamically - for example - on click on a "language flag" icon.

    But before digging within, i want to ask you guys for an advice - which is the best way to accomplish this?

    Maybe - there is some user extension already?

    Thanks in advance!

  2. #2
    Sencha - Community Support Team friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
    friend has a spectacular aura about friend has a spectacular aura about

      0  

  3. #3
    Sencha User
    Join Date
    Dec 2008
    Location
    Sofia
    Posts
    140
    Vote Rating
    3
    mx_starter is on a distinguished road

      0  

    Default


    Well, i expected such an answer
    However, this is not i asked for. May be my bad English is the reason.

    Anyway, managed to reach similar effect using custom triggerfield

  4. #4
    Sencha - Community Support Team friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
    friend has a spectacular aura about friend has a spectacular aura about

      0  

    Default


    Your language skills are excellent; I just wanted to make sure you'd seen the default blurb about localization...

    :]

  5. #5
    Sencha User
    Join Date
    Dec 2008
    Location
    Sofia
    Posts
    140
    Vote Rating
    3
    mx_starter is on a distinguished road

      0  

    Default


    Well - i managed to implement this field:
    Attachment 41118

    using code like this:

    Code:
    Ext.define('Ext.ux.FlagTrigger', {
        extend: 'Ext.form.field.Trigger',
        alias: 'widget.sbgTrigger-Flag',
        triggerCls: 'sbg-flagTrigger-EN',
       
        onTriggerClick: function() {
             this.triggerCls = 'sbg-flagTrigger-FR';
        },
    as you can see - this is a trigger field with custom triggerCls.

    Is it possible the triggerCls config property to be changed dynamically once the component is rendered?
    The line in blue above does nothing for me - the console shows the property is changed, but the icon itself remains the same, the flag is not switched
    Attached Images

Thread Participants: 1