cl-i18n /

Filename Size Date modified Message
262 B
245 B
1.8 KB
3.6 KB
1.2 KB
626 B
852 B
1.1 KB
175 B
803 B
1.7 KB

  - ASDF
  - cl-ppcre if you want to be able to extract translatable strings


  Start your Lisp image in the cl-i18n directory
  or add the latter to your ASDF registry:

    (push #p"/path/to/cl-i18n/" asdf:*central-registry*)

  Don't forget the terminating slash.

  Then load with (asdf:oos 'asdf:load-op 'cl-i18n)


  CL-USER> (asdf:oos 'asdf:load-op 'cl-i18n)

  CL-USER> (format t "The application encountered an error: ~A!~%" #!"Success")
  WARNING: cl-i18n: translation table not initialized! Call “load-language” first.
  WARNING: cl-i18n: no translation for "Success" defined!
  The application encountered an error: Success!

  CL-USER> (cl-i18n:load-language "klingon") ; load translations
                                             ; from ./klingon.lisp

  ; this file might look like this:
  ; (
  ;   "Greetings" -> "nuqneH"
  ;   "Success"   -> "Qapla’"
  ; )
  ; The -> can be an arbitrary unquoted symbol name.
  ; Whitespace including newlines doesn't matter except in strings.

  inserted Greetings:nuqneH
  inserted Success:Qapla’

  CL-USER> (format t "The application encountered an error: ~A!~%" #!"Success")
  The application encountered an error: Qapla’!

  Extracting translatable strings:

    (cl-i18n:generate-i18n-file "gowron-monologue.lisp" "klingon.lisp")

  Will extract all #! strings from gowron-monologue.lisp and set up a basic
  translation resource in klingon.lisp.

  To make it work with CL-WHO, use the “str” directive, as in

    (with-html-output *out*
      (:p (str #!"Blood and honour!")))


  Leslie P. Polzer <> (base)
  Vilson Vieira <> (string extractor)