RejectedSoftware Forums

Sign up

Pages: 1 2

Re: i18n

Currently only by using the undocumented diet_translate__ function:

input(type="text", placeholder=diet_translate__("my_i18n_placeholder"))

I can't seem to get this to work.

Alternatively, a syntax using & would be an option:

input(type="text", placeholder&="my_i18n_placeholder")

This would definitely be my preference :)

On top of that, there should definitely also be an annotation, such as
@ignore, in the future. I'm just not sure so far if it is a good idea
to reuse vibe.data.serialization.ignore or if it's better to define a
new vibe.web.common.noRoute attribute. Probably the latter...

Well, it's currently @path(<route>), so @noPath should do. (or perhaps
an empty @path/@path(null)?)

Re: i18n

On Fri, 26 Sep 2014 03:07:36 +0200, Lemonfiend wrote:

Currently only by using the undocumented diet_translate__ function:

input(type="text", placeholder=diet_translate__("my_i18n_placeholder"))

I can't seem to get this to work.

It needs a @translationContext defined, but otherwise it seems to work for me. Try putting this into the "web-i18n" example.

Alternatively, a syntax using & would be an option:

input(type="text", placeholder&="my_i18n_placeholder")

This would definitely be my preference :)

I've opened a ticket: #844

On top of that, there should definitely also be an annotation, such as
@ignore, in the future. I'm just not sure so far if it is a good idea
to reuse vibe.data.serialization.ignore or if it's better to define a
new vibe.web.common.noRoute attribute. Probably the latter...

Well, it's currently @path(<route>), so @noPath should do. (or perhaps
an empty @path/@path(null)?)

The problem is that the path is just one part of a route. The full route consists of a path, a HTTP method, and a callback method, so that route @noRoute would, I think, be the more precise term.

Re: i18n

On Fri 26 Sep 09:23, Sönke Ludwig wrote:

On Fri, 26 Sep 2014 03:07:36 +0200, Lemonfiend wrote:

Currently only by using the undocumented diet_translate__ function:

input(type="text", placeholder=diet_translate__("my_i18n_placeholder"))

I can't seem to get this to work.

It needs a @translationContext defined, but otherwise it seems to work for me. Try putting this into the "web-i18n" example.

Yep you're right, it does work. I must've been trying it on an
un-@translationContext'd webinterface.. now I feel silly :)

Thanks!

Re: i18n

Am 26.09.2014 09:40, schrieb Lemonfiend:

On Fri 26 Sep 09:23, Sönke Ludwig wrote:

On Fri, 26 Sep 2014 03:07:36 +0200, Lemonfiend wrote:

Currently only by using the undocumented diet_translate__ function:

input(type="text", placeholder=diet_translate__("my_i18n_placeholder"))

I can't seem to get this to work.

It needs a @translationContext defined, but otherwise it seems to
work for me. Try putting this into the "web-i18n" example.

Yep you're right, it does work. I must've been trying it on an
un-@translationContext'd webinterface.. now I feel silly :)

Thanks!

Completely forgot that there is also vibe.web.web.trWeb(). That one
also works for strings that are not compile-time constant.

Pages: 1 2