From 294d8ff76b892c31b4de7d5f6a8c7c177ed2f5ad Mon Sep 17 00:00:00 2001 From: Brenden Soares Date: Mon, 19 Sep 2022 23:02:51 -0700 Subject: [PATCH 1/2] Update Revel cmd install command --- tutorial/gettingstarted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorial/gettingstarted.md b/tutorial/gettingstarted.md index 083abb8..d1ff5e9 100644 --- a/tutorial/gettingstarted.md +++ b/tutorial/gettingstarted.md @@ -36,7 +36,7 @@ Git and Mercurial are required to allow `go get` to clone various dependencies. To get the Revel framework, run - go get github.com/revel/revel + go install github.com/revel/cmd/revel@latest This command does a couple of things: From a1617fbfa2a2b7937da17db7a4e1820517250747 Mon Sep 17 00:00:00 2001 From: crownedgrouse Date: Sat, 25 Mar 2023 11:40:30 +0100 Subject: [PATCH 2/2] Document timeago for i18n --- manual/templates-go.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manual/templates-go.md b/manual/templates-go.md index 5c7d1b5..4b00404 100644 --- a/manual/templates-go.md +++ b/manual/templates-go.md @@ -100,11 +100,17 @@ Assists in constructing a HTML checkbox `input` element, eg: Format a date according to the application's default [date](appconf.html#formatdate) and [datetime](appconf.html#formatdatetime) format. +`timeago` accept a second argument, either string or variable set in `ViewArgs` telling (ISO 639-1 code) as language to be used, otherwise use `i18n.default_language` config value, for preconfigured language : de, fr, ko, pt, sp, tr, zh and default en. +In last resort, internationalisation will apply on timeago english term, and missing translation will be displayed with `i18n.unknown_format` config value. + The example below assumes `dateArg := time.Now()`: {% capture ex %}{% raw %} {{date .MyDate}} {{datetime .MyDateTime}} +{{timeago .MyDateTime}} +{{timeago .MyDateTime "fr"}} +{{timeago .MyDateTime .lang}} {% endraw %}{% endcapture %} {% highlight htmldjango %}{{ex}}{% endhighlight %}