Enhancement #1006

Define bootbox style and strings

Added by Blatti Yves over 4 years ago. Updated over 3 years ago.

Status:ClosedStart date:05/15/2015
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:CATALOG
Target version:4.4.0
Sponsor: Ergonomic impact:

Better strings (specially in french).
Comply with #924 for "risky actions" like delete (red buttons)

Functional impact:

none


Description

Bootbox confirm modals currently use default style and strings.
Two things can be improved:
- text: we can set the buttons texts. (Currently the default has strange translations in french : "D'accord")
- style: we can set some specific classes, like btn-danger for deletions.

History

#1 Updated by Blatti Yves over 4 years ago

Todo in catalog (remove nodes, etc)

#2 Updated by Blatti Yves over 4 years ago

  • Description updated (diff)
Notes:
  • Bootbox locales:
    Bootbox locales are very simple: 3 string only.
    If needed we can use addLocale method (that allows override of existing locales), and set it with esaySDI translated strings.
    bootbox.addLocale('fr' , {
                OK      : 'OK',
                CANCEL  : 'Annuler',
                CONFIRM : 'Confirmer'
            });
    
  • When we need custom text on buttons (but standard classes) :
    bootbox.confirm('Est-tu vraiment sûr??', 'Annuler', 'Ouais, super sûr de moi!', function(e){alert('plop')});
    
  • For custom classes, I think we have to make a custom dialog :
    bootbox.dialog("Voulez-vous supprimer ?",
    [{
        "label" : "Annuler" 
    
    }, {
        "label" : "Supprimer",
        "class" : "btn-danger",
        "callback": function() {
            alert('now delete !');
        }
    }]);
    

#3 Updated by Van Hoecke Hélène about 4 years ago

  • Status changed from Request For Comments to Accepted
  • Assignee changed from Technical Committee to Blatti Yves

#4 Updated by Blatti Yves over 3 years ago

  • Status changed from Accepted to Affected

Add overrides in core lang file as all libs are in core.
Proposed values:
de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"}
en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"Confirm"}
fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"Confirmer"}

#5 Updated by Blatti Yves over 3 years ago

  • Status changed from Affected to Resolved
  • % Done changed from 0 to 100

rev. 9464
Todo : crowdin done

#6 Updated by Blatti Yves over 3 years ago

  • Status changed from Resolved to To merge

#7 Updated by Blatti Yves over 3 years ago

  • Assignee changed from Blatti Yves to Van Hoecke Hélène

#8 Updated by Van Hoecke Hélène over 3 years ago

  • Status changed from To merge to Closed
  • Target version set to 4.4.0

#9 Updated by Van Hoecke Hélène over 3 years ago

  • Assignee deleted (Van Hoecke Hélène )

Also available in: Atom PDF