This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-17
Channels
- # beginners (106)
- # cider (20)
- # cljs-dev (4)
- # cljsrn (1)
- # clojure (65)
- # clojure-austin (7)
- # clojure-canada (2)
- # clojure-russia (1)
- # clojure-spec (28)
- # clojure-uk (2)
- # clojurebridge (1)
- # clojurescript (32)
- # datomic (8)
- # docs (1)
- # emacs (27)
- # events (7)
- # fulcro (13)
- # garden (1)
- # hoplon (3)
- # leiningen (4)
- # luminus (2)
- # off-topic (32)
- # onyx (4)
- # parinfer (6)
- # pedestal (16)
- # re-frame (7)
- # reagent (5)
- # shadow-cljs (8)
- # spacemacs (2)
- # uncomplicate (4)
- # vim (3)
Hello ! Did some of you encountered an error while :import-ing goog classes with v2.1.16? I got this error :
The required namespace "goog.i18n.DateTimeSymbols_en" is not available, it was required by "cli/web/services/app/translations.cljs".
The ns looks like :
(ns cli.web.services.app.translations
(:require [bf.algo.generic :as a]) ;; an internal lib
(:import [goog.i18n DateTimeSymbols DateTimeSymbols_en]))
could it be similar as with goog.string format, where you have to both import it and require it?
@ggaillard I think you are supposed to use the :compiler-options {:closure-defines {goog.LOCALE "en"}}
and that will pull in the correct symbols
that being said there is a bug since DateTimeSymbols-en
works although its DateTimeSymbols_en
see https://github.com/google/closure-library/blob/master/closure/goog/i18n/datetimesymbols.js#L3425
changed it so both versions are now available (just in case). should still rely on goog.LOCALE though
@thheller You are 100% right about setting goog.LOCALE to the desired locale instead of importing DateTimeSymbols_* for so many reasons (as cited in the link you provided). But in this case I was trying to build a component that switch date formats explicitly at runtime. So I was kind of poking the thing with a stick, to see what I could get out of it. Thank you for the workaround 🙂