You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and use l(Time.local, scope:date, format: :default). And compilation fails with
There was a problem expanding macro 'macro_139974350525760'
Code in macro 'embed'
1 | {{ run("slang/slang/process", "src/views/tournament/index.slang", "__kilt_io__") }}
^
Called macro defined in macro 'embed'
1 | {{ run("slang/slang/process", "src/views/tournament/index.slang", "__kilt_io__") }}
Which expanded to:
> 177 | __kilt_io__ << "<td"
> 178 | __kilt_io__ << ">"
> 179 | __kilt_io__ << HTML.escape((l(Time.local, scope: :date, format: :default)).to_s).to_s(__kilt_io__)
^
Error: no argument named 'scope'
Matches are:
- Amber::Controller::Helpers::I18n#l(*arg)
When i replace it with ::I18n.localize(Time.local, scope: :date, format: :default)
compilation is successful, but it uses locale "en" not "cs" (got [Missing translation : en#__formats__.date.formats.default] in view; and after filling it, correct "13. 02. 2020" is displayed).
When I use only l(Time.local), I got translated time in default format "Čt 13. únor 2020 08:56 +0100". Unfortunately using l(Time.local, format: :short) will end in same compilation error.
At same view file I have h2 = t("tournament.other") which IS translated into czech language nicely. (By the way t("tournament", count: 2) did not work either).
THE QUESTIONS:
How it can be done properly?
How can I get currently used locale in view ( ::I18n.config.locale => "en" ,Citrine::I18n.config.locale => compilation error`
The text was updated successfully, but these errors were encountered:
Hi,
I have trouble with localizing
Time
as date in view.According https://github.com/TechMagister/i18n.cr
it can be done by
scope
likeI18n.localize(Time.local, scope: :date, format: :long)
.I set up default language in
config/i18n.cr
asput into
src/locales/cs.yml
and use
l(Time.local, scope:date, format: :default)
. And compilation fails withWhen i replace it with
::I18n.localize(Time.local, scope: :date, format: :default)
compilation is successful, but it uses locale "en" not "cs" (got
[Missing translation : en#__formats__.date.formats.default]
in view; and after filling it, correct "13. 02. 2020" is displayed).When I use only
l(Time.local)
, I got translated time in default format "Čt 13. únor 2020 08:56 +0100". Unfortunately usingl(Time.local, format: :short)
will end in same compilation error.At same view file I have
h2 = t("tournament.other")
which IS translated into czech language nicely. (By the wayt("tournament", count: 2)
did not work either).THE QUESTIONS:
::I18n.config.locale => "en" ,
Citrine::I18n.config.locale => compilation error`The text was updated successfully, but these errors were encountered: