aboutsummaryrefslogtreecommitdiffstats
path: root/library/sprintf.js/src/angular-sprintf.js
diff options
context:
space:
mode:
authorKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2015-05-14 10:39:56 +0200
committerKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2015-05-14 10:39:56 +0200
commitc62e75d789787cc21438dde943885dda9f0ae387 (patch)
tree78eacb1017da745432628d94769093790917a41d /library/sprintf.js/src/angular-sprintf.js
parentf866a42a42b9e12756353f5bb39a0f31a64bb26a (diff)
downloadvolse-hubzilla-c62e75d789787cc21438dde943885dda9f0ae387.tar.gz
volse-hubzilla-c62e75d789787cc21438dde943885dda9f0ae387.tar.bz2
volse-hubzilla-c62e75d789787cc21438dde943885dda9f0ae387.zip
Add sprintf.js v1.0.2.
This script provides sprintf() for JavaScript. It can be used for example for translating strings used in JavaScript with variables. It is licensed under BSD-3-Clause and can be found on GitHub: https://github.com/alexei/sprintf.js
Diffstat (limited to 'library/sprintf.js/src/angular-sprintf.js')
-rw-r--r--library/sprintf.js/src/angular-sprintf.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/library/sprintf.js/src/angular-sprintf.js b/library/sprintf.js/src/angular-sprintf.js
new file mode 100644
index 000000000..9c69123be
--- /dev/null
+++ b/library/sprintf.js/src/angular-sprintf.js
@@ -0,0 +1,18 @@
+angular.
+ module("sprintf", []).
+ filter("sprintf", function() {
+ return function() {
+ return sprintf.apply(null, arguments)
+ }
+ }).
+ filter("fmt", ["$filter", function($filter) {
+ return $filter("sprintf")
+ }]).
+ filter("vsprintf", function() {
+ return function(format, argv) {
+ return vsprintf(format, argv)
+ }
+ }).
+ filter("vfmt", ["$filter", function($filter) {
+ return $filter("vsprintf")
+ }])