svetlyak40wt
When I try it like this: ``` CL-USER> (let* ((loc (fluent:parse (uiop:read-file-string "~/tmp/test-fluent/ru-RU/app.flt"))) (ctx (fluent:localisation->fluent loc :ru-RU))) (fluent:resolve ctx "apples-for" :apple-count 1 :person-count 1)) ``` I'm getting an error that symbol `fluent:localisation->fluent` is not external. When I using the symbol `fluent::localisation->fluent` ``` CL-USER> (let* ((loc (fluent:parse (uiop:read-file-string "~/tmp/test-fluent/ru-RU/app.flt"))) (ctx (fluent::localisation->fluent loc :ru-RU))) (fluent:resolve ctx "apples-for" :apple-count 1 :person-count 1)) ``` then I get this error: ``` The value #S(FLUENT::LOCALISATIONS :TERMS #<HASH-TABLE :TEST EQUAL :COUNT 0 {7005CCBA53}> :LINES #<HASH-TABLE :TEST EQUAL :COUNT 1 {7005CCC273}>) is not of type HASH-TABLE when setting slot FLUENT::LOCS of structure FLUENT:FLUENT [Condition of type TYPE-ERROR] ``` I propose the following change to the README: Create test localization files in the directory `/tmp/i18n/`. File `/tmp/i18n/en-US/app.ftl` with this content: ``` apples-and-leafs = { $apple-count -> [one] {$apple-count} apple *[many] {$apple-count} apples } and { $leaf-count -> [one] {$leaf-count} leaf. *[many] {$leaf-count} leafs. } ``` and file `/tmp/i18n/ru-RU/app.ftl` with this content: ``` apples-and-leafs = { $apple-count -> [one] {$apple-count} яблоко [few] {$apple-count} яблока *[many] {$apple-count} яблок } и { $leaf-count -> [one] {$leaf-count} лист. [few] {$leaf-count} листа. *[many] {$leaf-count} листов. } ``` Then in the REPL do: ``` CL-USER> (let ((ctx (fluent:fluent (fluent:read-all-localisations #P"/tmp/i18n/") :locale :ru-ru))) (fluent:resolve ctx "apples-and-leafs" :apple-count 21 :leaf-count 33)) "21 яблоко и 33 листа." CL-USER> (let ((ctx (fluent:fluent (fluent:read-all-localisations #P"/tmp/i18n/") :locale :en-us))) (fluent:resolve ctx "apples-and-leafs" :apple-count 21 :leaf-count 33)) "21 apples and 33 leafs." ```