Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
Prerequisites:

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


Installation:

  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)


Usage:

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

  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!
  NIL

  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’
  #<HASH-TABLE :TEST EQUAL :COUNT 2 {A84F021}>

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


  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!")))

Contributors:

  Leslie P. Polzer <polzer@stardawn.org> (base)
  Vilson Vieira <vilson@void.cc> (string extractor)

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.