123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378 |
- describe "bootbox locales", ->
- beforeEach ->
- @setLocale = (locale) ->
- bootbox.setLocale locale
- d1 = bootbox.alert "foo"
- d2 = bootbox.confirm "foo", -> true
- @labels =
- ok: d1.find(".btn:first").text()
- cancel: d2.find(".btn:first").text()
- confirm: d2.find(".btn:last").text()
- describe "Invalid locale", ->
- beforeEach ->
- @setLocale "xx"
- it "shows the default OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the default CANCEL translation", ->
- expect(@labels.cancel).to.equal "Cancel"
- it "shows the default CONFIRM translation", ->
- expect(@labels.confirm).to.equal "OK"
- describe "English", ->
- beforeEach ->
- @setLocale "en"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Cancel"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "OK"
- describe "French", ->
- beforeEach ->
- @setLocale "fr"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Annuler"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "D'accord"
- describe "German", ->
- beforeEach ->
- @setLocale "de"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Abbrechen"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Akzeptieren"
- describe "Spanish", ->
- beforeEach ->
- @setLocale "es"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Cancelar"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Aceptar"
- describe "Portuguese", ->
- beforeEach ->
- @setLocale "br"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Cancelar"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Sim"
- describe "Dutch", ->
- beforeEach ->
- @setLocale "nl"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Annuleren"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Accepteren"
- describe "Russian", ->
- beforeEach ->
- @setLocale "ru"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Отмена"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Применить"
- describe "Indonesian", ->
- beforeEach ->
- @setLocale "id"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Batal"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "OK"
- describe "Italian", ->
- beforeEach ->
- @setLocale "it"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Annulla"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Conferma"
- describe "Polish", ->
- beforeEach ->
- @setLocale "pl"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Anuluj"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Potwierdź"
- describe "Danish", ->
- beforeEach ->
- @setLocale "da"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Annuller"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Accepter"
- describe "Chinese", ->
- describe "Taiwan", ->
- beforeEach ->
- @setLocale "zh_TW"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "取消"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "確認"
- describe "China", ->
- beforeEach ->
- @setLocale "zh_CN"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "取消"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "确认"
- describe "Norwegian", ->
- beforeEach ->
- @setLocale "no"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Avbryt"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "OK"
- describe "Swedish", ->
- beforeEach ->
- @setLocale "sv"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Avbryt"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "OK"
- describe "Latvian", ->
- beforeEach ->
- @setLocale "lv"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "Labi"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Atcelt"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Apstiprināt"
- describe "Lithuanian", ->
- beforeEach ->
- @setLocale "lt"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "Gerai"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Atšaukti"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Patvirtinti"
- describe "Turkish", ->
- beforeEach ->
- @setLocale "tr"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "Tamam"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "İptal"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Onayla"
- describe "Hebrew", ->
- beforeEach ->
- @setLocale "he"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "אישור"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "ביטול"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "אישור"
- describe "Greek", ->
- beforeEach ->
- @setLocale "el"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "Εντάξει"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Ακύρωση"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Επιβεβαίωση"
- describe "Japanese", ->
- beforeEach ->
- @setLocale "ja"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "キャンセル"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "確認"
- describe "Hungarian", ->
- beforeEach ->
- @setLocale "hu"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Mégsem"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Megerősít"
- describe "Croatian", ->
- beforeEach ->
- @setLocale "hr"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Odustani"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Potvrdi"
- describe "Bulgarian", ->
- beforeEach ->
- @setLocale "bg_BG"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "Ок"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Отказ"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Потвърждавам"
- describe "Thai", ->
- beforeEach ->
- @setLocale "th"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "ตกลง"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "ยกเลิก"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "ยืนยัน"
- describe "Persian", ->
- beforeEach ->
- @setLocale "fa"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "قبول"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "لغو"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "تایید"
- describe "Albanian", ->
- beforeEach ->
- @setLocale "sq"
- it "shows the correct OK translation", ->
- expect(@labels.ok).to.equal "OK"
- it "shows the correct CANCEL translation", ->
- expect(@labels.cancel).to.equal "Anulo"
- it "shows the correct CONFIRM translation", ->
- expect(@labels.confirm).to.equal "Prano"
|