[Owncloud] JavaScript translation function with interpolation support

Thomas Tanghus thomas at tanghus.net
Mon Sep 17 10:32:55 UTC 2012

On Monday 17 September 2012 10:18 Thomas Müller wrote:
> Hi,
> maybe I'm not looking at the correct file [0], but we have no support for
> string interpolation on the translation function in JavaScript - right?
> Any specific reason for this?
> Who can implement it?

I have used [1] for variable interpolation in a micro-templating jquery 
plugin in my process of rewriting the Contacts UI. Not extending the String
prototype as in the example, but as a separate function. 
I guess something like that could be used, maybe by simply adding an 
optional variable map/object argument to the t() function.

[1] http://stackoverflow.com/questions/1408289/best-way-to-do-variable-interpolation-in-javascript#answer-1408373

Med venlig hilsen / Best Regards

Thomas Tanghus

More information about the Owncloud mailing list