Commit f54e985b authored by David Byers's avatar David Byers
Browse files

Språksaker

parent 18a56710
Sun Jul 6 14:41:16 1997 David Byers <davby@ida.liu.se>
* language.el (lyskom-set-language): Byt bara om sprket finns.
* option-edit.el (lyskom-language-widget): Anvnd
lyskom-language-name
* english-strings.el (lyskom-language-codes): Ny variabel.
* vars.el.in (lyskom-language-codes): Ny variabel.
* startup.el (kom-start-anew): Skriv ut sprkbyte.
* swedish-strings.el (lyskom-message): Lade till
changing-language-to
* english-strings.el (lyskom-en-edit-mode-map): Rttade ngra
referenser till lyskom-sv-edit-mode-map
(kom-mercial): Stt p ett vettigt stt.
(lyskom-message): Lade till changing-language-to
* vars.el.in (kom-default-language): Default r nil
(lyskom-language): Dito
* language.el (lyskom-define-language): Stt kom-default-language
och lyskom-language om de inte r satta.
Thu Jul 3 11:13:03 1997 David Byers <davby@ida.liu.se>
* vars.el.in (lyskom-text-buttons): Bytte ut NUL mot \000 och ^L
mot \014
* english-strings.el (lyskom-customize-map): Definierad en
engelsk version.
* compatibility.el: Inga meddelanden.
(lyskom-compatibility-definition): Dito. Fixade en bug.
......
......@@ -1658,8 +1658,7 @@ membership info."
"Change the current language in LysKOM"
(interactive)
(let* ((completion-ignore-case t)
(table (mapcar (function (lambda (x) (cons (elt x 1) (elt x 0))))
lyskom-languages))
(table (lyskom-available-language-list))
(language (completing-read
(lyskom-get-string 'which-language)
table
......@@ -1667,3 +1666,29 @@ membership info."
t)))
(when (lyskom-string-assoc language table)
(lyskom-set-language (cdr (lyskom-string-assoc language table))))))
(defun lyskom-available-language-list ()
"Return an alist suitable for completing read of available language names."
(let ((tmp
(mapcar
(function
(lambda (el)
(cons (car el) (eval (cdr el)))))
(get 'lyskom-language-codes 'lyskom-language-var)))
(codes (mapcar 'car lyskom-languages))
(result nil))
(mapcar
(function
(lambda (code)
(mapcar
(function
(lambda (codelist)
(when (assq code codelist)
(setq result
(cons (cons (cdr (assq code codelist)) code)
result)))))
tmp)))
codes)
result))
......@@ -122,6 +122,7 @@ is saved before executing FORMS and restored when FORMS have finished."
(if (not (fboundp 'def-kom-var))
(defmacro def-kom-var (name value &rest args)
"Define a variable with name NAME and initial value VALUE.
Remaining args, ARGS may be
......@@ -219,6 +220,7 @@ local-hook A hook variable that is made local in LysKOM buffers."
buffer-local
minibuffer
widget-spec)))))))
)
(put 'def-kom-var 'edebug-form-spec
'(&define name form &rest sexp))
......
......@@ -57,7 +57,7 @@
;;; Set the keymap for lyskom-edit-mode
(defvar lyskom-sv-edit-prefix nil)
(defvar lyskom-en-edit-prefix nil)
(if lyskom-en-edit-mode-map
nil
......@@ -69,10 +69,10 @@
(define-key lyskom-en-edit-mode-map "\C-c?" 'lyskom-help)
(define-key lyskom-en-edit-mode-map "\C-cr" 'lyskom-en-edit-review-prefix)
(define-key lyskom-en-edit-mode-map "\C-ci" 'lyskom-en-edit-insert-prefix)
(define-key lyskom-sv-edit-mode-map (lyskom-keys [mouse-2]) 'kom-button-click)
(define-key lyskom-sv-edit-mode-map (lyskom-keys [down-mouse-3]) 'kom-popup-menu)
(define-key lyskom-sv-edit-mode-map [mouse-3] 'kom-mouse-null)
(define-key lyskom-sv-edit-mode-map "\C-c*" 'kom-button-press)
(define-key lyskom-en-edit-mode-map (lyskom-keys [mouse-2]) 'kom-button-click)
(define-key lyskom-en-edit-mode-map (lyskom-keys [down-mouse-3]) 'kom-popup-menu)
(define-key lyskom-en-edit-mode-map [mouse-3] 'kom-mouse-null)
(define-key lyskom-en-edit-mode-map "\C-c*" 'kom-button-press)
(define-key lyskom-en-edit-mode-map "\C-c\C-c" 'kom-edit-send)
(define-key lyskom-en-edit-mode-map "\C-ck" 'kom-edit-quit)
(define-key lyskom-en-edit-mode-map "\C-c\C-k" 'kom-edit-quit)
......@@ -1010,6 +1010,8 @@ On since %#8s%#9s")
(which-language . "ndra sprk till: ")
(send-formatted . "Skicka in som formatterad text? ")
(changing-language-to . "Changing to %#1s.\n")
(language-not-loaded . "%#1s is unavailable.\n")
))
......@@ -1141,6 +1143,148 @@ On since %#8s%#9s")
(kom-change-language . "Change language")
))
(lyskom-language-var lyskom-language-codes en
'((aa . "Afar")
(ab . "Abkhazian")
(af . "Afrikaans")
(am . "Amharic")
(ar . "Arabic")
(as . "Assamese")
(ay . "Aymara")
(az . "Azerbaijani")
(ba . "Bashkir")
(be . "Byelorussian")
(bg . "Bulgarian")
(bh . "Bihari")
(bi . "Bislama")
(bn . "Bengali")
(bo . "Tibetan")
(br . "Breton")
(ca . "Catalan")
(co . "Corsican")
(cs . "Czech")
(cy . "Welsh")
(da . "Danish")
(de . "German")
(dz . "Bhutani")
(el . "Greek")
(en . "English")
(eo . "Esperanto")
(es . "Spanish")
(et . "Estonian")
(eu . "Basque")
(fa . "Persian")
(fi . "Finnish")
(fj . "Fiji")
(fo . "Faroese")
(fr . "French")
(fy . "Frisian")
(ga . "Irish")
(gd . "Scots Gaelic")
(gl . "Galician")
(gn . "Guarani")
(gu . "Gujarati")
(ha . "Hausa")
(he . "Hebrew")
(hi . "Hindi")
(hr . "Croatian")
(hu . "Hungarian")
(hy . "Armenian")
(ia . "Interlingua")
(id . "Indonesian")
(ie . "Interlingue")
(ik . "Inupiak")
(is . "Icelandic")
(it . "Italian")
(iu . "Inuktitut")
(ja . "Japanese")
(jw . "Javanese")
(ka . "Georgian")
(kk . "Kazakh")
(kl . "Greenlandic")
(km . "Cambodian")
(kn . "Kannada")
(ko . "Korean")
(ks . "Kashmiri")
(ku . "Kurdish")
(ky . "Kirghiz")
(la . "Latin")
(ln . "Lingala")
(lo . "Laotian")
(lt . "Lithuanian")
(lv . "Latvian Lettish")
(mg . "Malagasy")
(mi . "Maori")
(mk . "Macedonian")
(ml . "Malayalam")
(mn . "Mongolian")
(mo . "Moldavian")
(mr . "Marathi")
(ms . "Malay")
(mt . "Maltese")
(my . "Burmese")
(na . "Nauru")
(ne . "Nepali")
(nl . "Dutch")
(no . "Norwegian")
(oc . "Occitan")
(om . "Oromo")
(or . "Oriya")
(pa . "Pundjabi")
(pl . "Polish")
(ps . "Pashto")
(pt . "Portuguese")
(qu . "Quechua")
(rm . "Rhaeto-Romance")
(rn . "Kirundi")
(ro . "Romanian")
(ru . "Russian")
(rw . "Kiyarwanda")
(sa . "Sanskrit")
(sd . "Sindhi")
(sg . "Sangho")
(sh . "Serbo-Croatian")
(si . "Singhalese")
(sk . "Slovak")
(sl . "Slovenian")
(sm . "Samoan")
(sn . "Shona")
(so . "Somali")
(sq . "Albanian")
(sr . "Serbian")
(ss . "Siswati")
(st . "Sesotho")
(su . "Sudanese")
(sv . "Swedish")
(sw . "Swahili")
(ta . "Tamil")
(te . "Telugu")
(tg . "Tajik")
(th . "Thai")
(ti . "Tigrinya")
(tk . "Turkmen")
(tl . "Tagalog")
(tn . "Setswana")
(to . "Tonga")
(tr . "Turkish")
(ts . "Tsonga")
(tt . "Tatar")
(tw . "Twi")
(ug . "Uigur")
(uk . "Ukrainian")
(ur . "Urdu")
(uz . "Uzbek")
(vi . "Vietnamese")
(vo . "Volapk")
(wo . "Wolof")
(xh . "Xhosa")
(yi . "Yiddish")
(yo . "Yorouba")
(za . "Zhuang")
(zh . "Chinese")
(zu . "Zulu")
(-- . "Unknown language (%#1s)")))
(lyskom-language-strings lyskom-menu en
'((lyskom . "LysKOM")
(read . "Read")
......@@ -1442,7 +1586,7 @@ On since %#8s%#9s")
;;;;
(defvar lyskom-en-customize-map nil)
(lyskom-language-keymap lyskom-edit-mode-map en lyskom-en-edit-mode-map)
(lyskom-language-keymap lyskom-customize-map en lyskom-en-customize-map)
(if lyskom-en-customize-map
......@@ -2262,7 +2406,8 @@ Lists etc. : [INS] Add a line [DEL] Remove a line [*] Modify")
;; Placed here because this must NOT be evaluated before
;; kom-tell-phrases is defined:
(lyskom-language-var kom-mercial en (car (cdr (assoc 'kom-tell-wait kom-tell-phrases))))
(lyskom-language-var kom-mercial en (lyskom-get-string 'kom-tell-wait
'kom-tell-phrases))
(lyskom-language-strings lyskom-error-texts en
......
......@@ -209,15 +209,32 @@ if 'lyskom-menu is not found."
(let ((match (assq language lyskom-languages)))
(if match
(setcdr match names)
(setq lyskom-languages (cons (cons language names) lyskom-languages)))))
(setq lyskom-languages (cons (cons language names) lyskom-languages))))
(unless (and lyskom-language
kom-default-language)
(setq lyskom-language language)
(setq kom-default-language language)))
(defun lyskom-language-name (language)
"Return the name of language code LANGUAGE in the current language."
(save-excursion
(when lyskom-buffer (set-buffer lyskom-buffer))
(or (cdr (assq language lyskom-language-codes))
(lyskom-format (cdr (assq '-- lyskom-language-codes))
(symbol-name language)))))
(defun lyskom-set-language (language)
"Set the current language to LANGUAGE."
(setq lyskom-language language)
(lyskom-set-language-vars language)
(lyskom-set-language-keymaps language)
(lyskom-update-menus)
(lyskom-update-prompt t))
(cond ((not (assq language lyskom-languages))
(lyskom-format-insert-before-prompt 'language-not-loaded
(lyskom-language-name language))
nil)
(t (setq lyskom-language language)
(lyskom-set-language-vars language)
(lyskom-set-language-keymaps language)
(lyskom-update-menus)
(lyskom-update-prompt t)
t)))
(provide 'lyskom-language)
......
......@@ -607,7 +607,7 @@ customize buffer but do not save them to the server."
(function
(lambda (x)
(list 'item
':tag (elt x 1)
':tag (lyskom-language-name (car x))
':format "%t"
':value (elt x 0))))
lyskom-languages)))
......
......@@ -368,8 +368,11 @@ variable documentation for lyskom-server-feautres"
(run-hooks 'kom-login-hook))
(error (lyskom-format-insert-before-prompt
'error-in-login-hook (format "%s" err))))
(unless (eq lyskom-language kom-default-language)
(lyskom-set-language kom-default-language)))
(unless (eq lyskom-language kom-default-language)
(when (lyskom-set-language kom-default-language)
(lyskom-format-insert-before-prompt
'changing-language-to
(lyskom-language-name kom-default-language)))))
(defun lyskom-refetch ()
......
No preview for this file type
No preview for this file type
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment