From bcdb23bdba829615acdc9f5dcb98468d8bec73eb Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Thu, 15 Nov 2018 21:44:13 -0800 Subject: [PATCH] chore(all): prepare release 3.0.0-beta.3 --- dist/amd/aurelia-i18n-loader.js | 121 -- dist/amd/aurelia-i18n-loader.js.map | 1 - dist/amd/aurelia-i18n.js | 1411 ++++++++++++++- dist/amd/aurelia-i18n.js.map | 1 - dist/amd/defaultTranslations/relative.time.js | 498 ------ .../defaultTranslations/relative.time.js.map | 1 - dist/amd/df/df-binding-behavior.js | 31 - dist/amd/df/df-binding-behavior.js.map | 1 - dist/amd/df/df-value-converter.js | 28 - dist/amd/df/df-value-converter.js.map | 1 - dist/amd/df/index.js | 10 - dist/amd/df/index.js.map | 1 - dist/amd/i18n.js | 311 ---- dist/amd/i18n.js.map | 1 - dist/amd/nf/index.js | 10 - dist/amd/nf/index.js.map | 1 - dist/amd/nf/nf-binding-behavior.js | 31 - dist/amd/nf/nf-binding-behavior.js.map | 1 - dist/amd/nf/nf-value-converter.js | 25 - dist/amd/nf/nf-value-converter.js.map | 1 - dist/amd/relativeTime.js | 92 - dist/amd/relativeTime.js.map | 1 - dist/amd/rt/index.js | 10 - dist/amd/rt/index.js.map | 1 - dist/amd/rt/rt-binding-behavior.js | 31 - dist/amd/rt/rt-binding-behavior.js.map | 1 - dist/amd/rt/rt-value-converter.js | 24 - dist/amd/rt/rt-value-converter.js.map | 1 - dist/amd/t/index.js | 12 - dist/amd/t/index.js.map | 1 - dist/amd/t/t-binding-behavior.js | 31 - dist/amd/t/t-binding-behavior.js.map | 1 - dist/amd/t/t-custom-attribute.js | 60 - dist/amd/t/t-custom-attribute.js.map | 1 - dist/amd/t/t-params-custom-attribute.js | 31 - dist/amd/t/t-params-custom-attribute.js.map | 1 - dist/amd/t/t-value-converter.js | 16 - dist/amd/t/t-value-converter.js.map | 1 - dist/amd/utils.js | 63 - dist/amd/utils.js.map | 1 - dist/aurelia-i18n.d.ts | 175 ++ dist/commonjs/aurelia-i18n-loader.js | 119 -- dist/commonjs/aurelia-i18n-loader.js.map | 1 - dist/commonjs/aurelia-i18n.js | 1429 +++++++++++++++- dist/commonjs/aurelia-i18n.js.map | 1 - .../defaultTranslations/relative.time.js | 496 ------ .../defaultTranslations/relative.time.js.map | 1 - dist/commonjs/df/df-binding-behavior.js | 31 - dist/commonjs/df/df-binding-behavior.js.map | 1 - dist/commonjs/df/df-value-converter.js | 28 - dist/commonjs/df/df-value-converter.js.map | 1 - dist/commonjs/df/index.js | 8 - dist/commonjs/df/index.js.map | 1 - dist/commonjs/i18n.js | 313 ---- dist/commonjs/i18n.js.map | 1 - dist/commonjs/nf/index.js | 8 - dist/commonjs/nf/index.js.map | 1 - dist/commonjs/nf/nf-binding-behavior.js | 31 - dist/commonjs/nf/nf-binding-behavior.js.map | 1 - dist/commonjs/nf/nf-value-converter.js | 24 - dist/commonjs/nf/nf-value-converter.js.map | 1 - dist/commonjs/relativeTime.js | 93 - dist/commonjs/relativeTime.js.map | 1 - dist/commonjs/rt/index.js | 8 - dist/commonjs/rt/index.js.map | 1 - dist/commonjs/rt/rt-binding-behavior.js | 31 - dist/commonjs/rt/rt-binding-behavior.js.map | 1 - dist/commonjs/rt/rt-value-converter.js | 23 - dist/commonjs/rt/rt-value-converter.js.map | 1 - dist/commonjs/t/index.js | 10 - dist/commonjs/t/index.js.map | 1 - dist/commonjs/t/t-binding-behavior.js | 31 - dist/commonjs/t/t-binding-behavior.js.map | 1 - dist/commonjs/t/t-custom-attribute.js | 65 - dist/commonjs/t/t-custom-attribute.js.map | 1 - dist/commonjs/t/t-params-custom-attribute.js | 32 - .../t/t-params-custom-attribute.js.map | 1 - dist/commonjs/t/t-value-converter.js | 15 - dist/commonjs/t/t-value-converter.js.map | 1 - dist/commonjs/utils.js | 62 - dist/commonjs/utils.js.map | 1 - dist/es2015/aurelia-i18n-loader.js | 117 -- dist/es2015/aurelia-i18n-loader.js.map | 1 - dist/es2015/aurelia-i18n.js | 1351 ++++++++++++++- dist/es2015/aurelia-i18n.js.map | 1 - .../defaultTranslations/relative.time.js | 494 ------ .../defaultTranslations/relative.time.js.map | 1 - dist/es2015/df/df-binding-behavior.js | 29 - dist/es2015/df/df-binding-behavior.js.map | 1 - dist/es2015/df/df-value-converter.js | 26 - dist/es2015/df/df-value-converter.js.map | 1 - dist/es2015/df/index.js | 3 - dist/es2015/df/index.js.map | 1 - dist/es2015/i18n.js | 311 ---- dist/es2015/i18n.js.map | 1 - dist/es2015/nf/index.js | 3 - dist/es2015/nf/index.js.map | 1 - dist/es2015/nf/nf-binding-behavior.js | 29 - dist/es2015/nf/nf-binding-behavior.js.map | 1 - dist/es2015/nf/nf-value-converter.js | 22 - dist/es2015/nf/nf-value-converter.js.map | 1 - dist/es2015/relativeTime.js | 91 - dist/es2015/relativeTime.js.map | 1 - dist/es2015/rt/index.js | 3 - dist/es2015/rt/index.js.map | 1 - dist/es2015/rt/rt-binding-behavior.js | 29 - dist/es2015/rt/rt-binding-behavior.js.map | 1 - dist/es2015/rt/rt-value-converter.js | 21 - dist/es2015/rt/rt-value-converter.js.map | 1 - dist/es2015/t/index.js | 5 - dist/es2015/t/index.js.map | 1 - dist/es2015/t/t-binding-behavior.js | 29 - dist/es2015/t/t-binding-behavior.js.map | 1 - dist/es2015/t/t-custom-attribute.js | 63 - dist/es2015/t/t-custom-attribute.js.map | 1 - dist/es2015/t/t-params-custom-attribute.js | 30 - .../es2015/t/t-params-custom-attribute.js.map | 1 - dist/es2015/t/t-value-converter.js | 13 - dist/es2015/t/t-value-converter.js.map | 1 - dist/es2015/utils.js | 60 - dist/es2015/utils.js.map | 1 - dist/es2017/aurelia-i18n-loader.js | 66 - dist/es2017/aurelia-i18n-loader.js.map | 1 - dist/es2017/aurelia-i18n.js | 1322 +++++++++++++- dist/es2017/aurelia-i18n.js.map | 1 - .../defaultTranslations/relative.time.js | 494 ------ .../defaultTranslations/relative.time.js.map | 1 - dist/es2017/df/df-binding-behavior.js | 27 - dist/es2017/df/df-binding-behavior.js.map | 1 - dist/es2017/df/df-value-converter.js | 24 - dist/es2017/df/df-value-converter.js.map | 1 - dist/es2017/df/index.js | 3 - dist/es2017/df/index.js.map | 1 - dist/es2017/i18n.js | 271 --- dist/es2017/i18n.js.map | 1 - dist/es2017/nf/index.js | 3 - dist/es2017/nf/index.js.map | 1 - dist/es2017/nf/nf-binding-behavior.js | 27 - dist/es2017/nf/nf-binding-behavior.js.map | 1 - dist/es2017/nf/nf-value-converter.js | 20 - dist/es2017/nf/nf-value-converter.js.map | 1 - dist/es2017/relativeTime.js | 88 - dist/es2017/relativeTime.js.map | 1 - dist/es2017/rt/index.js | 3 - dist/es2017/rt/index.js.map | 1 - dist/es2017/rt/rt-binding-behavior.js | 27 - dist/es2017/rt/rt-binding-behavior.js.map | 1 - dist/es2017/rt/rt-value-converter.js | 19 - dist/es2017/rt/rt-value-converter.js.map | 1 - dist/es2017/t/index.js | 5 - dist/es2017/t/index.js.map | 1 - dist/es2017/t/t-binding-behavior.js | 27 - dist/es2017/t/t-binding-behavior.js.map | 1 - dist/es2017/t/t-custom-attribute.js | 60 - dist/es2017/t/t-custom-attribute.js.map | 1 - dist/es2017/t/t-params-custom-attribute.js | 28 - .../es2017/t/t-params-custom-attribute.js.map | 1 - dist/es2017/t/t-value-converter.js | 11 - dist/es2017/t/t-value-converter.js.map | 1 - dist/es2017/utils.js | 57 - dist/es2017/utils.js.map | 1 - dist/native-modules/aurelia-i18n-loader.js | 117 -- .../native-modules/aurelia-i18n-loader.js.map | 1 - dist/native-modules/aurelia-i18n.js | 1397 ++++++++++++++- dist/native-modules/aurelia-i18n.js.map | 1 - .../defaultTranslations/relative.time.js | 494 ------ .../defaultTranslations/relative.time.js.map | 1 - dist/native-modules/df/df-binding-behavior.js | 29 - .../df/df-binding-behavior.js.map | 1 - dist/native-modules/df/df-value-converter.js | 26 - .../df/df-value-converter.js.map | 1 - dist/native-modules/df/index.js | 3 - dist/native-modules/df/index.js.map | 1 - dist/native-modules/i18n.js | 311 ---- dist/native-modules/i18n.js.map | 1 - dist/native-modules/nf/index.js | 3 - dist/native-modules/nf/index.js.map | 1 - dist/native-modules/nf/nf-binding-behavior.js | 29 - .../nf/nf-binding-behavior.js.map | 1 - dist/native-modules/nf/nf-value-converter.js | 22 - .../nf/nf-value-converter.js.map | 1 - dist/native-modules/relativeTime.js | 91 - dist/native-modules/relativeTime.js.map | 1 - dist/native-modules/rt/index.js | 3 - dist/native-modules/rt/index.js.map | 1 - dist/native-modules/rt/rt-binding-behavior.js | 29 - .../rt/rt-binding-behavior.js.map | 1 - dist/native-modules/rt/rt-value-converter.js | 21 - .../rt/rt-value-converter.js.map | 1 - dist/native-modules/t/index.js | 5 - dist/native-modules/t/index.js.map | 1 - dist/native-modules/t/t-binding-behavior.js | 29 - .../t/t-binding-behavior.js.map | 1 - dist/native-modules/t/t-custom-attribute.js | 63 - .../t/t-custom-attribute.js.map | 1 - .../t/t-params-custom-attribute.js | 30 - .../t/t-params-custom-attribute.js.map | 1 - dist/native-modules/t/t-value-converter.js | 13 - .../native-modules/t/t-value-converter.js.map | 1 - dist/native-modules/utils.js | 60 - dist/native-modules/utils.js.map | 1 - dist/system/aurelia-i18n-loader.js | 127 -- dist/system/aurelia-i18n-loader.js.map | 1 - dist/system/aurelia-i18n.js | 1517 +++++++++++++++-- dist/system/aurelia-i18n.js.map | 1 - .../defaultTranslations/relative.time.js | 503 ------ .../defaultTranslations/relative.time.js.map | 1 - dist/system/df/df-binding-behavior.js | 44 - dist/system/df/df-binding-behavior.js.map | 1 - dist/system/df/df-value-converter.js | 41 - dist/system/df/df-value-converter.js.map | 1 - dist/system/df/index.js | 24 - dist/system/df/index.js.map | 1 - dist/system/i18n.js | 330 ---- dist/system/i18n.js.map | 1 - dist/system/nf/index.js | 24 - dist/system/nf/index.js.map | 1 - dist/system/nf/nf-binding-behavior.js | 44 - dist/system/nf/nf-binding-behavior.js.map | 1 - dist/system/nf/nf-value-converter.js | 35 - dist/system/nf/nf-value-converter.js.map | 1 - dist/system/relativeTime.js | 108 -- dist/system/relativeTime.js.map | 1 - dist/system/rt/index.js | 24 - dist/system/rt/index.js.map | 1 - dist/system/rt/rt-binding-behavior.js | 44 - dist/system/rt/rt-binding-behavior.js.map | 1 - dist/system/rt/rt-value-converter.js | 34 - dist/system/rt/rt-value-converter.js.map | 1 - dist/system/t/index.js | 30 - dist/system/t/index.js.map | 1 - dist/system/t/t-binding-behavior.js | 44 - dist/system/t/t-binding-behavior.js.map | 1 - dist/system/t/t-custom-attribute.js | 88 - dist/system/t/t-custom-attribute.js.map | 1 - dist/system/t/t-params-custom-attribute.js | 47 - .../system/t/t-params-custom-attribute.js.map | 1 - dist/system/t/t-value-converter.js | 26 - dist/system/t/t-value-converter.js.map | 1 - dist/system/utils.js | 73 - dist/system/utils.js.map | 1 - dist/typings/aurelia-i18n-loader.d.ts | 22 - dist/typings/aurelia-i18n.d.ts | 10 - .../defaultTranslations/relative.time.d.ts | 4 - dist/typings/df/df-binding-behavior.d.ts | 8 - dist/typings/df/df-value-converter.d.ts | 7 - dist/typings/df/index.d.ts | 2 - dist/typings/i18n.d.ts | 46 - dist/typings/nf/index.d.ts | 2 - dist/typings/nf/nf-binding-behavior.d.ts | 8 - dist/typings/nf/nf-value-converter.d.ts | 7 - dist/typings/relativeTime.d.ts | 15 - dist/typings/rt/index.d.ts | 2 - dist/typings/rt/rt-binding-behavior.d.ts | 8 - dist/typings/rt/rt-value-converter.d.ts | 7 - dist/typings/t/index.d.ts | 4 - dist/typings/t/t-binding-behavior.d.ts | 8 - dist/typings/t/t-custom-attribute.d.ts | 24 - dist/typings/t/t-params-custom-attribute.d.ts | 11 - dist/typings/t/t-value-converter.d.ts | 8 - dist/typings/utils.d.ts | 10 - doc/CHANGELOG.md | 14 + doc/api.json | 1 - package-lock.json | 11 +- package.json | 7 +- 265 files changed, 8306 insertions(+), 9231 deletions(-) delete mode 100644 dist/amd/aurelia-i18n-loader.js delete mode 100644 dist/amd/aurelia-i18n-loader.js.map delete mode 100644 dist/amd/aurelia-i18n.js.map delete mode 100644 dist/amd/defaultTranslations/relative.time.js delete mode 100644 dist/amd/defaultTranslations/relative.time.js.map delete mode 100644 dist/amd/df/df-binding-behavior.js delete mode 100644 dist/amd/df/df-binding-behavior.js.map delete mode 100644 dist/amd/df/df-value-converter.js delete mode 100644 dist/amd/df/df-value-converter.js.map delete mode 100644 dist/amd/df/index.js delete mode 100644 dist/amd/df/index.js.map delete mode 100644 dist/amd/i18n.js delete mode 100644 dist/amd/i18n.js.map delete mode 100644 dist/amd/nf/index.js delete mode 100644 dist/amd/nf/index.js.map delete mode 100644 dist/amd/nf/nf-binding-behavior.js delete mode 100644 dist/amd/nf/nf-binding-behavior.js.map delete mode 100644 dist/amd/nf/nf-value-converter.js delete mode 100644 dist/amd/nf/nf-value-converter.js.map delete mode 100644 dist/amd/relativeTime.js delete mode 100644 dist/amd/relativeTime.js.map delete mode 100644 dist/amd/rt/index.js delete mode 100644 dist/amd/rt/index.js.map delete mode 100644 dist/amd/rt/rt-binding-behavior.js delete mode 100644 dist/amd/rt/rt-binding-behavior.js.map delete mode 100644 dist/amd/rt/rt-value-converter.js delete mode 100644 dist/amd/rt/rt-value-converter.js.map delete mode 100644 dist/amd/t/index.js delete mode 100644 dist/amd/t/index.js.map delete mode 100644 dist/amd/t/t-binding-behavior.js delete mode 100644 dist/amd/t/t-binding-behavior.js.map delete mode 100644 dist/amd/t/t-custom-attribute.js delete mode 100644 dist/amd/t/t-custom-attribute.js.map delete mode 100644 dist/amd/t/t-params-custom-attribute.js delete mode 100644 dist/amd/t/t-params-custom-attribute.js.map delete mode 100644 dist/amd/t/t-value-converter.js delete mode 100644 dist/amd/t/t-value-converter.js.map delete mode 100644 dist/amd/utils.js delete mode 100644 dist/amd/utils.js.map create mode 100644 dist/aurelia-i18n.d.ts delete mode 100644 dist/commonjs/aurelia-i18n-loader.js delete mode 100644 dist/commonjs/aurelia-i18n-loader.js.map delete mode 100644 dist/commonjs/aurelia-i18n.js.map delete mode 100644 dist/commonjs/defaultTranslations/relative.time.js delete mode 100644 dist/commonjs/defaultTranslations/relative.time.js.map delete mode 100644 dist/commonjs/df/df-binding-behavior.js delete mode 100644 dist/commonjs/df/df-binding-behavior.js.map delete mode 100644 dist/commonjs/df/df-value-converter.js delete mode 100644 dist/commonjs/df/df-value-converter.js.map delete mode 100644 dist/commonjs/df/index.js delete mode 100644 dist/commonjs/df/index.js.map delete mode 100644 dist/commonjs/i18n.js delete mode 100644 dist/commonjs/i18n.js.map delete mode 100644 dist/commonjs/nf/index.js delete mode 100644 dist/commonjs/nf/index.js.map delete mode 100644 dist/commonjs/nf/nf-binding-behavior.js delete mode 100644 dist/commonjs/nf/nf-binding-behavior.js.map delete mode 100644 dist/commonjs/nf/nf-value-converter.js delete mode 100644 dist/commonjs/nf/nf-value-converter.js.map delete mode 100644 dist/commonjs/relativeTime.js delete mode 100644 dist/commonjs/relativeTime.js.map delete mode 100644 dist/commonjs/rt/index.js delete mode 100644 dist/commonjs/rt/index.js.map delete mode 100644 dist/commonjs/rt/rt-binding-behavior.js delete mode 100644 dist/commonjs/rt/rt-binding-behavior.js.map delete mode 100644 dist/commonjs/rt/rt-value-converter.js delete mode 100644 dist/commonjs/rt/rt-value-converter.js.map delete mode 100644 dist/commonjs/t/index.js delete mode 100644 dist/commonjs/t/index.js.map delete mode 100644 dist/commonjs/t/t-binding-behavior.js delete mode 100644 dist/commonjs/t/t-binding-behavior.js.map delete mode 100644 dist/commonjs/t/t-custom-attribute.js delete mode 100644 dist/commonjs/t/t-custom-attribute.js.map delete mode 100644 dist/commonjs/t/t-params-custom-attribute.js delete mode 100644 dist/commonjs/t/t-params-custom-attribute.js.map delete mode 100644 dist/commonjs/t/t-value-converter.js delete mode 100644 dist/commonjs/t/t-value-converter.js.map delete mode 100644 dist/commonjs/utils.js delete mode 100644 dist/commonjs/utils.js.map delete mode 100644 dist/es2015/aurelia-i18n-loader.js delete mode 100644 dist/es2015/aurelia-i18n-loader.js.map delete mode 100644 dist/es2015/aurelia-i18n.js.map delete mode 100644 dist/es2015/defaultTranslations/relative.time.js delete mode 100644 dist/es2015/defaultTranslations/relative.time.js.map delete mode 100644 dist/es2015/df/df-binding-behavior.js delete mode 100644 dist/es2015/df/df-binding-behavior.js.map delete mode 100644 dist/es2015/df/df-value-converter.js delete mode 100644 dist/es2015/df/df-value-converter.js.map delete mode 100644 dist/es2015/df/index.js delete mode 100644 dist/es2015/df/index.js.map delete mode 100644 dist/es2015/i18n.js delete mode 100644 dist/es2015/i18n.js.map delete mode 100644 dist/es2015/nf/index.js delete mode 100644 dist/es2015/nf/index.js.map delete mode 100644 dist/es2015/nf/nf-binding-behavior.js delete mode 100644 dist/es2015/nf/nf-binding-behavior.js.map delete mode 100644 dist/es2015/nf/nf-value-converter.js delete mode 100644 dist/es2015/nf/nf-value-converter.js.map delete mode 100644 dist/es2015/relativeTime.js delete mode 100644 dist/es2015/relativeTime.js.map delete mode 100644 dist/es2015/rt/index.js delete mode 100644 dist/es2015/rt/index.js.map delete mode 100644 dist/es2015/rt/rt-binding-behavior.js delete mode 100644 dist/es2015/rt/rt-binding-behavior.js.map delete mode 100644 dist/es2015/rt/rt-value-converter.js delete mode 100644 dist/es2015/rt/rt-value-converter.js.map delete mode 100644 dist/es2015/t/index.js delete mode 100644 dist/es2015/t/index.js.map delete mode 100644 dist/es2015/t/t-binding-behavior.js delete mode 100644 dist/es2015/t/t-binding-behavior.js.map delete mode 100644 dist/es2015/t/t-custom-attribute.js delete mode 100644 dist/es2015/t/t-custom-attribute.js.map delete mode 100644 dist/es2015/t/t-params-custom-attribute.js delete mode 100644 dist/es2015/t/t-params-custom-attribute.js.map delete mode 100644 dist/es2015/t/t-value-converter.js delete mode 100644 dist/es2015/t/t-value-converter.js.map delete mode 100644 dist/es2015/utils.js delete mode 100644 dist/es2015/utils.js.map delete mode 100644 dist/es2017/aurelia-i18n-loader.js delete mode 100644 dist/es2017/aurelia-i18n-loader.js.map delete mode 100644 dist/es2017/aurelia-i18n.js.map delete mode 100644 dist/es2017/defaultTranslations/relative.time.js delete mode 100644 dist/es2017/defaultTranslations/relative.time.js.map delete mode 100644 dist/es2017/df/df-binding-behavior.js delete mode 100644 dist/es2017/df/df-binding-behavior.js.map delete mode 100644 dist/es2017/df/df-value-converter.js delete mode 100644 dist/es2017/df/df-value-converter.js.map delete mode 100644 dist/es2017/df/index.js delete mode 100644 dist/es2017/df/index.js.map delete mode 100644 dist/es2017/i18n.js delete mode 100644 dist/es2017/i18n.js.map delete mode 100644 dist/es2017/nf/index.js delete mode 100644 dist/es2017/nf/index.js.map delete mode 100644 dist/es2017/nf/nf-binding-behavior.js delete mode 100644 dist/es2017/nf/nf-binding-behavior.js.map delete mode 100644 dist/es2017/nf/nf-value-converter.js delete mode 100644 dist/es2017/nf/nf-value-converter.js.map delete mode 100644 dist/es2017/relativeTime.js delete mode 100644 dist/es2017/relativeTime.js.map delete mode 100644 dist/es2017/rt/index.js delete mode 100644 dist/es2017/rt/index.js.map delete mode 100644 dist/es2017/rt/rt-binding-behavior.js delete mode 100644 dist/es2017/rt/rt-binding-behavior.js.map delete mode 100644 dist/es2017/rt/rt-value-converter.js delete mode 100644 dist/es2017/rt/rt-value-converter.js.map delete mode 100644 dist/es2017/t/index.js delete mode 100644 dist/es2017/t/index.js.map delete mode 100644 dist/es2017/t/t-binding-behavior.js delete mode 100644 dist/es2017/t/t-binding-behavior.js.map delete mode 100644 dist/es2017/t/t-custom-attribute.js delete mode 100644 dist/es2017/t/t-custom-attribute.js.map delete mode 100644 dist/es2017/t/t-params-custom-attribute.js delete mode 100644 dist/es2017/t/t-params-custom-attribute.js.map delete mode 100644 dist/es2017/t/t-value-converter.js delete mode 100644 dist/es2017/t/t-value-converter.js.map delete mode 100644 dist/es2017/utils.js delete mode 100644 dist/es2017/utils.js.map delete mode 100644 dist/native-modules/aurelia-i18n-loader.js delete mode 100644 dist/native-modules/aurelia-i18n-loader.js.map delete mode 100644 dist/native-modules/aurelia-i18n.js.map delete mode 100644 dist/native-modules/defaultTranslations/relative.time.js delete mode 100644 dist/native-modules/defaultTranslations/relative.time.js.map delete mode 100644 dist/native-modules/df/df-binding-behavior.js delete mode 100644 dist/native-modules/df/df-binding-behavior.js.map delete mode 100644 dist/native-modules/df/df-value-converter.js delete mode 100644 dist/native-modules/df/df-value-converter.js.map delete mode 100644 dist/native-modules/df/index.js delete mode 100644 dist/native-modules/df/index.js.map delete mode 100644 dist/native-modules/i18n.js delete mode 100644 dist/native-modules/i18n.js.map delete mode 100644 dist/native-modules/nf/index.js delete mode 100644 dist/native-modules/nf/index.js.map delete mode 100644 dist/native-modules/nf/nf-binding-behavior.js delete mode 100644 dist/native-modules/nf/nf-binding-behavior.js.map delete mode 100644 dist/native-modules/nf/nf-value-converter.js delete mode 100644 dist/native-modules/nf/nf-value-converter.js.map delete mode 100644 dist/native-modules/relativeTime.js delete mode 100644 dist/native-modules/relativeTime.js.map delete mode 100644 dist/native-modules/rt/index.js delete mode 100644 dist/native-modules/rt/index.js.map delete mode 100644 dist/native-modules/rt/rt-binding-behavior.js delete mode 100644 dist/native-modules/rt/rt-binding-behavior.js.map delete mode 100644 dist/native-modules/rt/rt-value-converter.js delete mode 100644 dist/native-modules/rt/rt-value-converter.js.map delete mode 100644 dist/native-modules/t/index.js delete mode 100644 dist/native-modules/t/index.js.map delete mode 100644 dist/native-modules/t/t-binding-behavior.js delete mode 100644 dist/native-modules/t/t-binding-behavior.js.map delete mode 100644 dist/native-modules/t/t-custom-attribute.js delete mode 100644 dist/native-modules/t/t-custom-attribute.js.map delete mode 100644 dist/native-modules/t/t-params-custom-attribute.js delete mode 100644 dist/native-modules/t/t-params-custom-attribute.js.map delete mode 100644 dist/native-modules/t/t-value-converter.js delete mode 100644 dist/native-modules/t/t-value-converter.js.map delete mode 100644 dist/native-modules/utils.js delete mode 100644 dist/native-modules/utils.js.map delete mode 100644 dist/system/aurelia-i18n-loader.js delete mode 100644 dist/system/aurelia-i18n-loader.js.map delete mode 100644 dist/system/aurelia-i18n.js.map delete mode 100644 dist/system/defaultTranslations/relative.time.js delete mode 100644 dist/system/defaultTranslations/relative.time.js.map delete mode 100644 dist/system/df/df-binding-behavior.js delete mode 100644 dist/system/df/df-binding-behavior.js.map delete mode 100644 dist/system/df/df-value-converter.js delete mode 100644 dist/system/df/df-value-converter.js.map delete mode 100644 dist/system/df/index.js delete mode 100644 dist/system/df/index.js.map delete mode 100644 dist/system/i18n.js delete mode 100644 dist/system/i18n.js.map delete mode 100644 dist/system/nf/index.js delete mode 100644 dist/system/nf/index.js.map delete mode 100644 dist/system/nf/nf-binding-behavior.js delete mode 100644 dist/system/nf/nf-binding-behavior.js.map delete mode 100644 dist/system/nf/nf-value-converter.js delete mode 100644 dist/system/nf/nf-value-converter.js.map delete mode 100644 dist/system/relativeTime.js delete mode 100644 dist/system/relativeTime.js.map delete mode 100644 dist/system/rt/index.js delete mode 100644 dist/system/rt/index.js.map delete mode 100644 dist/system/rt/rt-binding-behavior.js delete mode 100644 dist/system/rt/rt-binding-behavior.js.map delete mode 100644 dist/system/rt/rt-value-converter.js delete mode 100644 dist/system/rt/rt-value-converter.js.map delete mode 100644 dist/system/t/index.js delete mode 100644 dist/system/t/index.js.map delete mode 100644 dist/system/t/t-binding-behavior.js delete mode 100644 dist/system/t/t-binding-behavior.js.map delete mode 100644 dist/system/t/t-custom-attribute.js delete mode 100644 dist/system/t/t-custom-attribute.js.map delete mode 100644 dist/system/t/t-params-custom-attribute.js delete mode 100644 dist/system/t/t-params-custom-attribute.js.map delete mode 100644 dist/system/t/t-value-converter.js delete mode 100644 dist/system/t/t-value-converter.js.map delete mode 100644 dist/system/utils.js delete mode 100644 dist/system/utils.js.map delete mode 100644 dist/typings/aurelia-i18n-loader.d.ts delete mode 100644 dist/typings/aurelia-i18n.d.ts delete mode 100644 dist/typings/defaultTranslations/relative.time.d.ts delete mode 100644 dist/typings/df/df-binding-behavior.d.ts delete mode 100644 dist/typings/df/df-value-converter.d.ts delete mode 100644 dist/typings/df/index.d.ts delete mode 100644 dist/typings/i18n.d.ts delete mode 100644 dist/typings/nf/index.d.ts delete mode 100644 dist/typings/nf/nf-binding-behavior.d.ts delete mode 100644 dist/typings/nf/nf-value-converter.d.ts delete mode 100644 dist/typings/relativeTime.d.ts delete mode 100644 dist/typings/rt/index.d.ts delete mode 100644 dist/typings/rt/rt-binding-behavior.d.ts delete mode 100644 dist/typings/rt/rt-value-converter.d.ts delete mode 100644 dist/typings/t/index.d.ts delete mode 100644 dist/typings/t/t-binding-behavior.d.ts delete mode 100644 dist/typings/t/t-custom-attribute.d.ts delete mode 100644 dist/typings/t/t-params-custom-attribute.d.ts delete mode 100644 dist/typings/t/t-value-converter.d.ts delete mode 100644 dist/typings/utils.d.ts delete mode 100644 doc/api.json diff --git a/dist/amd/aurelia-i18n-loader.js b/dist/amd/aurelia-i18n-loader.js deleted file mode 100644 index 83d53100..00000000 --- a/dist/amd/aurelia-i18n-loader.js +++ /dev/null @@ -1,121 +0,0 @@ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var Backend = /** @class */ (function () { - function Backend(services, options) { - if (options === void 0) { options = {}; } - this.services = services; - this.options = options; - this.type = "backend"; - this.init(services, options); - } - Backend.with = function (loader) { - this.loader = loader; - return this; - }; - Backend.prototype.init = function (services, options) { - if (options === void 0) { options = {}; } - this.services = services; - this.options = Object.assign({}, { - loadPath: "/locales/{{lng}}/{{ns}}.json", - addPath: "locales/add/{{lng}}/{{ns}}", - allowMultiLoading: false, - parse: JSON.parse - }, options); - }; - Backend.prototype.readMulti = function (languages, namespaces, callback) { - var loadPath = this.options.loadPath; - if (typeof this.options.loadPath === "function") { - loadPath = this.options.loadPath(languages, namespaces); - } - var url = this.services - .interpolator - .interpolate(loadPath, { lng: languages.join("+"), ns: namespaces.join("+") }); - this.loadUrl(url, callback); - }; - Backend.prototype.read = function (language, namespace, callback) { - var loadPath = this.options.loadPath; - if (typeof this.options.loadPath === "function") { - loadPath = this.options.loadPath([language], [namespace]); - } - var url = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }); - this.loadUrl(url, callback); - }; - Backend.prototype.loadUrl = function (url, callback) { - return __awaiter(this, void 0, void 0, function () { - var response, ret, err, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 2, , 3]); - return [4 /*yield*/, Backend.loader.loadText(url)]; - case 1: - response = _b.sent(); - ret = void 0; - err = void 0; - try { - ret = (response instanceof Object) ? response : this.options.parse(response, url); - } - catch (e) { - err = "failed parsing " + url + " to json"; - } - if (err) { - return [2 /*return*/, callback(err, false)]; - } - callback(null, ret); - return [3 /*break*/, 3]; - case 2: - _a = _b.sent(); - callback("failed loading " + url, false /* no retry */); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); - }; - // tslint:disable-next-line:variable-name - Backend.prototype.create = function (_languages, _namespace, _key, _fallbackValue) { - // not supported - }; - Backend.type = "backend"; - return Backend; - }()); - exports.Backend = Backend; - exports.default = Backend; -}); -//# sourceMappingURL=aurelia-i18n-loader.js.map \ No newline at end of file diff --git a/dist/amd/aurelia-i18n-loader.js.map b/dist/amd/aurelia-i18n-loader.js.map deleted file mode 100644 index 19c1e9eb..00000000 --- a/dist/amd/aurelia-i18n-loader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aurelia-i18n-loader.js","sourceRoot":"","sources":["../../src/aurelia-i18n-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmBA;QAWE,iBAAmB,QAAa,EAAS,OAAmC;YAAnC,wBAAA,EAAA,YAAmC;YAAzD,aAAQ,GAAR,QAAQ,CAAK;YAAS,YAAO,GAAP,OAAO,CAA4B;YAFrE,SAAI,GAAW,SAAS,CAAC;YAG9B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC/B,CAAC;QARa,YAAI,GAAlB,UAAmB,MAAc;YAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;YACrB,OAAO,IAAI,CAAC;QACd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3296a..e01348e8 100644 --- a/dist/amd/aurelia-i18n.js +++ b/dist/amd/aurelia-i18n.js @@ -1,50 +1,1364 @@ -define(["require", "exports", "aurelia-event-aggregator", "aurelia-templating", "aurelia-templating-resources", "aurelia-pal", "./i18n", "./i18n", "./relativeTime", "./aurelia-i18n-loader", "./df", "./nf", "./rt", "./t"], function (require, exports, aurelia_event_aggregator_1, aurelia_templating_1, aurelia_templating_resources_1, aurelia_pal_1, i18n_1, i18n_2, relativeTime_1, aurelia_i18n_loader_1, df_1, nf_1, rt_1, t_1) { - "use strict"; - function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +define('aurelia-i18n', ['exports', 'i18next', 'aurelia-logging', 'aurelia-dependency-injection', 'aurelia-templating', 'aurelia-metadata', 'aurelia-pal', 'aurelia-framework', 'aurelia-templating-resources', 'aurelia-event-aggregator', 'aurelia-binding'], function (exports, i18next, LogManager, aureliaDependencyInjection, aureliaTemplating, aureliaMetadata, aureliaPal, aureliaFramework, aureliaTemplatingResources, aureliaEventAggregator, aureliaBinding) { 'use strict'; + + i18next = i18next && i18next.hasOwnProperty('default') ? i18next['default'] : i18next; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + + function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } } - Object.defineProperty(exports, "__esModule", { value: true }); - __export(i18n_2); - __export(relativeTime_1); - __export(aurelia_i18n_loader_1); - exports.DfValueConverter = df_1.DfValueConverter; - exports.DfBindingBehavior = df_1.DfBindingBehavior; - exports.NfValueConverter = nf_1.NfValueConverter; - exports.NfBindingBehavior = nf_1.NfBindingBehavior; - exports.RtValueConverter = rt_1.RtValueConverter; - exports.RtBindingBehavior = rt_1.RtBindingBehavior; - exports.TValueConverter = t_1.TValueConverter; - exports.TBindingBehavior = t_1.TBindingBehavior; - exports.TCustomAttribute = t_1.TCustomAttribute; - exports.TParamsCustomAttribute = t_1.TParamsCustomAttribute; + + var I18N_EA_SIGNAL = "i18n:locale:changed"; + var I18N = /** @class */ (function () { + function I18N(ea, signaler) { + this.ea = ea; + this.signaler = signaler; + this.globalVars = {}; + this.i18next = i18next; + this.Intl = aureliaPal.PLATFORM.global.Intl; + } + I18N.inject = function () { return [aureliaEventAggregator.EventAggregator, aureliaTemplatingResources.BindingSignaler]; }; + I18N.prototype.setup = function (options) { + return __awaiter(this, void 0, void 0, function () { + var defaultOptions; + var _this = this; + return __generator(this, function (_a) { + defaultOptions = { + skipTranslationOnMissingKey: false, + compatibilityAPI: "v1", + compatibilityJSON: "v1", + lng: "en", + attributes: ["t", "i18n"], + fallbackLng: "en", + debug: false + }; + this.i18nextDeferred = new Promise(function (resolve, reject) { + _this.i18next = _this.i18next.init(options || defaultOptions, function (err) { + if (err) { + reject(err); + } + // make sure attributes is an array in case a string was provided + if (_this.i18next.options.attributes instanceof String) { + _this.i18next.options.attributes = [_this.i18next.options.attributes]; + } + resolve(_this.i18next); + }); + }); + return [2 /*return*/, this.i18nextDeferred]; + }); + }); + }; + I18N.prototype.i18nextReady = function () { + return this.i18nextDeferred; + }; + I18N.prototype.setLocale = function (locale) { + var _this = this; + return new Promise(function (resolve, reject) { + var oldLocale = _this.getLocale(); + _this.i18next.changeLanguage(locale, function (err, tr) { + if (err) { + reject(err); + } + _this.ea.publish(I18N_EA_SIGNAL, { oldValue: oldLocale, newValue: locale }); + _this.signaler.signal("aurelia-translation-signal"); + resolve(tr); + }); + }); + }; + I18N.prototype.getLocale = function () { + return this.i18next.language; + }; + I18N.prototype.nf = function (options, locales) { + return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); + }; + I18N.prototype.uf = function (numberLike, locale) { + var nf = this.nf({}, locale || this.getLocale()); + var comparer = nf.format(10000 / 3); + var thousandSeparator = comparer[1]; + var decimalSeparator = comparer[5]; + if (thousandSeparator === ".") { + thousandSeparator = "\\."; + } + // remove all thousand seperators + var result = numberLike.replace(new RegExp(thousandSeparator, "g"), "") + // remove non-numeric signs except -> , . + .replace(/[^\d.,-]/g, "") + // replace original decimalSeparator with english one + .replace(decimalSeparator, "."); + // return real number + return Number(result); + }; + I18N.prototype.df = function (options, locales) { + return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); + }; + I18N.prototype.tr = function (key, options) { + var fullOptions = this.globalVars; + if (options !== undefined) { + fullOptions = Object.assign(Object.assign({}, this.globalVars), options); + } + return this.i18next.t(key, fullOptions); + }; + I18N.prototype.registerGlobalVariable = function (key, value) { + this.globalVars[key] = value; + }; + I18N.prototype.unregisterGlobalVariable = function (key) { + delete this.globalVars[key]; + }; + /** + * Scans an element for children that have a translation attribute and + * updates their innerHTML with the current translation values. + * + * If an image is encountered the translated value will be applied to the src attribute. + * + * @param el HTMLElement to search within + */ + I18N.prototype.updateTranslations = function (el) { + if (!el || !el.querySelectorAll) { + return; + } + var i; + var l; + // create a selector from the specified attributes to look for + // var selector = [].concat(this.i18next.options.attributes); + var attributes = this.i18next.options.attributes; + var selector = [].concat(attributes); + for (i = 0, l = selector.length; i < l; i++) { + selector[i] = "[" + selector[i] + "]"; + } + selector = selector.join(","); + // get the nodes + var nodes = el.querySelectorAll(selector); + for (i = 0, l = nodes.length; i < l; i++) { + var node = nodes[i]; + var keys = void 0; + var params = void 0; + // test every attribute and get the first one that has a value + for (var i2 = 0, l2 = attributes.length; i2 < l2; i2++) { + keys = node.getAttribute(attributes[i2]); + var pname = attributes[i2] + "-params"; + if (pname && node.au && node.au[pname]) { + params = node.au[pname].viewModel.value; + } + if (keys) { + break; + } + } + // skip if nothing was found + if (!keys) { + continue; + } + // split the keys into multiple keys separated by a ; + this.updateValue(node, keys, params); + } + }; + I18N.prototype.updateValue = function (node, value, params) { + if (value === null || value === undefined) { + return; + } + var keys = value.toString().split(";"); + var i = keys.length; + while (i--) { + var key = keys[i]; + // remove the optional attribute + var re = /\[([a-z\-, ]*)\]/ig; + var m = void 0; + var attr = "text"; + // set default attribute to src if this is an image node + if (node.nodeName === "IMG") { + attr = "src"; + } + // check if a attribute was specified in the key + // tslint:disable-next-line:no-conditional-assignment + while ((m = re.exec(key)) !== null) { + if (m.index === re.lastIndex) { + re.lastIndex++; + } + if (m) { + key = key.replace(m[0], ""); + attr = m[1]; + } + } + var attrs = attr.split(","); + var j = attrs.length; + while (j--) { + attr = attrs[j].trim(); + if (!node._textContent) { + node._textContent = node.textContent; + } + if (!node._innerHTML) { + node._innerHTML = node.innerHTML; + } + // convert to camelCase + // tslint:disable-next-line:only-arrow-functions + var attrCC = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); + var reservedNames = ["prepend", "append", "text", "html"]; + var i18nLogger = LogManager.getLogger("i18n"); + if (reservedNames.indexOf(attr) > -1 && + node.au && + node.au.controller && + node.au.controller.viewModel && + attrCC in node.au.controller.viewModel) { + i18nLogger.warn("Aurelia I18N reserved attribute name\n\n [" + reservedNames.join(", ") + "]\n\n Your custom element has a bindable named " + attr + " which is a reserved word.\n\n If you'd like Aurelia I18N to translate your bindable instead, please consider giving it another name."); + } + if (this.i18next.options.skipTranslationOnMissingKey && + this.tr(key, params) === key) { + i18nLogger.warn("Couldn't find translation for key: " + key); + return; + } + // handle various attributes + // anything other than text,prepend,append or html will be added as an attribute on the element. + switch (attr) { + case "text": + var newChild = aureliaPal.DOM.createTextNode(this.tr(key, params)); + if (node._newChild && node._newChild.parentNode === node) { + node.removeChild(node._newChild); + } + node._newChild = newChild; + while (node.firstChild) { + node.removeChild(node.firstChild); + } + node.appendChild(node._newChild); + break; + case "prepend": + var prependParser = aureliaPal.DOM.createElement("div"); + prependParser.innerHTML = this.tr(key, params); + for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { + if (node.childNodes[ni]._prepended) { + node.removeChild(node.childNodes[ni]); + } + } + for (var pi = prependParser.childNodes.length - 1; pi >= 0; pi--) { + prependParser.childNodes[pi]._prepended = true; + if (node.firstChild) { + node.insertBefore(prependParser.childNodes[pi], node.firstChild); + } + else { + node.appendChild(prependParser.childNodes[pi]); + } + } + break; + case "append": + var appendParser = aureliaPal.DOM.createElement("div"); + appendParser.innerHTML = this.tr(key, params); + for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { + if (node.childNodes[ni]._appended) { + node.removeChild(node.childNodes[ni]); + } + } + while (appendParser.firstChild) { + appendParser.firstChild._appended = true; + node.appendChild(appendParser.firstChild); + } + break; + case "html": + node.innerHTML = this.tr(key, params); + break; + default: // normal html attribute + if (node.au && + node.au.controller && + node.au.controller.viewModel && + attrCC in node.au.controller.viewModel) { + node.au.controller.viewModel[attrCC] = this.tr(key, params); + } + else { + node.setAttribute(attr, this.tr(key, params)); + } + break; + } + } + } + }; + return I18N; + }()); + + var TBindingBehavior = /** @class */ (function () { + function TBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + TBindingBehavior.inject = function () { return [aureliaTemplatingResources.SignalBindingBehavior]; }; + TBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the TValueConverter. + // pass through any args to the binding behavior to the TValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new aureliaBinding.ValueConverter(expression, "t", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + TBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + TBindingBehavior = __decorate([ + aureliaBinding.bindingBehavior("t") + ], TBindingBehavior); + return TBindingBehavior; + }()); + + // tslint:disable-next-line:only-arrow-functions + var isInteger = Number.isInteger || function (value) { + return typeof value === "number" && + isFinite(value) && + Math.floor(value) === value; + }; + var LazyOptional = /** @class */ (function () { + function LazyOptional(key) { + this.key = key; + } + LazyOptional_1 = LazyOptional; + LazyOptional.of = function (key) { + return new LazyOptional_1(key); + }; + LazyOptional.prototype.get = function (container) { + var _this = this; + return function () { + if (container.hasResolver(_this.key, false)) { + return container.get(_this.key); + } + return null; + }; + }; + var LazyOptional_1; + LazyOptional = LazyOptional_1 = __decorate([ + aureliaDependencyInjection.resolver() + ], LazyOptional); + return LazyOptional; + }()); + + var TParamsCustomAttribute = /** @class */ (function () { + function TParamsCustomAttribute(element) { + this.element = element; + } + TParamsCustomAttribute_1 = TParamsCustomAttribute; + TParamsCustomAttribute.inject = function () { + return [aureliaPal.DOM.Element]; + }; + TParamsCustomAttribute.configureAliases = function (aliases) { + var r = aureliaMetadata.metadata.getOrCreateOwn(aureliaMetadata.metadata.resource, aureliaTemplating.HtmlBehaviorResource, TParamsCustomAttribute_1); + r.aliases = aliases; + }; + TParamsCustomAttribute.prototype.valueChanged = function () { }; + var TParamsCustomAttribute_1; + TParamsCustomAttribute = TParamsCustomAttribute_1 = __decorate([ + aureliaTemplating.customAttribute("t-params") + ], TParamsCustomAttribute); + return TParamsCustomAttribute; + }()); + + var TCustomAttribute = /** @class */ (function () { + function TCustomAttribute(element, service, ea, p) { + this.element = element; + this.service = service; + this.ea = ea; + this.lazyParams = p; + } + TCustomAttribute_1 = TCustomAttribute; + TCustomAttribute.inject = function () { + return [aureliaPal.DOM.Element, I18N, aureliaEventAggregator.EventAggregator, LazyOptional.of(TParamsCustomAttribute)]; + }; + TCustomAttribute.configureAliases = function (aliases) { + var r = aureliaMetadata.metadata.getOrCreateOwn(aureliaMetadata.metadata.resource, aureliaTemplating.HtmlBehaviorResource, TCustomAttribute_1); + r.aliases = aliases; + }; + TCustomAttribute.prototype.bind = function () { + var _this = this; + this.params = this.lazyParams(); + if (this.params) { + this.params.valueChanged = function (newParams, oldParams) { + _this.paramsChanged(_this.value, newParams, oldParams); + }; + } + var p = this.params !== null ? this.params.value : undefined; + this.subscription = this.ea.subscribe(I18N_EA_SIGNAL, function () { + _this.service.updateValue(_this.element, _this.value, _this.params !== null ? _this.params.value : undefined); + }); + this.service.updateValue(this.element, this.value, p); + }; + TCustomAttribute.prototype.paramsChanged = function (newValue, newParams) { + this.service.updateValue(this.element, newValue, newParams); + }; + TCustomAttribute.prototype.valueChanged = function (newValue) { + var p = this.params !== null ? this.params.value : undefined; + this.service.updateValue(this.element, newValue, p); + }; + TCustomAttribute.prototype.unbind = function () { + // If unbind is called before timeout for subscription is triggered, subscription will be undefined + if (this.subscription) { + this.subscription.dispose(); + } + }; + var TCustomAttribute_1; + TCustomAttribute = TCustomAttribute_1 = __decorate([ + aureliaTemplating.customAttribute("t") + ], TCustomAttribute); + return TCustomAttribute; + }()); + + var TValueConverter = /** @class */ (function () { + function TValueConverter(service) { + this.service = service; + } + TValueConverter.inject = function () { return [I18N]; }; + TValueConverter.prototype.toView = function (value, options) { + return this.service.tr(value, options); + }; + TValueConverter = __decorate([ + aureliaFramework.valueConverter("t") + ], TValueConverter); + return TValueConverter; + }()); + + var NfBindingBehavior = /** @class */ (function () { + function NfBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + NfBindingBehavior.inject = function () { return [aureliaTemplatingResources.SignalBindingBehavior]; }; + NfBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the NfValueConverter. + // pass through any args to the binding behavior to the NfValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new aureliaBinding.ValueConverter(expression, "nf", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + NfBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + NfBindingBehavior = __decorate([ + aureliaBinding.bindingBehavior("nf") + ], NfBindingBehavior); + return NfBindingBehavior; + }()); + + var NfValueConverter = /** @class */ (function () { + function NfValueConverter(service) { + this.service = service; + } + NfValueConverter.inject = function () { return [I18N]; }; + NfValueConverter.prototype.toView = function (value, nfOrOptions, locale) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (nfOrOptions && (nfOrOptions instanceof Intl.NumberFormat && typeof nfOrOptions.format === "function")) { + return nfOrOptions.format(value); + } + var nf = this.service.nf(nfOrOptions, locale || this.service.getLocale()); + return nf.format(value); + }; + NfValueConverter = __decorate([ + aureliaBinding.valueConverter("nf") + ], NfValueConverter); + return NfValueConverter; + }()); + + var DfBindingBehavior = /** @class */ (function () { + function DfBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + DfBindingBehavior.inject = function () { return [aureliaTemplatingResources.SignalBindingBehavior]; }; + DfBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the DfValueConverter. + // pass through any args to the binding behavior to the DfValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new aureliaBinding.ValueConverter(expression, "df", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + DfBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + DfBindingBehavior = __decorate([ + aureliaBinding.bindingBehavior("df") + ], DfBindingBehavior); + return DfBindingBehavior; + }()); + + var DfValueConverter = /** @class */ (function () { + function DfValueConverter(service) { + this.service = service; + } + DfValueConverter.inject = function () { return [I18N]; }; + DfValueConverter.prototype.toView = function (value, dfOrOptions, locale) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (typeof value === "string" && isNaN(value) && !isInteger(value)) { + value = new Date(value); + } + if (dfOrOptions && (dfOrOptions instanceof Intl.DateTimeFormat && typeof dfOrOptions.format === "function")) { + return dfOrOptions.format(value); + } + var df = this.service.df(dfOrOptions, locale || this.service.getLocale()); + return df.format(value); + }; + DfValueConverter = __decorate([ + aureliaBinding.valueConverter("df") + ], DfValueConverter); + return DfValueConverter; + }()); + + var RtBindingBehavior = /** @class */ (function () { + function RtBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + RtBindingBehavior.inject = function () { return [aureliaTemplatingResources.SignalBindingBehavior]; }; + RtBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal", "aurelia-relativetime-signal"); + // rewrite the expression to use the RtValueConverter. + // pass through any args to the binding behavior to the RtValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new aureliaBinding.ValueConverter(expression, "rt", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + RtBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + RtBindingBehavior = __decorate([ + aureliaBinding.bindingBehavior("rt") + ], RtBindingBehavior); + return RtBindingBehavior; + }()); + + var translations = { + ar: { + translation: { + now: 'الآن', + second_ago: 'منذ __count__ ثانية', + second_ago_plural: 'منذ __count__ ثواني', + second_in: 'في __count__ ثانية', + second_in_plural: 'في __count__ ثواني', + minute_ago: 'منذ __count__ دقيقة', + minute_ago_plural: 'منذ __count__ دقائق', + minute_in: 'في __count__ دقيقة', + minute_in_plural: 'في __count__ دقائق', + hour_ago: 'منذ __count__ ساعة', + hour_ago_plural: 'منذ __count__ ساعات', + hour_in: 'في __count__ ساعة', + hour_in_plural: 'في __count__ ساعات', + day_ago: 'منذ __count__ يوم', + day_ago_plural: 'منذ __count__ أيام', + day_in: 'في __count__ يوم', + day_in_plural: 'في __count__ أيام', + month_ago: 'منذ __count__ شهر', + month_ago_plural: 'منذ __count__ أشهر', + month_in: 'في __count__ شهر', + month_in_plural: 'في __count__ أشهر', + year_ago: 'منذ __count__ سنة', + year_ago_plural: 'منذ __count__ سنوات', + year_in: 'في __count__ سنة', + year_in_plural: 'في __count__ سنوات' + } + }, + da: { + translation: { + now: 'lige nu', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'i __count__ sekund', + second_in_plural: 'i __count__ sekunder', + minute_ago: '__count__ minut siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'i __count__ minut', + minute_in_plural: 'i __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'i __count__ time', + hour_in_plural: 'i __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dage siden', + day_in: 'i __count__ dag', + day_in_plural: 'i __count__ dage', + month_ago: '__count__ måned siden', + month_ago_plural: '__count__ måneder siden', + month_in: 'i __count__ måned', + month_in_plural: 'i __count__ måneder', + year_ago: '__count__ år siden', + year_ago_plural: '__count__ år siden', + year_in: 'i __count__ år', + year_in_plural: 'i __count__ år' + } + }, + de: { + translation: { + now: 'jetzt gerade', + second_ago: 'vor __count__ Sekunde', + second_ago_plural: 'vor __count__ Sekunden', + second_in: 'in __count__ Sekunde', + second_in_plural: 'in __count__ Sekunden', + minute_ago: 'vor __count__ Minute', + minute_ago_plural: 'vor __count__ Minuten', + minute_in: 'in __count__ Minute', + minute_in_plural: 'in __count__ Minuten', + hour_ago: 'vor __count__ Stunde', + hour_ago_plural: 'vor __count__ Stunden', + hour_in: 'in __count__ Stunde', + hour_in_plural: 'in __count__ Stunden', + day_ago: 'vor __count__ Tag', + day_ago_plural: 'vor __count__ Tagen', + day_in: 'in __count__ Tag', + day_in_plural: 'in __count__ Tagen', + month_ago: 'vor __count__ Monat', + month_ago_plural: 'vor __count__ Monaten', + month_in: 'in __count__ Monat', + month_in_plural: 'in __count__ Monaten', + year_ago: 'vor __count__ Jahr', + year_ago_plural: 'vor __count__ Jahren', + year_in: 'in __count__ Jahr', + year_in_plural: 'in __count__ Jahren' + } + }, + en: { + translation: { + now: 'just now', + second_ago: '__count__ second ago', + second_ago_plural: '__count__ seconds ago', + second_in: 'in __count__ second', + second_in_plural: 'in __count__ seconds', + minute_ago: '__count__ minute ago', + minute_ago_plural: '__count__ minutes ago', + minute_in: 'in __count__ minute', + minute_in_plural: 'in __count__ minutes', + hour_ago: '__count__ hour ago', + hour_ago_plural: '__count__ hours ago', + hour_in: 'in __count__ hour', + hour_in_plural: 'in __count__ hours', + day_ago: '__count__ day ago', + day_ago_plural: '__count__ days ago', + day_in: 'in __count__ day', + day_in_plural: 'in __count__ days', + month_ago: '__count__ month ago', + month_ago_plural: '__count__ months ago', + month_in: 'in __count__ month', + month_in_plural: 'in __count__ months', + year_ago: '__count__ year ago', + year_ago_plural: '__count__ years ago', + year_in: 'in __count__ year', + year_in_plural: 'in __count__ years' + } + }, + es: { + translation: { + now: 'ahora mismo', + second_ago: 'hace __count__ segundo', + second_ago_plural: 'hace __count__ segundos', + second_in: 'en __count__ segundo', + second_in_plural: 'en __count__ segundos', + minute_ago: 'hace __count__ minuto', + minute_ago_plural: 'hace __count__ minutos', + minute_in: 'en __count__ minuto', + minute_in_plural: 'en __count__ minutos', + hour_ago: 'hace __count__ hora', + hour_ago_plural: 'hace __count__ horas', + hour_in: 'en __count__ hora', + hour_in_plural: 'en __count__ horas', + day_ago: 'hace __count__ día', + day_ago_plural: 'hace __count__ días', + day_in: 'en __count__ día', + day_in_plural: 'en __count__ días', + month_ago: 'hace __count__ mes', + month_ago_plural: 'hace __count__ meses', + month_in: 'en __count__ mes', + month_in_plural: 'en __count__ meses', + year_ago: 'hace __count__ año', + year_ago_plural: 'hace __count__ años', + year_in: 'en __count__ año', + year_in_plural: 'en __count__ años' + } + }, + fi: { + translation: { + now: 'Nyt', + second_ago: '__count__ sekuntti sitten', + second_ago_plural: '__count__ sekunttia sitten', + second_in: ' __count__ sekunnin kuluttua', + second_in_plural: ' __count__ sekunttien kuluttua', + minute_ago: '__count__ minuutti sitten', + minute_ago_plural: '__count__ minuuttia sitten', + minute_in: ' __count__ minuutin kuluttua', + minute_in_plural: ' __count__ minuuttien kuluttua', + hour_ago: '__count__ tunti sitten', + hour_ago_plural: '__count__ tuntia sitten', + hour_in: ' __count__ tunnin kuluttua', + hour_in_plural: ' __count__ tunnin kuluttua', + day_ago: '__count__ päivä sitten', + day_ago_plural: '__count__ päiviä sitten', + day_in: ' __count__ päivän kuluttua', + day_in_plural: '__count__ päivien kuluttua', + month_ago: '__count__ kuukausi sitten', + month_ago_plural: '__count__ kuukausia sitten', + month_in: ' __count__ kuukauden kuluttua', + month_in_plural: ' __count__ kuukausien kuluttua', + year_ago: '__count__ vuosi sitten', + year_ago_plural: '__count__ vuosia sitten', + year_in: ' __count__ vuoden kuluttua', + year_in_plural: ' __count__ vuosien kuluttua' + } + }, + fr: { + translation: { + now: 'maintenant', + second_ago: 'il y a __count__ seconde', + second_ago_plural: 'il y a __count__ secondes', + second_in: 'dans __count__ seconde', + second_in_plural: 'dans __count__ secondes', + minute_ago: 'il y a __count__ minute', + minute_ago_plural: 'il y a __count__ minutes', + minute_in: 'dans __count__ minute', + minute_in_plural: 'dans __count__ minutes', + hour_ago: 'il y a __count__ heure', + hour_ago_plural: 'il y a __count__ heures', + hour_in: 'dans __count__ heure', + hour_in_plural: 'dans __count__ heures', + day_ago: 'il y a __count__ jour', + day_ago_plural: 'il y a __count__ jours', + day_in: 'dans __count__ jour', + day_in_plural: 'dans __count__ jours', + month_ago: 'il y a __count__ mois', + month_ago_plural: 'il y a __count__ mois', + month_in: 'dans __count__ mois', + month_in_plural: 'dans __count__ mois', + year_ago: 'il y a __count__ an', + year_ago_plural: 'il y a __count__ ans', + year_in: 'dans __count__ an', + year_in_plural: 'dans __count__ ans' + } + }, + it: { + translation: { + now: 'adesso', + second_ago: '__count__ secondo fa', + second_ago_plural: '__count__ secondi fa', + second_in: 'in __count__ secondo', + second_in_plural: 'in __count__ secondi', + minute_ago: '__count__ minuto fa', + minute_ago_plural: '__count__ minuti fa', + minute_in: 'in __count__ minuto', + minute_in_plural: 'in __count__ minuti', + hour_ago: '__count__ ora fa', + hour_ago_plural: '__count__ ore fa', + hour_in: 'in __count__ ora', + hour_in_plural: 'in __count__ ore', + day_ago: '__count__ giorno fa', + day_ago_plural: '__count__ giorni fa', + day_in: 'in __count__ giorno', + day_in_plural: 'in __count__ giorni', + month_ago: '__count__ mese fa', + month_ago_plural: '__count__ mesi fa', + month_in: 'in __count__ mese', + month_in_plural: 'in __count__ mesi', + year_ago: '__count__ anno fa', + year_ago_plural: '__count__ anni fa', + year_in: 'in __count__ anno', + year_in_plural: 'in __count__ anni' + } + }, + ja: { + translation: { + now: 'たった今', + second_ago: '__count__ 秒前', + second_ago_plural: '__count__ 秒前', + second_in: 'あと __count__ 秒', + second_in_plural: 'あと __count__ 秒', + minute_ago: '__count__ 分前', + minute_ago_plural: '__count__ 分前', + minute_in: 'あと __count__ 分', + minute_in_plural: 'あと __count__ 分', + hour_ago: '__count__ 時間前', + hour_ago_plural: '__count__ 時間前', + hour_in: 'あと __count__ 時間', + hour_in_plural: 'あと __count__ 時間', + day_ago: '__count__ 日間前', + day_ago_plural: '__count__ 日間前', + day_in: 'あと __count__ 日間', + day_in_plural: 'あと __count__ 日間', + month_ago: '__count__ ヶ月前', + month_ago_plural: '__count__ ヶ月前', + month_in: 'あと __count__ ヶ月前', + month_in_plural: 'あと __count__ ヶ月前', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: 'あと __count__ 年', + year_in_plural: 'あと __count__ 年' + } + }, + nl: { + translation: { + now: 'zonet', + second_ago: '__count__ seconde geleden', + second_ago_plural: '__count__ seconden geleden', + second_in: 'in __count__ seconde', + second_in_plural: 'in __count__ seconden', + minute_ago: '__count__ minuut geleden', + minute_ago_plural: '__count__ minuten geleden', + minute_in: 'in __count__ minuut', + minute_in_plural: 'in __count__ minuten', + hour_ago: '__count__ uur geleden', + hour_ago_plural: '__count__ uren geleden', + hour_in: 'in __count__ uur', + hour_in_plural: 'in __count__ uren', + day_ago: '__count__ dag geleden', + day_ago_plural: '__count__ dagen geleden', + day_in: 'in __count__ dag', + day_in_plural: 'in __count__ dagen', + month_ago: '__count__ maand geleden', + month_ago_plural: '__count__ maanden geleden', + month_in: 'in __count__ maand', + month_in_plural: 'in __count__ maanden', + year_ago: '__count__ jaar geleden', + year_ago_plural: '__count__ jaren geleden', + year_in: 'in __count__ jaar', + year_in_plural: 'in __count__ jaren' + } + }, + nn: { + translation: { + now: 'akkurat nå', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minutt siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'om __count__ minutt', + minute_in_plural: 'om __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'om __count__ time', + hour_in_plural: 'om __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dager siden', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dager', + month_ago: '__count__ en måned siden', + month_ago_plural: '__count__ flere måneder siden', + month_in: 'I løpet av en __count__ måned', + month_in_plural: 'I løpet av __count__ måneder', + year_ago: '__count__ et år siden', + year_ago_plural: '__count__ flere å siden', + year_in: 'I løpet av ett år __count__ år', + year_in_plural: 'på flere __count__ år' + } + }, + no: { + translation: { + now: 'akkurat nå', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minutt siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'om __count__ minutt', + minute_in_plural: 'om __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'om __count__ time', + hour_in_plural: 'om __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dager siden', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dager', + month_ago: '__count__ en måned siden', + month_ago_plural: '__count__ flere måneder siden', + month_in: 'I løpet av en __count__ måned', + month_in_plural: 'I løpet av __count__ måneder', + year_ago: '__count__ et år siden', + year_ago_plural: '__count__ flere å siden', + year_in: 'I løpet av ett år __count__ år', + year_in_plural: 'på flere __count__ år' + } + }, + pt: { + translation: { + now: 'neste exato momento', + second_ago: '__count__ segundo atrás', + second_ago_plural: '__count__ segundos atrás', + second_in: 'em __count__ segundo', + second_in_plural: 'em __count__ segundos', + minute_ago: '__count__ minuto atrás', + minute_ago_plural: '__count__ minutos atrás', + minute_in: 'em __count__ minuto', + minute_in_plural: 'em __count__ minutos', + hour_ago: '__count__ hora atrás', + hour_ago_plural: '__count__ horas atrás', + hour_in: 'em __count__ hora', + hour_in_plural: 'em __count__ horas', + day_ago: '__count__ dia atrás', + day_ago_plural: '__count__ dias atrás', + day_in: 'em __count__ dia', + day_in_plural: 'em __count__ dias', + month_ago: '__count__ mês atrás', + month_ago_plural: '__count__ meses atrás', + month_in: 'em __count__ mês', + month_in_plural: 'em __count__ meses', + year_ago: '__count__ ano atrás', + year_ago_plural: '__count__ anos atrás', + year_in: 'em __count__ ano', + year_in_plural: 'em __count__ anos' + } + }, + sv: { + translation: { + now: 'nu', + second_ago: '__count__ sekund sedan', + second_ago_plural: '__count__ sekunder sedan', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minut sedan', + minute_ago_plural: '__count__ minuter sedan', + minute_in: 'om __count__ minut', + minute_in_plural: 'om __count__ minuter', + hour_ago: '__count__ timme sedan', + hour_ago_plural: '__count__ timmar sedan', + hour_in: 'om __count__ timme', + hour_in_plural: 'om __count__ timmar', + day_ago: '__count__ dag sedan', + day_ago_plural: '__count__ dagar sedan', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dagar', + month_ago: '__count__ månad sedan', + month_ago_plural: '__count__ månader sedan', + month_in: 'om __count__ månad', + month_in_plural: 'om __count__ månader', + year_ago: '__count__ år sedan', + year_ago_plural: '__count__ år sedan', + year_in: 'om __count__ år', + year_in_plural: 'om __count__ år' + } + }, + th: { + translation: { + now: 'เมื่อกี้', + second_ago: '__count__ วินาที ที่ผ่านมา', + second_ago_plural: '__count__ วินาที ที่ผ่านมา', + second_in: 'อีก __count__ วินาที', + second_in_plural: 'อีก __count__ วินาที', + minute_ago: '__count__ นาที ที่ผ่านมา', + minute_ago_plural: '__count__ นาที ที่ผ่านมา', + minute_in: 'อีก __count__ นาที', + minute_in_plural: 'อีก __count__ นาที', + hour_ago: '__count__ ชั่วโมง ที่ผ่านมา', + hour_ago_plural: '__count__ ชั่วโมง ที่ผ่านมา', + hour_in: 'อีก __count__ ชั่วโมง', + hour_in_plural: 'อีก __count__ ชั่วโมง', + day_ago: '__count__ วัน ที่ผ่านมา', + day_ago_plural: '__count__ วัน ที่ผ่านมา', + day_in: 'อีก __count__ วัน', + day_in_plural: 'อีก __count__ วัน' + } + }, + zh: { + translation: { + now: '刚才', + second_ago: '__count__ 秒钟前', + second_ago_plural: '__count__ 秒钟前', + second_in: '__count__ 秒内', + second_in_plural: '__count__ 秒内', + minute_ago: '__count__ 分钟前', + minute_ago_plural: '__count__ 分钟前', + minute_in: '__count__ 分钟内', + minute_in_plural: '__count__ 分钟内', + hour_ago: '__count__ 小时前', + hour_ago_plural: '__count__ 小时前', + hour_in: '__count__ 小时内', + hour_in_plural: '__count__ 小时内', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天内', + day_in_plural: '__count__ 天内', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月内', + month_in_plural: '__count__ 月内', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年内', + year_in_plural: '__count__ 年内' + } + }, + 'zh-CN': { + translation: { + now: '刚才', + second_ago: '__count__ 秒钟前', + second_ago_plural: '__count__ 秒钟前', + second_in: '__count__ 秒内', + second_in_plural: '__count__ 秒内', + minute_ago: '__count__ 分钟前', + minute_ago_plural: '__count__ 分钟前', + minute_in: '__count__ 分钟内', + minute_in_plural: '__count__ 分钟内', + hour_ago: '__count__ 小时前', + hour_ago_plural: '__count__ 小时前', + hour_in: '__count__ 小时内', + hour_in_plural: '__count__ 小时内', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天内', + day_in_plural: '__count__ 天内', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月内', + month_in_plural: '__count__ 月内', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年内', + year_in_plural: '__count__ 年内' + } + }, + 'zh-HK': { + translation: { + now: '剛才', + second_ago: '__count__ 秒鐘前', + second_ago_plural: '__count__ 秒鐘前', + second_in: '__count__ 秒內', + second_in_plural: '__count__ 秒內', + minute_ago: '__count__ 分鐘前', + minute_ago_plural: '__count__ 分鐘前', + minute_in: '__count__ 分鐘內', + minute_in_plural: '__count__ 分鐘內', + hour_ago: '__count__ 小時前', + hour_ago_plural: '__count__ 小時前', + hour_in: '__count__ 小時內', + hour_in_plural: '__count__ 小時內', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天內', + day_in_plural: '__count__ 天內', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月內', + month_in_plural: '__count__ 月內', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年內', + year_in_plural: '__count__ 年內' + } + }, + 'zh-TW': { + translation: { + now: '剛才', + second_ago: '__count__ 秒鐘前', + second_ago_plural: '__count__ 秒鐘前', + second_in: '__count__ 秒內', + second_in_plural: '__count__ 秒內', + minute_ago: '__count__ 分鐘前', + minute_ago_plural: '__count__ 分鐘前', + minute_in: '__count__ 分鐘內', + minute_in_plural: '__count__ 分鐘內', + hour_ago: '__count__ 小時前', + hour_ago_plural: '__count__ 小時前', + hour_in: '__count__ 小時內', + hour_in_plural: '__count__ 小時內', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天內', + day_in_plural: '__count__ 天內', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月內', + month_in_plural: '__count__ 月內', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年內', + year_in_plural: '__count__ 年內' + } + } + }; + // tslint:enable + + var RelativeTime = /** @class */ (function () { + function RelativeTime(service, ea) { + var _this = this; + this.service = service; + this.ea = ea; + this.service.i18nextReady().then(function () { + _this.setup(); + }); + this.ea.subscribe(I18N_EA_SIGNAL, function (locales) { + _this.setup(locales); + }); + } + RelativeTime.inject = function () { return [I18N, aureliaEventAggregator.EventAggregator]; }; + RelativeTime.prototype.setup = function (locales) { + var trans = translations; + var fallbackLng = this.service.i18next.fallbackLng; + var alternateFb = fallbackLng || this.service.i18next.options.fallbackLng; + if (Array.isArray(alternateFb) && alternateFb.length > 0) { + alternateFb = alternateFb[0]; + } + var key = ((locales && locales.newValue) + ? locales.newValue + : this.service.getLocale()) || alternateFb; + var index = 0; + // tslint:disable-next-line:no-conditional-assignment + if ((index = key.indexOf("-")) >= 0) { + var baseLocale = key.substring(0, index); + if (trans[baseLocale]) { + this.addTranslationResource(baseLocale, trans[baseLocale].translation); + } + } + if (trans[key]) { + this.addTranslationResource(key, trans[key].translation); + } + if (trans[fallbackLng]) { + this.addTranslationResource(key, trans[fallbackLng].translation); + } + }; + RelativeTime.prototype.addTranslationResource = function (key, translation) { + var options = this.service.i18next.options; + if (options.interpolation && (options.interpolation.prefix !== "__" || options.interpolation.suffix !== "__")) { + // tslint:disable-next-line:forin + for (var subkey in translation) { + translation[subkey] = translation[subkey] + .replace("__count__", (options.interpolation.prefix || "{{") + "count" + (options.interpolation.suffix || "}}")); + } + } + this.service.i18next.addResources(key, options.defaultNS || "translation", translation); + }; + RelativeTime.prototype.getRelativeTime = function (time) { + var now = new Date(); + var diff = now.getTime() - time.getTime(); + var timeDiff = this.getTimeDiffDescription(diff, "year", 31104000000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "month", 2592000000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "day", 86400000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "hour", 3600000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "minute", 60000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "second", 1000); + if (!timeDiff) { + timeDiff = this.service.tr("now"); + } + } + } + } + } + } + return timeDiff; + }; + RelativeTime.prototype.getTimeDiffDescription = function (diff, unit, timeDivisor) { + var unitAmount = parseInt((diff / timeDivisor).toFixed(0), 10); + if (unitAmount > 0) { + return this.service.tr(unit, { count: unitAmount, context: "ago" }); + } + else if (unitAmount < 0) { + var abs = Math.abs(unitAmount); + return this.service.tr(unit, { count: abs, context: "in" }); + } + return null; + }; + return RelativeTime; + }()); + + var RtValueConverter = /** @class */ (function () { + function RtValueConverter(service) { + this.service = service; + } + RtValueConverter.inject = function () { return [RelativeTime]; }; + RtValueConverter.prototype.toView = function (value) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (typeof value === "string" && isNaN(value) && !Number.isInteger(value)) { + value = new Date(value); + } + return this.service.getRelativeTime(value); + }; + RtValueConverter = __decorate([ + aureliaBinding.valueConverter("rt") + ], RtValueConverter); + return RtValueConverter; + }()); + + var Backend = /** @class */ (function () { + function Backend(services, options) { + if (options === void 0) { options = {}; } + this.services = services; + this.options = options; + this.type = "backend"; + this.init(services, options); + } + Backend.with = function (loader) { + this.loader = loader; + return this; + }; + Backend.prototype.init = function (services, options) { + if (options === void 0) { options = {}; } + this.services = services; + this.options = Object.assign({}, { + loadPath: "/locales/{{lng}}/{{ns}}.json", + addPath: "locales/add/{{lng}}/{{ns}}", + allowMultiLoading: false, + parse: JSON.parse + }, options); + }; + Backend.prototype.readMulti = function (languages, namespaces, callback) { + var loadPath = this.options.loadPath; + if (typeof this.options.loadPath === "function") { + loadPath = this.options.loadPath(languages, namespaces); + } + var url = this.services + .interpolator + .interpolate(loadPath, { lng: languages.join("+"), ns: namespaces.join("+") }); + this.loadUrl(url, callback); + }; + Backend.prototype.read = function (language, namespace, callback) { + var loadPath = this.options.loadPath; + if (typeof this.options.loadPath === "function") { + loadPath = this.options.loadPath([language], [namespace]); + } + var url = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }); + this.loadUrl(url, callback); + }; + Backend.prototype.loadUrl = function (url, callback) { + return __awaiter(this, void 0, void 0, function () { + var response, ret, err, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 2, , 3]); + return [4 /*yield*/, Backend.loader.loadText(url)]; + case 1: + response = _b.sent(); + ret = void 0; + err = void 0; + try { + ret = (response instanceof Object) ? response : this.options.parse(response, url); + } + catch (e) { + err = "failed parsing " + url + " to json"; + } + if (err) { + return [2 /*return*/, callback(err, false)]; + } + callback(null, ret); + return [3 /*break*/, 3]; + case 2: + _a = _b.sent(); + callback("failed loading " + url, false /* no retry */); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + // tslint:disable-next-line:variable-name + Backend.prototype.create = function (_languages, _namespace, _key, _fallbackValue) { + // not supported + }; + Backend.type = "backend"; + return Backend; + }()); + function configure(frameworkConfig, cb) { - if (cb === undefined || typeof cb !== "function") { + if (typeof cb !== "function") { var errorMsg = "You need to provide a callback method to properly configure the library"; throw errorMsg; } + var instance = frameworkConfig.container.get(I18N); + var ret = cb(instance); frameworkConfig.globalResources([ - aurelia_pal_1.PLATFORM.moduleName("./t/t-value-converter"), - aurelia_pal_1.PLATFORM.moduleName("./t/t-custom-attribute"), - aurelia_pal_1.PLATFORM.moduleName("./t/t-params-custom-attribute"), - aurelia_pal_1.PLATFORM.moduleName("./t/t-binding-behavior") - ]); - frameworkConfig.globalResources([ - aurelia_pal_1.PLATFORM.moduleName("./nf/nf-value-converter"), - aurelia_pal_1.PLATFORM.moduleName("./nf/nf-binding-behavior") - ]); - frameworkConfig.globalResources([ - aurelia_pal_1.PLATFORM.moduleName("./df/df-value-converter"), - aurelia_pal_1.PLATFORM.moduleName("./df/df-binding-behavior") - ]); - frameworkConfig.globalResources([ - aurelia_pal_1.PLATFORM.moduleName("./rt/rt-value-converter"), - aurelia_pal_1.PLATFORM.moduleName("./rt/rt-binding-behavior") + TValueConverter, + TBindingBehavior, + TCustomAttribute, + TParamsCustomAttribute, + NfValueConverter, + NfBindingBehavior, + DfValueConverter, + DfBindingBehavior, + RtValueConverter, + RtBindingBehavior ]); - var instance = new i18n_1.I18N(frameworkConfig.container.get(aurelia_event_aggregator_1.EventAggregator), frameworkConfig.container.get(aurelia_templating_resources_1.BindingSignaler)); - frameworkConfig.container.registerInstance(i18n_1.I18N, instance); - var ret = cb(instance); frameworkConfig.postTask(function () { - var resources = frameworkConfig.container.get(aurelia_templating_1.ViewResources); + var resources = frameworkConfig.container.get(aureliaTemplating.ViewResources); var htmlBehaviorResource = resources.getAttribute("t"); var htmlParamsResource = resources.getAttribute("t-params"); var attributes = instance.i18next.options.attributes; @@ -57,6 +1371,23 @@ define(["require", "exports", "aurelia-event-aggregator", "aurelia-templating", }); return ret; } + exports.configure = configure; + exports.DfValueConverter = DfValueConverter; + exports.DfBindingBehavior = DfBindingBehavior; + exports.NfValueConverter = NfValueConverter; + exports.NfBindingBehavior = NfBindingBehavior; + exports.RtValueConverter = RtValueConverter; + exports.RtBindingBehavior = RtBindingBehavior; + exports.TValueConverter = TValueConverter; + exports.TBindingBehavior = TBindingBehavior; + exports.TCustomAttribute = TCustomAttribute; + exports.TParamsCustomAttribute = TParamsCustomAttribute; + exports.I18N_EA_SIGNAL = I18N_EA_SIGNAL; + exports.I18N = I18N; + exports.RelativeTime = RelativeTime; + exports.Backend = Backend; + + Object.defineProperty(exports, '__esModule', { value: true }); + }); -//# sourceMappingURL=aurelia-i18n.js.map \ No newline at end of file diff --git a/dist/amd/aurelia-i18n.js.map b/dist/amd/aurelia-i18n.js.map deleted file mode 100644 index c711a330..00000000 --- a/dist/amd/aurelia-i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aurelia-i18n.js","sourceRoot":"","sources":["../../src/aurelia-i18n.ts"],"names":[],"mappings":";;;;;;IAWA,iBAAuB;IACvB,yBAA+B;IAC/B,gCAAsC;IAEpC,gCAAA,gBAAgB,CAAA;IAChB,iCAAA,iBAAiB,CAAA;IAGjB,gCAAA,gBAAgB,CAAA;IAChB,iCAAA,iBAAiB,CAAA;IAGjB,gCAAA,gBAAgB,CAAA;IAChB,iCAAA,iBAAiB,CAAA;IAGjB,8BAAA,eAAe,CAAA;IACf,+BAAA,gBAAgB,CAAA;IAChB,+BAAA,gBAAgB,CAAA;IAChB,qCAAA,sBAAsB,CAAA;IAGxB,SAAgB,SAAS,CACvB,eAAuC,EACvC,EAA8C;QAE9C,IAAI,EAAE,KAAK,SAAS,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE;YAChD,IAAM,QAAQ,GAAG,yEAAyE,CAAC;YAC3F,MAAM,QAAQ,CAAC;SAChB;QAED,eAAe,CAAC,eAAe,CAAC;YAC9B,sBAAQ,CAAC,UAAU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;YAEjE,+CAA+C;YAC/C,IAAI,CAAC,UAAU,EAAE;gBACf,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;aAC5B;YAED,UAAU,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,CAAC,EAA7D,CAA6D,CAAC,CAAC;YAC7F,UAAU,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,SAAS,CAAC,iBAAiB,CAAC,KAAK,GAAG,SAAS,EAAE,kBAAkB,EAAE,UAAU,CAAC,EAA9E,CAA8E,CAAC,CAAC;QAChH,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACb,CAAC;IApDD,8BAoDC"} \ No newline at end of file diff --git a/dist/amd/defaultTranslations/relative.time.js b/dist/amd/defaultTranslations/relative.time.js deleted file mode 100644 index 0dd258c2..00000000 --- a/dist/amd/defaultTranslations/relative.time.js +++ /dev/null @@ -1,498 +0,0 @@ -define(["require", "exports"], function (require, exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.translations = { - ar: { - translation: { - "now": "الآن", - "second_ago": "منذ __count__ ثانية", - "second_ago_plural": "منذ __count__ ثواني", - "second_in": "في __count__ ثانية", - "second_in_plural": "في __count__ ثواني", - "minute_ago": "منذ __count__ دقيقة", - "minute_ago_plural": "منذ __count__ دقائق", - "minute_in": "في __count__ دقيقة", - "minute_in_plural": "في __count__ دقائق", - "hour_ago": "منذ __count__ ساعة", - "hour_ago_plural": "منذ __count__ ساعات", - "hour_in": "في __count__ ساعة", - "hour_in_plural": "في __count__ ساعات", - "day_ago": "منذ __count__ يوم", - "day_ago_plural": "منذ __count__ أيام", - "day_in": "في __count__ يوم", - "day_in_plural": "في __count__ أيام", - "month_ago": "منذ __count__ شهر", - "month_ago_plural": "منذ __count__ أشهر", - "month_in": "في __count__ شهر", - "month_in_plural": "في __count__ أشهر", - "year_ago": "منذ __count__ سنة", - "year_ago_plural": "منذ __count__ سنوات", - "year_in": "في __count__ سنة", - "year_in_plural": "في __count__ سنوات" - } - }, - en: { - translation: { - "now": "just now", - "second_ago": "__count__ second ago", - "second_ago_plural": "__count__ seconds ago", - "second_in": "in __count__ second", - "second_in_plural": "in __count__ seconds", - "minute_ago": "__count__ minute ago", - "minute_ago_plural": "__count__ minutes ago", - "minute_in": "in __count__ minute", - "minute_in_plural": "in __count__ minutes", - "hour_ago": "__count__ hour ago", - "hour_ago_plural": "__count__ hours ago", - "hour_in": "in __count__ hour", - "hour_in_plural": "in __count__ hours", - "day_ago": "__count__ day ago", - "day_ago_plural": "__count__ days ago", - "day_in": "in __count__ day", - "day_in_plural": "in __count__ days", - "month_ago": "__count__ month ago", - "month_ago_plural": "__count__ months ago", - "month_in": "in __count__ month", - "month_in_plural": "in __count__ months", - "year_ago": "__count__ year ago", - "year_ago_plural": "__count__ years ago", - "year_in": "in __count__ year", - "year_in_plural": "in __count__ years" - } - }, - es: { - translation: { - "now": "ahora mismo", - "second_ago": "hace __count__ segundo", - "second_ago_plural": "hace __count__ segundos", - "second_in": "en __count__ segundo", - "second_in_plural": "en __count__ segundos", - "minute_ago": "hace __count__ minuto", - "minute_ago_plural": "hace __count__ minutos", - "minute_in": "en __count__ minuto", - "minute_in_plural": "en __count__ minutos", - "hour_ago": "hace __count__ hora", - "hour_ago_plural": "hace __count__ horas", - "hour_in": "en __count__ hora", - "hour_in_plural": "en __count__ horas", - "day_ago": "hace __count__ día", - "day_ago_plural": "hace __count__ días", - "day_in": "en __count__ día", - "day_in_plural": "en __count__ días", - "month_ago": "hace __count__ mes", - "month_ago_plural": "hace __count__ meses", - "month_in": "en __count__ mes", - "month_in_plural": "en __count__ meses", - "year_ago": "hace __count__ año", - "year_ago_plural": "hace __count__ años", - "year_in": "en __count__ año", - "year_in_plural": "en __count__ años" - } - }, - it: { - translation: { - "now": "adesso", - "second_ago": "__count__ secondo fa", - "second_ago_plural": "__count__ secondi fa", - "second_in": "in __count__ secondo", - "second_in_plural": "in __count__ secondi", - "minute_ago": "__count__ minuto fa", - "minute_ago_plural": "__count__ minuti fa", - "minute_in": "in __count__ minuto", - "minute_in_plural": "in __count__ minuti", - "hour_ago": "__count__ ora fa", - "hour_ago_plural": "__count__ ore fa", - "hour_in": "in __count__ ora", - "hour_in_plural": "in __count__ ore", - "day_ago": "__count__ giorno fa", - "day_ago_plural": "__count__ giorni fa", - "day_in": "in __count__ giorno", - "day_in_plural": "in __count__ giorni", - "month_ago": "__count__ mese fa", - "month_ago_plural": "__count__ mesi fa", - "month_in": "in __count__ mese", - "month_in_plural": "in __count__ mesi", - "year_ago": "__count__ anno fa", - "year_ago_plural": "__count__ anni fa", - "year_in": "in __count__ anno", - "year_in_plural": "in __count__ anni" - } - }, - de: { - translation: { - "now": "jetzt gerade", - "second_ago": "vor __count__ Sekunde", - "second_ago_plural": "vor __count__ Sekunden", - "second_in": "in __count__ Sekunde", - "second_in_plural": "in __count__ Sekunden", - "minute_ago": "vor __count__ Minute", - "minute_ago_plural": "vor __count__ Minuten", - "minute_in": "in __count__ Minute", - "minute_in_plural": "in __count__ Minuten", - "hour_ago": "vor __count__ Stunde", - "hour_ago_plural": "vor __count__ Stunden", - "hour_in": "in __count__ Stunde", - "hour_in_plural": "in __count__ Stunden", - "day_ago": "vor __count__ Tag", - "day_ago_plural": "vor __count__ Tagen", - "day_in": "in __count__ Tag", - "day_in_plural": "in __count__ Tagen", - "month_ago": "vor __count__ Monat", - "month_ago_plural": "vor __count__ Monaten", - "month_in": "in __count__ Monat", - "month_in_plural": "in __count__ Monaten", - "year_ago": "vor __count__ Jahr", - "year_ago_plural": "vor __count__ Jahren", - "year_in": "in __count__ Jahr", - "year_in_plural": "in __count__ Jahren" - } - }, - nl: { - translation: { - "now": "zonet", - "second_ago": "__count__ seconde geleden", - "second_ago_plural": "__count__ seconden geleden", - "second_in": "in __count__ seconde", - "second_in_plural": "in __count__ seconden", - "minute_ago": "__count__ minuut geleden", - "minute_ago_plural": "__count__ minuten geleden", - "minute_in": "in __count__ minuut", - "minute_in_plural": "in __count__ minuten", - "hour_ago": "__count__ uur geleden", - "hour_ago_plural": "__count__ uren geleden", - "hour_in": "in __count__ uur", - "hour_in_plural": "in __count__ uren", - "day_ago": "__count__ dag geleden", - "day_ago_plural": "__count__ dagen geleden", - "day_in": "in __count__ dag", - "day_in_plural": "in __count__ dagen", - "month_ago": "__count__ maand geleden", - "month_ago_plural": "__count__ maanden geleden", - "month_in": "in __count__ maand", - "month_in_plural": "in __count__ maanden", - "year_ago": "__count__ jaar geleden", - "year_ago_plural": "__count__ jaren geleden", - "year_in": "in __count__ jaar", - "year_in_plural": "in __count__ jaren" - } - }, - fr: { - translation: { - "now": "maintenant", - "second_ago": "il y a __count__ seconde", - "second_ago_plural": "il y a __count__ secondes", - "second_in": "dans __count__ seconde", - "second_in_plural": "dans __count__ secondes", - "minute_ago": "il y a __count__ minute", - "minute_ago_plural": "il y a __count__ minutes", - "minute_in": "dans __count__ minute", - "minute_in_plural": "dans __count__ minutes", - "hour_ago": "il y a __count__ heure", - "hour_ago_plural": "il y a __count__ heures", - "hour_in": "dans __count__ heure", - "hour_in_plural": "dans __count__ heures", - "day_ago": "il y a __count__ jour", - "day_ago_plural": "il y a __count__ jours", - "day_in": "dans __count__ jour", - "day_in_plural": "dans __count__ jours", - "month_ago": "il y a __count__ mois", - "month_ago_plural": "il y a __count__ mois", - "month_in": "dans __count__ mois", - "month_in_plural": "dans __count__ mois", - "year_ago": "il y a __count__ an", - "year_ago_plural": "il y a __count__ ans", - "year_in": "dans __count__ an", - "year_in_plural": "dans __count__ ans" - } - }, - th: { - translation: { - "now": "เมื่อกี้", - "second_ago": "__count__ วินาที ที่ผ่านมา", - "second_ago_plural": "__count__ วินาที ที่ผ่านมา", - "second_in": "อีก __count__ วินาที", - "second_in_plural": "อีก __count__ วินาที", - "minute_ago": "__count__ นาที ที่ผ่านมา", - "minute_ago_plural": "__count__ นาที ที่ผ่านมา", - "minute_in": "อีก __count__ นาที", - "minute_in_plural": "อีก __count__ นาที", - "hour_ago": "__count__ ชั่วโมง ที่ผ่านมา", - "hour_ago_plural": "__count__ ชั่วโมง ที่ผ่านมา", - "hour_in": "อีก __count__ ชั่วโมง", - "hour_in_plural": "อีก __count__ ชั่วโมง", - "day_ago": "__count__ วัน ที่ผ่านมา", - "day_ago_plural": "__count__ วัน ที่ผ่านมา", - "day_in": "อีก __count__ วัน", - "day_in_plural": "อีก __count__ วัน" - } - }, - sv: { - translation: { - "now": "just nu", - "second_ago": "__count__ sekund sedan", - "second_ago_plural": "__count__ sekunder sedan", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minut sedan", - "minute_ago_plural": "__count__ minuter sedan", - "minute_in": "om __count__ minut", - "minute_in_plural": "om __count__ minuter", - "hour_ago": "__count__ timme sedan", - "hour_ago_plural": "__count__ timmar sedan", - "hour_in": "om __count__ timme", - "hour_in_plural": "om __count__ timmar", - "day_ago": "__count__ dag sedan", - "day_ago_plural": "__count__ dagar sedan", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dagar" - } - }, - da: { - translation: { - "now": "lige nu", - "second_ago": "__count__ sekunder siden", - "second_ago_plural": "__count__ sekunder siden", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minut siden", - "minute_ago_plural": "__count__ minutter siden", - "minute_in": "om __count__ minut", - "minute_in_plural": "om __count__ minutter", - "hour_ago": "__count__ time siden", - "hour_ago_plural": "__count__ timer siden", - "hour_in": "om __count__ time", - "hour_in_plural": "om __count__ timer", - "day_ago": "__count__ dag siden", - "day_ago_plural": "__count__ dage siden", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dage" - } - }, - no: { - translation: { - "now": "akkurat nå", - "second_ago": "__count__ sekund siden", - "second_ago_plural": "__count__ sekunder siden", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minutt siden", - "minute_ago_plural": "__count__ minutter siden", - "minute_in": "om __count__ minutt", - "minute_in_plural": "om __count__ minutter", - "hour_ago": "__count__ time siden", - "hour_ago_plural": "__count__ timer siden", - "hour_in": "om __count__ time", - "hour_in_plural": "om __count__ timer", - "day_ago": "__count__ dag siden", - "day_ago_plural": "__count__ dager siden", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dager" - } - }, - ja: { - translation: { - "now": "たった今", - "second_ago": "__count__ 秒前", - "second_ago_plural": "__count__ 秒前", - "second_in": "あと __count__ 秒", - "second_in_plural": "あと __count__ 秒", - "minute_ago": "__count__ 分前", - "minute_ago_plural": "__count__ 分前", - "minute_in": "あと __count__ 分", - "minute_in_plural": "あと __count__ 分", - "hour_ago": "__count__ 時間前", - "hour_ago_plural": "__count__ 時間前", - "hour_in": "あと __count__ 時間", - "hour_in_plural": "あと __count__ 時間", - "day_ago": "__count__ 日間前", - "day_ago_plural": "__count__ 日間前", - "day_in": "あと __count__ 日間", - "day_in_plural": "あと __count__ 日間", - "month_ago": "__count__ ヶ月前", - "month_ago_plural": "__count__ ヶ月前", - "month_in": "あと __count__ ヶ月前", - "month_in_plural": "あと __count__ ヶ月前", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "あと __count__ 年", - "year_in_plural": "あと __count__ 年" - } - }, - jp: { - translation: { - "now": "たった今", - "second_ago": "__count__ 秒前", - "second_ago_plural": "__count__ 秒前", - "second_in": "あと __count__ 秒", - "second_in_plural": "あと __count__ 秒", - "minute_ago": "__count__ 分前", - "minute_ago_plural": "__count__ 分前", - "minute_in": "あと __count__ 分", - "minute_in_plural": "あと __count__ 分", - "hour_ago": "__count__ 時間前", - "hour_ago_plural": "__count__ 時間前", - "hour_in": "あと __count__ 時間", - "hour_in_plural": "あと __count__ 時間", - "day_ago": "__count__ 日間前", - "day_ago_plural": "__count__ 日間前", - "day_in": "あと __count__ 日間", - "day_in_plural": "あと __count__ 日間", - "month_ago": "__count__ ヶ月前", - "month_ago_plural": "__count__ ヶ月前", - "month_in": "あと __count__ ヶ月前", - "month_in_plural": "あと __count__ ヶ月前", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "あと __count__ 年", - "year_in_plural": "あと __count__ 年" - } - }, - pt: { - translation: { - "now": "neste exato momento", - "second_ago": "__count__ segundo atrás", - "second_ago_plural": "__count__ segundos atrás", - "second_in": "em __count__ segundo", - "second_in_plural": "em __count__ segundos", - "minute_ago": "__count__ minuto atrás", - "minute_ago_plural": "__count__ minutos atrás", - "minute_in": "em __count__ minuto", - "minute_in_plural": "em __count__ minutos", - "hour_ago": "__count__ hora atrás", - "hour_ago_plural": "__count__ horas atrás", - "hour_in": "em __count__ hora", - "hour_in_plural": "em __count__ horas", - "day_ago": "__count__ dia atrás", - "day_ago_plural": "__count__ dias atrás", - "day_in": "em __count__ dia", - "day_in_plural": "em __count__ dias", - "month_ago": "__count__ mês atrás", - "month_ago_plural": "__count__ meses atrás", - "month_in": "em __count__ mês", - "month_in_plural": "em __count__ meses", - "year_ago": "__count__ ano atrás", - "year_ago_plural": "__count__ anos atrás", - "year_in": "em __count__ ano", - "year_in_plural": "em __count__ anos" - } - }, - zh: { - translation: { - "now": "刚才", - "second_ago": "__count__ 秒钟前", - "second_ago_plural": "__count__ 秒钟前", - "second_in": "__count__ 秒内", - "second_in_plural": "__count__ 秒内", - "minute_ago": "__count__ 分钟前", - "minute_ago_plural": "__count__ 分钟前", - "minute_in": "__count__ 分钟内", - "minute_in_plural": "__count__ 分钟内", - "hour_ago": "__count__ 小时前", - "hour_ago_plural": "__count__ 小时前", - "hour_in": "__count__ 小时内", - "hour_in_plural": "__count__ 小时内", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天内", - "day_in_plural": "__count__ 天内", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月内", - "month_in_plural": "__count__ 月内", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年内", - "year_in_plural": "__count__ 年内" - } - }, - "zh-CN": { - translation: { - "now": "刚才", - "second_ago": "__count__ 秒钟前", - "second_ago_plural": "__count__ 秒钟前", - "second_in": "__count__ 秒内", - "second_in_plural": "__count__ 秒内", - "minute_ago": "__count__ 分钟前", - "minute_ago_plural": "__count__ 分钟前", - "minute_in": "__count__ 分钟内", - "minute_in_plural": "__count__ 分钟内", - "hour_ago": "__count__ 小时前", - "hour_ago_plural": "__count__ 小时前", - "hour_in": "__count__ 小时内", - "hour_in_plural": "__count__ 小时内", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天内", - "day_in_plural": "__count__ 天内", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月内", - "month_in_plural": "__count__ 月内", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年内", - "year_in_plural": "__count__ 年内" - } - }, - "zh-HK": { - translation: { - "now": "剛才", - "second_ago": "__count__ 秒鐘前", - "second_ago_plural": "__count__ 秒鐘前", - "second_in": "__count__ 秒內", - "second_in_plural": "__count__ 秒內", - "minute_ago": "__count__ 分鐘前", - "minute_ago_plural": "__count__ 分鐘前", - "minute_in": "__count__ 分鐘內", - "minute_in_plural": "__count__ 分鐘內", - "hour_ago": "__count__ 小時前", - "hour_ago_plural": "__count__ 小時前", - "hour_in": "__count__ 小時內", - "hour_in_plural": "__count__ 小時內", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天內", - "day_in_plural": "__count__ 天內", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月內", - "month_in_plural": "__count__ 月內", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年內", - "year_in_plural": "__count__ 年內" - } - }, - "zh-TW": { - translation: { - "now": "剛才", - "second_ago": "__count__ 秒鐘前", - "second_ago_plural": "__count__ 秒鐘前", - "second_in": "__count__ 秒內", - "second_in_plural": "__count__ 秒內", - "minute_ago": "__count__ 分鐘前", - "minute_ago_plural": "__count__ 分鐘前", - "minute_in": "__count__ 分鐘內", - "minute_in_plural": "__count__ 分鐘內", - "hour_ago": "__count__ 小時前", - "hour_ago_plural": "__count__ 小時前", - "hour_in": "__count__ 小時內", - "hour_in_plural": "__count__ 小時內", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天內", - "day_in_plural": "__count__ 天內", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月內", - "month_in_plural": "__count__ 月內", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年內", - "year_in_plural": "__count__ 年內" - } - } - }; -}); -// tslint:enable -//# sourceMappingURL=relative.time.js.map \ No newline at end of file diff --git a/dist/amd/defaultTranslations/relative.time.js.map b/dist/amd/defaultTranslations/relative.time.js.map deleted file mode 100644 index 02061aad..00000000 --- a/dist/amd/defaultTranslations/relative.time.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"relative.time.js","sourceRoot":"","sources":["../../../src/defaultTranslations/relative.time.ts"],"names":[],"mappings":";;;IAKa,QAAA,YAAY,GAAwB;QAC/C,EAAE,EAAE;YACF,WAAW,EAAE;gBACX,KAAK,EAAE,MAAM;gBACb,YAAY,EAAE,qBAAqB;gBACnC,mBAAmB,EAAE,qBAAqB;gBAC1C,WAAW,EAAE,oBAAoB;gBACjC,kBAAkB,EAAE,oBAAoB;gBACxC,YAAY,EAAE,qBAAqB;gBACnC,mBAAmB,EAAE,qBAAqB;gBAC1C,WAAW,EAAE,oBAAoB;gBACjC,kBAAkB,EAAE,oBAAoB;gBACxC,UAAU,EAAE,oBAAoB;gBAChC,iBAAiB,EAAE,qBAAqB;gBACxC,SAAS,EAAE,mBAAmB;gBAC9B,gBAAgB,EAAE,oBAAoB;gBAC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/dist/amd/df/df-binding-behavior.js deleted file mode 100644 index 6e845381..00000000 --- a/dist/amd/df/df-binding-behavior.js +++ /dev/null @@ -1,31 +0,0 @@ -define(["require", "exports", "aurelia-templating-resources", "aurelia-binding"], function (require, exports, aurelia_templating_resources_1, aurelia_binding_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var DfBindingBehavior = /** @class */ (function () { - function DfBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - DfBindingBehavior.inject = function () { return [aurelia_templating_resources_1.SignalBindingBehavior]; }; - DfBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the DfValueConverter. - // pass through any args to the binding behavior to the DfValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new aurelia_binding_1.ValueConverter(expression, "df", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - DfBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return DfBindingBehavior; - }()); - exports.DfBindingBehavior = DfBindingBehavior; -}); -//# sourceMappingURL=df-binding-behavior.js.map \ No newline at end of file diff --git a/dist/amd/df/df-binding-behavior.js.map b/dist/amd/df/df-binding-behavior.js.map deleted file mode 100644 index a85b38f2..00000000 --- a/dist/amd/df/df-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"df-binding-behavior.js","sourceRoot":"","sources":["../../../src/df/df-binding-behavior.ts"],"names":[],"mappings":";;;IAGA;QAGE,2BAAoB,qBAA4C;YAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;QAAI,CAAC;QAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,oDAAqB,CAAC,CAAC,CAAC,CAAC;QAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;YACnC,2BAA2B;YAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;YACxF,sDAAsD;YACtD,wEAAwE;YACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAClD,2CAA2C;YAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;gBAC9B,OAAO;aACR;YACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;YAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;YAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,gCAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;QACJ,CAAC;QACM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;YACrC,6BAA6B;YAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACrD,CAAC;QACH,wBAAC;IAAD,CAAC,AAzBD,IAyBC;IAzBY,8CAAiB"} \ No newline at end of file diff --git a/dist/amd/df/df-value-converter.js b/dist/amd/df/df-value-converter.js deleted file mode 100644 index 2a9647cb..00000000 --- a/dist/amd/df/df-value-converter.js +++ /dev/null @@ -1,28 +0,0 @@ -define(["require", "exports", "../i18n", "../utils"], function (require, exports, i18n_1, utils_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var DfValueConverter = /** @class */ (function () { - function DfValueConverter(service) { - this.service = service; - } - DfValueConverter.inject = function () { return [i18n_1.I18N]; }; - DfValueConverter.prototype.toView = function (value, dfOrOptions, locale) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (typeof value === "string" && isNaN(value) && !utils_1.isInteger(value)) { - value = new Date(value); - } - if (dfOrOptions && (dfOrOptions instanceof Intl.DateTimeFormat && typeof dfOrOptions.format === "function")) { - return dfOrOptions.format(value); - } - var df = this.service.df(dfOrOptions, locale || this.service.getLocale()); - return df.format(value); - }; - return DfValueConverter; - }()); - exports.DfValueConverter = DfValueConverter; -}); -//# sourceMappingURL=df-value-converter.js.map \ No newline at end of file diff --git a/dist/amd/df/df-value-converter.js.map b/dist/amd/df/df-value-converter.js.map deleted file mode 100644 index f59d288d..00000000 --- a/dist/amd/df/df-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"df-value-converter.js","sourceRoot":"","sources":["../../../src/df/df-value-converter.ts"],"names":[],"mappings":";;;IAGA;QAGE,0BAAoB,OAAa;YAAb,YAAO,GAAP,OAAO,CAAM;QAAI,CAAC;QAFxB,uBAAM,GAApB,cAAyB,OAAO,CAAC,WAAI,CAAC,CAAC,CAAC,CAAC;QAIlC,iCAAM,GAAb,UACE,KAAU,EACV,WAA8D,EAC9D,MAAe;YAEf,IAAI,KAAK,KAAK,IAAI;mBACb,OAAO,KAAK,KAAK,WAAW;mBAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACrD;gBACA,OAAO,KAAK,CAAC;aACd;YAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAY,CAAC,IAAI,CAAC,iBAAS,CAAC,KAAY,CAAC,EAAE;gBAChF,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;aACzB;YAED,IAAI,WAAW,IAAI,CAAC,WAAW,YAAY,IAAI,CAAC,cAAc,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE;gBAC3G,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAClC;YAED,IAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAyC,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;YAC1G,OAAO,EAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QACH,uBAAC;IAAD,CAAC,AA5BD,IA4BC;IA5BY,4CAAgB"} \ No newline at end of file diff --git a/dist/amd/df/index.js b/dist/amd/df/index.js deleted file mode 100644 index d367eed1..00000000 --- a/dist/amd/df/index.js +++ /dev/null @@ -1,10 +0,0 @@ -define(["require", "exports", "./df-binding-behavior", "./df-value-converter"], function (require, exports, df_binding_behavior_1, df_value_converter_1) { - "use strict"; - function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; - } - Object.defineProperty(exports, "__esModule", { value: true }); - __export(df_binding_behavior_1); - __export(df_value_converter_1); -}); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/amd/df/index.js.map b/dist/amd/df/index.js.map deleted file mode 100644 index e43eec92..00000000 --- a/dist/amd/df/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/df/index.ts"],"names":[],"mappings":";;;;;;IAAA,gCAAsC;IACtC,+BAAqC"} \ No newline at end of file diff --git a/dist/amd/i18n.js b/dist/amd/i18n.js deleted file mode 100644 index b8c1ac17..00000000 --- a/dist/amd/i18n.js +++ /dev/null @@ -1,311 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -define(["require", "exports", "i18next", "aurelia-pal", "aurelia-logging", "aurelia-framework"], function (require, exports, i18next_1, aurelia_pal_1, LogManager, aurelia_framework_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.I18N_EA_SIGNAL = "i18n:locale:changed"; - var I18N = /** @class */ (function () { - function I18N(ea, signaler) { - this.ea = ea; - this.signaler = signaler; - this.globalVars = {}; - this.i18next = i18next_1.default; - this.Intl = aurelia_pal_1.PLATFORM.global.Intl; - } - I18N.prototype.setup = function (options) { - return __awaiter(this, void 0, void 0, function () { - var defaultOptions; - var _this = this; - return __generator(this, function (_a) { - defaultOptions = { - skipTranslationOnMissingKey: false, - compatibilityAPI: "v1", - compatibilityJSON: "v1", - lng: "en", - attributes: ["t", "i18n"], - fallbackLng: "en", - debug: false - }; - this.i18nextDeferred = new Promise(function (resolve, reject) { - _this.i18next = _this.i18next.init(options || defaultOptions, function (err) { - if (err) { - reject(err); - } - // make sure attributes is an array in case a string was provided - if (_this.i18next.options.attributes instanceof String) { - _this.i18next.options.attributes = [_this.i18next.options.attributes]; - } - resolve(_this.i18next); - }); - }); - return [2 /*return*/, this.i18nextDeferred]; - }); - }); - }; - I18N.prototype.i18nextReady = function () { - return this.i18nextDeferred; - }; - I18N.prototype.setLocale = function (locale) { - var _this = this; - return new Promise(function (resolve, reject) { - var oldLocale = _this.getLocale(); - _this.i18next.changeLanguage(locale, function (err, tr) { - if (err) { - reject(err); - } - _this.ea.publish(exports.I18N_EA_SIGNAL, { oldValue: oldLocale, newValue: locale }); - _this.signaler.signal("aurelia-translation-signal"); - resolve(tr); - }); - }); - }; - I18N.prototype.getLocale = function () { - return this.i18next.language; - }; - I18N.prototype.nf = function (options, locales) { - return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); - }; - I18N.prototype.uf = function (numberLike, locale) { - var nf = this.nf({}, locale || this.getLocale()); - var comparer = nf.format(10000 / 3); - var thousandSeparator = comparer[1]; - var decimalSeparator = comparer[5]; - if (thousandSeparator === ".") { - thousandSeparator = "\\."; - } - // remove all thousand seperators - var result = numberLike.replace(new RegExp(thousandSeparator, "g"), "") - // remove non-numeric signs except -> , . - .replace(/[^\d.,-]/g, "") - // replace original decimalSeparator with english one - .replace(decimalSeparator, "."); - // return real number - return Number(result); - }; - I18N.prototype.df = function (options, locales) { - return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); - }; - I18N.prototype.tr = function (key, options) { - var fullOptions = this.globalVars; - if (options !== undefined) { - fullOptions = Object.assign(Object.assign({}, this.globalVars), options); - } - return this.i18next.t(key, fullOptions); - }; - I18N.prototype.registerGlobalVariable = function (key, value) { - this.globalVars[key] = value; - }; - I18N.prototype.unregisterGlobalVariable = function (key) { - delete this.globalVars[key]; - }; - /** - * Scans an element for children that have a translation attribute and - * updates their innerHTML with the current translation values. - * - * If an image is encountered the translated value will be applied to the src attribute. - * - * @param el HTMLElement to search within - */ - I18N.prototype.updateTranslations = function (el) { - if (!el || !el.querySelectorAll) { - return; - } - var i; - var l; - // create a selector from the specified attributes to look for - // var selector = [].concat(this.i18next.options.attributes); - var attributes = this.i18next.options.attributes; - var selector = [].concat(attributes); - for (i = 0, l = selector.length; i < l; i++) { - selector[i] = "[" + selector[i] + "]"; - } - selector = selector.join(","); - // get the nodes - var nodes = el.querySelectorAll(selector); - for (i = 0, l = nodes.length; i < l; i++) { - var node = nodes[i]; - var keys = void 0; - var params = void 0; - // test every attribute and get the first one that has a value - for (var i2 = 0, l2 = attributes.length; i2 < l2; i2++) { - keys = node.getAttribute(attributes[i2]); - var pname = attributes[i2] + "-params"; - if (pname && node.au && node.au[pname]) { - params = node.au[pname].viewModel.value; - } - if (keys) { - break; - } - } - // skip if nothing was found - if (!keys) { - continue; - } - // split the keys into multiple keys separated by a ; - this.updateValue(node, keys, params); - } - }; - I18N.prototype.updateValue = function (node, value, params) { - if (value === null || value === undefined) { - return; - } - var keys = value.toString().split(";"); - var i = keys.length; - while (i--) { - var key = keys[i]; - // remove the optional attribute - var re = /\[([a-z\-, ]*)\]/ig; - var m = void 0; - var attr = "text"; - // set default attribute to src if this is an image node - if (node.nodeName === "IMG") { - attr = "src"; - } - // check if a attribute was specified in the key - // tslint:disable-next-line:no-conditional-assignment - while ((m = re.exec(key)) !== null) { - if (m.index === re.lastIndex) { - re.lastIndex++; - } - if (m) { - key = key.replace(m[0], ""); - attr = m[1]; - } - } - var attrs = attr.split(","); - var j = attrs.length; - while (j--) { - attr = attrs[j].trim(); - if (!node._textContent) { - node._textContent = node.textContent; - } - if (!node._innerHTML) { - node._innerHTML = node.innerHTML; - } - // convert to camelCase - // tslint:disable-next-line:only-arrow-functions - var attrCC = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); - var reservedNames = ["prepend", "append", "text", "html"]; - var i18nLogger = LogManager.getLogger("i18n"); - if (reservedNames.indexOf(attr) > -1 && - node.au && - node.au.controller && - node.au.controller.viewModel && - attrCC in node.au.controller.viewModel) { - i18nLogger.warn("Aurelia I18N reserved attribute name\n\n [" + reservedNames.join(", ") + "]\n\n Your custom element has a bindable named " + attr + " which is a reserved word.\n\n If you'd like Aurelia I18N to translate your bindable instead, please consider giving it another name."); - } - if (this.i18next.options.skipTranslationOnMissingKey && - this.tr(key, params) === key) { - i18nLogger.warn("Couldn't find translation for key: " + key); - return; - } - // handle various attributes - // anything other than text,prepend,append or html will be added as an attribute on the element. - switch (attr) { - case "text": - var newChild = aurelia_pal_1.DOM.createTextNode(this.tr(key, params)); - if (node._newChild && node._newChild.parentNode === node) { - node.removeChild(node._newChild); - } - node._newChild = newChild; - while (node.firstChild) { - node.removeChild(node.firstChild); - } - node.appendChild(node._newChild); - break; - case "prepend": - var prependParser = aurelia_pal_1.DOM.createElement("div"); - prependParser.innerHTML = this.tr(key, params); - for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { - if (node.childNodes[ni]._prepended) { - node.removeChild(node.childNodes[ni]); - } - } - for (var pi = prependParser.childNodes.length - 1; pi >= 0; pi--) { - prependParser.childNodes[pi]._prepended = true; - if (node.firstChild) { - node.insertBefore(prependParser.childNodes[pi], node.firstChild); - } - else { - node.appendChild(prependParser.childNodes[pi]); - } - } - break; - case "append": - var appendParser = aurelia_pal_1.DOM.createElement("div"); - appendParser.innerHTML = this.tr(key, params); - for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { - if (node.childNodes[ni]._appended) { - node.removeChild(node.childNodes[ni]); - } - } - while (appendParser.firstChild) { - appendParser.firstChild._appended = true; - node.appendChild(appendParser.firstChild); - } - break; - case "html": - node.innerHTML = this.tr(key, params); - break; - default: // normal html attribute - if (node.au && - node.au.controller && - node.au.controller.viewModel && - attrCC in node.au.controller.viewModel) { - node.au.controller.viewModel[attrCC] = this.tr(key, params); - } - else { - node.setAttribute(attr, this.tr(key, params)); - } - break; - } - } - } - }; - I18N = __decorate([ - aurelia_framework_1.autoinject() - ], I18N); - return I18N; - }()); - exports.I18N = I18N; -}); -//# sourceMappingURL=i18n.js.map \ No newline at end of file diff --git a/dist/amd/i18n.js.map b/dist/amd/i18n.js.map deleted file mode 100644 index 48097c39..00000000 --- a/dist/amd/i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4Ba,QAAA,cAAc,GAAG,qBAAqB,CAAC;IAGpD;QAME,cAAoB,EAAmB,EAAU,QAAyB;YAAtD,OAAE,GAAF,EAAE,CAAiB;YAAU,aAAQ,GAAR,QAAQ,CAAiB;YAFlE,eAAU,GAA2B,EAAE,CAAC;YAG9C,IAAI,CAAC,OAAO,GAAG,iBAAO,CAAC;YACvB,IAAI,CAAC,IAAI,GAAG,sBAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;QACnC,CAAC;QAEY,oBAAK,GAAlB,UAAmB,OAA8C;;;;;oBACzD,cAAc,GAAG;wBACrB,2BAA2B,EAAE,KAAK;wBAClC,gBAAgB,EAAE,IAAI;wBACtB,iBAAiB,EAAE,IAAI;wBACvB,GAAG,EAAE,IAAI;wBACT,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC;wBACzB,WAAW,EAAE,IAAI;wBACjB,KAAK,EAAE,KAAK;qBAC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diff --git a/dist/amd/nf/index.js b/dist/amd/nf/index.js deleted file mode 100644 index 0b763e3f..00000000 --- a/dist/amd/nf/index.js +++ /dev/null @@ -1,10 +0,0 @@ -define(["require", "exports", "./nf-binding-behavior", "./nf-value-converter"], function (require, exports, nf_binding_behavior_1, nf_value_converter_1) { - "use strict"; - function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; - } - Object.defineProperty(exports, "__esModule", { value: true }); - __export(nf_binding_behavior_1); - __export(nf_value_converter_1); -}); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/amd/nf/index.js.map b/dist/amd/nf/index.js.map deleted file mode 100644 index 09c12965..00000000 --- a/dist/amd/nf/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nf/index.ts"],"names":[],"mappings":";;;;;;IAAA,gCAAsC;IACtC,+BAAqC"} \ No newline at end of file diff --git a/dist/amd/nf/nf-binding-behavior.js b/dist/amd/nf/nf-binding-behavior.js deleted file mode 100644 index 71c9e3dd..00000000 --- a/dist/amd/nf/nf-binding-behavior.js +++ /dev/null @@ -1,31 +0,0 @@ -define(["require", "exports", "aurelia-templating-resources", "aurelia-binding"], function (require, exports, aurelia_templating_resources_1, aurelia_binding_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var NfBindingBehavior = /** @class */ (function () { - function NfBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - NfBindingBehavior.inject = function () { return [aurelia_templating_resources_1.SignalBindingBehavior]; }; - NfBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the NfValueConverter. - // pass through any args to the binding behavior to the NfValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new aurelia_binding_1.ValueConverter(expression, "nf", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - NfBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return NfBindingBehavior; - }()); - exports.NfBindingBehavior = NfBindingBehavior; -}); -//# sourceMappingURL=nf-binding-behavior.js.map \ No newline at end of file diff --git a/dist/amd/nf/nf-binding-behavior.js.map b/dist/amd/nf/nf-binding-behavior.js.map deleted file mode 100644 index ef4841dd..00000000 --- a/dist/amd/nf/nf-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nf-binding-behavior.js","sourceRoot":"","sources":["../../../src/nf/nf-binding-behavior.ts"],"names":[],"mappings":";;;IAGA;QAGE,2BAAoB,qBAA4C;YAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;QAAI,CAAC;QAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,oDAAqB,CAAC,CAAC,CAAC,CAAC;QAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;YACnC,2BAA2B;YAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;YACxF,sDAAsD;YACtD,wEAAwE;YACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAClD,2CAA2C;YAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;gBAC9B,OAAO;aACR;YACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;YAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;YAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,gCAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;QACJ,CAAC;QAEM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;YACrC,6BAA6B;YAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACrD,CAAC;QACH,wBAAC;IAAD,CAAC,AA1BD,IA0BC;IA1BY,8CAAiB"} \ No newline at end of file diff --git a/dist/amd/nf/nf-value-converter.js b/dist/amd/nf/nf-value-converter.js deleted file mode 100644 index 19278275..00000000 --- a/dist/amd/nf/nf-value-converter.js +++ /dev/null @@ -1,25 +0,0 @@ -define(["require", "exports", "../i18n"], function (require, exports, i18n_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var NfValueConverter = /** @class */ (function () { - function NfValueConverter(service) { - this.service = service; - } - NfValueConverter.inject = function () { return [i18n_1.I18N]; }; - NfValueConverter.prototype.toView = function (value, nfOrOptions, locale) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (nfOrOptions && (nfOrOptions instanceof Intl.NumberFormat && typeof nfOrOptions.format === "function")) { - return nfOrOptions.format(value); - } - var nf = this.service.nf(nfOrOptions, locale || this.service.getLocale()); - return nf.format(value); - }; - return NfValueConverter; - }()); - exports.NfValueConverter = NfValueConverter; -}); -//# sourceMappingURL=nf-value-converter.js.map \ No newline at end of file diff --git a/dist/amd/nf/nf-value-converter.js.map b/dist/amd/nf/nf-value-converter.js.map deleted file mode 100644 index 8bc80d84..00000000 --- a/dist/amd/nf/nf-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nf-value-converter.js","sourceRoot":"","sources":["../../../src/nf/nf-value-converter.ts"],"names":[],"mappings":";;;IAEA;QAEE,0BAAoB,OAAa;YAAb,YAAO,GAAP,OAAO,CAAM;QAAG,CAAC;QADvB,uBAAM,GAApB,cAAyB,OAAO,CAAC,WAAI,CAAC,CAAC,CAAC,CAAC;QAGlC,iCAAM,GAAb,UACE,KAAU,EACV,WAA0D,EAC1D,MAAe;YAEf,IAAI,KAAK,KAAK,IAAI;mBACb,OAAO,KAAK,KAAK,WAAW;mBAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACnD;gBACF,OAAO,KAAK,CAAC;aACd;YAED,IAAI,WAAW,IAAI,CAAC,WAAW,YAAY,IAAI,CAAC,YAAY,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE;gBACzG,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAClC;YAED,IAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAuC,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;YACxG,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;QACH,uBAAC;IAAD,CAAC,AAvBD,IAuBC;IAvBY,4CAAgB"} \ No newline at end of file diff --git a/dist/amd/relativeTime.js b/dist/amd/relativeTime.js deleted file mode 100644 index 0d64a185..00000000 --- a/dist/amd/relativeTime.js +++ /dev/null @@ -1,92 +0,0 @@ -define(["require", "exports", "aurelia-event-aggregator", "./i18n", "./defaultTranslations/relative.time"], function (require, exports, aurelia_event_aggregator_1, i18n_1, relative_time_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var RelativeTime = /** @class */ (function () { - function RelativeTime(service, ea) { - var _this = this; - this.service = service; - this.ea = ea; - this.service.i18nextReady().then(function () { - _this.setup(); - }); - this.ea.subscribe(i18n_1.I18N_EA_SIGNAL, function (locales) { - _this.setup(locales); - }); - } - RelativeTime.inject = function () { return [i18n_1.I18N, aurelia_event_aggregator_1.EventAggregator]; }; - RelativeTime.prototype.setup = function (locales) { - var trans = relative_time_1.translations.default || relative_time_1.translations; - var fallbackLng = this.service.i18next.fallbackLng; - var alternateFb = fallbackLng || this.service.i18next.options.fallbackLng; - if (Array.isArray(alternateFb) && alternateFb.length > 0) { - alternateFb = alternateFb[0]; - } - var key = ((locales && locales.newValue) - ? locales.newValue - : this.service.getLocale()) || alternateFb; - var index = 0; - // tslint:disable-next-line:no-conditional-assignment - if ((index = key.indexOf("-")) >= 0) { - var baseLocale = key.substring(0, index); - if (trans[baseLocale]) { - this.addTranslationResource(baseLocale, trans[baseLocale].translation); - } - } - if (trans[key]) { - this.addTranslationResource(key, trans[key].translation); - } - if (trans[fallbackLng]) { - this.addTranslationResource(key, trans[fallbackLng].translation); - } - }; - RelativeTime.prototype.addTranslationResource = function (key, translation) { - var options = this.service.i18next.options; - if (options.interpolation && (options.interpolation.prefix !== "__" || options.interpolation.suffix !== "__")) { - // tslint:disable-next-line:forin - for (var subkey in translation) { - translation[subkey] = translation[subkey] - .replace("__count__", (options.interpolation.prefix || "{{") + "count" + (options.interpolation.suffix || "}}")); - } - } - this.service.i18next.addResources(key, options.defaultNS || "translation", translation); - }; - RelativeTime.prototype.getRelativeTime = function (time) { - var now = new Date(); - var diff = now.getTime() - time.getTime(); - var timeDiff = this.getTimeDiffDescription(diff, "year", 31104000000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "month", 2592000000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "day", 86400000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "hour", 3600000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "minute", 60000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "second", 1000); - if (!timeDiff) { - timeDiff = this.service.tr("now"); - } - } - } - } - } - } - return timeDiff; - }; - RelativeTime.prototype.getTimeDiffDescription = function (diff, unit, timeDivisor) { - var unitAmount = parseInt((diff / timeDivisor).toFixed(0), 10); - if (unitAmount > 0) { - return this.service.tr(unit, { count: unitAmount, context: "ago" }); - } - else if (unitAmount < 0) { - var abs = Math.abs(unitAmount); - return this.service.tr(unit, { count: abs, context: "in" }); - } - return null; - }; - return RelativeTime; - }()); - exports.RelativeTime = RelativeTime; -}); -//# sourceMappingURL=relativeTime.js.map \ No newline at end of file diff --git a/dist/amd/relativeTime.js.map b/dist/amd/relativeTime.js.map deleted file mode 100644 index 1b22efa3..00000000 --- a/dist/amd/relativeTime.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"relativeTime.js","sourceRoot":"","sources":["../../src/relativeTime.ts"],"names":[],"mappings":";;;IASA;QAEE,sBAAoB,OAAa,EAAU,EAAmB;YAA9D,iBAQC;YARmB,YAAO,GAAP,OAAO,CAAM;YAAU,OAAE,GAAF,EAAE,CAAiB;YAC5D,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC;gBAC/B,KAAI,CAAC,KAAK,EAAE,CAAC;YACf,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,qBAAc,EAAE,UAAC,OAAyB;gBAC1D,KAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACL,CAAC;QATa,mBAAM,GAApB,cAAyB,OAAO,CAAC,WAAI,EAAE,0CAAe,CAAC,CAAC,CAAC,CAAC;QAWnD,4BAAK,GAAZ,UAAa,OAAgD;YAC3D,IAAM,KAAK,GAAI,4BAAoB,CAAC,OAAO,IAAI,4BAAY,CAAC;YAC5D,IAAM,WAAW,GAAI,IAAI,CAAC,OAAO,CAAC,OAAe,CAAC,WAAW,CAAC;YAE9D,IAAI,WAAW,GAAG,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;YAC1E,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;gBACxD,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;aAC9B;YAED,IAAM,GAAG,GAAG,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC;gBACxC,CAAC,CAAC,OAAO,CAAC,QAAQ;gBAClB,CAAC,CAAC,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B,GAA7B,UACE,IAAY,EAAE,IAA6D,EAAE,WAAmB;YAEhG,IAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,IAAI,GAAG,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACjE,IAAI,UAAU,GAAG,CAAC,EAAE;gBAClB,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;aACrE;iBAAM,IAAI,UAAU,GAAG,CAAC,EAAE;gBACzB,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBACjC,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;aAC7D;YAED,OAAO,IAAI,CAAC;QACd,CAAC;QACH,mBAAC;IAAD,CAAC,AAlGD,IAkGC;IAlGY,oCAAY"} \ No newline at end of file diff --git a/dist/amd/rt/index.js b/dist/amd/rt/index.js deleted file mode 100644 index 42a88bd0..00000000 --- a/dist/amd/rt/index.js +++ /dev/null @@ -1,10 +0,0 @@ -define(["require", "exports", "./rt-binding-behavior", "./rt-value-converter"], function (require, exports, rt_binding_behavior_1, rt_value_converter_1) { - "use strict"; - function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; - } - Object.defineProperty(exports, "__esModule", { value: true }); - __export(rt_binding_behavior_1); - __export(rt_value_converter_1); -}); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/amd/rt/index.js.map b/dist/amd/rt/index.js.map deleted file mode 100644 index c730d048..00000000 --- a/dist/amd/rt/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rt/index.ts"],"names":[],"mappings":";;;;;;IAAA,gCAAsC;IACtC,+BAAqC"} \ No newline at end of file diff --git a/dist/amd/rt/rt-binding-behavior.js b/dist/amd/rt/rt-binding-behavior.js deleted file mode 100644 index 98907b55..00000000 --- a/dist/amd/rt/rt-binding-behavior.js +++ /dev/null @@ -1,31 +0,0 @@ -define(["require", "exports", "aurelia-templating-resources", "aurelia-binding"], function (require, exports, aurelia_templating_resources_1, aurelia_binding_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var RtBindingBehavior = /** @class */ (function () { - function RtBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - RtBindingBehavior.inject = function () { return [aurelia_templating_resources_1.SignalBindingBehavior]; }; - RtBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal", "aurelia-relativetime-signal"); - // rewrite the expression to use the RtValueConverter. - // pass through any args to the binding behavior to the RtValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new aurelia_binding_1.ValueConverter(expression, "rt", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - RtBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return RtBindingBehavior; - }()); - exports.RtBindingBehavior = RtBindingBehavior; -}); -//# sourceMappingURL=rt-binding-behavior.js.map \ No newline at end of file diff --git a/dist/amd/rt/rt-binding-behavior.js.map b/dist/amd/rt/rt-binding-behavior.js.map deleted file mode 100644 index 4bc11cfb..00000000 --- a/dist/amd/rt/rt-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rt-binding-behavior.js","sourceRoot":"","sources":["../../../src/rt/rt-binding-behavior.ts"],"names":[],"mappings":";;;IAGA;QAGE,2BAAoB,qBAA4C;YAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;QAAI,CAAC;QAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,oDAAqB,CAAC,CAAC,CAAC,CAAC;QAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;YACnC,2BAA2B;YAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CACtC,OAAO,EAAE,MAAM,EAAE,4BAA4B,EAAE,6BAA6B,CAC7E,CAAC;YACF,sDAAsD;YACtD,wEAAwE;YACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAClD,2CAA2C;YAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;gBAC9B,OAAO;aACR;YACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;YAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;YAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,gCAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;QACJ,CAAC;QAEM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;YACrC,6BAA6B;YAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACrD,CAAC;QACH,wBAAC;IAAD,CAAC,AA5BD,IA4BC;IA5BY,8CAAiB"} \ No newline at end of file diff --git a/dist/amd/rt/rt-value-converter.js b/dist/amd/rt/rt-value-converter.js deleted file mode 100644 index 9bc29099..00000000 --- a/dist/amd/rt/rt-value-converter.js +++ /dev/null @@ -1,24 +0,0 @@ -define(["require", "exports", "../relativeTime"], function (require, exports, relativeTime_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var RtValueConverter = /** @class */ (function () { - function RtValueConverter(service) { - this.service = service; - } - RtValueConverter.inject = function () { return [relativeTime_1.RelativeTime]; }; - RtValueConverter.prototype.toView = function (value) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (typeof value === "string" && isNaN(value) && !Number.isInteger(value)) { - value = new Date(value); - } - return this.service.getRelativeTime(value); - }; - return RtValueConverter; - }()); - exports.RtValueConverter = RtValueConverter; -}); -//# sourceMappingURL=rt-value-converter.js.map \ No newline at end of file diff --git a/dist/amd/rt/rt-value-converter.js.map b/dist/amd/rt/rt-value-converter.js.map deleted file mode 100644 index c2abfd3b..00000000 --- a/dist/amd/rt/rt-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rt-value-converter.js","sourceRoot":"","sources":["../../../src/rt/rt-value-converter.ts"],"names":[],"mappings":";;;IAEA;QAEE,0BAAoB,OAAqB;YAArB,YAAO,GAAP,OAAO,CAAc;QAAG,CAAC;QAD/B,uBAAM,GAApB,cAAyB,OAAO,CAAC,2BAAY,CAAC,CAAC,CAAC,CAAC;QAG1C,iCAAM,GAAb,UAAc,KAAU;YACtB,IAAI,KAAK,KAAK,IAAI;mBACb,OAAO,KAAK,KAAK,WAAW;mBAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACnD;gBACF,OAAO,KAAK,CAAC;aACd;YAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAY,CAAC,EAAE;gBACvF,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;aACzB;YAED,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC;QACH,uBAAC;IAAD,CAAC,AAlBD,IAkBC;IAlBY,4CAAgB"} \ No newline at end of file diff --git a/dist/amd/t/index.js b/dist/amd/t/index.js deleted file mode 100644 index 653b51e6..00000000 --- a/dist/amd/t/index.js +++ /dev/null @@ -1,12 +0,0 @@ -define(["require", "exports", "./t-binding-behavior", "./t-custom-attribute", "./t-params-custom-attribute", "./t-value-converter"], function (require, exports, t_binding_behavior_1, t_custom_attribute_1, t_params_custom_attribute_1, t_value_converter_1) { - "use strict"; - function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; - } - Object.defineProperty(exports, "__esModule", { value: true }); - __export(t_binding_behavior_1); - __export(t_custom_attribute_1); - __export(t_params_custom_attribute_1); - __export(t_value_converter_1); -}); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/amd/t/index.js.map b/dist/amd/t/index.js.map deleted file mode 100644 index 1470133e..00000000 --- a/dist/amd/t/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/t/index.ts"],"names":[],"mappings":";;;;;;IAAA,+BAAqC;IACrC,+BAAqC;IACrC,sCAA4C;IAC5C,8BAAoC"} \ No newline at end of file diff --git a/dist/amd/t/t-binding-behavior.js b/dist/amd/t/t-binding-behavior.js deleted file mode 100644 index 107c48e2..00000000 --- a/dist/amd/t/t-binding-behavior.js +++ /dev/null @@ -1,31 +0,0 @@ -define(["require", "exports", "aurelia-templating-resources", "aurelia-binding"], function (require, exports, aurelia_templating_resources_1, aurelia_binding_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var TBindingBehavior = /** @class */ (function () { - function TBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - TBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the TValueConverter. - // pass through any args to the binding behavior to the TValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new aurelia_binding_1.ValueConverter(expression, "t", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - TBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - TBindingBehavior.inject = [aurelia_templating_resources_1.SignalBindingBehavior]; - return TBindingBehavior; - }()); - exports.TBindingBehavior = TBindingBehavior; -}); -//# sourceMappingURL=t-binding-behavior.js.map \ No newline at end of file diff --git a/dist/amd/t/t-binding-behavior.js.map b/dist/amd/t/t-binding-behavior.js.map deleted file mode 100644 index 73e16a61..00000000 --- a/dist/amd/t/t-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-binding-behavior.js","sourceRoot":"","sources":["../../../src/t/t-binding-behavior.ts"],"names":[],"mappings":";;;IAGA;QAGE,0BAAoB,qBAA4C;YAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;QAAI,CAAC;QAE9D,+BAAI,GAAX,UAAY,OAAY,EAAE,MAAW;YACnC,2BAA2B;YAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;YACxF,qDAAqD;YACrD,uEAAuE;YACvE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAClD,2CAA2C;YAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;gBAC9B,OAAO;aACR;YACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;YAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;YAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,gCAAc,CAC9C,UAAU,EAAE,GAAG,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC9E,CAAC;QACJ,CAAC;QAEM,iCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;YACrC,6BAA6B;YAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACrD,CAAC;QAxBa,uBAAM,GAAG,CAAC,oDAAqB,CAAC,CAAC;QA0BjD,uBAAC;KAAA,AA3BD,IA2BC;IA3BY,4CAAgB"} \ No newline at end of file diff --git a/dist/amd/t/t-custom-attribute.js b/dist/amd/t/t-custom-attribute.js deleted file mode 100644 index 9b56e001..00000000 --- a/dist/amd/t/t-custom-attribute.js +++ /dev/null @@ -1,60 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -define(["require", "exports", "aurelia-templating", "aurelia-event-aggregator", "aurelia-metadata", "aurelia-pal", "../i18n", "../utils", "./t-params-custom-attribute"], function (require, exports, aurelia_templating_1, aurelia_event_aggregator_1, aurelia_metadata_1, aurelia_pal_1, i18n_1, utils_1, t_params_custom_attribute_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var TCustomAttribute = /** @class */ (function () { - function TCustomAttribute(element, service, ea, p) { - this.element = element; - this.service = service; - this.ea = ea; - this.lazyParams = p; - } - TCustomAttribute_1 = TCustomAttribute; - TCustomAttribute.inject = function () { - return [aurelia_pal_1.DOM.Element, i18n_1.I18N, aurelia_event_aggregator_1.EventAggregator, utils_1.LazyOptional.of(t_params_custom_attribute_1.TParamsCustomAttribute)]; - }; - TCustomAttribute.configureAliases = function (aliases) { - var r = aurelia_metadata_1.metadata.getOrCreateOwn(aurelia_metadata_1.metadata.resource, aurelia_templating_1.HtmlBehaviorResource, TCustomAttribute_1); - r.aliases = aliases; - }; - TCustomAttribute.prototype.bind = function () { - var _this = this; - this.params = this.lazyParams(); - if (this.params) { - this.params.valueChanged = function (newParams, oldParams) { - _this.paramsChanged(_this.value, newParams, oldParams); - }; - } - var p = this.params !== null ? this.params.value : undefined; - this.subscription = this.ea.subscribe(i18n_1.I18N_EA_SIGNAL, function () { - _this.service.updateValue(_this.element, _this.value, _this.params !== null ? _this.params.value : undefined); - }); - this.service.updateValue(this.element, this.value, p); - }; - TCustomAttribute.prototype.paramsChanged = function (newValue, newParams) { - this.service.updateValue(this.element, newValue, newParams); - }; - TCustomAttribute.prototype.valueChanged = function (newValue) { - var p = this.params !== null ? this.params.value : undefined; - this.service.updateValue(this.element, newValue, p); - }; - TCustomAttribute.prototype.unbind = function () { - // If unbind is called before timeout for subscription is triggered, subscription will be undefined - if (this.subscription) { - this.subscription.dispose(); - } - }; - var TCustomAttribute_1; - TCustomAttribute = TCustomAttribute_1 = __decorate([ - aurelia_templating_1.customAttribute("t") - ], TCustomAttribute); - return TCustomAttribute; - }()); - exports.TCustomAttribute = TCustomAttribute; -}); -//# sourceMappingURL=t-custom-attribute.js.map \ No newline at end of file diff --git a/dist/amd/t/t-custom-attribute.js.map b/dist/amd/t/t-custom-attribute.js.map deleted file mode 100644 index ad3dd6c0..00000000 --- a/dist/amd/t/t-custom-attribute.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-custom-attribute.js","sourceRoot":"","sources":["../../../src/t/t-custom-attribute.ts"],"names":[],"mappings":";;;;;;;;;IAmBA;QAcE,0BACU,OAA8B,EAC9B,OAAa,EACb,EAAmB,EAC3B,CAAM;YAHE,YAAO,GAAP,OAAO,CAAuB;YAC9B,YAAO,GAAP,OAAO,CAAM;YACb,OAAE,GAAF,EAAE,CAAiB;YAG3B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACtB,CAAC;6BArBU,gBAAgB;QACb,uBAAM,GAApB;YACE,OAAO,CAAC,iBAAG,CAAC,OAAO,EAAE,WAAI,EAAE,0CAAe,EAAE,oBAAY,CAAC,EAAE,CAAC,kDAAsB,CAAC,CAAC,CAAC;QACvF,CAAC;QACa,iCAAgB,GAA9B,UAA+B,OAAiB;YAC9C,IAAM,CAAC,GAAG,2B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I,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;YAC/D,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QACtD,CAAC;QAEM,iCAAM,GAAb;YACE,mGAAmG;YACnG,IAAI,IAAI,CAAC,YAAY,EAAE;gBACrB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;aAC7B;QACH,CAAC;;QAtDU,gBAAgB;YAD5B,oCAAe,CAAC,GAAG,CAAC;WACR,gBAAgB,CAuD5B;QAAD,uBAAC;KAAA,AAvDD,IAuDC;IAvDY,4CAAgB"} \ No newline at end of file diff --git a/dist/amd/t/t-params-custom-attribute.js b/dist/amd/t/t-params-custom-attribute.js deleted file mode 100644 index b4dedf49..00000000 --- a/dist/amd/t/t-params-custom-attribute.js +++ /dev/null @@ -1,31 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -define(["require", "exports", "aurelia-templating", "aurelia-metadata", "aurelia-pal"], function (require, exports, aurelia_templating_1, aurelia_metadata_1, aurelia_pal_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var TParamsCustomAttribute = /** @class */ (function () { - function TParamsCustomAttribute(element) { - this.element = element; - } - TParamsCustomAttribute_1 = TParamsCustomAttribute; - TParamsCustomAttribute.inject = function () { - return [aurelia_pal_1.DOM.Element]; - }; - TParamsCustomAttribute.configureAliases = function (aliases) { - var r = aurelia_metadata_1.metadata.getOrCreateOwn(aurelia_metadata_1.metadata.resource, aurelia_templating_1.HtmlBehaviorResource, TParamsCustomAttribute_1); - r.aliases = aliases; - }; - TParamsCustomAttribute.prototype.valueChanged = function () { }; - var TParamsCustomAttribute_1; - TParamsCustomAttribute = TParamsCustomAttribute_1 = __decorate([ - aurelia_templating_1.customAttribute("t-params") - ], TParamsCustomAttribute); - return TParamsCustomAttribute; - }()); - exports.TParamsCustomAttribute = TParamsCustomAttribute; -}); -//# sourceMappingURL=t-params-custom-attribute.js.map \ No newline at end of file diff --git a/dist/amd/t/t-params-custom-attribute.js.map b/dist/amd/t/t-params-custom-attribute.js.map deleted file mode 100644 index e73badae..00000000 --- a/dist/amd/t/t-params-custom-attribute.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-params-custom-attribute.js","sourceRoot":"","sources":["../../../src/t/t-params-custom-attribute.ts"],"names":[],"mappings":";;;;;;;;;IAQA;QAYE,gCAAmB,OAAgB;YAAhB,YAAO,GAAP,OAAO,CAAS;QAAI,CAAC;mCAZ7B,sBAAsB;QACnB,6BAAM,GAApB;YACE,OAAO,CAAC,iBAAG,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;QAEa,uCAAgB,GAA9B,UAA+B,OAAiB;YAC9C,IAAM,CAAC,GAAG,2BAAQ,CAAC,cAAc,CAAC,2BAAQ,CAAC,QAAQ,EAAE,yCAAoB,EAAE,wBAAsB,CAAC,CAAC;YAClG,CAAS,CAAC,OAAO,GAAG,OAAO,CAAC;QAC/B,CAAC;QAMM,6CAAY,GAAnB,cAA6B,CAAC;;QAdnB,sBAAsB;YADlC,oCAAe,CAAC,UAAU,CAAC;WACf,sBAAsB,CAelC;QAAD,6BAAC;KAAA,AAfD,IAeC;IAfY,wDAAsB"} \ No newline at end of file diff --git a/dist/amd/t/t-value-converter.js b/dist/amd/t/t-value-converter.js deleted file mode 100644 index b0783b00..00000000 --- a/dist/amd/t/t-value-converter.js +++ /dev/null @@ -1,16 +0,0 @@ -define(["require", "exports", "../i18n"], function (require, exports, i18n_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var TValueConverter = /** @class */ (function () { - function TValueConverter(service) { - this.service = service; - } - TValueConverter.inject = function () { return [i18n_1.I18N]; }; - TValueConverter.prototype.toView = function (value, options) { - return this.service.tr(value, options); - }; - return TValueConverter; - }()); - exports.TValueConverter = TValueConverter; -}); -//# sourceMappingURL=t-value-converter.js.map \ No newline at end of file diff --git a/dist/amd/t/t-value-converter.js.map b/dist/amd/t/t-value-converter.js.map deleted file mode 100644 index 3b8f2220..00000000 --- a/dist/amd/t/t-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-value-converter.js","sourceRoot":"","sources":["../../../src/t/t-value-converter.ts"],"names":[],"mappings":";;;IAIA;QAGE,yBAAoB,OAAa;YAAb,YAAO,GAAP,OAAO,CAAM;QAAI,CAAC;QAFxB,sBAAM,GAApB,cAAyB,OAAO,CAAC,WAAI,CAAC,CAAC,CAAC,CAAC;QAIlC,gCAAM,GAAb,UAAc,KAAU,EAAE,OAA4C;YACpE,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACzC,CAAC;QACH,sBAAC;IAAD,CAAC,AARD,IAQC;IARY,0CAAe"} \ No newline at end of file diff --git a/dist/amd/utils.js b/dist/amd/utils.js deleted file mode 100644 index 3107c199..00000000 --- a/dist/amd/utils.js +++ /dev/null @@ -1,63 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -define(["require", "exports", "aurelia-dependency-injection"], function (require, exports, aurelia_dependency_injection_1) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.extend = function (destination, source) { - // tslint:disable-next-line:forin - for (var property in source) { - destination[property] = source[property]; - } - return destination; - }; - // tslint:disable-next-line:only-arrow-functions - exports.isInteger = Number.isInteger || function (value) { - return typeof value === "number" && - isFinite(value) && - Math.floor(value) === value; - }; - exports.assignObjectToKeys = function (root, obj) { - if (obj === undefined || obj === null) { - return obj; - } - var opts = {}; - Object.keys(obj).map(function (key) { - if (typeof obj[key] === "object") { - exports.extend(opts, exports.assignObjectToKeys(key, obj[key])); - } - else { - opts[root !== "" ? root + "." + key : key] = obj[key]; - } - }); - return opts; - }; - var LazyOptional = /** @class */ (function () { - function LazyOptional(key) { - this.key = key; - } - LazyOptional_1 = LazyOptional; - LazyOptional.of = function (key) { - return new LazyOptional_1(key); - }; - LazyOptional.prototype.get = function (container) { - var _this = this; - return function () { - if (container.hasResolver(_this.key, false)) { - return container.get(_this.key); - } - return null; - }; - }; - var LazyOptional_1; - LazyOptional = LazyOptional_1 = __decorate([ - aurelia_dependency_injection_1.resolver() - ], LazyOptional); - return LazyOptional; - }()); - exports.LazyOptional = LazyOptional; -}); -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/dist/amd/utils.js.map b/dist/amd/utils.js.map deleted file mode 100644 index 74e5dfe7..00000000 --- a/dist/amd/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;;;;IAKW,QAAA,MAAM,GAAG,UAAC,WAAgB,EAAE,MAAW;QAChD,iCAAiC;QACjC,KAAK,IAAM,QAAQ,IAAI,MAAM,EAAE;YAC7B,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;SAC1C;QAED,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;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AG,CAAC,CAAC;iBAChC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;QACJ,CAAC;;QAdU,YAAY;YADxB,uCAAQ,EAAE;WACE,YAAY,CAexB;QAAD,mBAAC;KAAA,AAfD,IAeC;IAfY,oCAAY"} \ No newline at end of file diff --git a/dist/aurelia-i18n.d.ts b/dist/aurelia-i18n.d.ts new file mode 100644 index 00000000..c4c70af6 --- /dev/null +++ b/dist/aurelia-i18n.d.ts @@ -0,0 +1,175 @@ +import i18next from "i18next"; +import { Container } from 'aurelia-dependency-injection'; +import { EventAggregator } from 'aurelia-event-aggregator'; +import { FrameworkConfiguration } from 'aurelia-framework'; +import { Loader } from 'aurelia-loader'; +import { BindingSignaler, SignalBindingBehavior } from 'aurelia-templating-resources'; + +export interface AureliaEnhancedOptions extends i18next.InitOptions { + attributes?: string[]; + skipTranslationOnMissingKey?: boolean; +} +export interface AureliaEnhancedI18Next extends i18next.i18n { + options: AureliaEnhancedOptions; +} +export interface I18NEventPayload { + oldValue: string; + newValue: string; +} +export declare const I18N_EA_SIGNAL = "i18n:locale:changed"; +export declare class I18N { + private ea; + private signaler; + static inject(): (typeof EventAggregator | typeof BindingSignaler)[]; + i18nextDeferred: Promise; + i18next: AureliaEnhancedI18Next; + Intl: typeof Intl; + private globalVars; + constructor(ea: EventAggregator, signaler: BindingSignaler); + setup(options?: AureliaEnhancedOptions & i18next.InitOptions): Promise; + i18nextReady(): Promise; + setLocale(locale: string): Promise; + getLocale(): string; + nf(options?: Intl.NumberFormatOptions, locales?: string | string[]): Intl.NumberFormat; + uf(numberLike: string, locale?: string): number; + df(options?: Intl.DateTimeFormatOptions, locales?: string | string[]): Intl.DateTimeFormat; + tr(key: string | string[], options?: i18next.TranslationOptions): any; + registerGlobalVariable(key: string, value: any): void; + unregisterGlobalVariable(key: string): void; + /** + * Scans an element for children that have a translation attribute and + * updates their innerHTML with the current translation values. + * + * If an image is encountered the translated value will be applied to the src attribute. + * + * @param el HTMLElement to search within + */ + updateTranslations(el: HTMLElement): void; + updateValue(node: Element & { + au: any; + }, value: string, params: any): void; +} +export declare class RelativeTime { + private service; + private ea; + static inject(): (typeof EventAggregator | typeof I18N)[]; + constructor(service: I18N, ea: EventAggregator); + setup(locales?: { + oldValue: string; + newValue: string; + }): void; + addTranslationResource(key: string, translation: any): void; + getRelativeTime(time: Date): any; + getTimeDiffDescription(diff: number, unit: "year" | "month" | "day" | "hour" | "minute" | "second", timeDivisor: number): any; +} +export declare type LoadPathOption = string | ((lngs: string[], namespaces: string[]) => string); +export declare type LoadCallback = (error: any, result: string | false | undefined) => void; +export interface AureliaBackendOptions { + loadPath?: LoadPathOption; + parse?(data: string, url: string): string; +} +export declare class Backend { + services: any; + options: AureliaBackendOptions; + static type: string; + static loader: Loader; + static with(loader: Loader): typeof Backend; + type: string; + constructor(services: any, options?: AureliaBackendOptions); + init(services: any, options?: AureliaBackendOptions): void; + readMulti(languages: string[], namespaces: string[], callback: LoadCallback): void; + read(language: string, namespace: string, callback: LoadCallback): void; + loadUrl(url: string, callback: LoadCallback): Promise; + create(_languages: string | string[], _namespace: string, _key: string, _fallbackValue: string): void; +} +export declare class DfBindingBehavior { + private signalBindingBehavior; + static inject(): (typeof SignalBindingBehavior)[]; + constructor(signalBindingBehavior: SignalBindingBehavior); + bind(binding: any, source: any): void; + unbind(binding: any, source: any): void; +} +export declare class DfValueConverter { + private service; + static inject(): (typeof I18N)[]; + constructor(service: I18N); + toView(value: any, dfOrOptions?: Intl.DateTimeFormat | Intl.DateTimeFormatOptions, locale?: string): any; +} +export declare class NfBindingBehavior { + private signalBindingBehavior; + static inject(): (typeof SignalBindingBehavior)[]; + constructor(signalBindingBehavior: SignalBindingBehavior); + bind(binding: any, source: any): void; + unbind(binding: any, source: any): void; +} +export declare class NfValueConverter { + private service; + static inject(): (typeof I18N)[]; + constructor(service: I18N); + toView(value: any, nfOrOptions?: Intl.NumberFormat | Intl.NumberFormatOptions, locale?: string): any; +} +export declare class RtBindingBehavior { + private signalBindingBehavior; + static inject(): (typeof SignalBindingBehavior)[]; + constructor(signalBindingBehavior: SignalBindingBehavior); + bind(binding: any, source: any): void; + unbind(binding: any, source: any): void; +} +export declare class RtValueConverter { + private service; + static inject(): (typeof RelativeTime)[]; + constructor(service: RelativeTime); + toView(value: any): any; +} +export declare class TBindingBehavior { + private signalBindingBehavior; + static inject(): (typeof SignalBindingBehavior)[]; + constructor(signalBindingBehavior: SignalBindingBehavior); + bind(binding: any, source: any): void; + unbind(binding: any, source: any): void; +} +declare class LazyOptional { + private key; + static of(key: any): LazyOptional; + constructor(key: string); + get(container: Container): () => any; +} +export declare class TCustomAttribute { + private element; + private service; + private ea; + static inject(): ({ + new (): Element; + prototype: Element; + } | typeof EventAggregator | typeof I18N | LazyOptional)[]; + static configureAliases(aliases: string[]): void; + private params; + private lazyParams; + private subscription; + private value; + constructor(element: Element & { + au: any; + }, service: I18N, ea: EventAggregator, p: any); + bind(): void; + paramsChanged(newValue: any, newParams: any): void; + valueChanged(newValue: any): void; + unbind(): void; +} +export declare class TParamsCustomAttribute { + element: Element; + static inject(): { + new (): Element; + prototype: Element; + }[]; + static configureAliases(aliases: string[]): void; + service: any; + constructor(element: Element); + valueChanged(): void; +} +export declare class TValueConverter { + private service; + static inject(): (typeof I18N)[]; + constructor(service: I18N); + toView(value: any, options?: i18next.TranslationOptions): any; +} +export declare function configure(frameworkConfig: FrameworkConfiguration, cb: (instance: I18N) => AureliaEnhancedI18Next): AureliaEnhancedI18Next; \ No newline at end of file diff --git a/dist/commonjs/aurelia-i18n-loader.js b/dist/commonjs/aurelia-i18n-loader.js deleted file mode 100644 index 444cc85e..00000000 --- a/dist/commonjs/aurelia-i18n-loader.js +++ /dev/null @@ -1,119 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var Backend = /** @class */ (function () { - function Backend(services, options) { - if (options === void 0) { options = {}; } - this.services = services; - this.options = options; - this.type = "backend"; - this.init(services, options); - } - Backend.with = function (loader) { - this.loader = loader; - return this; - }; - Backend.prototype.init = function (services, options) { - if (options === void 0) { options = {}; } - this.services = services; - this.options = Object.assign({}, { - loadPath: "/locales/{{lng}}/{{ns}}.json", - addPath: "locales/add/{{lng}}/{{ns}}", - allowMultiLoading: false, - parse: JSON.parse - }, options); - }; - Backend.prototype.readMulti = function (languages, namespaces, callback) { - var loadPath = this.options.loadPath; - if (typeof this.options.loadPath === "function") { - loadPath = this.options.loadPath(languages, namespaces); - } - var url = this.services - .interpolator - .interpolate(loadPath, { lng: languages.join("+"), ns: namespaces.join("+") }); - this.loadUrl(url, callback); - }; - Backend.prototype.read = function (language, namespace, callback) { - var loadPath = this.options.loadPath; - if (typeof this.options.loadPath === "function") { - loadPath = this.options.loadPath([language], [namespace]); - } - var url = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }); - this.loadUrl(url, callback); - }; - Backend.prototype.loadUrl = function (url, callback) { - return __awaiter(this, void 0, void 0, function () { - var response, ret, err, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 2, , 3]); - return [4 /*yield*/, Backend.loader.loadText(url)]; - case 1: - response = _b.sent(); - ret = void 0; - err = void 0; - try { - ret = (response instanceof Object) ? response : this.options.parse(response, url); - } - catch (e) { - err = "failed parsing " + url + " to json"; - } - if (err) { - return [2 /*return*/, callback(err, false)]; - } - callback(null, ret); - return [3 /*break*/, 3]; - case 2: - _a = _b.sent(); - callback("failed loading " + url, false /* no retry */); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); - }; - // tslint:disable-next-line:variable-name - Backend.prototype.create = function (_languages, _namespace, _key, _fallbackValue) { - // not supported - }; - Backend.type = "backend"; - return Backend; -}()); -exports.Backend = Backend; -exports.default = Backend; -//# sourceMappingURL=aurelia-i18n-loader.js.map \ No newline at end of file diff --git a/dist/commonjs/aurelia-i18n-loader.js.map b/dist/commonjs/aurelia-i18n-loader.js.map deleted file mode 100644 index c83d8c66..00000000 --- a/dist/commonjs/aurelia-i18n-loader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aurelia-i18n-loader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7B;wBACD,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;;;;wBAEpB,QAAQ,CAAC,iBAAiB,GAAG,GAAG,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;;;;;;KAE3D;IAED,yCAAyC;IAClC,wBAAM,GAAb,UAAc,UAA6B,EAAE,UAAkB,EAAE,IAAY,EAAE,cAAsB;QACnG,gBAAgB;IAClB,CAAC;IAxEa,YAAI,GAAW,SAAS,CAAC;IAyEzC,cAAC;CAAA,AA3ED,IA2EC;AA3EY,0BAAO;AA6EpB,kBAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/dist/commonjs/aurelia-i18n.js b/dist/commonjs/aurelia-i18n.js index ebbf309c..f615d553 100644 --- a/dist/commonjs/aurelia-i18n.js +++ b/dist/commonjs/aurelia-i18n.js @@ -1,58 +1,1377 @@ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var i18next = _interopDefault(require('i18next')); +var LogManager = require('aurelia-logging'); +var aureliaDependencyInjection = require('aurelia-dependency-injection'); +var aureliaTemplating = require('aurelia-templating'); +var aureliaMetadata = require('aurelia-metadata'); +var aureliaPal = require('aurelia-pal'); +var aureliaFramework = require('aurelia-framework'); +var aureliaTemplatingResources = require('aurelia-templating-resources'); +var aureliaEventAggregator = require('aurelia-event-aggregator'); +var aureliaBinding = require('aurelia-binding'); + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } } -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_event_aggregator_1 = require("aurelia-event-aggregator"); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_templating_resources_1 = require("aurelia-templating-resources"); -var aurelia_pal_1 = require("aurelia-pal"); -var i18n_1 = require("./i18n"); -__export(require("./i18n")); -__export(require("./relativeTime")); -__export(require("./aurelia-i18n-loader")); -var df_1 = require("./df"); -exports.DfValueConverter = df_1.DfValueConverter; -exports.DfBindingBehavior = df_1.DfBindingBehavior; -var nf_1 = require("./nf"); -exports.NfValueConverter = nf_1.NfValueConverter; -exports.NfBindingBehavior = nf_1.NfBindingBehavior; -var rt_1 = require("./rt"); -exports.RtValueConverter = rt_1.RtValueConverter; -exports.RtBindingBehavior = rt_1.RtBindingBehavior; -var t_1 = require("./t"); -exports.TValueConverter = t_1.TValueConverter; -exports.TBindingBehavior = t_1.TBindingBehavior; -exports.TCustomAttribute = t_1.TCustomAttribute; -exports.TParamsCustomAttribute = t_1.TParamsCustomAttribute; + +var I18N_EA_SIGNAL = "i18n:locale:changed"; +var I18N = /** @class */ (function () { + function I18N(ea, signaler) { + this.ea = ea; + this.signaler = signaler; + this.globalVars = {}; + this.i18next = i18next; + this.Intl = aureliaPal.PLATFORM.global.Intl; + } + I18N.inject = function () { return [aureliaEventAggregator.EventAggregator, aureliaTemplatingResources.BindingSignaler]; }; + I18N.prototype.setup = function (options) { + return __awaiter(this, void 0, void 0, function () { + var defaultOptions; + var _this = this; + return __generator(this, function (_a) { + defaultOptions = { + skipTranslationOnMissingKey: false, + compatibilityAPI: "v1", + compatibilityJSON: "v1", + lng: "en", + attributes: ["t", "i18n"], + fallbackLng: "en", + debug: false + }; + this.i18nextDeferred = new Promise(function (resolve, reject) { + _this.i18next = _this.i18next.init(options || defaultOptions, function (err) { + if (err) { + reject(err); + } + // make sure attributes is an array in case a string was provided + if (_this.i18next.options.attributes instanceof String) { + _this.i18next.options.attributes = [_this.i18next.options.attributes]; + } + resolve(_this.i18next); + }); + }); + return [2 /*return*/, this.i18nextDeferred]; + }); + }); + }; + I18N.prototype.i18nextReady = function () { + return this.i18nextDeferred; + }; + I18N.prototype.setLocale = function (locale) { + var _this = this; + return new Promise(function (resolve, reject) { + var oldLocale = _this.getLocale(); + _this.i18next.changeLanguage(locale, function (err, tr) { + if (err) { + reject(err); + } + _this.ea.publish(I18N_EA_SIGNAL, { oldValue: oldLocale, newValue: locale }); + _this.signaler.signal("aurelia-translation-signal"); + resolve(tr); + }); + }); + }; + I18N.prototype.getLocale = function () { + return this.i18next.language; + }; + I18N.prototype.nf = function (options, locales) { + return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); + }; + I18N.prototype.uf = function (numberLike, locale) { + var nf = this.nf({}, locale || this.getLocale()); + var comparer = nf.format(10000 / 3); + var thousandSeparator = comparer[1]; + var decimalSeparator = comparer[5]; + if (thousandSeparator === ".") { + thousandSeparator = "\\."; + } + // remove all thousand seperators + var result = numberLike.replace(new RegExp(thousandSeparator, "g"), "") + // remove non-numeric signs except -> , . + .replace(/[^\d.,-]/g, "") + // replace original decimalSeparator with english one + .replace(decimalSeparator, "."); + // return real number + return Number(result); + }; + I18N.prototype.df = function (options, locales) { + return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); + }; + I18N.prototype.tr = function (key, options) { + var fullOptions = this.globalVars; + if (options !== undefined) { + fullOptions = Object.assign(Object.assign({}, this.globalVars), options); + } + return this.i18next.t(key, fullOptions); + }; + I18N.prototype.registerGlobalVariable = function (key, value) { + this.globalVars[key] = value; + }; + I18N.prototype.unregisterGlobalVariable = function (key) { + delete this.globalVars[key]; + }; + /** + * Scans an element for children that have a translation attribute and + * updates their innerHTML with the current translation values. + * + * If an image is encountered the translated value will be applied to the src attribute. + * + * @param el HTMLElement to search within + */ + I18N.prototype.updateTranslations = function (el) { + if (!el || !el.querySelectorAll) { + return; + } + var i; + var l; + // create a selector from the specified attributes to look for + // var selector = [].concat(this.i18next.options.attributes); + var attributes = this.i18next.options.attributes; + var selector = [].concat(attributes); + for (i = 0, l = selector.length; i < l; i++) { + selector[i] = "[" + selector[i] + "]"; + } + selector = selector.join(","); + // get the nodes + var nodes = el.querySelectorAll(selector); + for (i = 0, l = nodes.length; i < l; i++) { + var node = nodes[i]; + var keys = void 0; + var params = void 0; + // test every attribute and get the first one that has a value + for (var i2 = 0, l2 = attributes.length; i2 < l2; i2++) { + keys = node.getAttribute(attributes[i2]); + var pname = attributes[i2] + "-params"; + if (pname && node.au && node.au[pname]) { + params = node.au[pname].viewModel.value; + } + if (keys) { + break; + } + } + // skip if nothing was found + if (!keys) { + continue; + } + // split the keys into multiple keys separated by a ; + this.updateValue(node, keys, params); + } + }; + I18N.prototype.updateValue = function (node, value, params) { + if (value === null || value === undefined) { + return; + } + var keys = value.toString().split(";"); + var i = keys.length; + while (i--) { + var key = keys[i]; + // remove the optional attribute + var re = /\[([a-z\-, ]*)\]/ig; + var m = void 0; + var attr = "text"; + // set default attribute to src if this is an image node + if (node.nodeName === "IMG") { + attr = "src"; + } + // check if a attribute was specified in the key + // tslint:disable-next-line:no-conditional-assignment + while ((m = re.exec(key)) !== null) { + if (m.index === re.lastIndex) { + re.lastIndex++; + } + if (m) { + key = key.replace(m[0], ""); + attr = m[1]; + } + } + var attrs = attr.split(","); + var j = attrs.length; + while (j--) { + attr = attrs[j].trim(); + if (!node._textContent) { + node._textContent = node.textContent; + } + if (!node._innerHTML) { + node._innerHTML = node.innerHTML; + } + // convert to camelCase + // tslint:disable-next-line:only-arrow-functions + var attrCC = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); + var reservedNames = ["prepend", "append", "text", "html"]; + var i18nLogger = LogManager.getLogger("i18n"); + if (reservedNames.indexOf(attr) > -1 && + node.au && + node.au.controller && + node.au.controller.viewModel && + attrCC in node.au.controller.viewModel) { + i18nLogger.warn("Aurelia I18N reserved attribute name\n\n [" + reservedNames.join(", ") + "]\n\n Your custom element has a bindable named " + attr + " which is a reserved word.\n\n If you'd like Aurelia I18N to translate your bindable instead, please consider giving it another name."); + } + if (this.i18next.options.skipTranslationOnMissingKey && + this.tr(key, params) === key) { + i18nLogger.warn("Couldn't find translation for key: " + key); + return; + } + // handle various attributes + // anything other than text,prepend,append or html will be added as an attribute on the element. + switch (attr) { + case "text": + var newChild = aureliaPal.DOM.createTextNode(this.tr(key, params)); + if (node._newChild && node._newChild.parentNode === node) { + node.removeChild(node._newChild); + } + node._newChild = newChild; + while (node.firstChild) { + node.removeChild(node.firstChild); + } + node.appendChild(node._newChild); + break; + case "prepend": + var prependParser = aureliaPal.DOM.createElement("div"); + prependParser.innerHTML = this.tr(key, params); + for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { + if (node.childNodes[ni]._prepended) { + node.removeChild(node.childNodes[ni]); + } + } + for (var pi = prependParser.childNodes.length - 1; pi >= 0; pi--) { + prependParser.childNodes[pi]._prepended = true; + if (node.firstChild) { + node.insertBefore(prependParser.childNodes[pi], node.firstChild); + } + else { + node.appendChild(prependParser.childNodes[pi]); + } + } + break; + case "append": + var appendParser = aureliaPal.DOM.createElement("div"); + appendParser.innerHTML = this.tr(key, params); + for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { + if (node.childNodes[ni]._appended) { + node.removeChild(node.childNodes[ni]); + } + } + while (appendParser.firstChild) { + appendParser.firstChild._appended = true; + node.appendChild(appendParser.firstChild); + } + break; + case "html": + node.innerHTML = this.tr(key, params); + break; + default: // normal html attribute + if (node.au && + node.au.controller && + node.au.controller.viewModel && + attrCC in node.au.controller.viewModel) { + node.au.controller.viewModel[attrCC] = this.tr(key, params); + } + else { + node.setAttribute(attr, this.tr(key, params)); + } + break; + } + } + } + }; + return I18N; +}()); + +var TBindingBehavior = /** @class */ (function () { + function TBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + TBindingBehavior.inject = function () { return [aureliaTemplatingResources.SignalBindingBehavior]; }; + TBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the TValueConverter. + // pass through any args to the binding behavior to the TValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new aureliaBinding.ValueConverter(expression, "t", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + TBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + TBindingBehavior = __decorate([ + aureliaBinding.bindingBehavior("t") + ], TBindingBehavior); + return TBindingBehavior; +}()); + +// tslint:disable-next-line:only-arrow-functions +var isInteger = Number.isInteger || function (value) { + return typeof value === "number" && + isFinite(value) && + Math.floor(value) === value; +}; +var LazyOptional = /** @class */ (function () { + function LazyOptional(key) { + this.key = key; + } + LazyOptional_1 = LazyOptional; + LazyOptional.of = function (key) { + return new LazyOptional_1(key); + }; + LazyOptional.prototype.get = function (container) { + var _this = this; + return function () { + if (container.hasResolver(_this.key, false)) { + return container.get(_this.key); + } + return null; + }; + }; + var LazyOptional_1; + LazyOptional = LazyOptional_1 = __decorate([ + aureliaDependencyInjection.resolver() + ], LazyOptional); + return LazyOptional; +}()); + +var TParamsCustomAttribute = /** @class */ (function () { + function TParamsCustomAttribute(element) { + this.element = element; + } + TParamsCustomAttribute_1 = TParamsCustomAttribute; + TParamsCustomAttribute.inject = function () { + return [aureliaPal.DOM.Element]; + }; + TParamsCustomAttribute.configureAliases = function (aliases) { + var r = aureliaMetadata.metadata.getOrCreateOwn(aureliaMetadata.metadata.resource, aureliaTemplating.HtmlBehaviorResource, TParamsCustomAttribute_1); + r.aliases = aliases; + }; + TParamsCustomAttribute.prototype.valueChanged = function () { }; + var TParamsCustomAttribute_1; + TParamsCustomAttribute = TParamsCustomAttribute_1 = __decorate([ + aureliaTemplating.customAttribute("t-params") + ], TParamsCustomAttribute); + return TParamsCustomAttribute; +}()); + +var TCustomAttribute = /** @class */ (function () { + function TCustomAttribute(element, service, ea, p) { + this.element = element; + this.service = service; + this.ea = ea; + this.lazyParams = p; + } + TCustomAttribute_1 = TCustomAttribute; + TCustomAttribute.inject = function () { + return [aureliaPal.DOM.Element, I18N, aureliaEventAggregator.EventAggregator, LazyOptional.of(TParamsCustomAttribute)]; + }; + TCustomAttribute.configureAliases = function (aliases) { + var r = aureliaMetadata.metadata.getOrCreateOwn(aureliaMetadata.metadata.resource, aureliaTemplating.HtmlBehaviorResource, TCustomAttribute_1); + r.aliases = aliases; + }; + TCustomAttribute.prototype.bind = function () { + var _this = this; + this.params = this.lazyParams(); + if (this.params) { + this.params.valueChanged = function (newParams, oldParams) { + _this.paramsChanged(_this.value, newParams, oldParams); + }; + } + var p = this.params !== null ? this.params.value : undefined; + this.subscription = this.ea.subscribe(I18N_EA_SIGNAL, function () { + _this.service.updateValue(_this.element, _this.value, _this.params !== null ? _this.params.value : undefined); + }); + this.service.updateValue(this.element, this.value, p); + }; + TCustomAttribute.prototype.paramsChanged = function (newValue, newParams) { + this.service.updateValue(this.element, newValue, newParams); + }; + TCustomAttribute.prototype.valueChanged = function (newValue) { + var p = this.params !== null ? this.params.value : undefined; + this.service.updateValue(this.element, newValue, p); + }; + TCustomAttribute.prototype.unbind = function () { + // If unbind is called before timeout for subscription is triggered, subscription will be undefined + if (this.subscription) { + this.subscription.dispose(); + } + }; + var TCustomAttribute_1; + TCustomAttribute = TCustomAttribute_1 = __decorate([ + aureliaTemplating.customAttribute("t") + ], TCustomAttribute); + return TCustomAttribute; +}()); + +var TValueConverter = /** @class */ (function () { + function TValueConverter(service) { + this.service = service; + } + TValueConverter.inject = function () { return [I18N]; }; + TValueConverter.prototype.toView = function (value, options) { + return this.service.tr(value, options); + }; + TValueConverter = __decorate([ + aureliaFramework.valueConverter("t") + ], TValueConverter); + return TValueConverter; +}()); + +var NfBindingBehavior = /** @class */ (function () { + function NfBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + NfBindingBehavior.inject = function () { return [aureliaTemplatingResources.SignalBindingBehavior]; }; + NfBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the NfValueConverter. + // pass through any args to the binding behavior to the NfValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new aureliaBinding.ValueConverter(expression, "nf", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + NfBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + NfBindingBehavior = __decorate([ + aureliaBinding.bindingBehavior("nf") + ], NfBindingBehavior); + return NfBindingBehavior; +}()); + +var NfValueConverter = /** @class */ (function () { + function NfValueConverter(service) { + this.service = service; + } + NfValueConverter.inject = function () { return [I18N]; }; + NfValueConverter.prototype.toView = function (value, nfOrOptions, locale) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (nfOrOptions && (nfOrOptions instanceof Intl.NumberFormat && typeof nfOrOptions.format === "function")) { + return nfOrOptions.format(value); + } + var nf = this.service.nf(nfOrOptions, locale || this.service.getLocale()); + return nf.format(value); + }; + NfValueConverter = __decorate([ + aureliaBinding.valueConverter("nf") + ], NfValueConverter); + return NfValueConverter; +}()); + +var DfBindingBehavior = /** @class */ (function () { + function DfBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + DfBindingBehavior.inject = function () { return [aureliaTemplatingResources.SignalBindingBehavior]; }; + DfBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the DfValueConverter. + // pass through any args to the binding behavior to the DfValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new aureliaBinding.ValueConverter(expression, "df", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + DfBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + DfBindingBehavior = __decorate([ + aureliaBinding.bindingBehavior("df") + ], DfBindingBehavior); + return DfBindingBehavior; +}()); + +var DfValueConverter = /** @class */ (function () { + function DfValueConverter(service) { + this.service = service; + } + DfValueConverter.inject = function () { return [I18N]; }; + DfValueConverter.prototype.toView = function (value, dfOrOptions, locale) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (typeof value === "string" && isNaN(value) && !isInteger(value)) { + value = new Date(value); + } + if (dfOrOptions && (dfOrOptions instanceof Intl.DateTimeFormat && typeof dfOrOptions.format === "function")) { + return dfOrOptions.format(value); + } + var df = this.service.df(dfOrOptions, locale || this.service.getLocale()); + return df.format(value); + }; + DfValueConverter = __decorate([ + aureliaBinding.valueConverter("df") + ], DfValueConverter); + return DfValueConverter; +}()); + +var RtBindingBehavior = /** @class */ (function () { + function RtBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + RtBindingBehavior.inject = function () { return [aureliaTemplatingResources.SignalBindingBehavior]; }; + RtBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal", "aurelia-relativetime-signal"); + // rewrite the expression to use the RtValueConverter. + // pass through any args to the binding behavior to the RtValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new aureliaBinding.ValueConverter(expression, "rt", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + RtBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + RtBindingBehavior = __decorate([ + aureliaBinding.bindingBehavior("rt") + ], RtBindingBehavior); + return RtBindingBehavior; +}()); + +var translations = { + ar: { + translation: { + now: 'الآن', + second_ago: 'منذ __count__ ثانية', + second_ago_plural: 'منذ __count__ ثواني', + second_in: 'في __count__ ثانية', + second_in_plural: 'في __count__ ثواني', + minute_ago: 'منذ __count__ دقيقة', + minute_ago_plural: 'منذ __count__ دقائق', + minute_in: 'في __count__ دقيقة', + minute_in_plural: 'في __count__ دقائق', + hour_ago: 'منذ __count__ ساعة', + hour_ago_plural: 'منذ __count__ ساعات', + hour_in: 'في __count__ ساعة', + hour_in_plural: 'في __count__ ساعات', + day_ago: 'منذ __count__ يوم', + day_ago_plural: 'منذ __count__ أيام', + day_in: 'في __count__ يوم', + day_in_plural: 'في __count__ أيام', + month_ago: 'منذ __count__ شهر', + month_ago_plural: 'منذ __count__ أشهر', + month_in: 'في __count__ شهر', + month_in_plural: 'في __count__ أشهر', + year_ago: 'منذ __count__ سنة', + year_ago_plural: 'منذ __count__ سنوات', + year_in: 'في __count__ سنة', + year_in_plural: 'في __count__ سنوات' + } + }, + da: { + translation: { + now: 'lige nu', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'i __count__ sekund', + second_in_plural: 'i __count__ sekunder', + minute_ago: '__count__ minut siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'i __count__ minut', + minute_in_plural: 'i __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'i __count__ time', + hour_in_plural: 'i __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dage siden', + day_in: 'i __count__ dag', + day_in_plural: 'i __count__ dage', + month_ago: '__count__ måned siden', + month_ago_plural: '__count__ måneder siden', + month_in: 'i __count__ måned', + month_in_plural: 'i __count__ måneder', + year_ago: '__count__ år siden', + year_ago_plural: '__count__ år siden', + year_in: 'i __count__ år', + year_in_plural: 'i __count__ år' + } + }, + de: { + translation: { + now: 'jetzt gerade', + second_ago: 'vor __count__ Sekunde', + second_ago_plural: 'vor __count__ Sekunden', + second_in: 'in __count__ Sekunde', + second_in_plural: 'in __count__ Sekunden', + minute_ago: 'vor __count__ Minute', + minute_ago_plural: 'vor __count__ Minuten', + minute_in: 'in __count__ Minute', + minute_in_plural: 'in __count__ Minuten', + hour_ago: 'vor __count__ Stunde', + hour_ago_plural: 'vor __count__ Stunden', + hour_in: 'in __count__ Stunde', + hour_in_plural: 'in __count__ Stunden', + day_ago: 'vor __count__ Tag', + day_ago_plural: 'vor __count__ Tagen', + day_in: 'in __count__ Tag', + day_in_plural: 'in __count__ Tagen', + month_ago: 'vor __count__ Monat', + month_ago_plural: 'vor __count__ Monaten', + month_in: 'in __count__ Monat', + month_in_plural: 'in __count__ Monaten', + year_ago: 'vor __count__ Jahr', + year_ago_plural: 'vor __count__ Jahren', + year_in: 'in __count__ Jahr', + year_in_plural: 'in __count__ Jahren' + } + }, + en: { + translation: { + now: 'just now', + second_ago: '__count__ second ago', + second_ago_plural: '__count__ seconds ago', + second_in: 'in __count__ second', + second_in_plural: 'in __count__ seconds', + minute_ago: '__count__ minute ago', + minute_ago_plural: '__count__ minutes ago', + minute_in: 'in __count__ minute', + minute_in_plural: 'in __count__ minutes', + hour_ago: '__count__ hour ago', + hour_ago_plural: '__count__ hours ago', + hour_in: 'in __count__ hour', + hour_in_plural: 'in __count__ hours', + day_ago: '__count__ day ago', + day_ago_plural: '__count__ days ago', + day_in: 'in __count__ day', + day_in_plural: 'in __count__ days', + month_ago: '__count__ month ago', + month_ago_plural: '__count__ months ago', + month_in: 'in __count__ month', + month_in_plural: 'in __count__ months', + year_ago: '__count__ year ago', + year_ago_plural: '__count__ years ago', + year_in: 'in __count__ year', + year_in_plural: 'in __count__ years' + } + }, + es: { + translation: { + now: 'ahora mismo', + second_ago: 'hace __count__ segundo', + second_ago_plural: 'hace __count__ segundos', + second_in: 'en __count__ segundo', + second_in_plural: 'en __count__ segundos', + minute_ago: 'hace __count__ minuto', + minute_ago_plural: 'hace __count__ minutos', + minute_in: 'en __count__ minuto', + minute_in_plural: 'en __count__ minutos', + hour_ago: 'hace __count__ hora', + hour_ago_plural: 'hace __count__ horas', + hour_in: 'en __count__ hora', + hour_in_plural: 'en __count__ horas', + day_ago: 'hace __count__ día', + day_ago_plural: 'hace __count__ días', + day_in: 'en __count__ día', + day_in_plural: 'en __count__ días', + month_ago: 'hace __count__ mes', + month_ago_plural: 'hace __count__ meses', + month_in: 'en __count__ mes', + month_in_plural: 'en __count__ meses', + year_ago: 'hace __count__ año', + year_ago_plural: 'hace __count__ años', + year_in: 'en __count__ año', + year_in_plural: 'en __count__ años' + } + }, + fi: { + translation: { + now: 'Nyt', + second_ago: '__count__ sekuntti sitten', + second_ago_plural: '__count__ sekunttia sitten', + second_in: ' __count__ sekunnin kuluttua', + second_in_plural: ' __count__ sekunttien kuluttua', + minute_ago: '__count__ minuutti sitten', + minute_ago_plural: '__count__ minuuttia sitten', + minute_in: ' __count__ minuutin kuluttua', + minute_in_plural: ' __count__ minuuttien kuluttua', + hour_ago: '__count__ tunti sitten', + hour_ago_plural: '__count__ tuntia sitten', + hour_in: ' __count__ tunnin kuluttua', + hour_in_plural: ' __count__ tunnin kuluttua', + day_ago: '__count__ päivä sitten', + day_ago_plural: '__count__ päiviä sitten', + day_in: ' __count__ päivän kuluttua', + day_in_plural: '__count__ päivien kuluttua', + month_ago: '__count__ kuukausi sitten', + month_ago_plural: '__count__ kuukausia sitten', + month_in: ' __count__ kuukauden kuluttua', + month_in_plural: ' __count__ kuukausien kuluttua', + year_ago: '__count__ vuosi sitten', + year_ago_plural: '__count__ vuosia sitten', + year_in: ' __count__ vuoden kuluttua', + year_in_plural: ' __count__ vuosien kuluttua' + } + }, + fr: { + translation: { + now: 'maintenant', + second_ago: 'il y a __count__ seconde', + second_ago_plural: 'il y a __count__ secondes', + second_in: 'dans __count__ seconde', + second_in_plural: 'dans __count__ secondes', + minute_ago: 'il y a __count__ minute', + minute_ago_plural: 'il y a __count__ minutes', + minute_in: 'dans __count__ minute', + minute_in_plural: 'dans __count__ minutes', + hour_ago: 'il y a __count__ heure', + hour_ago_plural: 'il y a __count__ heures', + hour_in: 'dans __count__ heure', + hour_in_plural: 'dans __count__ heures', + day_ago: 'il y a __count__ jour', + day_ago_plural: 'il y a __count__ jours', + day_in: 'dans __count__ jour', + day_in_plural: 'dans __count__ jours', + month_ago: 'il y a __count__ mois', + month_ago_plural: 'il y a __count__ mois', + month_in: 'dans __count__ mois', + month_in_plural: 'dans __count__ mois', + year_ago: 'il y a __count__ an', + year_ago_plural: 'il y a __count__ ans', + year_in: 'dans __count__ an', + year_in_plural: 'dans __count__ ans' + } + }, + it: { + translation: { + now: 'adesso', + second_ago: '__count__ secondo fa', + second_ago_plural: '__count__ secondi fa', + second_in: 'in __count__ secondo', + second_in_plural: 'in __count__ secondi', + minute_ago: '__count__ minuto fa', + minute_ago_plural: '__count__ minuti fa', + minute_in: 'in __count__ minuto', + minute_in_plural: 'in __count__ minuti', + hour_ago: '__count__ ora fa', + hour_ago_plural: '__count__ ore fa', + hour_in: 'in __count__ ora', + hour_in_plural: 'in __count__ ore', + day_ago: '__count__ giorno fa', + day_ago_plural: '__count__ giorni fa', + day_in: 'in __count__ giorno', + day_in_plural: 'in __count__ giorni', + month_ago: '__count__ mese fa', + month_ago_plural: '__count__ mesi fa', + month_in: 'in __count__ mese', + month_in_plural: 'in __count__ mesi', + year_ago: '__count__ anno fa', + year_ago_plural: '__count__ anni fa', + year_in: 'in __count__ anno', + year_in_plural: 'in __count__ anni' + } + }, + ja: { + translation: { + now: 'たった今', + second_ago: '__count__ 秒前', + second_ago_plural: '__count__ 秒前', + second_in: 'あと __count__ 秒', + second_in_plural: 'あと __count__ 秒', + minute_ago: '__count__ 分前', + minute_ago_plural: '__count__ 分前', + minute_in: 'あと __count__ 分', + minute_in_plural: 'あと __count__ 分', + hour_ago: '__count__ 時間前', + hour_ago_plural: '__count__ 時間前', + hour_in: 'あと __count__ 時間', + hour_in_plural: 'あと __count__ 時間', + day_ago: '__count__ 日間前', + day_ago_plural: '__count__ 日間前', + day_in: 'あと __count__ 日間', + day_in_plural: 'あと __count__ 日間', + month_ago: '__count__ ヶ月前', + month_ago_plural: '__count__ ヶ月前', + month_in: 'あと __count__ ヶ月前', + month_in_plural: 'あと __count__ ヶ月前', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: 'あと __count__ 年', + year_in_plural: 'あと __count__ 年' + } + }, + nl: { + translation: { + now: 'zonet', + second_ago: '__count__ seconde geleden', + second_ago_plural: '__count__ seconden geleden', + second_in: 'in __count__ seconde', + second_in_plural: 'in __count__ seconden', + minute_ago: '__count__ minuut geleden', + minute_ago_plural: '__count__ minuten geleden', + minute_in: 'in __count__ minuut', + minute_in_plural: 'in __count__ minuten', + hour_ago: '__count__ uur geleden', + hour_ago_plural: '__count__ uren geleden', + hour_in: 'in __count__ uur', + hour_in_plural: 'in __count__ uren', + day_ago: '__count__ dag geleden', + day_ago_plural: '__count__ dagen geleden', + day_in: 'in __count__ dag', + day_in_plural: 'in __count__ dagen', + month_ago: '__count__ maand geleden', + month_ago_plural: '__count__ maanden geleden', + month_in: 'in __count__ maand', + month_in_plural: 'in __count__ maanden', + year_ago: '__count__ jaar geleden', + year_ago_plural: '__count__ jaren geleden', + year_in: 'in __count__ jaar', + year_in_plural: 'in __count__ jaren' + } + }, + nn: { + translation: { + now: 'akkurat nå', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minutt siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'om __count__ minutt', + minute_in_plural: 'om __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'om __count__ time', + hour_in_plural: 'om __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dager siden', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dager', + month_ago: '__count__ en måned siden', + month_ago_plural: '__count__ flere måneder siden', + month_in: 'I løpet av en __count__ måned', + month_in_plural: 'I løpet av __count__ måneder', + year_ago: '__count__ et år siden', + year_ago_plural: '__count__ flere å siden', + year_in: 'I løpet av ett år __count__ år', + year_in_plural: 'på flere __count__ år' + } + }, + no: { + translation: { + now: 'akkurat nå', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minutt siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'om __count__ minutt', + minute_in_plural: 'om __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'om __count__ time', + hour_in_plural: 'om __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dager siden', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dager', + month_ago: '__count__ en måned siden', + month_ago_plural: '__count__ flere måneder siden', + month_in: 'I løpet av en __count__ måned', + month_in_plural: 'I løpet av __count__ måneder', + year_ago: '__count__ et år siden', + year_ago_plural: '__count__ flere å siden', + year_in: 'I løpet av ett år __count__ år', + year_in_plural: 'på flere __count__ år' + } + }, + pt: { + translation: { + now: 'neste exato momento', + second_ago: '__count__ segundo atrás', + second_ago_plural: '__count__ segundos atrás', + second_in: 'em __count__ segundo', + second_in_plural: 'em __count__ segundos', + minute_ago: '__count__ minuto atrás', + minute_ago_plural: '__count__ minutos atrás', + minute_in: 'em __count__ minuto', + minute_in_plural: 'em __count__ minutos', + hour_ago: '__count__ hora atrás', + hour_ago_plural: '__count__ horas atrás', + hour_in: 'em __count__ hora', + hour_in_plural: 'em __count__ horas', + day_ago: '__count__ dia atrás', + day_ago_plural: '__count__ dias atrás', + day_in: 'em __count__ dia', + day_in_plural: 'em __count__ dias', + month_ago: '__count__ mês atrás', + month_ago_plural: '__count__ meses atrás', + month_in: 'em __count__ mês', + month_in_plural: 'em __count__ meses', + year_ago: '__count__ ano atrás', + year_ago_plural: '__count__ anos atrás', + year_in: 'em __count__ ano', + year_in_plural: 'em __count__ anos' + } + }, + sv: { + translation: { + now: 'nu', + second_ago: '__count__ sekund sedan', + second_ago_plural: '__count__ sekunder sedan', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minut sedan', + minute_ago_plural: '__count__ minuter sedan', + minute_in: 'om __count__ minut', + minute_in_plural: 'om __count__ minuter', + hour_ago: '__count__ timme sedan', + hour_ago_plural: '__count__ timmar sedan', + hour_in: 'om __count__ timme', + hour_in_plural: 'om __count__ timmar', + day_ago: '__count__ dag sedan', + day_ago_plural: '__count__ dagar sedan', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dagar', + month_ago: '__count__ månad sedan', + month_ago_plural: '__count__ månader sedan', + month_in: 'om __count__ månad', + month_in_plural: 'om __count__ månader', + year_ago: '__count__ år sedan', + year_ago_plural: '__count__ år sedan', + year_in: 'om __count__ år', + year_in_plural: 'om __count__ år' + } + }, + th: { + translation: { + now: 'เมื่อกี้', + second_ago: '__count__ วินาที ที่ผ่านมา', + second_ago_plural: '__count__ วินาที ที่ผ่านมา', + second_in: 'อีก __count__ วินาที', + second_in_plural: 'อีก __count__ วินาที', + minute_ago: '__count__ นาที ที่ผ่านมา', + minute_ago_plural: '__count__ นาที ที่ผ่านมา', + minute_in: 'อีก __count__ นาที', + minute_in_plural: 'อีก __count__ นาที', + hour_ago: '__count__ ชั่วโมง ที่ผ่านมา', + hour_ago_plural: '__count__ ชั่วโมง ที่ผ่านมา', + hour_in: 'อีก __count__ ชั่วโมง', + hour_in_plural: 'อีก __count__ ชั่วโมง', + day_ago: '__count__ วัน ที่ผ่านมา', + day_ago_plural: '__count__ วัน ที่ผ่านมา', + day_in: 'อีก __count__ วัน', + day_in_plural: 'อีก __count__ วัน' + } + }, + zh: { + translation: { + now: '刚才', + second_ago: '__count__ 秒钟前', + second_ago_plural: '__count__ 秒钟前', + second_in: '__count__ 秒内', + second_in_plural: '__count__ 秒内', + minute_ago: '__count__ 分钟前', + minute_ago_plural: '__count__ 分钟前', + minute_in: '__count__ 分钟内', + minute_in_plural: '__count__ 分钟内', + hour_ago: '__count__ 小时前', + hour_ago_plural: '__count__ 小时前', + hour_in: '__count__ 小时内', + hour_in_plural: '__count__ 小时内', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天内', + day_in_plural: '__count__ 天内', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月内', + month_in_plural: '__count__ 月内', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年内', + year_in_plural: '__count__ 年内' + } + }, + 'zh-CN': { + translation: { + now: '刚才', + second_ago: '__count__ 秒钟前', + second_ago_plural: '__count__ 秒钟前', + second_in: '__count__ 秒内', + second_in_plural: '__count__ 秒内', + minute_ago: '__count__ 分钟前', + minute_ago_plural: '__count__ 分钟前', + minute_in: '__count__ 分钟内', + minute_in_plural: '__count__ 分钟内', + hour_ago: '__count__ 小时前', + hour_ago_plural: '__count__ 小时前', + hour_in: '__count__ 小时内', + hour_in_plural: '__count__ 小时内', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天内', + day_in_plural: '__count__ 天内', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月内', + month_in_plural: '__count__ 月内', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年内', + year_in_plural: '__count__ 年内' + } + }, + 'zh-HK': { + translation: { + now: '剛才', + second_ago: '__count__ 秒鐘前', + second_ago_plural: '__count__ 秒鐘前', + second_in: '__count__ 秒內', + second_in_plural: '__count__ 秒內', + minute_ago: '__count__ 分鐘前', + minute_ago_plural: '__count__ 分鐘前', + minute_in: '__count__ 分鐘內', + minute_in_plural: '__count__ 分鐘內', + hour_ago: '__count__ 小時前', + hour_ago_plural: '__count__ 小時前', + hour_in: '__count__ 小時內', + hour_in_plural: '__count__ 小時內', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天內', + day_in_plural: '__count__ 天內', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月內', + month_in_plural: '__count__ 月內', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年內', + year_in_plural: '__count__ 年內' + } + }, + 'zh-TW': { + translation: { + now: '剛才', + second_ago: '__count__ 秒鐘前', + second_ago_plural: '__count__ 秒鐘前', + second_in: '__count__ 秒內', + second_in_plural: '__count__ 秒內', + minute_ago: '__count__ 分鐘前', + minute_ago_plural: '__count__ 分鐘前', + minute_in: '__count__ 分鐘內', + minute_in_plural: '__count__ 分鐘內', + hour_ago: '__count__ 小時前', + hour_ago_plural: '__count__ 小時前', + hour_in: '__count__ 小時內', + hour_in_plural: '__count__ 小時內', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天內', + day_in_plural: '__count__ 天內', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月內', + month_in_plural: '__count__ 月內', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年內', + year_in_plural: '__count__ 年內' + } + } +}; +// tslint:enable + +var RelativeTime = /** @class */ (function () { + function RelativeTime(service, ea) { + var _this = this; + this.service = service; + this.ea = ea; + this.service.i18nextReady().then(function () { + _this.setup(); + }); + this.ea.subscribe(I18N_EA_SIGNAL, function (locales) { + _this.setup(locales); + }); + } + RelativeTime.inject = function () { return [I18N, aureliaEventAggregator.EventAggregator]; }; + RelativeTime.prototype.setup = function (locales) { + var trans = translations; + var fallbackLng = this.service.i18next.fallbackLng; + var alternateFb = fallbackLng || this.service.i18next.options.fallbackLng; + if (Array.isArray(alternateFb) && alternateFb.length > 0) { + alternateFb = alternateFb[0]; + } + var key = ((locales && locales.newValue) + ? locales.newValue + : this.service.getLocale()) || alternateFb; + var index = 0; + // tslint:disable-next-line:no-conditional-assignment + if ((index = key.indexOf("-")) >= 0) { + var baseLocale = key.substring(0, index); + if (trans[baseLocale]) { + this.addTranslationResource(baseLocale, trans[baseLocale].translation); + } + } + if (trans[key]) { + this.addTranslationResource(key, trans[key].translation); + } + if (trans[fallbackLng]) { + this.addTranslationResource(key, trans[fallbackLng].translation); + } + }; + RelativeTime.prototype.addTranslationResource = function (key, translation) { + var options = this.service.i18next.options; + if (options.interpolation && (options.interpolation.prefix !== "__" || options.interpolation.suffix !== "__")) { + // tslint:disable-next-line:forin + for (var subkey in translation) { + translation[subkey] = translation[subkey] + .replace("__count__", (options.interpolation.prefix || "{{") + "count" + (options.interpolation.suffix || "}}")); + } + } + this.service.i18next.addResources(key, options.defaultNS || "translation", translation); + }; + RelativeTime.prototype.getRelativeTime = function (time) { + var now = new Date(); + var diff = now.getTime() - time.getTime(); + var timeDiff = this.getTimeDiffDescription(diff, "year", 31104000000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "month", 2592000000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "day", 86400000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "hour", 3600000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "minute", 60000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "second", 1000); + if (!timeDiff) { + timeDiff = this.service.tr("now"); + } + } + } + } + } + } + return timeDiff; + }; + RelativeTime.prototype.getTimeDiffDescription = function (diff, unit, timeDivisor) { + var unitAmount = parseInt((diff / timeDivisor).toFixed(0), 10); + if (unitAmount > 0) { + return this.service.tr(unit, { count: unitAmount, context: "ago" }); + } + else if (unitAmount < 0) { + var abs = Math.abs(unitAmount); + return this.service.tr(unit, { count: abs, context: "in" }); + } + return null; + }; + return RelativeTime; +}()); + +var RtValueConverter = /** @class */ (function () { + function RtValueConverter(service) { + this.service = service; + } + RtValueConverter.inject = function () { return [RelativeTime]; }; + RtValueConverter.prototype.toView = function (value) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (typeof value === "string" && isNaN(value) && !Number.isInteger(value)) { + value = new Date(value); + } + return this.service.getRelativeTime(value); + }; + RtValueConverter = __decorate([ + aureliaBinding.valueConverter("rt") + ], RtValueConverter); + return RtValueConverter; +}()); + +var Backend = /** @class */ (function () { + function Backend(services, options) { + if (options === void 0) { options = {}; } + this.services = services; + this.options = options; + this.type = "backend"; + this.init(services, options); + } + Backend.with = function (loader) { + this.loader = loader; + return this; + }; + Backend.prototype.init = function (services, options) { + if (options === void 0) { options = {}; } + this.services = services; + this.options = Object.assign({}, { + loadPath: "/locales/{{lng}}/{{ns}}.json", + addPath: "locales/add/{{lng}}/{{ns}}", + allowMultiLoading: false, + parse: JSON.parse + }, options); + }; + Backend.prototype.readMulti = function (languages, namespaces, callback) { + var loadPath = this.options.loadPath; + if (typeof this.options.loadPath === "function") { + loadPath = this.options.loadPath(languages, namespaces); + } + var url = this.services + .interpolator + .interpolate(loadPath, { lng: languages.join("+"), ns: namespaces.join("+") }); + this.loadUrl(url, callback); + }; + Backend.prototype.read = function (language, namespace, callback) { + var loadPath = this.options.loadPath; + if (typeof this.options.loadPath === "function") { + loadPath = this.options.loadPath([language], [namespace]); + } + var url = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }); + this.loadUrl(url, callback); + }; + Backend.prototype.loadUrl = function (url, callback) { + return __awaiter(this, void 0, void 0, function () { + var response, ret, err, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 2, , 3]); + return [4 /*yield*/, Backend.loader.loadText(url)]; + case 1: + response = _b.sent(); + ret = void 0; + err = void 0; + try { + ret = (response instanceof Object) ? response : this.options.parse(response, url); + } + catch (e) { + err = "failed parsing " + url + " to json"; + } + if (err) { + return [2 /*return*/, callback(err, false)]; + } + callback(null, ret); + return [3 /*break*/, 3]; + case 2: + _a = _b.sent(); + callback("failed loading " + url, false /* no retry */); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + // tslint:disable-next-line:variable-name + Backend.prototype.create = function (_languages, _namespace, _key, _fallbackValue) { + // not supported + }; + Backend.type = "backend"; + return Backend; +}()); + function configure(frameworkConfig, cb) { - if (cb === undefined || typeof cb !== "function") { + if (typeof cb !== "function") { var errorMsg = "You need to provide a callback method to properly configure the library"; throw errorMsg; } + var instance = frameworkConfig.container.get(I18N); + var ret = cb(instance); frameworkConfig.globalResources([ - aurelia_pal_1.PLATFORM.moduleName("./t/t-value-converter"), - aurelia_pal_1.PLATFORM.moduleName("./t/t-custom-attribute"), - aurelia_pal_1.PLATFORM.moduleName("./t/t-params-custom-attribute"), - aurelia_pal_1.PLATFORM.moduleName("./t/t-binding-behavior") - ]); - frameworkConfig.globalResources([ - aurelia_pal_1.PLATFORM.moduleName("./nf/nf-value-converter"), - aurelia_pal_1.PLATFORM.moduleName("./nf/nf-binding-behavior") - ]); - frameworkConfig.globalResources([ - aurelia_pal_1.PLATFORM.moduleName("./df/df-value-converter"), - aurelia_pal_1.PLATFORM.moduleName("./df/df-binding-behavior") - ]); - frameworkConfig.globalResources([ - aurelia_pal_1.PLATFORM.moduleName("./rt/rt-value-converter"), - aurelia_pal_1.PLATFORM.moduleName("./rt/rt-binding-behavior") + TValueConverter, + TBindingBehavior, + TCustomAttribute, + TParamsCustomAttribute, + NfValueConverter, + NfBindingBehavior, + DfValueConverter, + DfBindingBehavior, + RtValueConverter, + RtBindingBehavior ]); - var instance = new i18n_1.I18N(frameworkConfig.container.get(aurelia_event_aggregator_1.EventAggregator), frameworkConfig.container.get(aurelia_templating_resources_1.BindingSignaler)); - frameworkConfig.container.registerInstance(i18n_1.I18N, instance); - var ret = cb(instance); frameworkConfig.postTask(function () { - var resources = frameworkConfig.container.get(aurelia_templating_1.ViewResources); + var resources = frameworkConfig.container.get(aureliaTemplating.ViewResources); var htmlBehaviorResource = resources.getAttribute("t"); var htmlParamsResource = resources.getAttribute("t-params"); var attributes = instance.i18next.options.attributes; @@ -65,5 +1384,19 @@ function configure(frameworkConfig, cb) { }); return ret; } + exports.configure = configure; -//# sourceMappingURL=aurelia-i18n.js.map \ No newline at end of file +exports.DfValueConverter = DfValueConverter; +exports.DfBindingBehavior = DfBindingBehavior; +exports.NfValueConverter = NfValueConverter; +exports.NfBindingBehavior = NfBindingBehavior; +exports.RtValueConverter = RtValueConverter; +exports.RtBindingBehavior = RtBindingBehavior; +exports.TValueConverter = TValueConverter; +exports.TBindingBehavior = TBindingBehavior; +exports.TCustomAttribute = TCustomAttribute; +exports.TParamsCustomAttribute = TParamsCustomAttribute; +exports.I18N_EA_SIGNAL = I18N_EA_SIGNAL; +exports.I18N = I18N; +exports.RelativeTime = RelativeTime; +exports.Backend = Backend; diff --git a/dist/commonjs/aurelia-i18n.js.map b/dist/commonjs/aurelia-i18n.js.map deleted file mode 100644 index 635c1dec..00000000 --- a/dist/commonjs/aurelia-i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aurelia-i18n.js","sourceRoot":"","sources":["../../src/aurelia-i18n.ts"],"names":[],"mappings":";;;;;AACA,qEAA2D;AAC3D,yDAAmD;AACnD,6EAA+D;AAC/D,2CAAuC;AAEvC,+BAGgB;AAEhB,4BAAuB;AACvB,oCAA+B;AAC/B,2CAAsC;AACtC,2BAGc;A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AS,CAAC,GAAG,CAAC,0CAAe,CAAC,EAC9C,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,8CAAe,CAAC,CAC/C,CAAC;IACF,eAAe,CAAC,SAAS,CAAC,gBAAgB,CAAC,WAAI,EAAE,QAAQ,CAAC,CAAC;IAE3D,IAAM,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC;IAEzB,eAAe,CAAC,QAAQ,CAAC;QACvB,IAAM,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,kCAAa,CAAC,CAAC;QAC/D,IAAM,oBAAoB,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACzD,IAAM,kBAAkB,GAAG,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC9D,IAAI,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,UAAsB,CAAC;QAEjE,+CAA+C;QAC/C,IAAI,CAAC,UAAU,EAAE;YACf,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;SAC5B;QAED,UAAU,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,CAAC,EAA7D,CAA6D,CAAC,CAAC;QAC7F,UAAU,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,SAAS,CAAC,iBAAiB,CAAC,KAAK,GAAG,SAAS,EAAE,kBAAkB,EAAE,UAAU,CAAC,EAA9E,CAA8E,CAAC,CAAC;IAChH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC;AApDD,8BAoDC"} \ No newline at end of file diff --git a/dist/commonjs/defaultTranslations/relative.time.js b/dist/commonjs/defaultTranslations/relative.time.js deleted file mode 100644 index 47ac32ca..00000000 --- a/dist/commonjs/defaultTranslations/relative.time.js +++ /dev/null @@ -1,496 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.translations = { - ar: { - translation: { - "now": "الآن", - "second_ago": "منذ __count__ ثانية", - "second_ago_plural": "منذ __count__ ثواني", - "second_in": "في __count__ ثانية", - "second_in_plural": "في __count__ ثواني", - "minute_ago": "منذ __count__ دقيقة", - "minute_ago_plural": "منذ __count__ دقائق", - "minute_in": "في __count__ دقيقة", - "minute_in_plural": "في __count__ دقائق", - "hour_ago": "منذ __count__ ساعة", - "hour_ago_plural": "منذ __count__ ساعات", - "hour_in": "في __count__ ساعة", - "hour_in_plural": "في __count__ ساعات", - "day_ago": "منذ __count__ يوم", - "day_ago_plural": "منذ __count__ أيام", - "day_in": "في __count__ يوم", - "day_in_plural": "في __count__ أيام", - "month_ago": "منذ __count__ شهر", - "month_ago_plural": "منذ __count__ أشهر", - "month_in": "في __count__ شهر", - "month_in_plural": "في __count__ أشهر", - "year_ago": "منذ __count__ سنة", - "year_ago_plural": "منذ __count__ سنوات", - "year_in": "في __count__ سنة", - "year_in_plural": "في __count__ سنوات" - } - }, - en: { - translation: { - "now": "just now", - "second_ago": "__count__ second ago", - "second_ago_plural": "__count__ seconds ago", - "second_in": "in __count__ second", - "second_in_plural": "in __count__ seconds", - "minute_ago": "__count__ minute ago", - "minute_ago_plural": "__count__ minutes ago", - "minute_in": "in __count__ minute", - "minute_in_plural": "in __count__ minutes", - "hour_ago": "__count__ hour ago", - "hour_ago_plural": "__count__ hours ago", - "hour_in": "in __count__ hour", - "hour_in_plural": "in __count__ hours", - "day_ago": "__count__ day ago", - "day_ago_plural": "__count__ days ago", - "day_in": "in __count__ day", - "day_in_plural": "in __count__ days", - "month_ago": "__count__ month ago", - "month_ago_plural": "__count__ months ago", - "month_in": "in __count__ month", - "month_in_plural": "in __count__ months", - "year_ago": "__count__ year ago", - "year_ago_plural": "__count__ years ago", - "year_in": "in __count__ year", - "year_in_plural": "in __count__ years" - } - }, - es: { - translation: { - "now": "ahora mismo", - "second_ago": "hace __count__ segundo", - "second_ago_plural": "hace __count__ segundos", - "second_in": "en __count__ segundo", - "second_in_plural": "en __count__ segundos", - "minute_ago": "hace __count__ minuto", - "minute_ago_plural": "hace __count__ minutos", - "minute_in": "en __count__ minuto", - "minute_in_plural": "en __count__ minutos", - "hour_ago": "hace __count__ hora", - "hour_ago_plural": "hace __count__ horas", - "hour_in": "en __count__ hora", - "hour_in_plural": "en __count__ horas", - "day_ago": "hace __count__ día", - "day_ago_plural": "hace __count__ días", - "day_in": "en __count__ día", - "day_in_plural": "en __count__ días", - "month_ago": "hace __count__ mes", - "month_ago_plural": "hace __count__ meses", - "month_in": "en __count__ mes", - "month_in_plural": "en __count__ meses", - "year_ago": "hace __count__ año", - "year_ago_plural": "hace __count__ años", - "year_in": "en __count__ año", - "year_in_plural": "en __count__ años" - } - }, - it: { - translation: { - "now": "adesso", - "second_ago": "__count__ secondo fa", - "second_ago_plural": "__count__ secondi fa", - "second_in": "in __count__ secondo", - "second_in_plural": "in __count__ secondi", - "minute_ago": "__count__ minuto fa", - "minute_ago_plural": "__count__ minuti fa", - "minute_in": "in __count__ minuto", - "minute_in_plural": "in __count__ minuti", - "hour_ago": "__count__ ora fa", - "hour_ago_plural": "__count__ ore fa", - "hour_in": "in __count__ ora", - "hour_in_plural": "in __count__ ore", - "day_ago": "__count__ giorno fa", - "day_ago_plural": "__count__ giorni fa", - "day_in": "in __count__ giorno", - "day_in_plural": "in __count__ giorni", - "month_ago": "__count__ mese fa", - "month_ago_plural": "__count__ mesi fa", - "month_in": "in __count__ mese", - "month_in_plural": "in __count__ mesi", - "year_ago": "__count__ anno fa", - "year_ago_plural": "__count__ anni fa", - "year_in": "in __count__ anno", - "year_in_plural": "in __count__ anni" - } - }, - de: { - translation: { - "now": "jetzt gerade", - "second_ago": "vor __count__ Sekunde", - "second_ago_plural": "vor __count__ Sekunden", - "second_in": "in __count__ Sekunde", - "second_in_plural": "in __count__ Sekunden", - "minute_ago": "vor __count__ Minute", - "minute_ago_plural": "vor __count__ Minuten", - "minute_in": "in __count__ Minute", - "minute_in_plural": "in __count__ Minuten", - "hour_ago": "vor __count__ Stunde", - "hour_ago_plural": "vor __count__ Stunden", - "hour_in": "in __count__ Stunde", - "hour_in_plural": "in __count__ Stunden", - "day_ago": "vor __count__ Tag", - "day_ago_plural": "vor __count__ Tagen", - "day_in": "in __count__ Tag", - "day_in_plural": "in __count__ Tagen", - "month_ago": "vor __count__ Monat", - "month_ago_plural": "vor __count__ Monaten", - "month_in": "in __count__ Monat", - "month_in_plural": "in __count__ Monaten", - "year_ago": "vor __count__ Jahr", - "year_ago_plural": "vor __count__ Jahren", - "year_in": "in __count__ Jahr", - "year_in_plural": "in __count__ Jahren" - } - }, - nl: { - translation: { - "now": "zonet", - "second_ago": "__count__ seconde geleden", - "second_ago_plural": "__count__ seconden geleden", - "second_in": "in __count__ seconde", - "second_in_plural": "in __count__ seconden", - "minute_ago": "__count__ minuut geleden", - "minute_ago_plural": "__count__ minuten geleden", - "minute_in": "in __count__ minuut", - "minute_in_plural": "in __count__ minuten", - "hour_ago": "__count__ uur geleden", - "hour_ago_plural": "__count__ uren geleden", - "hour_in": "in __count__ uur", - "hour_in_plural": "in __count__ uren", - "day_ago": "__count__ dag geleden", - "day_ago_plural": "__count__ dagen geleden", - "day_in": "in __count__ dag", - "day_in_plural": "in __count__ dagen", - "month_ago": "__count__ maand geleden", - "month_ago_plural": "__count__ maanden geleden", - "month_in": "in __count__ maand", - "month_in_plural": "in __count__ maanden", - "year_ago": "__count__ jaar geleden", - "year_ago_plural": "__count__ jaren geleden", - "year_in": "in __count__ jaar", - "year_in_plural": "in __count__ jaren" - } - }, - fr: { - translation: { - "now": "maintenant", - "second_ago": "il y a __count__ seconde", - "second_ago_plural": "il y a __count__ secondes", - "second_in": "dans __count__ seconde", - "second_in_plural": "dans __count__ secondes", - "minute_ago": "il y a __count__ minute", - "minute_ago_plural": "il y a __count__ minutes", - "minute_in": "dans __count__ minute", - "minute_in_plural": "dans __count__ minutes", - "hour_ago": "il y a __count__ heure", - "hour_ago_plural": "il y a __count__ heures", - "hour_in": "dans __count__ heure", - "hour_in_plural": "dans __count__ heures", - "day_ago": "il y a __count__ jour", - "day_ago_plural": "il y a __count__ jours", - "day_in": "dans __count__ jour", - "day_in_plural": "dans __count__ jours", - "month_ago": "il y a __count__ mois", - "month_ago_plural": "il y a __count__ mois", - "month_in": "dans __count__ mois", - "month_in_plural": "dans __count__ mois", - "year_ago": "il y a __count__ an", - "year_ago_plural": "il y a __count__ ans", - "year_in": "dans __count__ an", - "year_in_plural": "dans __count__ ans" - } - }, - th: { - translation: { - "now": "เมื่อกี้", - "second_ago": "__count__ วินาที ที่ผ่านมา", - "second_ago_plural": "__count__ วินาที ที่ผ่านมา", - "second_in": "อีก __count__ วินาที", - "second_in_plural": "อีก __count__ วินาที", - "minute_ago": "__count__ นาที ที่ผ่านมา", - "minute_ago_plural": "__count__ นาที ที่ผ่านมา", - "minute_in": "อีก __count__ นาที", - "minute_in_plural": "อีก __count__ นาที", - "hour_ago": "__count__ ชั่วโมง ที่ผ่านมา", - "hour_ago_plural": "__count__ ชั่วโมง ที่ผ่านมา", - "hour_in": "อีก __count__ ชั่วโมง", - "hour_in_plural": "อีก __count__ ชั่วโมง", - "day_ago": "__count__ วัน ที่ผ่านมา", - "day_ago_plural": "__count__ วัน ที่ผ่านมา", - "day_in": "อีก __count__ วัน", - "day_in_plural": "อีก __count__ วัน" - } - }, - sv: { - translation: { - "now": "just nu", - "second_ago": "__count__ sekund sedan", - "second_ago_plural": "__count__ sekunder sedan", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minut sedan", - "minute_ago_plural": "__count__ minuter sedan", - "minute_in": "om __count__ minut", - "minute_in_plural": "om __count__ minuter", - "hour_ago": "__count__ timme sedan", - "hour_ago_plural": "__count__ timmar sedan", - "hour_in": "om __count__ timme", - "hour_in_plural": "om __count__ timmar", - "day_ago": "__count__ dag sedan", - "day_ago_plural": "__count__ dagar sedan", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dagar" - } - }, - da: { - translation: { - "now": "lige nu", - "second_ago": "__count__ sekunder siden", - "second_ago_plural": "__count__ sekunder siden", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minut siden", - "minute_ago_plural": "__count__ minutter siden", - "minute_in": "om __count__ minut", - "minute_in_plural": "om __count__ minutter", - "hour_ago": "__count__ time siden", - "hour_ago_plural": "__count__ timer siden", - "hour_in": "om __count__ time", - "hour_in_plural": "om __count__ timer", - "day_ago": "__count__ dag siden", - "day_ago_plural": "__count__ dage siden", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dage" - } - }, - no: { - translation: { - "now": "akkurat nå", - "second_ago": "__count__ sekund siden", - "second_ago_plural": "__count__ sekunder siden", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minutt siden", - "minute_ago_plural": "__count__ minutter siden", - "minute_in": "om __count__ minutt", - "minute_in_plural": "om __count__ minutter", - "hour_ago": "__count__ time siden", - "hour_ago_plural": "__count__ timer siden", - "hour_in": "om __count__ time", - "hour_in_plural": "om __count__ timer", - "day_ago": "__count__ dag siden", - "day_ago_plural": "__count__ dager siden", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dager" - } - }, - ja: { - translation: { - "now": "たった今", - "second_ago": "__count__ 秒前", - "second_ago_plural": "__count__ 秒前", - "second_in": "あと __count__ 秒", - "second_in_plural": "あと __count__ 秒", - "minute_ago": "__count__ 分前", - "minute_ago_plural": "__count__ 分前", - "minute_in": "あと __count__ 分", - "minute_in_plural": "あと __count__ 分", - "hour_ago": "__count__ 時間前", - "hour_ago_plural": "__count__ 時間前", - "hour_in": "あと __count__ 時間", - "hour_in_plural": "あと __count__ 時間", - "day_ago": "__count__ 日間前", - "day_ago_plural": "__count__ 日間前", - "day_in": "あと __count__ 日間", - "day_in_plural": "あと __count__ 日間", - "month_ago": "__count__ ヶ月前", - "month_ago_plural": "__count__ ヶ月前", - "month_in": "あと __count__ ヶ月前", - "month_in_plural": "あと __count__ ヶ月前", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "あと __count__ 年", - "year_in_plural": "あと __count__ 年" - } - }, - jp: { - translation: { - "now": "たった今", - "second_ago": "__count__ 秒前", - "second_ago_plural": "__count__ 秒前", - "second_in": "あと __count__ 秒", - "second_in_plural": "あと __count__ 秒", - "minute_ago": "__count__ 分前", - "minute_ago_plural": "__count__ 分前", - "minute_in": "あと __count__ 分", - "minute_in_plural": "あと __count__ 分", - "hour_ago": "__count__ 時間前", - "hour_ago_plural": "__count__ 時間前", - "hour_in": "あと __count__ 時間", - "hour_in_plural": "あと __count__ 時間", - "day_ago": "__count__ 日間前", - "day_ago_plural": "__count__ 日間前", - "day_in": "あと __count__ 日間", - "day_in_plural": "あと __count__ 日間", - "month_ago": "__count__ ヶ月前", - "month_ago_plural": "__count__ ヶ月前", - "month_in": "あと __count__ ヶ月前", - "month_in_plural": "あと __count__ ヶ月前", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "あと __count__ 年", - "year_in_plural": "あと __count__ 年" - } - }, - pt: { - translation: { - "now": "neste exato momento", - "second_ago": "__count__ segundo atrás", - "second_ago_plural": "__count__ segundos atrás", - "second_in": "em __count__ segundo", - "second_in_plural": "em __count__ segundos", - "minute_ago": "__count__ minuto atrás", - "minute_ago_plural": "__count__ minutos atrás", - "minute_in": "em __count__ minuto", - "minute_in_plural": "em __count__ minutos", - "hour_ago": "__count__ hora atrás", - "hour_ago_plural": "__count__ horas atrás", - "hour_in": "em __count__ hora", - "hour_in_plural": "em __count__ horas", - "day_ago": "__count__ dia atrás", - "day_ago_plural": "__count__ dias atrás", - "day_in": "em __count__ dia", - "day_in_plural": "em __count__ dias", - "month_ago": "__count__ mês atrás", - "month_ago_plural": "__count__ meses atrás", - "month_in": "em __count__ mês", - "month_in_plural": "em __count__ meses", - "year_ago": "__count__ ano atrás", - "year_ago_plural": "__count__ anos atrás", - "year_in": "em __count__ ano", - "year_in_plural": "em __count__ anos" - } - }, - zh: { - translation: { - "now": "刚才", - "second_ago": "__count__ 秒钟前", - "second_ago_plural": "__count__ 秒钟前", - "second_in": "__count__ 秒内", - "second_in_plural": "__count__ 秒内", - "minute_ago": "__count__ 分钟前", - "minute_ago_plural": "__count__ 分钟前", - "minute_in": "__count__ 分钟内", - "minute_in_plural": "__count__ 分钟内", - "hour_ago": "__count__ 小时前", - "hour_ago_plural": "__count__ 小时前", - "hour_in": "__count__ 小时内", - "hour_in_plural": "__count__ 小时内", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天内", - "day_in_plural": "__count__ 天内", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月内", - "month_in_plural": "__count__ 月内", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年内", - "year_in_plural": "__count__ 年内" - } - }, - "zh-CN": { - translation: { - "now": "刚才", - "second_ago": "__count__ 秒钟前", - "second_ago_plural": "__count__ 秒钟前", - "second_in": "__count__ 秒内", - "second_in_plural": "__count__ 秒内", - "minute_ago": "__count__ 分钟前", - "minute_ago_plural": "__count__ 分钟前", - "minute_in": "__count__ 分钟内", - "minute_in_plural": "__count__ 分钟内", - "hour_ago": "__count__ 小时前", - "hour_ago_plural": "__count__ 小时前", - "hour_in": "__count__ 小时内", - "hour_in_plural": "__count__ 小时内", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天内", - "day_in_plural": "__count__ 天内", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月内", - "month_in_plural": "__count__ 月内", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年内", - "year_in_plural": "__count__ 年内" - } - }, - "zh-HK": { - translation: { - "now": "剛才", - "second_ago": "__count__ 秒鐘前", - "second_ago_plural": "__count__ 秒鐘前", - "second_in": "__count__ 秒內", - "second_in_plural": "__count__ 秒內", - "minute_ago": "__count__ 分鐘前", - "minute_ago_plural": "__count__ 分鐘前", - "minute_in": "__count__ 分鐘內", - "minute_in_plural": "__count__ 分鐘內", - "hour_ago": "__count__ 小時前", - "hour_ago_plural": "__count__ 小時前", - "hour_in": "__count__ 小時內", - "hour_in_plural": "__count__ 小時內", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天內", - "day_in_plural": "__count__ 天內", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月內", - "month_in_plural": "__count__ 月內", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年內", - "year_in_plural": "__count__ 年內" - } - }, - "zh-TW": { - translation: { - "now": "剛才", - "second_ago": "__count__ 秒鐘前", - "second_ago_plural": "__count__ 秒鐘前", - "second_in": "__count__ 秒內", - "second_in_plural": "__count__ 秒內", - "minute_ago": "__count__ 分鐘前", - "minute_ago_plural": "__count__ 分鐘前", - "minute_in": "__count__ 分鐘內", - "minute_in_plural": "__count__ 分鐘內", - "hour_ago": "__count__ 小時前", - "hour_ago_plural": "__count__ 小時前", - "hour_in": "__count__ 小時內", - "hour_in_plural": "__count__ 小時內", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天內", - "day_in_plural": "__count__ 天內", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月內", - "month_in_plural": "__count__ 月內", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年內", - "year_in_plural": "__count__ 年內" - } - } -}; -// tslint:enable -//# sourceMappingURL=relative.time.js.map \ No newline at end of file diff --git a/dist/commonjs/defaultTranslations/relative.time.js.map b/dist/commonjs/defaultTranslations/relative.time.js.map deleted file mode 100644 index 6bac950f..00000000 --- a/dist/commonjs/defaultTranslations/relative.time.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"relative.time.js","sourceRoot":"","sources":["../../../src/defaultTranslations/relative.time.ts"],"names":[],"mappings":";;AAKa,QAAA,YAAY,GAAwB;IAC/C,EAAE,EAAE;QACF,WAAW,EAAE;YACX,KAAK,EAAE,MAAM;YACb,YAAY,EAAE,qBAAqB;YACnC,mBAAmB,EAAE,qBAAqB;YAC1C,WAAW,EAAE,oBAAoB;YACjC,kBAAkB,EAAE,oBAAoB;YACxC,YAAY,EAAE,qBAAqB;YACnC,mBAAmB,EAAE,qBAAqB;YAC1C,WAAW,EAAE,oBAAoB;YACjC,kBAAkB,EAAE,oBAAoB;YACxC,UAAU,EAAE,oBAAoB;YAChC,iBAAiB,EAAE,qBAAqB;YACxC,SAAS,EAAE,mBAAmB;YAC9B,gBAAgB,EAAE,oBAAoB;YACtC,SAAS,EAAE,mBAAmB;YAC9B,gBAAgB,EAAE,oBAAoB;YACtC,QAAQ,EAAE,kBAAkB;YAC5B,eAAe,EAAE,mBAAmB;YACpC,WAAW,EAAE,mBAAmB;YAChC,kBAAkB,EAAE,oBAAoB;YACxC,UAAU,EAAE,kBAAkB;YAC9B,iBAAiB,EAAE,mBAAmB;YACtC,UAAU,EAAE,mBAAmB;YAC/B,iBAAiB,EAAE,qBAAqB;YACxC,SAAS,EAAE,kBAAkB;YAC7B,gBAAgB,EAAE,oBAAoB;SACvC;KACF;IACD,EAAE,EAAE;QACF,WAAW,EAAE;YACX,KAAK,EAAE,UAAU;YACjB,YAAY,EAAE,sBAAsB;YACpC,mBAAmB,EAAE,uBAAuB;YAC5C,WAAW,EAAE,qBAAqB;YAClC,kBAAkB,EAAE,sBAAsB;YAC1C,YAAY,EAAE,sBAAsB;YACpC,mBAAmB,EAAE,uBAAuB;YAC5C,WAAW,EAAE,qBAAqB;YAClC,kBAAkB,EAAE,sBAAsB;YAC1C,UAAU,EAAE,oBAAoB;YAChC,iBAAiB,EAAE,qBAAqB;YACxC,SAAS,EAAE,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"} \ No newline at end of file diff --git a/dist/commonjs/df/df-binding-behavior.js b/dist/commonjs/df/df-binding-behavior.js deleted file mode 100644 index 30d7e185..00000000 --- a/dist/commonjs/df/df-binding-behavior.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_resources_1 = require("aurelia-templating-resources"); -var aurelia_binding_1 = require("aurelia-binding"); -var DfBindingBehavior = /** @class */ (function () { - function DfBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - DfBindingBehavior.inject = function () { return [aurelia_templating_resources_1.SignalBindingBehavior]; }; - DfBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the DfValueConverter. - // pass through any args to the binding behavior to the DfValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new aurelia_binding_1.ValueConverter(expression, "df", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - DfBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return DfBindingBehavior; -}()); -exports.DfBindingBehavior = DfBindingBehavior; -//# sourceMappingURL=df-binding-behavior.js.map \ No newline at end of file diff --git a/dist/commonjs/df/df-binding-behavior.js.map b/dist/commonjs/df/df-binding-behavior.js.map deleted file mode 100644 index bca24b2c..00000000 --- a/dist/commonjs/df/df-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"df-binding-behavior.js","sourceRoot":"","sources":["../../../src/df/df-binding-behavior.ts"],"names":[],"mappings":";;AAAA,6EAAqE;AACrE,mDAAiD;AAEjD;IAGE,2BAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,oDAAqB,CAAC,CAAC,CAAC,CAAC;IAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;QACxF,sDAAsD;QACtD,wEAAwE;QACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,gCAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;IACJ,CAAC;IACM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IACH,wBAAC;AAAD,CAAC,AAzBD,IAyBC;AAzBY,8CAAiB"} \ No newline at end of file diff --git a/dist/commonjs/df/df-value-converter.js b/dist/commonjs/df/df-value-converter.js deleted file mode 100644 index 69f12ead..00000000 --- a/dist/commonjs/df/df-value-converter.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var i18n_1 = require("../i18n"); -var utils_1 = require("../utils"); -var DfValueConverter = /** @class */ (function () { - function DfValueConverter(service) { - this.service = service; - } - DfValueConverter.inject = function () { return [i18n_1.I18N]; }; - DfValueConverter.prototype.toView = function (value, dfOrOptions, locale) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (typeof value === "string" && isNaN(value) && !utils_1.isInteger(value)) { - value = new Date(value); - } - if (dfOrOptions && (dfOrOptions instanceof Intl.DateTimeFormat && typeof dfOrOptions.format === "function")) { - return dfOrOptions.format(value); - } - var df = this.service.df(dfOrOptions, locale || this.service.getLocale()); - return df.format(value); - }; - return DfValueConverter; -}()); -exports.DfValueConverter = DfValueConverter; -//# sourceMappingURL=df-value-converter.js.map \ No newline at end of file diff --git a/dist/commonjs/df/df-value-converter.js.map b/dist/commonjs/df/df-value-converter.js.map deleted file mode 100644 index 7324a897..00000000 --- a/dist/commonjs/df/df-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"df-value-converter.js","sourceRoot":"","sources":["../../../src/df/df-value-converter.ts"],"names":[],"mappings":";;AAAA,gCAA+B;AAC/B,kCAAqC;AAErC;IAGE,0BAAoB,OAAa;QAAb,YAAO,GAAP,OAAO,CAAM;IAAI,CAAC;IAFxB,uBAAM,GAApB,cAAyB,OAAO,CAAC,WAAI,CAAC,CAAC,CAAC,CAAC;IAIlC,iCAAM,GAAb,UACE,KAAU,EACV,WAA8D,EAC9D,MAAe;QAEf,IAAI,KAAK,KAAK,IAAI;eACb,OAAO,KAAK,KAAK,WAAW;eAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACrD;YACA,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAY,CAAC,IAAI,CAAC,iBAAS,CAAC,KAAY,CAAC,EAAE;YAChF,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;QAED,IAAI,WAAW,IAAI,CAAC,WAAW,YAAY,IAAI,CAAC,cAAc,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE;YAC3G,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAClC;QAED,IAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAyC,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QAC1G,OAAO,EAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IACH,uBAAC;AAAD,CAAC,AA5BD,IA4BC;AA5BY,4CAAgB"} \ No newline at end of file diff --git a/dist/commonjs/df/index.js b/dist/commonjs/df/index.js deleted file mode 100644 index 17e66280..00000000 --- a/dist/commonjs/df/index.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./df-binding-behavior")); -__export(require("./df-value-converter")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/commonjs/df/index.js.map b/dist/commonjs/df/index.js.map deleted file mode 100644 index c0de6a7c..00000000 --- a/dist/commonjs/df/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/df/index.ts"],"names":[],"mappings":";;;;;AAAA,2CAAsC;AACtC,0CAAqC"} \ No newline at end of file diff --git a/dist/commonjs/i18n.js b/dist/commonjs/i18n.js deleted file mode 100644 index fdb90d30..00000000 --- a/dist/commonjs/i18n.js +++ /dev/null @@ -1,313 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var i18next_1 = require("i18next"); -var aurelia_pal_1 = require("aurelia-pal"); -var LogManager = require("aurelia-logging"); -var aurelia_framework_1 = require("aurelia-framework"); -exports.I18N_EA_SIGNAL = "i18n:locale:changed"; -var I18N = /** @class */ (function () { - function I18N(ea, signaler) { - this.ea = ea; - this.signaler = signaler; - this.globalVars = {}; - this.i18next = i18next_1.default; - this.Intl = aurelia_pal_1.PLATFORM.global.Intl; - } - I18N.prototype.setup = function (options) { - return __awaiter(this, void 0, void 0, function () { - var defaultOptions; - var _this = this; - return __generator(this, function (_a) { - defaultOptions = { - skipTranslationOnMissingKey: false, - compatibilityAPI: "v1", - compatibilityJSON: "v1", - lng: "en", - attributes: ["t", "i18n"], - fallbackLng: "en", - debug: false - }; - this.i18nextDeferred = new Promise(function (resolve, reject) { - _this.i18next = _this.i18next.init(options || defaultOptions, function (err) { - if (err) { - reject(err); - } - // make sure attributes is an array in case a string was provided - if (_this.i18next.options.attributes instanceof String) { - _this.i18next.options.attributes = [_this.i18next.options.attributes]; - } - resolve(_this.i18next); - }); - }); - return [2 /*return*/, this.i18nextDeferred]; - }); - }); - }; - I18N.prototype.i18nextReady = function () { - return this.i18nextDeferred; - }; - I18N.prototype.setLocale = function (locale) { - var _this = this; - return new Promise(function (resolve, reject) { - var oldLocale = _this.getLocale(); - _this.i18next.changeLanguage(locale, function (err, tr) { - if (err) { - reject(err); - } - _this.ea.publish(exports.I18N_EA_SIGNAL, { oldValue: oldLocale, newValue: locale }); - _this.signaler.signal("aurelia-translation-signal"); - resolve(tr); - }); - }); - }; - I18N.prototype.getLocale = function () { - return this.i18next.language; - }; - I18N.prototype.nf = function (options, locales) { - return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); - }; - I18N.prototype.uf = function (numberLike, locale) { - var nf = this.nf({}, locale || this.getLocale()); - var comparer = nf.format(10000 / 3); - var thousandSeparator = comparer[1]; - var decimalSeparator = comparer[5]; - if (thousandSeparator === ".") { - thousandSeparator = "\\."; - } - // remove all thousand seperators - var result = numberLike.replace(new RegExp(thousandSeparator, "g"), "") - // remove non-numeric signs except -> , . - .replace(/[^\d.,-]/g, "") - // replace original decimalSeparator with english one - .replace(decimalSeparator, "."); - // return real number - return Number(result); - }; - I18N.prototype.df = function (options, locales) { - return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); - }; - I18N.prototype.tr = function (key, options) { - var fullOptions = this.globalVars; - if (options !== undefined) { - fullOptions = Object.assign(Object.assign({}, this.globalVars), options); - } - return this.i18next.t(key, fullOptions); - }; - I18N.prototype.registerGlobalVariable = function (key, value) { - this.globalVars[key] = value; - }; - I18N.prototype.unregisterGlobalVariable = function (key) { - delete this.globalVars[key]; - }; - /** - * Scans an element for children that have a translation attribute and - * updates their innerHTML with the current translation values. - * - * If an image is encountered the translated value will be applied to the src attribute. - * - * @param el HTMLElement to search within - */ - I18N.prototype.updateTranslations = function (el) { - if (!el || !el.querySelectorAll) { - return; - } - var i; - var l; - // create a selector from the specified attributes to look for - // var selector = [].concat(this.i18next.options.attributes); - var attributes = this.i18next.options.attributes; - var selector = [].concat(attributes); - for (i = 0, l = selector.length; i < l; i++) { - selector[i] = "[" + selector[i] + "]"; - } - selector = selector.join(","); - // get the nodes - var nodes = el.querySelectorAll(selector); - for (i = 0, l = nodes.length; i < l; i++) { - var node = nodes[i]; - var keys = void 0; - var params = void 0; - // test every attribute and get the first one that has a value - for (var i2 = 0, l2 = attributes.length; i2 < l2; i2++) { - keys = node.getAttribute(attributes[i2]); - var pname = attributes[i2] + "-params"; - if (pname && node.au && node.au[pname]) { - params = node.au[pname].viewModel.value; - } - if (keys) { - break; - } - } - // skip if nothing was found - if (!keys) { - continue; - } - // split the keys into multiple keys separated by a ; - this.updateValue(node, keys, params); - } - }; - I18N.prototype.updateValue = function (node, value, params) { - if (value === null || value === undefined) { - return; - } - var keys = value.toString().split(";"); - var i = keys.length; - while (i--) { - var key = keys[i]; - // remove the optional attribute - var re = /\[([a-z\-, ]*)\]/ig; - var m = void 0; - var attr = "text"; - // set default attribute to src if this is an image node - if (node.nodeName === "IMG") { - attr = "src"; - } - // check if a attribute was specified in the key - // tslint:disable-next-line:no-conditional-assignment - while ((m = re.exec(key)) !== null) { - if (m.index === re.lastIndex) { - re.lastIndex++; - } - if (m) { - key = key.replace(m[0], ""); - attr = m[1]; - } - } - var attrs = attr.split(","); - var j = attrs.length; - while (j--) { - attr = attrs[j].trim(); - if (!node._textContent) { - node._textContent = node.textContent; - } - if (!node._innerHTML) { - node._innerHTML = node.innerHTML; - } - // convert to camelCase - // tslint:disable-next-line:only-arrow-functions - var attrCC = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); - var reservedNames = ["prepend", "append", "text", "html"]; - var i18nLogger = LogManager.getLogger("i18n"); - if (reservedNames.indexOf(attr) > -1 && - node.au && - node.au.controller && - node.au.controller.viewModel && - attrCC in node.au.controller.viewModel) { - i18nLogger.warn("Aurelia I18N reserved attribute name\n\n [" + reservedNames.join(", ") + "]\n\n Your custom element has a bindable named " + attr + " which is a reserved word.\n\n If you'd like Aurelia I18N to translate your bindable instead, please consider giving it another name."); - } - if (this.i18next.options.skipTranslationOnMissingKey && - this.tr(key, params) === key) { - i18nLogger.warn("Couldn't find translation for key: " + key); - return; - } - // handle various attributes - // anything other than text,prepend,append or html will be added as an attribute on the element. - switch (attr) { - case "text": - var newChild = aurelia_pal_1.DOM.createTextNode(this.tr(key, params)); - if (node._newChild && node._newChild.parentNode === node) { - node.removeChild(node._newChild); - } - node._newChild = newChild; - while (node.firstChild) { - node.removeChild(node.firstChild); - } - node.appendChild(node._newChild); - break; - case "prepend": - var prependParser = aurelia_pal_1.DOM.createElement("div"); - prependParser.innerHTML = this.tr(key, params); - for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { - if (node.childNodes[ni]._prepended) { - node.removeChild(node.childNodes[ni]); - } - } - for (var pi = prependParser.childNodes.length - 1; pi >= 0; pi--) { - prependParser.childNodes[pi]._prepended = true; - if (node.firstChild) { - node.insertBefore(prependParser.childNodes[pi], node.firstChild); - } - else { - node.appendChild(prependParser.childNodes[pi]); - } - } - break; - case "append": - var appendParser = aurelia_pal_1.DOM.createElement("div"); - appendParser.innerHTML = this.tr(key, params); - for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { - if (node.childNodes[ni]._appended) { - node.removeChild(node.childNodes[ni]); - } - } - while (appendParser.firstChild) { - appendParser.firstChild._appended = true; - node.appendChild(appendParser.firstChild); - } - break; - case "html": - node.innerHTML = this.tr(key, params); - break; - default: // normal html attribute - if (node.au && - node.au.controller && - node.au.controller.viewModel && - attrCC in node.au.controller.viewModel) { - node.au.controller.viewModel[attrCC] = this.tr(key, params); - } - else { - node.setAttribute(attr, this.tr(key, params)); - } - break; - } - } - } - }; - I18N = __decorate([ - aurelia_framework_1.autoinject() - ], I18N); - return I18N; -}()); -exports.I18N = I18N; -//# sourceMappingURL=i18n.js.map \ No newline at end of file diff --git a/dist/commonjs/i18n.js.map b/dist/commonjs/i18n.js.map deleted file mode 100644 index e48b8546..00000000 --- a/dist/commonjs/i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAGiB;AACjB,2CAGqB;AACrB,4CAA8C;AAG9C,uDAA+C;AAiBlC,QAAA,cAAc,GAAG,qBAAqB,CAAC;AAGpD;IAME,cAAoB,EAAmB,EAAU,QAAyB;QAAtD,OAAE,GAAF,EAAE,CAAiB;QAAU,aAAQ,GAAR,QAAQ,CAAiB;QAFlE,eAAU,GAA2B,EAAE,CAAC;QAG9C,IAAI,CAAC,OAAO,GAAG,iBAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,sBAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;IACnC,CAAC;IAEY,oBAAK,GAAlB,UAAmB,OAA8C;;;;;gBACzD,cAAc,GAAG;oBACrB,2BAA2B,EAAE,KAAK;oBAClC,gBAAgB,EAAE,IAAI;oBACtB,iBAAiB,EAAE,IAAI;oBACvB,GAAG,EAAE,I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;IAAD,WAAC;CAAA,AA9RD,IA8RC;AA9RY,oBAAI"} \ No newline at end of file diff --git a/dist/commonjs/nf/index.js b/dist/commonjs/nf/index.js deleted file mode 100644 index b3ed0117..00000000 --- a/dist/commonjs/nf/index.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./nf-binding-behavior")); -__export(require("./nf-value-converter")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/commonjs/nf/index.js.map b/dist/commonjs/nf/index.js.map deleted file mode 100644 index 3ba8d34a..00000000 --- a/dist/commonjs/nf/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nf/index.ts"],"names":[],"mappings":";;;;;AAAA,2CAAsC;AACtC,0CAAqC"} \ No newline at end of file diff --git a/dist/commonjs/nf/nf-binding-behavior.js b/dist/commonjs/nf/nf-binding-behavior.js deleted file mode 100644 index 2dcaf541..00000000 --- a/dist/commonjs/nf/nf-binding-behavior.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_resources_1 = require("aurelia-templating-resources"); -var aurelia_binding_1 = require("aurelia-binding"); -var NfBindingBehavior = /** @class */ (function () { - function NfBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - NfBindingBehavior.inject = function () { return [aurelia_templating_resources_1.SignalBindingBehavior]; }; - NfBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the NfValueConverter. - // pass through any args to the binding behavior to the NfValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new aurelia_binding_1.ValueConverter(expression, "nf", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - NfBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return NfBindingBehavior; -}()); -exports.NfBindingBehavior = NfBindingBehavior; -//# sourceMappingURL=nf-binding-behavior.js.map \ No newline at end of file diff --git a/dist/commonjs/nf/nf-binding-behavior.js.map b/dist/commonjs/nf/nf-binding-behavior.js.map deleted file mode 100644 index 9bc8e803..00000000 --- a/dist/commonjs/nf/nf-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nf-binding-behavior.js","sourceRoot":"","sources":["../../../src/nf/nf-binding-behavior.ts"],"names":[],"mappings":";;AAAA,6EAAqE;AACrE,mDAAiD;AAEjD;IAGE,2BAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,oDAAqB,CAAC,CAAC,CAAC,CAAC;IAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;QACxF,sDAAsD;QACtD,wEAAwE;QACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,gCAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;IACJ,CAAC;IAEM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IACH,wBAAC;AAAD,CAAC,AA1BD,IA0BC;AA1BY,8CAAiB"} \ No newline at end of file diff --git a/dist/commonjs/nf/nf-value-converter.js b/dist/commonjs/nf/nf-value-converter.js deleted file mode 100644 index e21315ec..00000000 --- a/dist/commonjs/nf/nf-value-converter.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var i18n_1 = require("../i18n"); -var NfValueConverter = /** @class */ (function () { - function NfValueConverter(service) { - this.service = service; - } - NfValueConverter.inject = function () { return [i18n_1.I18N]; }; - NfValueConverter.prototype.toView = function (value, nfOrOptions, locale) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (nfOrOptions && (nfOrOptions instanceof Intl.NumberFormat && typeof nfOrOptions.format === "function")) { - return nfOrOptions.format(value); - } - var nf = this.service.nf(nfOrOptions, locale || this.service.getLocale()); - return nf.format(value); - }; - return NfValueConverter; -}()); -exports.NfValueConverter = NfValueConverter; -//# sourceMappingURL=nf-value-converter.js.map \ No newline at end of file diff --git a/dist/commonjs/nf/nf-value-converter.js.map b/dist/commonjs/nf/nf-value-converter.js.map deleted file mode 100644 index cf1ea981..00000000 --- a/dist/commonjs/nf/nf-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nf-value-converter.js","sourceRoot":"","sources":["../../../src/nf/nf-value-converter.ts"],"names":[],"mappings":";;AAAA,gCAA+B;AAE/B;IAEE,0BAAoB,OAAa;QAAb,YAAO,GAAP,OAAO,CAAM;IAAG,CAAC;IADvB,uBAAM,GAApB,cAAyB,OAAO,CAAC,WAAI,CAAC,CAAC,CAAC,CAAC;IAGlC,iCAAM,GAAb,UACE,KAAU,EACV,WAA0D,EAC1D,MAAe;QAEf,IAAI,KAAK,KAAK,IAAI;eACb,OAAO,KAAK,KAAK,WAAW;eAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACnD;YACF,OAAO,KAAK,CAAC;SACd;QAED,IAAI,WAAW,IAAI,CAAC,WAAW,YAAY,IAAI,CAAC,YAAY,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE;YACzG,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAClC;QAED,IAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAuC,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACxG,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACH,uBAAC;AAAD,CAAC,AAvBD,IAuBC;AAvBY,4CAAgB"} \ No newline at end of file diff --git a/dist/commonjs/relativeTime.js b/dist/commonjs/relativeTime.js deleted file mode 100644 index 6c2dd193..00000000 --- a/dist/commonjs/relativeTime.js +++ /dev/null @@ -1,93 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_event_aggregator_1 = require("aurelia-event-aggregator"); -var i18n_1 = require("./i18n"); -var relative_time_1 = require("./defaultTranslations/relative.time"); -var RelativeTime = /** @class */ (function () { - function RelativeTime(service, ea) { - var _this = this; - this.service = service; - this.ea = ea; - this.service.i18nextReady().then(function () { - _this.setup(); - }); - this.ea.subscribe(i18n_1.I18N_EA_SIGNAL, function (locales) { - _this.setup(locales); - }); - } - RelativeTime.inject = function () { return [i18n_1.I18N, aurelia_event_aggregator_1.EventAggregator]; }; - RelativeTime.prototype.setup = function (locales) { - var trans = relative_time_1.translations.default || relative_time_1.translations; - var fallbackLng = this.service.i18next.fallbackLng; - var alternateFb = fallbackLng || this.service.i18next.options.fallbackLng; - if (Array.isArray(alternateFb) && alternateFb.length > 0) { - alternateFb = alternateFb[0]; - } - var key = ((locales && locales.newValue) - ? locales.newValue - : this.service.getLocale()) || alternateFb; - var index = 0; - // tslint:disable-next-line:no-conditional-assignment - if ((index = key.indexOf("-")) >= 0) { - var baseLocale = key.substring(0, index); - if (trans[baseLocale]) { - this.addTranslationResource(baseLocale, trans[baseLocale].translation); - } - } - if (trans[key]) { - this.addTranslationResource(key, trans[key].translation); - } - if (trans[fallbackLng]) { - this.addTranslationResource(key, trans[fallbackLng].translation); - } - }; - RelativeTime.prototype.addTranslationResource = function (key, translation) { - var options = this.service.i18next.options; - if (options.interpolation && (options.interpolation.prefix !== "__" || options.interpolation.suffix !== "__")) { - // tslint:disable-next-line:forin - for (var subkey in translation) { - translation[subkey] = translation[subkey] - .replace("__count__", (options.interpolation.prefix || "{{") + "count" + (options.interpolation.suffix || "}}")); - } - } - this.service.i18next.addResources(key, options.defaultNS || "translation", translation); - }; - RelativeTime.prototype.getRelativeTime = function (time) { - var now = new Date(); - var diff = now.getTime() - time.getTime(); - var timeDiff = this.getTimeDiffDescription(diff, "year", 31104000000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "month", 2592000000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "day", 86400000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "hour", 3600000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "minute", 60000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "second", 1000); - if (!timeDiff) { - timeDiff = this.service.tr("now"); - } - } - } - } - } - } - return timeDiff; - }; - RelativeTime.prototype.getTimeDiffDescription = function (diff, unit, timeDivisor) { - var unitAmount = parseInt((diff / timeDivisor).toFixed(0), 10); - if (unitAmount > 0) { - return this.service.tr(unit, { count: unitAmount, context: "ago" }); - } - else if (unitAmount < 0) { - var abs = Math.abs(unitAmount); - return this.service.tr(unit, { count: abs, context: "in" }); - } - return null; - }; - return RelativeTime; -}()); -exports.RelativeTime = RelativeTime; -//# sourceMappingURL=relativeTime.js.map \ No newline at end of file diff --git a/dist/commonjs/relativeTime.js.map b/dist/commonjs/relativeTime.js.map deleted file mode 100644 index 505807ce..00000000 --- a/dist/commonjs/relativeTime.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"relativeTime.js","sourceRoot":"","sources":["../../src/relativeTime.ts"],"names":[],"mappings":";;AAAA,qEAA2D;AAE3D,+BAIgB;AAChB,qEAAmE;AAEnE;IAEE,sBAAoB,OAAa,EAAU,EAAmB;QAA9D,iBAQC;QARmB,YAAO,GAAP,OAAO,CAAM;QAAU,OAAE,GAAF,EAAE,CAAiB;QAC5D,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC;YAC/B,KAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,qBAAc,EAAE,UAAC,OAAyB;YAC1D,KAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IATa,mBAAM,GAApB,cAAyB,OAAO,CAAC,WAAI,EAAE,0CAAe,CAAC,CAAC,CAAC,CAAC;IAWnD,4BAAK,GAAZ,UAAa,OAAgD;QAC3D,IAAM,KAAK,GAAI,4BAAoB,CAAC,OAAO,IAAI,4BAAY,CAAC;QAC5D,IAAM,WAAW,GAAI,IAAI,CAAC,OAAO,CAAC,OAAe,CAAC,WAAW,CAAC;QAE9D,IAAI,WAAW,GAAG,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;QAC1E,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YACxD,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;SAC9B;QAED,IAAM,GAAG,GAAG,CAAC,CAAC,OAAO,IAAI,OAA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iBACF;aACF;SACF;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,6CAAsB,GAA7B,UACE,IAAY,EAAE,IAA6D,EAAE,WAAmB;QAEhG,IAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,IAAI,GAAG,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACjE,IAAI,UAAU,GAAG,CAAC,EAAE;YAClB,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;SACrE;aAAM,IAAI,UAAU,GAAG,CAAC,EAAE;YACzB,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACjC,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;SAC7D;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IACH,mBAAC;AAAD,CAAC,AAlGD,IAkGC;AAlGY,oCAAY"} \ No newline at end of file diff --git a/dist/commonjs/rt/index.js b/dist/commonjs/rt/index.js deleted file mode 100644 index d623148f..00000000 --- a/dist/commonjs/rt/index.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./rt-binding-behavior")); -__export(require("./rt-value-converter")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/commonjs/rt/index.js.map b/dist/commonjs/rt/index.js.map deleted file mode 100644 index 435ee9b7..00000000 --- a/dist/commonjs/rt/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rt/index.ts"],"names":[],"mappings":";;;;;AAAA,2CAAsC;AACtC,0CAAqC"} \ No newline at end of file diff --git a/dist/commonjs/rt/rt-binding-behavior.js b/dist/commonjs/rt/rt-binding-behavior.js deleted file mode 100644 index e704d9a5..00000000 --- a/dist/commonjs/rt/rt-binding-behavior.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_resources_1 = require("aurelia-templating-resources"); -var aurelia_binding_1 = require("aurelia-binding"); -var RtBindingBehavior = /** @class */ (function () { - function RtBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - RtBindingBehavior.inject = function () { return [aurelia_templating_resources_1.SignalBindingBehavior]; }; - RtBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal", "aurelia-relativetime-signal"); - // rewrite the expression to use the RtValueConverter. - // pass through any args to the binding behavior to the RtValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new aurelia_binding_1.ValueConverter(expression, "rt", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - RtBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return RtBindingBehavior; -}()); -exports.RtBindingBehavior = RtBindingBehavior; -//# sourceMappingURL=rt-binding-behavior.js.map \ No newline at end of file diff --git a/dist/commonjs/rt/rt-binding-behavior.js.map b/dist/commonjs/rt/rt-binding-behavior.js.map deleted file mode 100644 index 9eded33f..00000000 --- a/dist/commonjs/rt/rt-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rt-binding-behavior.js","sourceRoot":"","sources":["../../../src/rt/rt-binding-behavior.ts"],"names":[],"mappings":";;AAAA,6EAAqE;AACrE,mDAAiD;AAEjD;IAGE,2BAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,oDAAqB,CAAC,CAAC,CAAC,CAAC;IAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CACtC,OAAO,EAAE,MAAM,EAAE,4BAA4B,EAAE,6BAA6B,CAC7E,CAAC;QACF,sDAAsD;QACtD,wEAAwE;QACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,gCAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;IACJ,CAAC;IAEM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IACH,wBAAC;AAAD,CAAC,AA5BD,IA4BC;AA5BY,8CAAiB"} \ No newline at end of file diff --git a/dist/commonjs/rt/rt-value-converter.js b/dist/commonjs/rt/rt-value-converter.js deleted file mode 100644 index 9317bed9..00000000 --- a/dist/commonjs/rt/rt-value-converter.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var relativeTime_1 = require("../relativeTime"); -var RtValueConverter = /** @class */ (function () { - function RtValueConverter(service) { - this.service = service; - } - RtValueConverter.inject = function () { return [relativeTime_1.RelativeTime]; }; - RtValueConverter.prototype.toView = function (value) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (typeof value === "string" && isNaN(value) && !Number.isInteger(value)) { - value = new Date(value); - } - return this.service.getRelativeTime(value); - }; - return RtValueConverter; -}()); -exports.RtValueConverter = RtValueConverter; -//# sourceMappingURL=rt-value-converter.js.map \ No newline at end of file diff --git a/dist/commonjs/rt/rt-value-converter.js.map b/dist/commonjs/rt/rt-value-converter.js.map deleted file mode 100644 index d0434ce1..00000000 --- a/dist/commonjs/rt/rt-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rt-value-converter.js","sourceRoot":"","sources":["../../../src/rt/rt-value-converter.ts"],"names":[],"mappings":";;AAAA,gDAA+C;AAE/C;IAEE,0BAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAG,CAAC;IAD/B,uBAAM,GAApB,cAAyB,OAAO,CAAC,2BAAY,CAAC,CAAC,CAAC,CAAC;IAG1C,iCAAM,GAAb,UAAc,KAAU;QACtB,IAAI,KAAK,KAAK,IAAI;eACb,OAAO,KAAK,KAAK,WAAW;eAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACnD;YACF,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAY,CAAC,EAAE;YACvF,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IACH,uBAAC;AAAD,CAAC,AAlBD,IAkBC;AAlBY,4CAAgB"} \ No newline at end of file diff --git a/dist/commonjs/t/index.js b/dist/commonjs/t/index.js deleted file mode 100644 index f4227bcf..00000000 --- a/dist/commonjs/t/index.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./t-binding-behavior")); -__export(require("./t-custom-attribute")); -__export(require("./t-params-custom-attribute")); -__export(require("./t-value-converter")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/commonjs/t/index.js.map b/dist/commonjs/t/index.js.map deleted file mode 100644 index f3f226ca..00000000 --- a/dist/commonjs/t/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/t/index.ts"],"names":[],"mappings":";;;;;AAAA,0CAAqC;AACrC,0CAAqC;AACrC,iDAA4C;AAC5C,yCAAoC"} \ No newline at end of file diff --git a/dist/commonjs/t/t-binding-behavior.js b/dist/commonjs/t/t-binding-behavior.js deleted file mode 100644 index 25d5f42c..00000000 --- a/dist/commonjs/t/t-binding-behavior.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_resources_1 = require("aurelia-templating-resources"); -var aurelia_binding_1 = require("aurelia-binding"); -var TBindingBehavior = /** @class */ (function () { - function TBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - TBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the TValueConverter. - // pass through any args to the binding behavior to the TValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new aurelia_binding_1.ValueConverter(expression, "t", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - TBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - TBindingBehavior.inject = [aurelia_templating_resources_1.SignalBindingBehavior]; - return TBindingBehavior; -}()); -exports.TBindingBehavior = TBindingBehavior; -//# sourceMappingURL=t-binding-behavior.js.map \ No newline at end of file diff --git a/dist/commonjs/t/t-binding-behavior.js.map b/dist/commonjs/t/t-binding-behavior.js.map deleted file mode 100644 index e08f67af..00000000 --- a/dist/commonjs/t/t-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-binding-behavior.js","sourceRoot":"","sources":["../../../src/t/t-binding-behavior.ts"],"names":[],"mappings":";;AAAA,6EAAqE;AACrE,mDAAiD;AAEjD;IAGE,0BAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAE9D,+BAAI,GAAX,UAAY,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;QACxF,qDAAqD;QACrD,uEAAuE;QACvE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,gCAAc,CAC9C,UAAU,EAAE,GAAG,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC9E,CAAC;IACJ,CAAC;IAEM,iCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IAxBa,uBAAM,GAAG,CAAC,oDAAqB,CAAC,CAAC;IA0BjD,uBAAC;CAAA,AA3BD,IA2BC;AA3BY,4CAAgB"} \ No newline at end of file diff --git a/dist/commonjs/t/t-custom-attribute.js b/dist/commonjs/t/t-custom-attribute.js deleted file mode 100644 index 40ae3592..00000000 --- a/dist/commonjs/t/t-custom-attribute.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_event_aggregator_1 = require("aurelia-event-aggregator"); -var aurelia_metadata_1 = require("aurelia-metadata"); -var aurelia_pal_1 = require("aurelia-pal"); -var i18n_1 = require("../i18n"); -var utils_1 = require("../utils"); -var t_params_custom_attribute_1 = require("./t-params-custom-attribute"); -var TCustomAttribute = /** @class */ (function () { - function TCustomAttribute(element, service, ea, p) { - this.element = element; - this.service = service; - this.ea = ea; - this.lazyParams = p; - } - TCustomAttribute_1 = TCustomAttribute; - TCustomAttribute.inject = function () { - return [aurelia_pal_1.DOM.Element, i18n_1.I18N, aurelia_event_aggregator_1.EventAggregator, utils_1.LazyOptional.of(t_params_custom_attribute_1.TParamsCustomAttribute)]; - }; - TCustomAttribute.configureAliases = function (aliases) { - var r = aurelia_metadata_1.metadata.getOrCreateOwn(aurelia_metadata_1.metadata.resource, aurelia_templating_1.HtmlBehaviorResource, TCustomAttribute_1); - r.aliases = aliases; - }; - TCustomAttribute.prototype.bind = function () { - var _this = this; - this.params = this.lazyParams(); - if (this.params) { - this.params.valueChanged = function (newParams, oldParams) { - _this.paramsChanged(_this.value, newParams, oldParams); - }; - } - var p = this.params !== null ? this.params.value : undefined; - this.subscription = this.ea.subscribe(i18n_1.I18N_EA_SIGNAL, function () { - _this.service.updateValue(_this.element, _this.value, _this.params !== null ? _this.params.value : undefined); - }); - this.service.updateValue(this.element, this.value, p); - }; - TCustomAttribute.prototype.paramsChanged = function (newValue, newParams) { - this.service.updateValue(this.element, newValue, newParams); - }; - TCustomAttribute.prototype.valueChanged = function (newValue) { - var p = this.params !== null ? this.params.value : undefined; - this.service.updateValue(this.element, newValue, p); - }; - TCustomAttribute.prototype.unbind = function () { - // If unbind is called before timeout for subscription is triggered, subscription will be undefined - if (this.subscription) { - this.subscription.dispose(); - } - }; - var TCustomAttribute_1; - TCustomAttribute = TCustomAttribute_1 = __decorate([ - aurelia_templating_1.customAttribute("t") - ], TCustomAttribute); - return TCustomAttribute; -}()); -exports.TCustomAttribute = TCustomAttribute; -//# sourceMappingURL=t-custom-attribute.js.map \ No newline at end of file diff --git a/dist/commonjs/t/t-custom-attribute.js.map b/dist/commonjs/t/t-custom-attribute.js.map deleted file mode 100644 index e7d624b0..00000000 --- a/dist/commonjs/t/t-custom-attribute.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-custom-attribute.js","sourceRoot":"","sources":["../../../src/t/t-custom-attribute.ts"],"names":[],"mappings":";;;;;;;;AAAA,yDAG4B;AAC5B,qEAGkC;AAClC,qDAA4C;AAC5C,2CAAkC;AAElC,gCAGiB;AACjB,kCAAwC;AACxC,yEAAqE;AAGrE;IAcE,0BACU,OAA8B,EAC9B,OAAa,EACb,EAAmB,EAC3B,CAAM;QAHE,YAAO,GAAP,OAAO,CAAuB;QAC9B,YAAO,GAAP,OAAO,CAAM;QACb,OAAE,GAAF,EAAE,CAAiB;QAG3B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IACtB,CAAC;yBArBU,gBAAgB;IACb,uBAAM,GAApB;QACE,OAAO,CAAC,iBAAG,CAAC,OAAO,EAAE,WAAI,EAAE,0CAAe,EAAE,oBAAY,CAAC,EAAE,CAAC,kDAAsB,CAAC,CAAC,CAAC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9D,CAAC;IAEM,uCAAY,GAAnB,UAAoB,QAAa;QAC/B,IAAM,CAAC,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/D,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC;IAEM,iCAAM,GAAb;QACE,mGAAmG;QACnG,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;SAC7B;IACH,CAAC;;IAtDU,gBAAgB;QAD5B,oCAAe,CAAC,GAAG,CAAC;OACR,gBAAgB,CAuD5B;IAAD,uBAAC;CAAA,AAvDD,IAuDC;AAvDY,4CAAgB"} \ No newline at end of file diff --git a/dist/commonjs/t/t-params-custom-attribute.js b/dist/commonjs/t/t-params-custom-attribute.js deleted file mode 100644 index 47a6058c..00000000 --- a/dist/commonjs/t/t-params-custom-attribute.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_templating_1 = require("aurelia-templating"); -var aurelia_metadata_1 = require("aurelia-metadata"); -var aurelia_pal_1 = require("aurelia-pal"); -var TParamsCustomAttribute = /** @class */ (function () { - function TParamsCustomAttribute(element) { - this.element = element; - } - TParamsCustomAttribute_1 = TParamsCustomAttribute; - TParamsCustomAttribute.inject = function () { - return [aurelia_pal_1.DOM.Element]; - }; - TParamsCustomAttribute.configureAliases = function (aliases) { - var r = aurelia_metadata_1.metadata.getOrCreateOwn(aurelia_metadata_1.metadata.resource, aurelia_templating_1.HtmlBehaviorResource, TParamsCustomAttribute_1); - r.aliases = aliases; - }; - TParamsCustomAttribute.prototype.valueChanged = function () { }; - var TParamsCustomAttribute_1; - TParamsCustomAttribute = TParamsCustomAttribute_1 = __decorate([ - aurelia_templating_1.customAttribute("t-params") - ], TParamsCustomAttribute); - return TParamsCustomAttribute; -}()); -exports.TParamsCustomAttribute = TParamsCustomAttribute; -//# sourceMappingURL=t-params-custom-attribute.js.map \ No newline at end of file diff --git a/dist/commonjs/t/t-params-custom-attribute.js.map b/dist/commonjs/t/t-params-custom-attribute.js.map deleted file mode 100644 index e0ee14aa..00000000 --- a/dist/commonjs/t/t-params-custom-attribute.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-params-custom-attribute.js","sourceRoot":"","sources":["../../../src/t/t-params-custom-attribute.ts"],"names":[],"mappings":";;;;;;;;AAAA,yDAG4B;AAC5B,qDAA4C;AAC5C,2CAAkC;AAGlC;IAYE,gCAAmB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAI,CAAC;+BAZ7B,sBAAsB;IACnB,6BAAM,GAApB;QACE,OAAO,CAAC,iBAAG,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAEa,uCAAgB,GAA9B,UAA+B,OAAiB;QAC9C,IAAM,CAAC,GAAG,2BAAQ,CAAC,cAAc,CAAC,2BAAQ,CAAC,QAAQ,EAAE,yCAAoB,EAAE,wBAAsB,CAAC,CAAC;QAClG,CAAS,CAAC,OAAO,GAAG,OAAO,CAAC;IAC/B,CAAC;IAMM,6CAAY,GAAnB,cAA6B,CAAC;;IAdnB,sBAAsB;QADlC,oCAAe,CAAC,UAAU,CAAC;OACf,sBAAsB,CAelC;IAAD,6BAAC;CAAA,AAfD,IAeC;AAfY,wDAAsB"} \ No newline at end of file diff --git a/dist/commonjs/t/t-value-converter.js b/dist/commonjs/t/t-value-converter.js deleted file mode 100644 index e4474f16..00000000 --- a/dist/commonjs/t/t-value-converter.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var i18n_1 = require("../i18n"); -var TValueConverter = /** @class */ (function () { - function TValueConverter(service) { - this.service = service; - } - TValueConverter.inject = function () { return [i18n_1.I18N]; }; - TValueConverter.prototype.toView = function (value, options) { - return this.service.tr(value, options); - }; - return TValueConverter; -}()); -exports.TValueConverter = TValueConverter; -//# sourceMappingURL=t-value-converter.js.map \ No newline at end of file diff --git a/dist/commonjs/t/t-value-converter.js.map b/dist/commonjs/t/t-value-converter.js.map deleted file mode 100644 index 7acd2659..00000000 --- a/dist/commonjs/t/t-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-value-converter.js","sourceRoot":"","sources":["../../../src/t/t-value-converter.ts"],"names":[],"mappings":";;AAEA,gCAA+B;AAE/B;IAGE,yBAAoB,OAAa;QAAb,YAAO,GAAP,OAAO,CAAM;IAAI,CAAC;IAFxB,sBAAM,GAApB,cAAyB,OAAO,CAAC,WAAI,CAAC,CAAC,CAAC,CAAC;IAIlC,gCAAM,GAAb,UAAc,KAAU,EAAE,OAA4C;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IACH,sBAAC;AAAD,CAAC,AARD,IAQC;AARY,0CAAe"} \ No newline at end of file diff --git a/dist/commonjs/utils.js b/dist/commonjs/utils.js deleted file mode 100644 index 37a69b0e..00000000 --- a/dist/commonjs/utils.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var aurelia_dependency_injection_1 = require("aurelia-dependency-injection"); -exports.extend = function (destination, source) { - // tslint:disable-next-line:forin - for (var property in source) { - destination[property] = source[property]; - } - return destination; -}; -// tslint:disable-next-line:only-arrow-functions -exports.isInteger = Number.isInteger || function (value) { - return typeof value === "number" && - isFinite(value) && - Math.floor(value) === value; -}; -exports.assignObjectToKeys = function (root, obj) { - if (obj === undefined || obj === null) { - return obj; - } - var opts = {}; - Object.keys(obj).map(function (key) { - if (typeof obj[key] === "object") { - exports.extend(opts, exports.assignObjectToKeys(key, obj[key])); - } - else { - opts[root !== "" ? root + "." + key : key] = obj[key]; - } - }); - return opts; -}; -var LazyOptional = /** @class */ (function () { - function LazyOptional(key) { - this.key = key; - } - LazyOptional_1 = LazyOptional; - LazyOptional.of = function (key) { - return new LazyOptional_1(key); - }; - LazyOptional.prototype.get = function (container) { - var _this = this; - return function () { - if (container.hasResolver(_this.key, false)) { - return container.get(_this.key); - } - return null; - }; - }; - var LazyOptional_1; - LazyOptional = LazyOptional_1 = __decorate([ - aurelia_dependency_injection_1.resolver() - ], LazyOptional); - return LazyOptional; -}()); -exports.LazyOptional = LazyOptional; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/dist/commonjs/utils.js.map b/dist/commonjs/utils.js.map deleted file mode 100644 index b0fedc9c..00000000 --- a/dist/commonjs/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;;;AAAA,6EAGsC;AAE3B,QAAA,MAAM,GAAG,UAAC,WAAgB,EAAE,MAAW;IAChD,iCAAiC;IACjC,KAAK,IAAM,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C,OAAO;YACL,IAAI,SAAS,CAAC,WAAW,CAAC,KAAI,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;gBAC1C,OAAO,SAAS,CAAC,GAAG,CAAC,KAAI,CAAC,GAAG,CAAC,CAAC;aAChC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IACJ,CAAC;;IAdU,YAAY;QADxB,uCAAQ,EAAE;OACE,YAAY,CAexB;IAAD,mBAAC;CAAA,AAfD,IAeC;AAfY,oCAAY"} \ No newline at end of file diff --git a/dist/es2015/aurelia-i18n-loader.js b/dist/es2015/aurelia-i18n-loader.js deleted file mode 100644 index 6c25c986..00000000 --- a/dist/es2015/aurelia-i18n-loader.js +++ /dev/null @@ -1,117 +0,0 @@ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var Backend = /** @class */ (function () { - function Backend(services, options) { - if (options === void 0) { options = {}; } - this.services = services; - this.options = options; - this.type = "backend"; - this.init(services, options); - } - Backend.with = function (loader) { - this.loader = loader; - return this; - }; - Backend.prototype.init = function (services, options) { - if (options === void 0) { options = {}; } - this.services = services; - this.options = Object.assign({}, { - loadPath: "/locales/{{lng}}/{{ns}}.json", - addPath: "locales/add/{{lng}}/{{ns}}", - allowMultiLoading: false, - parse: JSON.parse - }, options); - }; - Backend.prototype.readMulti = function (languages, namespaces, callback) { - var loadPath = this.options.loadPath; - if (typeof this.options.loadPath === "function") { - loadPath = this.options.loadPath(languages, namespaces); - } - var url = this.services - .interpolator - .interpolate(loadPath, { lng: languages.join("+"), ns: namespaces.join("+") }); - this.loadUrl(url, callback); - }; - Backend.prototype.read = function (language, namespace, callback) { - var loadPath = this.options.loadPath; - if (typeof this.options.loadPath === "function") { - loadPath = this.options.loadPath([language], [namespace]); - } - var url = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }); - this.loadUrl(url, callback); - }; - Backend.prototype.loadUrl = function (url, callback) { - return __awaiter(this, void 0, void 0, function () { - var response, ret, err, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 2, , 3]); - return [4 /*yield*/, Backend.loader.loadText(url)]; - case 1: - response = _b.sent(); - ret = void 0; - err = void 0; - try { - ret = (response instanceof Object) ? response : this.options.parse(response, url); - } - catch (e) { - err = "failed parsing " + url + " to json"; - } - if (err) { - return [2 /*return*/, callback(err, false)]; - } - callback(null, ret); - return [3 /*break*/, 3]; - case 2: - _a = _b.sent(); - callback("failed loading " + url, false /* no retry */); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); - }; - // tslint:disable-next-line:variable-name - Backend.prototype.create = function (_languages, _namespace, _key, _fallbackValue) { - // not supported - }; - Backend.type = "backend"; - return Backend; -}()); -export { Backend }; -export default Backend; -//# sourceMappingURL=aurelia-i18n-loader.js.map \ No newline at end of file diff --git a/dist/es2015/aurelia-i18n-loader.js.map b/dist/es2015/aurelia-i18n-loader.js.map deleted file mode 100644 index 67917222..00000000 --- a/dist/es2015/aurelia-i18n-loader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aurelia-i18n-loader.js","sourceRoot":"","sources":["../../src/aurelia-i18n-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA;IAWE,iBAAmB,QAAa,EAAS,OAAmC;QAAnC,wBAAA,EAAA,YAAmC;QAAzD,aAAQ,GAAR,QAAQ,CAAK;QAAS,YAAO,GAAP,OAAO,CAA4B;QAFrE,SAAI,GAAW,SAAS,CAAC;QAG9B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;IARa,YAAI,GAAlB,UAAmB,MAAc;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAOM,sBAAI,GAAX,UAAY,QAAa,EAAE,OAAmC;QAAnC,wBAAA,EAAA,YAAmC;QAC5D,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE;YAC/B,QAAQ,EAAE,8BAA8B;YACxC,O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;IAEY,yBAAO,GAApB,UAAqB,GAAW,EAAE,QAAsB;;;;;;;wBAEnC,qBAAM,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAA;;wBAA7C,QAAQ,GAAG,SAAkC;wBAC/C,GAAG,SAAA,CAAC;wBACJ,GAAG,SAAA,CAAC;wBACR,IAAI;4BACF,GAAG,GAAG,CAAC,QAAe,YAAY,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;yBAC3F;wBAAC,OAAO,CAAC,EAAE;4BACV,GAAG,GAAG,iBAAiB,GAAG,GAAG,GAAG,UAAU,CAAC;yBAC5C;wBAED,IAAI,GAAG,EAAE;4BACP,sBAAO,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,EAAC;yBAC7B;wBACD,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;;;;wBAEpB,QAAQ,CAAC,iBAAiB,GAAG,GAAG,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;;;;;;KAE3D;IAED,yCAAyC;IAClC,wBAAM,GAAb,UAAc,UAA6B,EAAE,UAAkB,EAAE,IAAY,EAAE,cAAsB;QACnG,gBAAgB;IAClB,CAAC;IAxEa,YAAI,GAAW,SAAS,CAAC;IAyEzC,cAAC;CAAA,AA3ED,IA2EC;SA3EY,OAAO;AA6EpB,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/dist/es2015/aurelia-i18n.js b/dist/es2015/aurelia-i18n.js index b3c91da3..204ae7ea 100644 --- a/dist/es2015/aurelia-i18n.js +++ b/dist/es2015/aurelia-i18n.js @@ -1,53 +1,1320 @@ -import { EventAggregator } from "aurelia-event-aggregator"; -import { ViewResources } from "aurelia-templating"; -import { BindingSignaler } from "aurelia-templating-resources"; -import { PLATFORM } from "aurelia-pal"; -import { I18N } from "./i18n"; -export * from "./i18n"; -export * from "./relativeTime"; -export * from "./aurelia-i18n-loader"; -export { DfValueConverter, DfBindingBehavior } from "./df"; -export { NfValueConverter, NfBindingBehavior } from "./nf"; -export { RtValueConverter, RtBindingBehavior } from "./rt"; -export { TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute } from "./t"; -export function configure(frameworkConfig, cb) { - if (cb === undefined || typeof cb !== "function") { - var errorMsg = "You need to provide a callback method to properly configure the library"; +import i18next from 'i18next'; +import { getLogger } from 'aurelia-logging'; +import { resolver } from 'aurelia-dependency-injection'; +import { customAttribute, HtmlBehaviorResource, ViewResources } from 'aurelia-templating'; +import { metadata } from 'aurelia-metadata'; +import { DOM, PLATFORM } from 'aurelia-pal'; +import { valueConverter } from 'aurelia-framework'; +import { BindingSignaler, SignalBindingBehavior } from 'aurelia-templating-resources'; +import { EventAggregator } from 'aurelia-event-aggregator'; +import { ValueConverter, bindingBehavior, valueConverter as valueConverter$1 } from 'aurelia-binding'; + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +const I18N_EA_SIGNAL = "i18n:locale:changed"; +class I18N { + constructor(ea, signaler) { + this.ea = ea; + this.signaler = signaler; + this.globalVars = {}; + this.i18next = i18next; + this.Intl = PLATFORM.global.Intl; + } + static inject() { return [EventAggregator, BindingSignaler]; } + setup(options) { + return __awaiter(this, void 0, void 0, function* () { + const defaultOptions = { + skipTranslationOnMissingKey: false, + compatibilityAPI: "v1", + compatibilityJSON: "v1", + lng: "en", + attributes: ["t", "i18n"], + fallbackLng: "en", + debug: false + }; + this.i18nextDeferred = new Promise((resolve, reject) => { + this.i18next = this.i18next.init(options || defaultOptions, (err) => { + if (err) { + reject(err); + } + // make sure attributes is an array in case a string was provided + if (this.i18next.options.attributes instanceof String) { + this.i18next.options.attributes = [this.i18next.options.attributes]; + } + resolve(this.i18next); + }); + }); + return this.i18nextDeferred; + }); + } + i18nextReady() { + return this.i18nextDeferred; + } + setLocale(locale) { + return new Promise((resolve, reject) => { + const oldLocale = this.getLocale(); + this.i18next.changeLanguage(locale, (err, tr) => { + if (err) { + reject(err); + } + this.ea.publish(I18N_EA_SIGNAL, { oldValue: oldLocale, newValue: locale }); + this.signaler.signal("aurelia-translation-signal"); + resolve(tr); + }); + }); + } + getLocale() { + return this.i18next.language; + } + nf(options, locales) { + return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); + } + uf(numberLike, locale) { + const nf = this.nf({}, locale || this.getLocale()); + const comparer = nf.format(10000 / 3); + let thousandSeparator = comparer[1]; + const decimalSeparator = comparer[5]; + if (thousandSeparator === ".") { + thousandSeparator = "\\."; + } + // remove all thousand seperators + const result = numberLike.replace(new RegExp(thousandSeparator, "g"), "") + // remove non-numeric signs except -> , . + .replace(/[^\d.,-]/g, "") + // replace original decimalSeparator with english one + .replace(decimalSeparator, "."); + // return real number + return Number(result); + } + df(options, locales) { + return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); + } + tr(key, options) { + let fullOptions = this.globalVars; + if (options !== undefined) { + fullOptions = Object.assign(Object.assign({}, this.globalVars), options); + } + return this.i18next.t(key, fullOptions); + } + registerGlobalVariable(key, value) { + this.globalVars[key] = value; + } + unregisterGlobalVariable(key) { + delete this.globalVars[key]; + } + /** + * Scans an element for children that have a translation attribute and + * updates their innerHTML with the current translation values. + * + * If an image is encountered the translated value will be applied to the src attribute. + * + * @param el HTMLElement to search within + */ + updateTranslations(el) { + if (!el || !el.querySelectorAll) { + return; + } + let i; + let l; + // create a selector from the specified attributes to look for + // var selector = [].concat(this.i18next.options.attributes); + const attributes = this.i18next.options.attributes; + let selector = [].concat(attributes); + for (i = 0, l = selector.length; i < l; i++) { + selector[i] = "[" + selector[i] + "]"; + } + selector = selector.join(","); + // get the nodes + const nodes = el.querySelectorAll(selector); + for (i = 0, l = nodes.length; i < l; i++) { + const node = nodes[i]; + let keys; + let params; + // test every attribute and get the first one that has a value + for (let i2 = 0, l2 = attributes.length; i2 < l2; i2++) { + keys = node.getAttribute(attributes[i2]); + const pname = attributes[i2] + "-params"; + if (pname && node.au && node.au[pname]) { + params = node.au[pname].viewModel.value; + } + if (keys) { + break; + } + } + // skip if nothing was found + if (!keys) { + continue; + } + // split the keys into multiple keys separated by a ; + this.updateValue(node, keys, params); + } + } + updateValue(node, value, params) { + if (value === null || value === undefined) { + return; + } + const keys = value.toString().split(";"); + let i = keys.length; + while (i--) { + let key = keys[i]; + // remove the optional attribute + const re = /\[([a-z\-, ]*)\]/ig; + let m; + let attr = "text"; + // set default attribute to src if this is an image node + if (node.nodeName === "IMG") { + attr = "src"; + } + // check if a attribute was specified in the key + // tslint:disable-next-line:no-conditional-assignment + while ((m = re.exec(key)) !== null) { + if (m.index === re.lastIndex) { + re.lastIndex++; + } + if (m) { + key = key.replace(m[0], ""); + attr = m[1]; + } + } + const attrs = attr.split(","); + let j = attrs.length; + while (j--) { + attr = attrs[j].trim(); + if (!node._textContent) { + node._textContent = node.textContent; + } + if (!node._innerHTML) { + node._innerHTML = node.innerHTML; + } + // convert to camelCase + // tslint:disable-next-line:only-arrow-functions + const attrCC = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); + const reservedNames = ["prepend", "append", "text", "html"]; + const i18nLogger = getLogger("i18n"); + if (reservedNames.indexOf(attr) > -1 && + node.au && + node.au.controller && + node.au.controller.viewModel && + attrCC in node.au.controller.viewModel) { + i18nLogger.warn(`Aurelia I18N reserved attribute name\n + [${reservedNames.join(", ")}]\n + Your custom element has a bindable named ${attr} which is a reserved word.\n + If you'd like Aurelia I18N to translate your bindable instead, please consider giving it another name.`); + } + if (this.i18next.options.skipTranslationOnMissingKey && + this.tr(key, params) === key) { + i18nLogger.warn(`Couldn't find translation for key: ${key}`); + return; + } + // handle various attributes + // anything other than text,prepend,append or html will be added as an attribute on the element. + switch (attr) { + case "text": + const newChild = DOM.createTextNode(this.tr(key, params)); + if (node._newChild && node._newChild.parentNode === node) { + node.removeChild(node._newChild); + } + node._newChild = newChild; + while (node.firstChild) { + node.removeChild(node.firstChild); + } + node.appendChild(node._newChild); + break; + case "prepend": + const prependParser = DOM.createElement("div"); + prependParser.innerHTML = this.tr(key, params); + for (let ni = node.childNodes.length - 1; ni >= 0; ni--) { + if (node.childNodes[ni]._prepended) { + node.removeChild(node.childNodes[ni]); + } + } + for (let pi = prependParser.childNodes.length - 1; pi >= 0; pi--) { + prependParser.childNodes[pi]._prepended = true; + if (node.firstChild) { + node.insertBefore(prependParser.childNodes[pi], node.firstChild); + } + else { + node.appendChild(prependParser.childNodes[pi]); + } + } + break; + case "append": + const appendParser = DOM.createElement("div"); + appendParser.innerHTML = this.tr(key, params); + for (let ni = node.childNodes.length - 1; ni >= 0; ni--) { + if (node.childNodes[ni]._appended) { + node.removeChild(node.childNodes[ni]); + } + } + while (appendParser.firstChild) { + appendParser.firstChild._appended = true; + node.appendChild(appendParser.firstChild); + } + break; + case "html": + node.innerHTML = this.tr(key, params); + break; + default: // normal html attribute + if (node.au && + node.au.controller && + node.au.controller.viewModel && + attrCC in node.au.controller.viewModel) { + node.au.controller.viewModel[attrCC] = this.tr(key, params); + } + else { + node.setAttribute(attr, this.tr(key, params)); + } + break; + } + } + } + } +} + +let TBindingBehavior = class TBindingBehavior { + constructor(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + static inject() { return [SignalBindingBehavior]; } + bind(binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the TValueConverter. + // pass through any args to the binding behavior to the TValueConverter + const sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + const expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "t", sourceExpression.args, [expression, ...sourceExpression.args]); + } + unbind(binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + } +}; +TBindingBehavior = __decorate([ + bindingBehavior("t") +], TBindingBehavior); + +var LazyOptional_1; +// tslint:disable-next-line:only-arrow-functions +const isInteger = Number.isInteger || function (value) { + return typeof value === "number" && + isFinite(value) && + Math.floor(value) === value; +}; +let LazyOptional = LazyOptional_1 = class LazyOptional { + constructor(key) { + this.key = key; + } + static of(key) { + return new LazyOptional_1(key); + } + get(container) { + return () => { + if (container.hasResolver(this.key, false)) { + return container.get(this.key); + } + return null; + }; + } +}; +LazyOptional = LazyOptional_1 = __decorate([ + resolver() +], LazyOptional); + +var TParamsCustomAttribute_1; +let TParamsCustomAttribute = TParamsCustomAttribute_1 = class TParamsCustomAttribute { + constructor(element) { + this.element = element; + } + static inject() { + return [DOM.Element]; + } + static configureAliases(aliases) { + const r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TParamsCustomAttribute_1); + r.aliases = aliases; + } + valueChanged() { } +}; +TParamsCustomAttribute = TParamsCustomAttribute_1 = __decorate([ + customAttribute("t-params") +], TParamsCustomAttribute); + +var TCustomAttribute_1; +let TCustomAttribute = TCustomAttribute_1 = class TCustomAttribute { + constructor(element, service, ea, p) { + this.element = element; + this.service = service; + this.ea = ea; + this.lazyParams = p; + } + static inject() { + return [DOM.Element, I18N, EventAggregator, LazyOptional.of(TParamsCustomAttribute)]; + } + static configureAliases(aliases) { + const r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TCustomAttribute_1); + r.aliases = aliases; + } + bind() { + this.params = this.lazyParams(); + if (this.params) { + this.params.valueChanged = (newParams, oldParams) => { + this.paramsChanged(this.value, newParams, oldParams); + }; + } + const p = this.params !== null ? this.params.value : undefined; + this.subscription = this.ea.subscribe(I18N_EA_SIGNAL, () => { + this.service.updateValue(this.element, this.value, this.params !== null ? this.params.value : undefined); + }); + this.service.updateValue(this.element, this.value, p); + } + paramsChanged(newValue, newParams) { + this.service.updateValue(this.element, newValue, newParams); + } + valueChanged(newValue) { + const p = this.params !== null ? this.params.value : undefined; + this.service.updateValue(this.element, newValue, p); + } + unbind() { + // If unbind is called before timeout for subscription is triggered, subscription will be undefined + if (this.subscription) { + this.subscription.dispose(); + } + } +}; +TCustomAttribute = TCustomAttribute_1 = __decorate([ + customAttribute("t") +], TCustomAttribute); + +let TValueConverter = class TValueConverter { + constructor(service) { + this.service = service; + } + static inject() { return [I18N]; } + toView(value, options) { + return this.service.tr(value, options); + } +}; +TValueConverter = __decorate([ + valueConverter("t") +], TValueConverter); + +let NfBindingBehavior = class NfBindingBehavior { + constructor(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + static inject() { return [SignalBindingBehavior]; } + bind(binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the NfValueConverter. + // pass through any args to the binding behavior to the NfValueConverter + const sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + const expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "nf", sourceExpression.args, [expression, ...sourceExpression.args]); + } + unbind(binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + } +}; +NfBindingBehavior = __decorate([ + bindingBehavior("nf") +], NfBindingBehavior); + +let NfValueConverter = class NfValueConverter { + constructor(service) { + this.service = service; + } + static inject() { return [I18N]; } + toView(value, nfOrOptions, locale) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (nfOrOptions && (nfOrOptions instanceof Intl.NumberFormat && typeof nfOrOptions.format === "function")) { + return nfOrOptions.format(value); + } + const nf = this.service.nf(nfOrOptions, locale || this.service.getLocale()); + return nf.format(value); + } +}; +NfValueConverter = __decorate([ + valueConverter$1("nf") +], NfValueConverter); + +let DfBindingBehavior = class DfBindingBehavior { + constructor(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + static inject() { return [SignalBindingBehavior]; } + bind(binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the DfValueConverter. + // pass through any args to the binding behavior to the DfValueConverter + const sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + const expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "df", sourceExpression.args, [expression, ...sourceExpression.args]); + } + unbind(binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + } +}; +DfBindingBehavior = __decorate([ + bindingBehavior("df") +], DfBindingBehavior); + +let DfValueConverter = class DfValueConverter { + constructor(service) { + this.service = service; + } + static inject() { return [I18N]; } + toView(value, dfOrOptions, locale) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (typeof value === "string" && isNaN(value) && !isInteger(value)) { + value = new Date(value); + } + if (dfOrOptions && (dfOrOptions instanceof Intl.DateTimeFormat && typeof dfOrOptions.format === "function")) { + return dfOrOptions.format(value); + } + const df = this.service.df(dfOrOptions, locale || this.service.getLocale()); + return df.format(value); + } +}; +DfValueConverter = __decorate([ + valueConverter$1("df") +], DfValueConverter); + +let RtBindingBehavior = class RtBindingBehavior { + constructor(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + static inject() { return [SignalBindingBehavior]; } + bind(binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal", "aurelia-relativetime-signal"); + // rewrite the expression to use the RtValueConverter. + // pass through any args to the binding behavior to the RtValueConverter + const sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + const expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "rt", sourceExpression.args, [expression, ...sourceExpression.args]); + } + unbind(binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + } +}; +RtBindingBehavior = __decorate([ + bindingBehavior("rt") +], RtBindingBehavior); + +const translations = { + ar: { + translation: { + now: 'الآن', + second_ago: 'منذ __count__ ثانية', + second_ago_plural: 'منذ __count__ ثواني', + second_in: 'في __count__ ثانية', + second_in_plural: 'في __count__ ثواني', + minute_ago: 'منذ __count__ دقيقة', + minute_ago_plural: 'منذ __count__ دقائق', + minute_in: 'في __count__ دقيقة', + minute_in_plural: 'في __count__ دقائق', + hour_ago: 'منذ __count__ ساعة', + hour_ago_plural: 'منذ __count__ ساعات', + hour_in: 'في __count__ ساعة', + hour_in_plural: 'في __count__ ساعات', + day_ago: 'منذ __count__ يوم', + day_ago_plural: 'منذ __count__ أيام', + day_in: 'في __count__ يوم', + day_in_plural: 'في __count__ أيام', + month_ago: 'منذ __count__ شهر', + month_ago_plural: 'منذ __count__ أشهر', + month_in: 'في __count__ شهر', + month_in_plural: 'في __count__ أشهر', + year_ago: 'منذ __count__ سنة', + year_ago_plural: 'منذ __count__ سنوات', + year_in: 'في __count__ سنة', + year_in_plural: 'في __count__ سنوات' + } + }, + da: { + translation: { + now: 'lige nu', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'i __count__ sekund', + second_in_plural: 'i __count__ sekunder', + minute_ago: '__count__ minut siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'i __count__ minut', + minute_in_plural: 'i __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'i __count__ time', + hour_in_plural: 'i __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dage siden', + day_in: 'i __count__ dag', + day_in_plural: 'i __count__ dage', + month_ago: '__count__ måned siden', + month_ago_plural: '__count__ måneder siden', + month_in: 'i __count__ måned', + month_in_plural: 'i __count__ måneder', + year_ago: '__count__ år siden', + year_ago_plural: '__count__ år siden', + year_in: 'i __count__ år', + year_in_plural: 'i __count__ år' + } + }, + de: { + translation: { + now: 'jetzt gerade', + second_ago: 'vor __count__ Sekunde', + second_ago_plural: 'vor __count__ Sekunden', + second_in: 'in __count__ Sekunde', + second_in_plural: 'in __count__ Sekunden', + minute_ago: 'vor __count__ Minute', + minute_ago_plural: 'vor __count__ Minuten', + minute_in: 'in __count__ Minute', + minute_in_plural: 'in __count__ Minuten', + hour_ago: 'vor __count__ Stunde', + hour_ago_plural: 'vor __count__ Stunden', + hour_in: 'in __count__ Stunde', + hour_in_plural: 'in __count__ Stunden', + day_ago: 'vor __count__ Tag', + day_ago_plural: 'vor __count__ Tagen', + day_in: 'in __count__ Tag', + day_in_plural: 'in __count__ Tagen', + month_ago: 'vor __count__ Monat', + month_ago_plural: 'vor __count__ Monaten', + month_in: 'in __count__ Monat', + month_in_plural: 'in __count__ Monaten', + year_ago: 'vor __count__ Jahr', + year_ago_plural: 'vor __count__ Jahren', + year_in: 'in __count__ Jahr', + year_in_plural: 'in __count__ Jahren' + } + }, + en: { + translation: { + now: 'just now', + second_ago: '__count__ second ago', + second_ago_plural: '__count__ seconds ago', + second_in: 'in __count__ second', + second_in_plural: 'in __count__ seconds', + minute_ago: '__count__ minute ago', + minute_ago_plural: '__count__ minutes ago', + minute_in: 'in __count__ minute', + minute_in_plural: 'in __count__ minutes', + hour_ago: '__count__ hour ago', + hour_ago_plural: '__count__ hours ago', + hour_in: 'in __count__ hour', + hour_in_plural: 'in __count__ hours', + day_ago: '__count__ day ago', + day_ago_plural: '__count__ days ago', + day_in: 'in __count__ day', + day_in_plural: 'in __count__ days', + month_ago: '__count__ month ago', + month_ago_plural: '__count__ months ago', + month_in: 'in __count__ month', + month_in_plural: 'in __count__ months', + year_ago: '__count__ year ago', + year_ago_plural: '__count__ years ago', + year_in: 'in __count__ year', + year_in_plural: 'in __count__ years' + } + }, + es: { + translation: { + now: 'ahora mismo', + second_ago: 'hace __count__ segundo', + second_ago_plural: 'hace __count__ segundos', + second_in: 'en __count__ segundo', + second_in_plural: 'en __count__ segundos', + minute_ago: 'hace __count__ minuto', + minute_ago_plural: 'hace __count__ minutos', + minute_in: 'en __count__ minuto', + minute_in_plural: 'en __count__ minutos', + hour_ago: 'hace __count__ hora', + hour_ago_plural: 'hace __count__ horas', + hour_in: 'en __count__ hora', + hour_in_plural: 'en __count__ horas', + day_ago: 'hace __count__ día', + day_ago_plural: 'hace __count__ días', + day_in: 'en __count__ día', + day_in_plural: 'en __count__ días', + month_ago: 'hace __count__ mes', + month_ago_plural: 'hace __count__ meses', + month_in: 'en __count__ mes', + month_in_plural: 'en __count__ meses', + year_ago: 'hace __count__ año', + year_ago_plural: 'hace __count__ años', + year_in: 'en __count__ año', + year_in_plural: 'en __count__ años' + } + }, + fi: { + translation: { + now: 'Nyt', + second_ago: '__count__ sekuntti sitten', + second_ago_plural: '__count__ sekunttia sitten', + second_in: ' __count__ sekunnin kuluttua', + second_in_plural: ' __count__ sekunttien kuluttua', + minute_ago: '__count__ minuutti sitten', + minute_ago_plural: '__count__ minuuttia sitten', + minute_in: ' __count__ minuutin kuluttua', + minute_in_plural: ' __count__ minuuttien kuluttua', + hour_ago: '__count__ tunti sitten', + hour_ago_plural: '__count__ tuntia sitten', + hour_in: ' __count__ tunnin kuluttua', + hour_in_plural: ' __count__ tunnin kuluttua', + day_ago: '__count__ päivä sitten', + day_ago_plural: '__count__ päiviä sitten', + day_in: ' __count__ päivän kuluttua', + day_in_plural: '__count__ päivien kuluttua', + month_ago: '__count__ kuukausi sitten', + month_ago_plural: '__count__ kuukausia sitten', + month_in: ' __count__ kuukauden kuluttua', + month_in_plural: ' __count__ kuukausien kuluttua', + year_ago: '__count__ vuosi sitten', + year_ago_plural: '__count__ vuosia sitten', + year_in: ' __count__ vuoden kuluttua', + year_in_plural: ' __count__ vuosien kuluttua' + } + }, + fr: { + translation: { + now: 'maintenant', + second_ago: 'il y a __count__ seconde', + second_ago_plural: 'il y a __count__ secondes', + second_in: 'dans __count__ seconde', + second_in_plural: 'dans __count__ secondes', + minute_ago: 'il y a __count__ minute', + minute_ago_plural: 'il y a __count__ minutes', + minute_in: 'dans __count__ minute', + minute_in_plural: 'dans __count__ minutes', + hour_ago: 'il y a __count__ heure', + hour_ago_plural: 'il y a __count__ heures', + hour_in: 'dans __count__ heure', + hour_in_plural: 'dans __count__ heures', + day_ago: 'il y a __count__ jour', + day_ago_plural: 'il y a __count__ jours', + day_in: 'dans __count__ jour', + day_in_plural: 'dans __count__ jours', + month_ago: 'il y a __count__ mois', + month_ago_plural: 'il y a __count__ mois', + month_in: 'dans __count__ mois', + month_in_plural: 'dans __count__ mois', + year_ago: 'il y a __count__ an', + year_ago_plural: 'il y a __count__ ans', + year_in: 'dans __count__ an', + year_in_plural: 'dans __count__ ans' + } + }, + it: { + translation: { + now: 'adesso', + second_ago: '__count__ secondo fa', + second_ago_plural: '__count__ secondi fa', + second_in: 'in __count__ secondo', + second_in_plural: 'in __count__ secondi', + minute_ago: '__count__ minuto fa', + minute_ago_plural: '__count__ minuti fa', + minute_in: 'in __count__ minuto', + minute_in_plural: 'in __count__ minuti', + hour_ago: '__count__ ora fa', + hour_ago_plural: '__count__ ore fa', + hour_in: 'in __count__ ora', + hour_in_plural: 'in __count__ ore', + day_ago: '__count__ giorno fa', + day_ago_plural: '__count__ giorni fa', + day_in: 'in __count__ giorno', + day_in_plural: 'in __count__ giorni', + month_ago: '__count__ mese fa', + month_ago_plural: '__count__ mesi fa', + month_in: 'in __count__ mese', + month_in_plural: 'in __count__ mesi', + year_ago: '__count__ anno fa', + year_ago_plural: '__count__ anni fa', + year_in: 'in __count__ anno', + year_in_plural: 'in __count__ anni' + } + }, + ja: { + translation: { + now: 'たった今', + second_ago: '__count__ 秒前', + second_ago_plural: '__count__ 秒前', + second_in: 'あと __count__ 秒', + second_in_plural: 'あと __count__ 秒', + minute_ago: '__count__ 分前', + minute_ago_plural: '__count__ 分前', + minute_in: 'あと __count__ 分', + minute_in_plural: 'あと __count__ 分', + hour_ago: '__count__ 時間前', + hour_ago_plural: '__count__ 時間前', + hour_in: 'あと __count__ 時間', + hour_in_plural: 'あと __count__ 時間', + day_ago: '__count__ 日間前', + day_ago_plural: '__count__ 日間前', + day_in: 'あと __count__ 日間', + day_in_plural: 'あと __count__ 日間', + month_ago: '__count__ ヶ月前', + month_ago_plural: '__count__ ヶ月前', + month_in: 'あと __count__ ヶ月前', + month_in_plural: 'あと __count__ ヶ月前', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: 'あと __count__ 年', + year_in_plural: 'あと __count__ 年' + } + }, + nl: { + translation: { + now: 'zonet', + second_ago: '__count__ seconde geleden', + second_ago_plural: '__count__ seconden geleden', + second_in: 'in __count__ seconde', + second_in_plural: 'in __count__ seconden', + minute_ago: '__count__ minuut geleden', + minute_ago_plural: '__count__ minuten geleden', + minute_in: 'in __count__ minuut', + minute_in_plural: 'in __count__ minuten', + hour_ago: '__count__ uur geleden', + hour_ago_plural: '__count__ uren geleden', + hour_in: 'in __count__ uur', + hour_in_plural: 'in __count__ uren', + day_ago: '__count__ dag geleden', + day_ago_plural: '__count__ dagen geleden', + day_in: 'in __count__ dag', + day_in_plural: 'in __count__ dagen', + month_ago: '__count__ maand geleden', + month_ago_plural: '__count__ maanden geleden', + month_in: 'in __count__ maand', + month_in_plural: 'in __count__ maanden', + year_ago: '__count__ jaar geleden', + year_ago_plural: '__count__ jaren geleden', + year_in: 'in __count__ jaar', + year_in_plural: 'in __count__ jaren' + } + }, + nn: { + translation: { + now: 'akkurat nå', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minutt siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'om __count__ minutt', + minute_in_plural: 'om __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'om __count__ time', + hour_in_plural: 'om __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dager siden', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dager', + month_ago: '__count__ en måned siden', + month_ago_plural: '__count__ flere måneder siden', + month_in: 'I løpet av en __count__ måned', + month_in_plural: 'I løpet av __count__ måneder', + year_ago: '__count__ et år siden', + year_ago_plural: '__count__ flere å siden', + year_in: 'I løpet av ett år __count__ år', + year_in_plural: 'på flere __count__ år' + } + }, + no: { + translation: { + now: 'akkurat nå', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minutt siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'om __count__ minutt', + minute_in_plural: 'om __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'om __count__ time', + hour_in_plural: 'om __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dager siden', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dager', + month_ago: '__count__ en måned siden', + month_ago_plural: '__count__ flere måneder siden', + month_in: 'I løpet av en __count__ måned', + month_in_plural: 'I løpet av __count__ måneder', + year_ago: '__count__ et år siden', + year_ago_plural: '__count__ flere å siden', + year_in: 'I løpet av ett år __count__ år', + year_in_plural: 'på flere __count__ år' + } + }, + pt: { + translation: { + now: 'neste exato momento', + second_ago: '__count__ segundo atrás', + second_ago_plural: '__count__ segundos atrás', + second_in: 'em __count__ segundo', + second_in_plural: 'em __count__ segundos', + minute_ago: '__count__ minuto atrás', + minute_ago_plural: '__count__ minutos atrás', + minute_in: 'em __count__ minuto', + minute_in_plural: 'em __count__ minutos', + hour_ago: '__count__ hora atrás', + hour_ago_plural: '__count__ horas atrás', + hour_in: 'em __count__ hora', + hour_in_plural: 'em __count__ horas', + day_ago: '__count__ dia atrás', + day_ago_plural: '__count__ dias atrás', + day_in: 'em __count__ dia', + day_in_plural: 'em __count__ dias', + month_ago: '__count__ mês atrás', + month_ago_plural: '__count__ meses atrás', + month_in: 'em __count__ mês', + month_in_plural: 'em __count__ meses', + year_ago: '__count__ ano atrás', + year_ago_plural: '__count__ anos atrás', + year_in: 'em __count__ ano', + year_in_plural: 'em __count__ anos' + } + }, + sv: { + translation: { + now: 'nu', + second_ago: '__count__ sekund sedan', + second_ago_plural: '__count__ sekunder sedan', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minut sedan', + minute_ago_plural: '__count__ minuter sedan', + minute_in: 'om __count__ minut', + minute_in_plural: 'om __count__ minuter', + hour_ago: '__count__ timme sedan', + hour_ago_plural: '__count__ timmar sedan', + hour_in: 'om __count__ timme', + hour_in_plural: 'om __count__ timmar', + day_ago: '__count__ dag sedan', + day_ago_plural: '__count__ dagar sedan', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dagar', + month_ago: '__count__ månad sedan', + month_ago_plural: '__count__ månader sedan', + month_in: 'om __count__ månad', + month_in_plural: 'om __count__ månader', + year_ago: '__count__ år sedan', + year_ago_plural: '__count__ år sedan', + year_in: 'om __count__ år', + year_in_plural: 'om __count__ år' + } + }, + th: { + translation: { + now: 'เมื่อกี้', + second_ago: '__count__ วินาที ที่ผ่านมา', + second_ago_plural: '__count__ วินาที ที่ผ่านมา', + second_in: 'อีก __count__ วินาที', + second_in_plural: 'อีก __count__ วินาที', + minute_ago: '__count__ นาที ที่ผ่านมา', + minute_ago_plural: '__count__ นาที ที่ผ่านมา', + minute_in: 'อีก __count__ นาที', + minute_in_plural: 'อีก __count__ นาที', + hour_ago: '__count__ ชั่วโมง ที่ผ่านมา', + hour_ago_plural: '__count__ ชั่วโมง ที่ผ่านมา', + hour_in: 'อีก __count__ ชั่วโมง', + hour_in_plural: 'อีก __count__ ชั่วโมง', + day_ago: '__count__ วัน ที่ผ่านมา', + day_ago_plural: '__count__ วัน ที่ผ่านมา', + day_in: 'อีก __count__ วัน', + day_in_plural: 'อีก __count__ วัน' + } + }, + zh: { + translation: { + now: '刚才', + second_ago: '__count__ 秒钟前', + second_ago_plural: '__count__ 秒钟前', + second_in: '__count__ 秒内', + second_in_plural: '__count__ 秒内', + minute_ago: '__count__ 分钟前', + minute_ago_plural: '__count__ 分钟前', + minute_in: '__count__ 分钟内', + minute_in_plural: '__count__ 分钟内', + hour_ago: '__count__ 小时前', + hour_ago_plural: '__count__ 小时前', + hour_in: '__count__ 小时内', + hour_in_plural: '__count__ 小时内', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天内', + day_in_plural: '__count__ 天内', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月内', + month_in_plural: '__count__ 月内', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年内', + year_in_plural: '__count__ 年内' + } + }, + 'zh-CN': { + translation: { + now: '刚才', + second_ago: '__count__ 秒钟前', + second_ago_plural: '__count__ 秒钟前', + second_in: '__count__ 秒内', + second_in_plural: '__count__ 秒内', + minute_ago: '__count__ 分钟前', + minute_ago_plural: '__count__ 分钟前', + minute_in: '__count__ 分钟内', + minute_in_plural: '__count__ 分钟内', + hour_ago: '__count__ 小时前', + hour_ago_plural: '__count__ 小时前', + hour_in: '__count__ 小时内', + hour_in_plural: '__count__ 小时内', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天内', + day_in_plural: '__count__ 天内', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月内', + month_in_plural: '__count__ 月内', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年内', + year_in_plural: '__count__ 年内' + } + }, + 'zh-HK': { + translation: { + now: '剛才', + second_ago: '__count__ 秒鐘前', + second_ago_plural: '__count__ 秒鐘前', + second_in: '__count__ 秒內', + second_in_plural: '__count__ 秒內', + minute_ago: '__count__ 分鐘前', + minute_ago_plural: '__count__ 分鐘前', + minute_in: '__count__ 分鐘內', + minute_in_plural: '__count__ 分鐘內', + hour_ago: '__count__ 小時前', + hour_ago_plural: '__count__ 小時前', + hour_in: '__count__ 小時內', + hour_in_plural: '__count__ 小時內', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天內', + day_in_plural: '__count__ 天內', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月內', + month_in_plural: '__count__ 月內', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年內', + year_in_plural: '__count__ 年內' + } + }, + 'zh-TW': { + translation: { + now: '剛才', + second_ago: '__count__ 秒鐘前', + second_ago_plural: '__count__ 秒鐘前', + second_in: '__count__ 秒內', + second_in_plural: '__count__ 秒內', + minute_ago: '__count__ 分鐘前', + minute_ago_plural: '__count__ 分鐘前', + minute_in: '__count__ 分鐘內', + minute_in_plural: '__count__ 分鐘內', + hour_ago: '__count__ 小時前', + hour_ago_plural: '__count__ 小時前', + hour_in: '__count__ 小時內', + hour_in_plural: '__count__ 小時內', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天內', + day_in_plural: '__count__ 天內', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月內', + month_in_plural: '__count__ 月內', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年內', + year_in_plural: '__count__ 年內' + } + } +}; +// tslint:enable + +class RelativeTime { + constructor(service, ea) { + this.service = service; + this.ea = ea; + this.service.i18nextReady().then(() => { + this.setup(); + }); + this.ea.subscribe(I18N_EA_SIGNAL, (locales) => { + this.setup(locales); + }); + } + static inject() { return [I18N, EventAggregator]; } + setup(locales) { + const trans = translations; + const fallbackLng = this.service.i18next.fallbackLng; + let alternateFb = fallbackLng || this.service.i18next.options.fallbackLng; + if (Array.isArray(alternateFb) && alternateFb.length > 0) { + alternateFb = alternateFb[0]; + } + const key = ((locales && locales.newValue) + ? locales.newValue + : this.service.getLocale()) || alternateFb; + let index = 0; + // tslint:disable-next-line:no-conditional-assignment + if ((index = key.indexOf("-")) >= 0) { + const baseLocale = key.substring(0, index); + if (trans[baseLocale]) { + this.addTranslationResource(baseLocale, trans[baseLocale].translation); + } + } + if (trans[key]) { + this.addTranslationResource(key, trans[key].translation); + } + if (trans[fallbackLng]) { + this.addTranslationResource(key, trans[fallbackLng].translation); + } + } + addTranslationResource(key, translation) { + const options = this.service.i18next.options; + if (options.interpolation && (options.interpolation.prefix !== "__" || options.interpolation.suffix !== "__")) { + // tslint:disable-next-line:forin + for (const subkey in translation) { + translation[subkey] = translation[subkey] + .replace("__count__", `${options.interpolation.prefix || "{{"}count${options.interpolation.suffix || "}}"}`); + } + } + this.service.i18next.addResources(key, options.defaultNS || "translation", translation); + } + getRelativeTime(time) { + const now = new Date(); + const diff = now.getTime() - time.getTime(); + let timeDiff = this.getTimeDiffDescription(diff, "year", 31104000000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "month", 2592000000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "day", 86400000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "hour", 3600000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "minute", 60000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "second", 1000); + if (!timeDiff) { + timeDiff = this.service.tr("now"); + } + } + } + } + } + } + return timeDiff; + } + getTimeDiffDescription(diff, unit, timeDivisor) { + const unitAmount = parseInt((diff / timeDivisor).toFixed(0), 10); + if (unitAmount > 0) { + return this.service.tr(unit, { count: unitAmount, context: "ago" }); + } + else if (unitAmount < 0) { + const abs = Math.abs(unitAmount); + return this.service.tr(unit, { count: abs, context: "in" }); + } + return null; + } +} + +let RtValueConverter = class RtValueConverter { + constructor(service) { + this.service = service; + } + static inject() { return [RelativeTime]; } + toView(value) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (typeof value === "string" && isNaN(value) && !Number.isInteger(value)) { + value = new Date(value); + } + return this.service.getRelativeTime(value); + } +}; +RtValueConverter = __decorate([ + valueConverter$1("rt") +], RtValueConverter); + +class Backend { + constructor(services, options = {}) { + this.services = services; + this.options = options; + this.type = "backend"; + this.init(services, options); + } + static with(loader) { + this.loader = loader; + return this; + } + init(services, options = {}) { + this.services = services; + this.options = Object.assign({}, { + loadPath: "/locales/{{lng}}/{{ns}}.json", + addPath: "locales/add/{{lng}}/{{ns}}", + allowMultiLoading: false, + parse: JSON.parse + }, options); + } + readMulti(languages, namespaces, callback) { + let loadPath = this.options.loadPath; + if (typeof this.options.loadPath === "function") { + loadPath = this.options.loadPath(languages, namespaces); + } + const url = this.services + .interpolator + .interpolate(loadPath, { lng: languages.join("+"), ns: namespaces.join("+") }); + this.loadUrl(url, callback); + } + read(language, namespace, callback) { + let loadPath = this.options.loadPath; + if (typeof this.options.loadPath === "function") { + loadPath = this.options.loadPath([language], [namespace]); + } + const url = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }); + this.loadUrl(url, callback); + } + loadUrl(url, callback) { + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield Backend.loader.loadText(url); + let ret; + let err; + try { + ret = (response instanceof Object) ? response : this.options.parse(response, url); + } + catch (e) { + err = "failed parsing " + url + " to json"; + } + if (err) { + return callback(err, false); + } + callback(null, ret); + } + catch (_a) { + callback("failed loading " + url, false /* no retry */); + } + }); + } + // tslint:disable-next-line:variable-name + create(_languages, _namespace, _key, _fallbackValue) { + // not supported + } +} +Backend.type = "backend"; + +function configure(frameworkConfig, cb) { + if (typeof cb !== "function") { + const errorMsg = "You need to provide a callback method to properly configure the library"; throw errorMsg; } + const instance = frameworkConfig.container.get(I18N); + const ret = cb(instance); frameworkConfig.globalResources([ - PLATFORM.moduleName("./t/t-value-converter"), - PLATFORM.moduleName("./t/t-custom-attribute"), - PLATFORM.moduleName("./t/t-params-custom-attribute"), - PLATFORM.moduleName("./t/t-binding-behavior") - ]); - frameworkConfig.globalResources([ - PLATFORM.moduleName("./nf/nf-value-converter"), - PLATFORM.moduleName("./nf/nf-binding-behavior") - ]); - frameworkConfig.globalResources([ - PLATFORM.moduleName("./df/df-value-converter"), - PLATFORM.moduleName("./df/df-binding-behavior") - ]); - frameworkConfig.globalResources([ - PLATFORM.moduleName("./rt/rt-value-converter"), - PLATFORM.moduleName("./rt/rt-binding-behavior") + TValueConverter, + TBindingBehavior, + TCustomAttribute, + TParamsCustomAttribute, + NfValueConverter, + NfBindingBehavior, + DfValueConverter, + DfBindingBehavior, + RtValueConverter, + RtBindingBehavior ]); - var instance = new I18N(frameworkConfig.container.get(EventAggregator), frameworkConfig.container.get(BindingSignaler)); - frameworkConfig.container.registerInstance(I18N, instance); - var ret = cb(instance); - frameworkConfig.postTask(function () { - var resources = frameworkConfig.container.get(ViewResources); - var htmlBehaviorResource = resources.getAttribute("t"); - var htmlParamsResource = resources.getAttribute("t-params"); - var attributes = instance.i18next.options.attributes; + frameworkConfig.postTask(() => { + const resources = frameworkConfig.container.get(ViewResources); + const htmlBehaviorResource = resources.getAttribute("t"); + const htmlParamsResource = resources.getAttribute("t-params"); + let attributes = instance.i18next.options.attributes; // Register default attributes if none provided if (!attributes) { attributes = ["t", "i18n"]; } - attributes.forEach(function (alias) { return resources.registerAttribute(alias, htmlBehaviorResource, "t"); }); - attributes.forEach(function (alias) { return resources.registerAttribute(alias + "-params", htmlParamsResource, "t-params"); }); + attributes.forEach((alias) => resources.registerAttribute(alias, htmlBehaviorResource, "t")); + attributes.forEach((alias) => resources.registerAttribute(alias + "-params", htmlParamsResource, "t-params")); }); return ret; } -//# sourceMappingURL=aurelia-i18n.js.map \ No newline at end of file + +export { configure, DfValueConverter, DfBindingBehavior, NfValueConverter, NfBindingBehavior, RtValueConverter, RtBindingBehavior, TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute, I18N_EA_SIGNAL, I18N, RelativeTime, Backend }; diff --git a/dist/es2015/aurelia-i18n.js.map b/dist/es2015/aurelia-i18n.js.map deleted file mode 100644 index a664c99b..00000000 --- a/dist/es2015/aurelia-i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aurelia-i18n.js","sourceRoot":"","sources":["../../src/aurelia-i18n.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EACL,IAAI,EAEL,MAAM,QAAQ,CAAC;AAEhB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACL,gBAAgB,EAChB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e,CAAC,CAC/C,CAAC;IACF,eAAe,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAE3D,IAAM,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC;IAEzB,eAAe,CAAC,QAAQ,CAAC;QACvB,IAAM,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC/D,IAAM,oBAAoB,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QACzD,IAAM,kBAAkB,GAAG,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC9D,IAAI,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,UAAsB,CAAC;QAEjE,+CAA+C;QAC/C,IAAI,CAAC,UAAU,EAAE;YACf,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;SAC5B;QAED,UAAU,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,CAAC,EAA7D,CAA6D,CAAC,CAAC;QAC7F,UAAU,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,SAAS,CAAC,iBAAiB,CAAC,KAAK,GAAG,SAAS,EAAE,kBAAkB,EAAE,UAAU,CAAC,EAA9E,CAA8E,CAAC,CAAC;IAChH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC"} \ No newline at end of file diff --git a/dist/es2015/defaultTranslations/relative.time.js b/dist/es2015/defaultTranslations/relative.time.js deleted file mode 100644 index ee7a4c85..00000000 --- a/dist/es2015/defaultTranslations/relative.time.js +++ /dev/null @@ -1,494 +0,0 @@ -export var translations = { - ar: { - translation: { - "now": "الآن", - "second_ago": "منذ __count__ ثانية", - "second_ago_plural": "منذ __count__ ثواني", - "second_in": "في __count__ ثانية", - "second_in_plural": "في __count__ ثواني", - "minute_ago": "منذ __count__ دقيقة", - "minute_ago_plural": "منذ __count__ دقائق", - "minute_in": "في __count__ دقيقة", - "minute_in_plural": "في __count__ دقائق", - "hour_ago": "منذ __count__ ساعة", - "hour_ago_plural": "منذ __count__ ساعات", - "hour_in": "في __count__ ساعة", - "hour_in_plural": "في __count__ ساعات", - "day_ago": "منذ __count__ يوم", - "day_ago_plural": "منذ __count__ أيام", - "day_in": "في __count__ يوم", - "day_in_plural": "في __count__ أيام", - "month_ago": "منذ __count__ شهر", - "month_ago_plural": "منذ __count__ أشهر", - "month_in": "في __count__ شهر", - "month_in_plural": "في __count__ أشهر", - "year_ago": "منذ __count__ سنة", - "year_ago_plural": "منذ __count__ سنوات", - "year_in": "في __count__ سنة", - "year_in_plural": "في __count__ سنوات" - } - }, - en: { - translation: { - "now": "just now", - "second_ago": "__count__ second ago", - "second_ago_plural": "__count__ seconds ago", - "second_in": "in __count__ second", - "second_in_plural": "in __count__ seconds", - "minute_ago": "__count__ minute ago", - "minute_ago_plural": "__count__ minutes ago", - "minute_in": "in __count__ minute", - "minute_in_plural": "in __count__ minutes", - "hour_ago": "__count__ hour ago", - "hour_ago_plural": "__count__ hours ago", - "hour_in": "in __count__ hour", - "hour_in_plural": "in __count__ hours", - "day_ago": "__count__ day ago", - "day_ago_plural": "__count__ days ago", - "day_in": "in __count__ day", - "day_in_plural": "in __count__ days", - "month_ago": "__count__ month ago", - "month_ago_plural": "__count__ months ago", - "month_in": "in __count__ month", - "month_in_plural": "in __count__ months", - "year_ago": "__count__ year ago", - "year_ago_plural": "__count__ years ago", - "year_in": "in __count__ year", - "year_in_plural": "in __count__ years" - } - }, - es: { - translation: { - "now": "ahora mismo", - "second_ago": "hace __count__ segundo", - "second_ago_plural": "hace __count__ segundos", - "second_in": "en __count__ segundo", - "second_in_plural": "en __count__ segundos", - "minute_ago": "hace __count__ minuto", - "minute_ago_plural": "hace __count__ minutos", - "minute_in": "en __count__ minuto", - "minute_in_plural": "en __count__ minutos", - "hour_ago": "hace __count__ hora", - "hour_ago_plural": "hace __count__ horas", - "hour_in": "en __count__ hora", - "hour_in_plural": "en __count__ horas", - "day_ago": "hace __count__ día", - "day_ago_plural": "hace __count__ días", - "day_in": "en __count__ día", - "day_in_plural": "en __count__ días", - "month_ago": "hace __count__ mes", - "month_ago_plural": "hace __count__ meses", - "month_in": "en __count__ mes", - "month_in_plural": "en __count__ meses", - "year_ago": "hace __count__ año", - "year_ago_plural": "hace __count__ años", - "year_in": "en __count__ año", - "year_in_plural": "en __count__ años" - } - }, - it: { - translation: { - "now": "adesso", - "second_ago": "__count__ secondo fa", - "second_ago_plural": "__count__ secondi fa", - "second_in": "in __count__ secondo", - "second_in_plural": "in __count__ secondi", - "minute_ago": "__count__ minuto fa", - "minute_ago_plural": "__count__ minuti fa", - "minute_in": "in __count__ minuto", - "minute_in_plural": "in __count__ minuti", - "hour_ago": "__count__ ora fa", - "hour_ago_plural": "__count__ ore fa", - "hour_in": "in __count__ ora", - "hour_in_plural": "in __count__ ore", - "day_ago": "__count__ giorno fa", - "day_ago_plural": "__count__ giorni fa", - "day_in": "in __count__ giorno", - "day_in_plural": "in __count__ giorni", - "month_ago": "__count__ mese fa", - "month_ago_plural": "__count__ mesi fa", - "month_in": "in __count__ mese", - "month_in_plural": "in __count__ mesi", - "year_ago": "__count__ anno fa", - "year_ago_plural": "__count__ anni fa", - "year_in": "in __count__ anno", - "year_in_plural": "in __count__ anni" - } - }, - de: { - translation: { - "now": "jetzt gerade", - "second_ago": "vor __count__ Sekunde", - "second_ago_plural": "vor __count__ Sekunden", - "second_in": "in __count__ Sekunde", - "second_in_plural": "in __count__ Sekunden", - "minute_ago": "vor __count__ Minute", - "minute_ago_plural": "vor __count__ Minuten", - "minute_in": "in __count__ Minute", - "minute_in_plural": "in __count__ Minuten", - "hour_ago": "vor __count__ Stunde", - "hour_ago_plural": "vor __count__ Stunden", - "hour_in": "in __count__ Stunde", - "hour_in_plural": "in __count__ Stunden", - "day_ago": "vor __count__ Tag", - "day_ago_plural": "vor __count__ Tagen", - "day_in": "in __count__ Tag", - "day_in_plural": "in __count__ Tagen", - "month_ago": "vor __count__ Monat", - "month_ago_plural": "vor __count__ Monaten", - "month_in": "in __count__ Monat", - "month_in_plural": "in __count__ Monaten", - "year_ago": "vor __count__ Jahr", - "year_ago_plural": "vor __count__ Jahren", - "year_in": "in __count__ Jahr", - "year_in_plural": "in __count__ Jahren" - } - }, - nl: { - translation: { - "now": "zonet", - "second_ago": "__count__ seconde geleden", - "second_ago_plural": "__count__ seconden geleden", - "second_in": "in __count__ seconde", - "second_in_plural": "in __count__ seconden", - "minute_ago": "__count__ minuut geleden", - "minute_ago_plural": "__count__ minuten geleden", - "minute_in": "in __count__ minuut", - "minute_in_plural": "in __count__ minuten", - "hour_ago": "__count__ uur geleden", - "hour_ago_plural": "__count__ uren geleden", - "hour_in": "in __count__ uur", - "hour_in_plural": "in __count__ uren", - "day_ago": "__count__ dag geleden", - "day_ago_plural": "__count__ dagen geleden", - "day_in": "in __count__ dag", - "day_in_plural": "in __count__ dagen", - "month_ago": "__count__ maand geleden", - "month_ago_plural": "__count__ maanden geleden", - "month_in": "in __count__ maand", - "month_in_plural": "in __count__ maanden", - "year_ago": "__count__ jaar geleden", - "year_ago_plural": "__count__ jaren geleden", - "year_in": "in __count__ jaar", - "year_in_plural": "in __count__ jaren" - } - }, - fr: { - translation: { - "now": "maintenant", - "second_ago": "il y a __count__ seconde", - "second_ago_plural": "il y a __count__ secondes", - "second_in": "dans __count__ seconde", - "second_in_plural": "dans __count__ secondes", - "minute_ago": "il y a __count__ minute", - "minute_ago_plural": "il y a __count__ minutes", - "minute_in": "dans __count__ minute", - "minute_in_plural": "dans __count__ minutes", - "hour_ago": "il y a __count__ heure", - "hour_ago_plural": "il y a __count__ heures", - "hour_in": "dans __count__ heure", - "hour_in_plural": "dans __count__ heures", - "day_ago": "il y a __count__ jour", - "day_ago_plural": "il y a __count__ jours", - "day_in": "dans __count__ jour", - "day_in_plural": "dans __count__ jours", - "month_ago": "il y a __count__ mois", - "month_ago_plural": "il y a __count__ mois", - "month_in": "dans __count__ mois", - "month_in_plural": "dans __count__ mois", - "year_ago": "il y a __count__ an", - "year_ago_plural": "il y a __count__ ans", - "year_in": "dans __count__ an", - "year_in_plural": "dans __count__ ans" - } - }, - th: { - translation: { - "now": "เมื่อกี้", - "second_ago": "__count__ วินาที ที่ผ่านมา", - "second_ago_plural": "__count__ วินาที ที่ผ่านมา", - "second_in": "อีก __count__ วินาที", - "second_in_plural": "อีก __count__ วินาที", - "minute_ago": "__count__ นาที ที่ผ่านมา", - "minute_ago_plural": "__count__ นาที ที่ผ่านมา", - "minute_in": "อีก __count__ นาที", - "minute_in_plural": "อีก __count__ นาที", - "hour_ago": "__count__ ชั่วโมง ที่ผ่านมา", - "hour_ago_plural": "__count__ ชั่วโมง ที่ผ่านมา", - "hour_in": "อีก __count__ ชั่วโมง", - "hour_in_plural": "อีก __count__ ชั่วโมง", - "day_ago": "__count__ วัน ที่ผ่านมา", - "day_ago_plural": "__count__ วัน ที่ผ่านมา", - "day_in": "อีก __count__ วัน", - "day_in_plural": "อีก __count__ วัน" - } - }, - sv: { - translation: { - "now": "just nu", - "second_ago": "__count__ sekund sedan", - "second_ago_plural": "__count__ sekunder sedan", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minut sedan", - "minute_ago_plural": "__count__ minuter sedan", - "minute_in": "om __count__ minut", - "minute_in_plural": "om __count__ minuter", - "hour_ago": "__count__ timme sedan", - "hour_ago_plural": "__count__ timmar sedan", - "hour_in": "om __count__ timme", - "hour_in_plural": "om __count__ timmar", - "day_ago": "__count__ dag sedan", - "day_ago_plural": "__count__ dagar sedan", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dagar" - } - }, - da: { - translation: { - "now": "lige nu", - "second_ago": "__count__ sekunder siden", - "second_ago_plural": "__count__ sekunder siden", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minut siden", - "minute_ago_plural": "__count__ minutter siden", - "minute_in": "om __count__ minut", - "minute_in_plural": "om __count__ minutter", - "hour_ago": "__count__ time siden", - "hour_ago_plural": "__count__ timer siden", - "hour_in": "om __count__ time", - "hour_in_plural": "om __count__ timer", - "day_ago": "__count__ dag siden", - "day_ago_plural": "__count__ dage siden", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dage" - } - }, - no: { - translation: { - "now": "akkurat nå", - "second_ago": "__count__ sekund siden", - "second_ago_plural": "__count__ sekunder siden", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minutt siden", - "minute_ago_plural": "__count__ minutter siden", - "minute_in": "om __count__ minutt", - "minute_in_plural": "om __count__ minutter", - "hour_ago": "__count__ time siden", - "hour_ago_plural": "__count__ timer siden", - "hour_in": "om __count__ time", - "hour_in_plural": "om __count__ timer", - "day_ago": "__count__ dag siden", - "day_ago_plural": "__count__ dager siden", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dager" - } - }, - ja: { - translation: { - "now": "たった今", - "second_ago": "__count__ 秒前", - "second_ago_plural": "__count__ 秒前", - "second_in": "あと __count__ 秒", - "second_in_plural": "あと __count__ 秒", - "minute_ago": "__count__ 分前", - "minute_ago_plural": "__count__ 分前", - "minute_in": "あと __count__ 分", - "minute_in_plural": "あと __count__ 分", - "hour_ago": "__count__ 時間前", - "hour_ago_plural": "__count__ 時間前", - "hour_in": "あと __count__ 時間", - "hour_in_plural": "あと __count__ 時間", - "day_ago": "__count__ 日間前", - "day_ago_plural": "__count__ 日間前", - "day_in": "あと __count__ 日間", - "day_in_plural": "あと __count__ 日間", - "month_ago": "__count__ ヶ月前", - "month_ago_plural": "__count__ ヶ月前", - "month_in": "あと __count__ ヶ月前", - "month_in_plural": "あと __count__ ヶ月前", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "あと __count__ 年", - "year_in_plural": "あと __count__ 年" - } - }, - jp: { - translation: { - "now": "たった今", - "second_ago": "__count__ 秒前", - "second_ago_plural": "__count__ 秒前", - "second_in": "あと __count__ 秒", - "second_in_plural": "あと __count__ 秒", - "minute_ago": "__count__ 分前", - "minute_ago_plural": "__count__ 分前", - "minute_in": "あと __count__ 分", - "minute_in_plural": "あと __count__ 分", - "hour_ago": "__count__ 時間前", - "hour_ago_plural": "__count__ 時間前", - "hour_in": "あと __count__ 時間", - "hour_in_plural": "あと __count__ 時間", - "day_ago": "__count__ 日間前", - "day_ago_plural": "__count__ 日間前", - "day_in": "あと __count__ 日間", - "day_in_plural": "あと __count__ 日間", - "month_ago": "__count__ ヶ月前", - "month_ago_plural": "__count__ ヶ月前", - "month_in": "あと __count__ ヶ月前", - "month_in_plural": "あと __count__ ヶ月前", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "あと __count__ 年", - "year_in_plural": "あと __count__ 年" - } - }, - pt: { - translation: { - "now": "neste exato momento", - "second_ago": "__count__ segundo atrás", - "second_ago_plural": "__count__ segundos atrás", - "second_in": "em __count__ segundo", - "second_in_plural": "em __count__ segundos", - "minute_ago": "__count__ minuto atrás", - "minute_ago_plural": "__count__ minutos atrás", - "minute_in": "em __count__ minuto", - "minute_in_plural": "em __count__ minutos", - "hour_ago": "__count__ hora atrás", - "hour_ago_plural": "__count__ horas atrás", - "hour_in": "em __count__ hora", - "hour_in_plural": "em __count__ horas", - "day_ago": "__count__ dia atrás", - "day_ago_plural": "__count__ dias atrás", - "day_in": "em __count__ dia", - "day_in_plural": "em __count__ dias", - "month_ago": "__count__ mês atrás", - "month_ago_plural": "__count__ meses atrás", - "month_in": "em __count__ mês", - "month_in_plural": "em __count__ meses", - "year_ago": "__count__ ano atrás", - "year_ago_plural": "__count__ anos atrás", - "year_in": "em __count__ ano", - "year_in_plural": "em __count__ anos" - } - }, - zh: { - translation: { - "now": "刚才", - "second_ago": "__count__ 秒钟前", - "second_ago_plural": "__count__ 秒钟前", - "second_in": "__count__ 秒内", - "second_in_plural": "__count__ 秒内", - "minute_ago": "__count__ 分钟前", - "minute_ago_plural": "__count__ 分钟前", - "minute_in": "__count__ 分钟内", - "minute_in_plural": "__count__ 分钟内", - "hour_ago": "__count__ 小时前", - "hour_ago_plural": "__count__ 小时前", - "hour_in": "__count__ 小时内", - "hour_in_plural": "__count__ 小时内", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天内", - "day_in_plural": "__count__ 天内", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月内", - "month_in_plural": "__count__ 月内", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年内", - "year_in_plural": "__count__ 年内" - } - }, - "zh-CN": { - translation: { - "now": "刚才", - "second_ago": "__count__ 秒钟前", - "second_ago_plural": "__count__ 秒钟前", - "second_in": "__count__ 秒内", - "second_in_plural": "__count__ 秒内", - "minute_ago": "__count__ 分钟前", - "minute_ago_plural": "__count__ 分钟前", - "minute_in": "__count__ 分钟内", - "minute_in_plural": "__count__ 分钟内", - "hour_ago": "__count__ 小时前", - "hour_ago_plural": "__count__ 小时前", - "hour_in": "__count__ 小时内", - "hour_in_plural": "__count__ 小时内", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天内", - "day_in_plural": "__count__ 天内", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月内", - "month_in_plural": "__count__ 月内", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年内", - "year_in_plural": "__count__ 年内" - } - }, - "zh-HK": { - translation: { - "now": "剛才", - "second_ago": "__count__ 秒鐘前", - "second_ago_plural": "__count__ 秒鐘前", - "second_in": "__count__ 秒內", - "second_in_plural": "__count__ 秒內", - "minute_ago": "__count__ 分鐘前", - "minute_ago_plural": "__count__ 分鐘前", - "minute_in": "__count__ 分鐘內", - "minute_in_plural": "__count__ 分鐘內", - "hour_ago": "__count__ 小時前", - "hour_ago_plural": "__count__ 小時前", - "hour_in": "__count__ 小時內", - "hour_in_plural": "__count__ 小時內", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天內", - "day_in_plural": "__count__ 天內", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月內", - "month_in_plural": "__count__ 月內", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年內", - "year_in_plural": "__count__ 年內" - } - }, - "zh-TW": { - translation: { - "now": "剛才", - "second_ago": "__count__ 秒鐘前", - "second_ago_plural": "__count__ 秒鐘前", - "second_in": "__count__ 秒內", - "second_in_plural": "__count__ 秒內", - "minute_ago": "__count__ 分鐘前", - "minute_ago_plural": "__count__ 分鐘前", - "minute_in": "__count__ 分鐘內", - "minute_in_plural": "__count__ 分鐘內", - "hour_ago": "__count__ 小時前", - "hour_ago_plural": "__count__ 小時前", - "hour_in": "__count__ 小時內", - "hour_in_plural": "__count__ 小時內", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天內", - "day_in_plural": "__count__ 天內", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月內", - "month_in_plural": "__count__ 月內", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年內", - "year_in_plural": "__count__ 年內" - } - } -}; -// tslint:enable -//# sourceMappingURL=relative.time.js.map \ No newline at end of file diff --git a/dist/es2015/defaultTranslations/relative.time.js.map b/dist/es2015/defaultTranslations/relative.time.js.map deleted file mode 100644 index 2086a256..00000000 --- a/dist/es2015/defaultTranslations/relative.time.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"relative.time.js","sourceRoot":"","sources":["../../../src/defaultTranslations/relative.time.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,IAAM,YAAY,GAAwB;I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iBAAiB,EAAE,eAAe;YAClC,SAAS,EAAE,eAAe;YAC1B,gBAAgB,EAAE,eAAe;YACjC,SAAS,EAAE,cAAc;YACzB,gBAAgB,EAAE,cAAc;YAChC,QAAQ,EAAE,cAAc;YACxB,eAAe,EAAE,cAAc;YAC/B,WAAW,EAAE,cAAc;YAC3B,kBAAkB,EAAE,cAAc;YAClC,UAAU,EAAE,cAAc;YAC1B,iBAAiB,EAAE,cAAc;YACjC,UAAU,EAAE,cAAc;YAC1B,iBAAiB,EAAE,cAAc;YACjC,SAAS,EAAE,cAAc;YACzB,gBAAgB,EAAE,cAAc;SACjC;KACF;IACD,OAAO,EAAE;QACP,WAAW,EAAE;YACX,KAAK,EAAE,IAAI;YACX,YAAY,EAAE,eAAe;YAC7B,mBAAmB,EAAE,eAAe;YACpC,WAAW,EAAE,cAAc;YAC3B,kBAAkB,EAAE,cAAc;YAClC,YAAY,EAAE,eAAe;YAC7B,mBAAmB,EAAE,eAAe;YACpC,WAAW,EAAE,eAAe;YAC5B,kBAAkB,EAAE,eAAe;YACnC,UAAU,EAAE,eAAe;YAC3B,iBAAiB,EAAE,eAAe;YAClC,SAAS,EAAE,eAAe;YAC1B,gBAAgB,EAAE,eAAe;YACjC,SAAS,EAAE,cAAc;YACzB,gBAAgB,EAAE,cAAc;YAChC,QAAQ,EAAE,cAAc;YACxB,eAAe,EAAE,cAAc;YAC/B,WAAW,EAAE,cAAc;YAC3B,kBAAkB,EAAE,cAAc;YAClC,UAAU,EAAE,cAAc;YAC1B,iBAAiB,EAAE,cAAc;YACjC,UAAU,EAAE,cAAc;YAC1B,iBAAiB,EAAE,cAAc;YACjC,SAAS,EAAE,cAAc;YACzB,gBAAgB,EAAE,cAAc;SACjC;KACF;CACF,CAAC;AACF,gBAAgB"} \ No newline at end of file diff --git a/dist/es2015/df/df-binding-behavior.js b/dist/es2015/df/df-binding-behavior.js deleted file mode 100644 index 5498c28e..00000000 --- a/dist/es2015/df/df-binding-behavior.js +++ /dev/null @@ -1,29 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -import { ValueConverter } from "aurelia-binding"; -var DfBindingBehavior = /** @class */ (function () { - function DfBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - DfBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; - DfBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the DfValueConverter. - // pass through any args to the binding behavior to the DfValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new ValueConverter(expression, "df", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - DfBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return DfBindingBehavior; -}()); -export { DfBindingBehavior }; -//# sourceMappingURL=df-binding-behavior.js.map \ No newline at end of file diff --git a/dist/es2015/df/df-binding-behavior.js.map b/dist/es2015/df/df-binding-behavior.js.map deleted file mode 100644 index ebcc05c6..00000000 --- a/dist/es2015/df/df-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"df-binding-behavior.js","sourceRoot":"","sources":["../../../src/df/df-binding-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;IAGE,2BAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;QACxF,sDAAsD;QACtD,wEAAwE;QACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,cAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;IACJ,CAAC;IACM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IACH,wBAAC;AAAD,CAAC,AAzBD,IAyBC"} \ No newline at end of file diff --git a/dist/es2015/df/df-value-converter.js b/dist/es2015/df/df-value-converter.js deleted file mode 100644 index 37c5f521..00000000 --- a/dist/es2015/df/df-value-converter.js +++ /dev/null @@ -1,26 +0,0 @@ -import { I18N } from "../i18n"; -import { isInteger } from "../utils"; -var DfValueConverter = /** @class */ (function () { - function DfValueConverter(service) { - this.service = service; - } - DfValueConverter.inject = function () { return [I18N]; }; - DfValueConverter.prototype.toView = function (value, dfOrOptions, locale) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (typeof value === "string" && isNaN(value) && !isInteger(value)) { - value = new Date(value); - } - if (dfOrOptions && (dfOrOptions instanceof Intl.DateTimeFormat && typeof dfOrOptions.format === "function")) { - return dfOrOptions.format(value); - } - var df = this.service.df(dfOrOptions, locale || this.service.getLocale()); - return df.format(value); - }; - return DfValueConverter; -}()); -export { DfValueConverter }; -//# sourceMappingURL=df-value-converter.js.map \ No newline at end of file diff --git a/dist/es2015/df/df-value-converter.js.map b/dist/es2015/df/df-value-converter.js.map deleted file mode 100644 index d30b0c7f..00000000 --- a/dist/es2015/df/df-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"df-value-converter.js","sourceRoot":"","sources":["../../../src/df/df-value-converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC;IAGE,0BAAoB,OAAa;QAAb,YAAO,GAAP,OAAO,CAAM;IAAI,CAAC;IAFxB,uBAAM,GAApB,cAAyB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAIlC,iCAAM,GAAb,UACE,KAAU,EACV,WAA8D,EAC9D,MAAe;QAEf,IAAI,KAAK,KAAK,IAAI;eACb,OAAO,KAAK,KAAK,WAAW;eAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACrD;YACA,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAY,CAAC,IAAI,CAAC,SAAS,CAAC,KAAY,CAAC,EAAE;YAChF,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;QAED,IAAI,WAAW,IAAI,CAAC,WAAW,YAAY,IAAI,CAAC,cAAc,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE;YAC3G,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAClC;QAED,IAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAyC,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QAC1G,OAAO,EAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IACH,uBAAC;AAAD,CAAC,AA5BD,IA4BC"} \ No newline at end of file diff --git a/dist/es2015/df/index.js b/dist/es2015/df/index.js deleted file mode 100644 index 8dca4c6d..00000000 --- a/dist/es2015/df/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./df-binding-behavior"; -export * from "./df-value-converter"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/es2015/df/index.js.map b/dist/es2015/df/index.js.map deleted file mode 100644 index bda5730c..00000000 --- a/dist/es2015/df/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/df/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/dist/es2015/i18n.js b/dist/es2015/i18n.js deleted file mode 100644 index 71887daa..00000000 --- a/dist/es2015/i18n.js +++ /dev/null @@ -1,311 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -import i18next from "i18next"; -import { DOM, PLATFORM } from "aurelia-pal"; -import * as LogManager from "aurelia-logging"; -import { autoinject } from "aurelia-framework"; -export var I18N_EA_SIGNAL = "i18n:locale:changed"; -var I18N = /** @class */ (function () { - function I18N(ea, signaler) { - this.ea = ea; - this.signaler = signaler; - this.globalVars = {}; - this.i18next = i18next; - this.Intl = PLATFORM.global.Intl; - } - I18N.prototype.setup = function (options) { - return __awaiter(this, void 0, void 0, function () { - var defaultOptions; - var _this = this; - return __generator(this, function (_a) { - defaultOptions = { - skipTranslationOnMissingKey: false, - compatibilityAPI: "v1", - compatibilityJSON: "v1", - lng: "en", - attributes: ["t", "i18n"], - fallbackLng: "en", - debug: false - }; - this.i18nextDeferred = new Promise(function (resolve, reject) { - _this.i18next = _this.i18next.init(options || defaultOptions, function (err) { - if (err) { - reject(err); - } - // make sure attributes is an array in case a string was provided - if (_this.i18next.options.attributes instanceof String) { - _this.i18next.options.attributes = [_this.i18next.options.attributes]; - } - resolve(_this.i18next); - }); - }); - return [2 /*return*/, this.i18nextDeferred]; - }); - }); - }; - I18N.prototype.i18nextReady = function () { - return this.i18nextDeferred; - }; - I18N.prototype.setLocale = function (locale) { - var _this = this; - return new Promise(function (resolve, reject) { - var oldLocale = _this.getLocale(); - _this.i18next.changeLanguage(locale, function (err, tr) { - if (err) { - reject(err); - } - _this.ea.publish(I18N_EA_SIGNAL, { oldValue: oldLocale, newValue: locale }); - _this.signaler.signal("aurelia-translation-signal"); - resolve(tr); - }); - }); - }; - I18N.prototype.getLocale = function () { - return this.i18next.language; - }; - I18N.prototype.nf = function (options, locales) { - return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); - }; - I18N.prototype.uf = function (numberLike, locale) { - var nf = this.nf({}, locale || this.getLocale()); - var comparer = nf.format(10000 / 3); - var thousandSeparator = comparer[1]; - var decimalSeparator = comparer[5]; - if (thousandSeparator === ".") { - thousandSeparator = "\\."; - } - // remove all thousand seperators - var result = numberLike.replace(new RegExp(thousandSeparator, "g"), "") - // remove non-numeric signs except -> , . - .replace(/[^\d.,-]/g, "") - // replace original decimalSeparator with english one - .replace(decimalSeparator, "."); - // return real number - return Number(result); - }; - I18N.prototype.df = function (options, locales) { - return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); - }; - I18N.prototype.tr = function (key, options) { - var fullOptions = this.globalVars; - if (options !== undefined) { - fullOptions = Object.assign(Object.assign({}, this.globalVars), options); - } - return this.i18next.t(key, fullOptions); - }; - I18N.prototype.registerGlobalVariable = function (key, value) { - this.globalVars[key] = value; - }; - I18N.prototype.unregisterGlobalVariable = function (key) { - delete this.globalVars[key]; - }; - /** - * Scans an element for children that have a translation attribute and - * updates their innerHTML with the current translation values. - * - * If an image is encountered the translated value will be applied to the src attribute. - * - * @param el HTMLElement to search within - */ - I18N.prototype.updateTranslations = function (el) { - if (!el || !el.querySelectorAll) { - return; - } - var i; - var l; - // create a selector from the specified attributes to look for - // var selector = [].concat(this.i18next.options.attributes); - var attributes = this.i18next.options.attributes; - var selector = [].concat(attributes); - for (i = 0, l = selector.length; i < l; i++) { - selector[i] = "[" + selector[i] + "]"; - } - selector = selector.join(","); - // get the nodes - var nodes = el.querySelectorAll(selector); - for (i = 0, l = nodes.length; i < l; i++) { - var node = nodes[i]; - var keys = void 0; - var params = void 0; - // test every attribute and get the first one that has a value - for (var i2 = 0, l2 = attributes.length; i2 < l2; i2++) { - keys = node.getAttribute(attributes[i2]); - var pname = attributes[i2] + "-params"; - if (pname && node.au && node.au[pname]) { - params = node.au[pname].viewModel.value; - } - if (keys) { - break; - } - } - // skip if nothing was found - if (!keys) { - continue; - } - // split the keys into multiple keys separated by a ; - this.updateValue(node, keys, params); - } - }; - I18N.prototype.updateValue = function (node, value, params) { - if (value === null || value === undefined) { - return; - } - var keys = value.toString().split(";"); - var i = keys.length; - while (i--) { - var key = keys[i]; - // remove the optional attribute - var re = /\[([a-z\-, ]*)\]/ig; - var m = void 0; - var attr = "text"; - // set default attribute to src if this is an image node - if (node.nodeName === "IMG") { - attr = "src"; - } - // check if a attribute was specified in the key - // tslint:disable-next-line:no-conditional-assignment - while ((m = re.exec(key)) !== null) { - if (m.index === re.lastIndex) { - re.lastIndex++; - } - if (m) { - key = key.replace(m[0], ""); - attr = m[1]; - } - } - var attrs = attr.split(","); - var j = attrs.length; - while (j--) { - attr = attrs[j].trim(); - if (!node._textContent) { - node._textContent = node.textContent; - } - if (!node._innerHTML) { - node._innerHTML = node.innerHTML; - } - // convert to camelCase - // tslint:disable-next-line:only-arrow-functions - var attrCC = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); - var reservedNames = ["prepend", "append", "text", "html"]; - var i18nLogger = LogManager.getLogger("i18n"); - if (reservedNames.indexOf(attr) > -1 && - node.au && - node.au.controller && - node.au.controller.viewModel && - attrCC in node.au.controller.viewModel) { - i18nLogger.warn("Aurelia I18N reserved attribute name\n\n [" + reservedNames.join(", ") + "]\n\n Your custom element has a bindable named " + attr + " which is a reserved word.\n\n If you'd like Aurelia I18N to translate your bindable instead, please consider giving it another name."); - } - if (this.i18next.options.skipTranslationOnMissingKey && - this.tr(key, params) === key) { - i18nLogger.warn("Couldn't find translation for key: " + key); - return; - } - // handle various attributes - // anything other than text,prepend,append or html will be added as an attribute on the element. - switch (attr) { - case "text": - var newChild = DOM.createTextNode(this.tr(key, params)); - if (node._newChild && node._newChild.parentNode === node) { - node.removeChild(node._newChild); - } - node._newChild = newChild; - while (node.firstChild) { - node.removeChild(node.firstChild); - } - node.appendChild(node._newChild); - break; - case "prepend": - var prependParser = DOM.createElement("div"); - prependParser.innerHTML = this.tr(key, params); - for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { - if (node.childNodes[ni]._prepended) { - node.removeChild(node.childNodes[ni]); - } - } - for (var pi = prependParser.childNodes.length - 1; pi >= 0; pi--) { - prependParser.childNodes[pi]._prepended = true; - if (node.firstChild) { - node.insertBefore(prependParser.childNodes[pi], node.firstChild); - } - else { - node.appendChild(prependParser.childNodes[pi]); - } - } - break; - case "append": - var appendParser = DOM.createElement("div"); - appendParser.innerHTML = this.tr(key, params); - for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { - if (node.childNodes[ni]._appended) { - node.removeChild(node.childNodes[ni]); - } - } - while (appendParser.firstChild) { - appendParser.firstChild._appended = true; - node.appendChild(appendParser.firstChild); - } - break; - case "html": - node.innerHTML = this.tr(key, params); - break; - default: // normal html attribute - if (node.au && - node.au.controller && - node.au.controller.viewModel && - attrCC in node.au.controller.viewModel) { - node.au.controller.viewModel[attrCC] = this.tr(key, params); - } - else { - node.setAttribute(attr, this.tr(key, params)); - } - break; - } - } - } - }; - I18N = __decorate([ - autoinject() - ], I18N); - return I18N; -}()); -export { I18N }; -//# sourceMappingURL=i18n.js.map \ No newline at end of file diff --git a/dist/es2015/i18n.js.map b/dist/es2015/i18n.js.map deleted file mode 100644 index 2f632d79..00000000 --- a/dist/es2015/i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,OAGN,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,GAAG,EACH,QAAQ,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAiB/C,MAAM,CAAC,IAAM,cAAc,GAAG,qBAAqB,CAAC;AAGpD;IAME,cAAoB,EAAmB,EAAU,QAAyB;QAAtD,OAAE,GAAF,EAAE,CAAiB;QAAU,aAAQ,GAAR,QAAQ,CAAiB;QAFlE,eAAU,GAA2B,EAAE,CAAC;QAG9C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;IACnC,CAAC;IAEY,oBAAK,GAAlB,UAAmB,OAA8C;;;;;gBACzD,cAAc,GAAG;oBACrB,2BAA2B,EAAE,KAAK;oBAClC,gBAAgB,EAAE,IAAI;oBACtB,iBAAiB,EAAE,IAAI;oBACvB,GAAG,EAAE,IAAI;oBACT,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC;oBACzB,WAAW,EAAE,IAAI;oBACjB,KAAK,EAAE,KAAK;iBACb,CAAC;gBAEF,IAAI,CAAC,eAAe,GAAG,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;oBACjD,KAAI,CAAC,OAAO,GAAG,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,I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AAE,CAAS,CAAC,SAAS,EAAE;gCAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;6BACvC;yBACF;wBAED,OAAO,YAAY,CAAC,UAAU,EAAE;4BAC7B,YAAY,CAAC,UAAkB,CAAC,SAAS,GAAG,IAAI,CAAC;4BAClD,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;yBAC3C;wBACD,MAAM;oBACR,KAAK,MAAM;wBACT,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;wBACtC,MAAM;oBACR,SAAS,wBAAwB;wBAC/B,IAAI,IAAI,CAAC,EAAE;4BACT,IAAI,CAAC,EAAE,CAAC,UAAU;4BAClB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS;4BAC5B,MAAM,IAAI,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,EAAE;4BACxC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;yBAC7D;6BAAM;4BACL,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;yBAC/C;wBAED,MAAM;iBACT;aACF;SACF;IACH,CAAC;IA7RU,IAAI;QADhB,UAAU,EAAE;OACA,IAAI,CA8RhB;IAAD,WAAC;CAAA,AA9RD,IA8RC;SA9RY,IAAI"} \ No newline at end of file diff --git a/dist/es2015/nf/index.js b/dist/es2015/nf/index.js deleted file mode 100644 index d0ec24df..00000000 --- a/dist/es2015/nf/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./nf-binding-behavior"; -export * from "./nf-value-converter"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/es2015/nf/index.js.map b/dist/es2015/nf/index.js.map deleted file mode 100644 index 243f0577..00000000 --- a/dist/es2015/nf/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nf/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/dist/es2015/nf/nf-binding-behavior.js b/dist/es2015/nf/nf-binding-behavior.js deleted file mode 100644 index ee012219..00000000 --- a/dist/es2015/nf/nf-binding-behavior.js +++ /dev/null @@ -1,29 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -import { ValueConverter } from "aurelia-binding"; -var NfBindingBehavior = /** @class */ (function () { - function NfBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - NfBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; - NfBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the NfValueConverter. - // pass through any args to the binding behavior to the NfValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new ValueConverter(expression, "nf", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - NfBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return NfBindingBehavior; -}()); -export { NfBindingBehavior }; -//# sourceMappingURL=nf-binding-behavior.js.map \ No newline at end of file diff --git a/dist/es2015/nf/nf-binding-behavior.js.map b/dist/es2015/nf/nf-binding-behavior.js.map deleted file mode 100644 index eb5b33b4..00000000 --- a/dist/es2015/nf/nf-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nf-binding-behavior.js","sourceRoot":"","sources":["../../../src/nf/nf-binding-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;IAGE,2BAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;QACxF,sDAAsD;QACtD,wEAAwE;QACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,cAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;IACJ,CAAC;IAEM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IACH,wBAAC;AAAD,CAAC,AA1BD,IA0BC"} \ No newline at end of file diff --git a/dist/es2015/nf/nf-value-converter.js b/dist/es2015/nf/nf-value-converter.js deleted file mode 100644 index 2fac1743..00000000 --- a/dist/es2015/nf/nf-value-converter.js +++ /dev/null @@ -1,22 +0,0 @@ -import { I18N } from "../i18n"; -var NfValueConverter = /** @class */ (function () { - function NfValueConverter(service) { - this.service = service; - } - NfValueConverter.inject = function () { return [I18N]; }; - NfValueConverter.prototype.toView = function (value, nfOrOptions, locale) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (nfOrOptions && (nfOrOptions instanceof Intl.NumberFormat && typeof nfOrOptions.format === "function")) { - return nfOrOptions.format(value); - } - var nf = this.service.nf(nfOrOptions, locale || this.service.getLocale()); - return nf.format(value); - }; - return NfValueConverter; -}()); -export { NfValueConverter }; -//# sourceMappingURL=nf-value-converter.js.map \ No newline at end of file diff --git a/dist/es2015/nf/nf-value-converter.js.map b/dist/es2015/nf/nf-value-converter.js.map deleted file mode 100644 index d50dba82..00000000 --- a/dist/es2015/nf/nf-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nf-value-converter.js","sourceRoot":"","sources":["../../../src/nf/nf-value-converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B;IAEE,0BAAoB,OAAa;QAAb,YAAO,GAAP,OAAO,CAAM;IAAG,CAAC;IADvB,uBAAM,GAApB,cAAyB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAGlC,iCAAM,GAAb,UACE,KAAU,EACV,WAA0D,EAC1D,MAAe;QAEf,IAAI,KAAK,KAAK,IAAI;eACb,OAAO,KAAK,KAAK,WAAW;eAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACnD;YACF,OAAO,KAAK,CAAC;SACd;QAED,IAAI,WAAW,IAAI,CAAC,WAAW,YAAY,IAAI,CAAC,YAAY,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE;YACzG,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAClC;QAED,IAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAuC,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACxG,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACH,uBAAC;AAAD,CAAC,AAvBD,IAuBC"} \ No newline at end of file diff --git a/dist/es2015/relativeTime.js b/dist/es2015/relativeTime.js deleted file mode 100644 index c65abdd7..00000000 --- a/dist/es2015/relativeTime.js +++ /dev/null @@ -1,91 +0,0 @@ -import { EventAggregator } from "aurelia-event-aggregator"; -import { I18N, I18N_EA_SIGNAL } from "./i18n"; -import { translations } from "./defaultTranslations/relative.time"; -var RelativeTime = /** @class */ (function () { - function RelativeTime(service, ea) { - var _this = this; - this.service = service; - this.ea = ea; - this.service.i18nextReady().then(function () { - _this.setup(); - }); - this.ea.subscribe(I18N_EA_SIGNAL, function (locales) { - _this.setup(locales); - }); - } - RelativeTime.inject = function () { return [I18N, EventAggregator]; }; - RelativeTime.prototype.setup = function (locales) { - var trans = translations.default || translations; - var fallbackLng = this.service.i18next.fallbackLng; - var alternateFb = fallbackLng || this.service.i18next.options.fallbackLng; - if (Array.isArray(alternateFb) && alternateFb.length > 0) { - alternateFb = alternateFb[0]; - } - var key = ((locales && locales.newValue) - ? locales.newValue - : this.service.getLocale()) || alternateFb; - var index = 0; - // tslint:disable-next-line:no-conditional-assignment - if ((index = key.indexOf("-")) >= 0) { - var baseLocale = key.substring(0, index); - if (trans[baseLocale]) { - this.addTranslationResource(baseLocale, trans[baseLocale].translation); - } - } - if (trans[key]) { - this.addTranslationResource(key, trans[key].translation); - } - if (trans[fallbackLng]) { - this.addTranslationResource(key, trans[fallbackLng].translation); - } - }; - RelativeTime.prototype.addTranslationResource = function (key, translation) { - var options = this.service.i18next.options; - if (options.interpolation && (options.interpolation.prefix !== "__" || options.interpolation.suffix !== "__")) { - // tslint:disable-next-line:forin - for (var subkey in translation) { - translation[subkey] = translation[subkey] - .replace("__count__", (options.interpolation.prefix || "{{") + "count" + (options.interpolation.suffix || "}}")); - } - } - this.service.i18next.addResources(key, options.defaultNS || "translation", translation); - }; - RelativeTime.prototype.getRelativeTime = function (time) { - var now = new Date(); - var diff = now.getTime() - time.getTime(); - var timeDiff = this.getTimeDiffDescription(diff, "year", 31104000000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "month", 2592000000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "day", 86400000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "hour", 3600000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "minute", 60000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "second", 1000); - if (!timeDiff) { - timeDiff = this.service.tr("now"); - } - } - } - } - } - } - return timeDiff; - }; - RelativeTime.prototype.getTimeDiffDescription = function (diff, unit, timeDivisor) { - var unitAmount = parseInt((diff / timeDivisor).toFixed(0), 10); - if (unitAmount > 0) { - return this.service.tr(unit, { count: unitAmount, context: "ago" }); - } - else if (unitAmount < 0) { - var abs = Math.abs(unitAmount); - return this.service.tr(unit, { count: abs, context: "in" }); - } - return null; - }; - return RelativeTime; -}()); -export { RelativeTime }; -//# sourceMappingURL=relativeTime.js.map \ No newline at end of file diff --git a/dist/es2015/relativeTime.js.map b/dist/es2015/relativeTime.js.map deleted file mode 100644 index efab1c77..00000000 --- a/dist/es2015/relativeTime.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"relativeTime.js","sourceRoot":"","sources":["../../src/relativeTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EACL,IAAI,EAEJ,cAAc,EACf,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE;IAEE,sBAAoB,OAAa,EAAU,EAAmB;QAA9D,iBAQC;QARmB,YAAO,GAAP,OAAO,CAAM;QAAU,OAAE,GAAF,EAAE,CAAiB;QAC5D,IAAI,CAAC,OAA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;YACzB,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACjC,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;SAC7D;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IACH,mBAAC;AAAD,CAAC,AAlGD,IAkGC"} \ No newline at end of file diff --git a/dist/es2015/rt/index.js b/dist/es2015/rt/index.js deleted file mode 100644 index edf97dc9..00000000 --- a/dist/es2015/rt/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./rt-binding-behavior"; -export * from "./rt-value-converter"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/es2015/rt/index.js.map b/dist/es2015/rt/index.js.map deleted file mode 100644 index 2532c310..00000000 --- a/dist/es2015/rt/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rt/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/dist/es2015/rt/rt-binding-behavior.js b/dist/es2015/rt/rt-binding-behavior.js deleted file mode 100644 index f2ab1d5e..00000000 --- a/dist/es2015/rt/rt-binding-behavior.js +++ /dev/null @@ -1,29 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -import { ValueConverter } from "aurelia-binding"; -var RtBindingBehavior = /** @class */ (function () { - function RtBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - RtBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; - RtBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal", "aurelia-relativetime-signal"); - // rewrite the expression to use the RtValueConverter. - // pass through any args to the binding behavior to the RtValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new ValueConverter(expression, "rt", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - RtBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return RtBindingBehavior; -}()); -export { RtBindingBehavior }; -//# sourceMappingURL=rt-binding-behavior.js.map \ No newline at end of file diff --git a/dist/es2015/rt/rt-binding-behavior.js.map b/dist/es2015/rt/rt-binding-behavior.js.map deleted file mode 100644 index bf5aa967..00000000 --- a/dist/es2015/rt/rt-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rt-binding-behavior.js","sourceRoot":"","sources":["../../../src/rt/rt-binding-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;IAGE,2BAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CACtC,OAAO,EAAE,MAAM,EAAE,4BAA4B,EAAE,6BAA6B,CAC7E,CAAC;QACF,sDAAsD;QACtD,wEAAwE;QACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,cAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;IACJ,CAAC;IAEM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IACH,wBAAC;AAAD,CAAC,AA5BD,IA4BC"} \ No newline at end of file diff --git a/dist/es2015/rt/rt-value-converter.js b/dist/es2015/rt/rt-value-converter.js deleted file mode 100644 index 91bea93c..00000000 --- a/dist/es2015/rt/rt-value-converter.js +++ /dev/null @@ -1,21 +0,0 @@ -import { RelativeTime } from "../relativeTime"; -var RtValueConverter = /** @class */ (function () { - function RtValueConverter(service) { - this.service = service; - } - RtValueConverter.inject = function () { return [RelativeTime]; }; - RtValueConverter.prototype.toView = function (value) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (typeof value === "string" && isNaN(value) && !Number.isInteger(value)) { - value = new Date(value); - } - return this.service.getRelativeTime(value); - }; - return RtValueConverter; -}()); -export { RtValueConverter }; -//# sourceMappingURL=rt-value-converter.js.map \ No newline at end of file diff --git a/dist/es2015/rt/rt-value-converter.js.map b/dist/es2015/rt/rt-value-converter.js.map deleted file mode 100644 index b0529fe6..00000000 --- a/dist/es2015/rt/rt-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rt-value-converter.js","sourceRoot":"","sources":["../../../src/rt/rt-value-converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;IAEE,0BAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAG,CAAC;IAD/B,uBAAM,GAApB,cAAyB,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAG1C,iCAAM,GAAb,UAAc,KAAU;QACtB,IAAI,KAAK,KAAK,IAAI;eACb,OAAO,KAAK,KAAK,WAAW;eAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACnD;YACF,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAY,CAAC,EAAE;YACvF,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IACH,uBAAC;AAAD,CAAC,AAlBD,IAkBC"} \ No newline at end of file diff --git a/dist/es2015/t/index.js b/dist/es2015/t/index.js deleted file mode 100644 index 16a538e2..00000000 --- a/dist/es2015/t/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./t-binding-behavior"; -export * from "./t-custom-attribute"; -export * from "./t-params-custom-attribute"; -export * from "./t-value-converter"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/es2015/t/index.js.map b/dist/es2015/t/index.js.map deleted file mode 100644 index 2a6666da..00000000 --- a/dist/es2015/t/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/t/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC"} \ No newline at end of file diff --git a/dist/es2015/t/t-binding-behavior.js b/dist/es2015/t/t-binding-behavior.js deleted file mode 100644 index 497f4c8b..00000000 --- a/dist/es2015/t/t-binding-behavior.js +++ /dev/null @@ -1,29 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -import { ValueConverter } from "aurelia-binding"; -var TBindingBehavior = /** @class */ (function () { - function TBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - TBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the TValueConverter. - // pass through any args to the binding behavior to the TValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new ValueConverter(expression, "t", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - TBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - TBindingBehavior.inject = [SignalBindingBehavior]; - return TBindingBehavior; -}()); -export { TBindingBehavior }; -//# sourceMappingURL=t-binding-behavior.js.map \ No newline at end of file diff --git a/dist/es2015/t/t-binding-behavior.js.map b/dist/es2015/t/t-binding-behavior.js.map deleted file mode 100644 index 1a766444..00000000 --- a/dist/es2015/t/t-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-binding-behavior.js","sourceRoot":"","sources":["../../../src/t/t-binding-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;IAGE,0BAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAE9D,+BAAI,GAAX,UAAY,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;QACxF,qDAAqD;QACrD,uEAAuE;QACvE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,cAAc,CAC9C,UAAU,EAAE,GAAG,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC9E,CAAC;IACJ,CAAC;IAEM,iCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IAxBa,uBAAM,GAAG,CAAC,qBAAqB,CAAC,CAAC;IA0BjD,uBAAC;CAAA,AA3BD,IA2BC;SA3BY,gBAAgB"} \ No newline at end of file diff --git a/dist/es2015/t/t-custom-attribute.js b/dist/es2015/t/t-custom-attribute.js deleted file mode 100644 index 016d279e..00000000 --- a/dist/es2015/t/t-custom-attribute.js +++ /dev/null @@ -1,63 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -import { customAttribute, HtmlBehaviorResource } from "aurelia-templating"; -import { EventAggregator } from "aurelia-event-aggregator"; -import { metadata } from "aurelia-metadata"; -import { DOM } from "aurelia-pal"; -import { I18N, I18N_EA_SIGNAL } from "../i18n"; -import { LazyOptional } from "../utils"; -import { TParamsCustomAttribute } from "./t-params-custom-attribute"; -var TCustomAttribute = /** @class */ (function () { - function TCustomAttribute(element, service, ea, p) { - this.element = element; - this.service = service; - this.ea = ea; - this.lazyParams = p; - } - TCustomAttribute_1 = TCustomAttribute; - TCustomAttribute.inject = function () { - return [DOM.Element, I18N, EventAggregator, LazyOptional.of(TParamsCustomAttribute)]; - }; - TCustomAttribute.configureAliases = function (aliases) { - var r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TCustomAttribute_1); - r.aliases = aliases; - }; - TCustomAttribute.prototype.bind = function () { - var _this = this; - this.params = this.lazyParams(); - if (this.params) { - this.params.valueChanged = function (newParams, oldParams) { - _this.paramsChanged(_this.value, newParams, oldParams); - }; - } - var p = this.params !== null ? this.params.value : undefined; - this.subscription = this.ea.subscribe(I18N_EA_SIGNAL, function () { - _this.service.updateValue(_this.element, _this.value, _this.params !== null ? _this.params.value : undefined); - }); - this.service.updateValue(this.element, this.value, p); - }; - TCustomAttribute.prototype.paramsChanged = function (newValue, newParams) { - this.service.updateValue(this.element, newValue, newParams); - }; - TCustomAttribute.prototype.valueChanged = function (newValue) { - var p = this.params !== null ? this.params.value : undefined; - this.service.updateValue(this.element, newValue, p); - }; - TCustomAttribute.prototype.unbind = function () { - // If unbind is called before timeout for subscription is triggered, subscription will be undefined - if (this.subscription) { - this.subscription.dispose(); - } - }; - var TCustomAttribute_1; - TCustomAttribute = TCustomAttribute_1 = __decorate([ - customAttribute("t") - ], TCustomAttribute); - return TCustomAttribute; -}()); -export { TCustomAttribute }; -//# sourceMappingURL=t-custom-attribute.js.map \ No newline at end of file diff --git a/dist/es2015/t/t-custom-attribute.js.map b/dist/es2015/t/t-custom-attribute.js.map deleted file mode 100644 index 3cdddd6c..00000000 --- a/dist/es2015/t/t-custom-attribute.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-custom-attribute.js","sourceRoot":"","sources":["../../../src/t/t-custom-attribute.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,eAAe,EACf,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EAEhB,MAAM,0BAA0B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attribute.js deleted file mode 100644 index 20799688..00000000 --- a/dist/es2015/t/t-params-custom-attribute.js +++ /dev/null @@ -1,30 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -import { customAttribute, HtmlBehaviorResource } from "aurelia-templating"; -import { metadata } from "aurelia-metadata"; -import { DOM } from "aurelia-pal"; -var TParamsCustomAttribute = /** @class */ (function () { - function TParamsCustomAttribute(element) { - this.element = element; - } - TParamsCustomAttribute_1 = TParamsCustomAttribute; - TParamsCustomAttribute.inject = function () { - return [DOM.Element]; - }; - TParamsCustomAttribute.configureAliases = function (aliases) { - var r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TParamsCustomAttribute_1); - r.aliases = aliases; - }; - TParamsCustomAttribute.prototype.valueChanged = function () { }; - var TParamsCustomAttribute_1; - TParamsCustomAttribute = TParamsCustomAttribute_1 = __decorate([ - customAttribute("t-params") - ], TParamsCustomAttribute); - return TParamsCustomAttribute; -}()); -export { TParamsCustomAttribute }; -//# sourceMappingURL=t-params-custom-attribute.js.map \ No newline at end of file diff --git a/dist/es2015/t/t-params-custom-attribute.js.map b/dist/es2015/t/t-params-custom-attribute.js.map deleted file mode 100644 index 3f691651..00000000 --- a/dist/es2015/t/t-params-custom-attribute.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-params-custom-attribute.js","sourceRoot":"","sources":["../../../src/t/t-params-custom-attribute.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,eAAe,EACf,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC;IAYE,gCAAmB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAI,CAAC;+BAZ7B,sBAAsB;IACnB,6BAAM,GAApB;QACE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAEa,uCAAgB,GAA9B,UAA+B,OAAiB;QAC9C,IAAM,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,EAAE,wBAAsB,CAAC,CAAC;QAClG,CAAS,CAAC,OAAO,GAAG,OAAO,CAAC;IAC/B,CAAC;IAMM,6CAAY,GAAnB,cAA6B,CAAC;;IAdnB,sBAAsB;QADlC,eAAe,CAAC,UAAU,CAAC;OACf,sBAAsB,CAelC;IAAD,6BAAC;CAAA,AAfD,IAeC;SAfY,sBAAsB"} \ No newline at end of file diff --git a/dist/es2015/t/t-value-converter.js b/dist/es2015/t/t-value-converter.js deleted file mode 100644 index c231def0..00000000 --- a/dist/es2015/t/t-value-converter.js +++ /dev/null @@ -1,13 +0,0 @@ -import { I18N } from "../i18n"; -var TValueConverter = /** @class */ (function () { - function TValueConverter(service) { - this.service = service; - } - TValueConverter.inject = function () { return [I18N]; }; - TValueConverter.prototype.toView = function (value, options) { - return this.service.tr(value, options); - }; - return TValueConverter; -}()); -export { TValueConverter }; -//# sourceMappingURL=t-value-converter.js.map \ No newline at end of file diff --git a/dist/es2015/t/t-value-converter.js.map b/dist/es2015/t/t-value-converter.js.map deleted file mode 100644 index 598e821d..00000000 --- a/dist/es2015/t/t-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-value-converter.js","sourceRoot":"","sources":["../../../src/t/t-value-converter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B;IAGE,yBAAoB,OAAa;QAAb,YAAO,GAAP,OAAO,CAAM;IAAI,CAAC;IAFxB,sBAAM,GAApB,cAAyB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAIlC,gCAAM,GAAb,UAAc,KAAU,EAAE,OAA4C;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IACH,sBAAC;AAAD,CAAC,AARD,IAQC"} \ No newline at end of file diff --git a/dist/es2015/utils.js b/dist/es2015/utils.js deleted file mode 100644 index 924dea15..00000000 --- a/dist/es2015/utils.js +++ /dev/null @@ -1,60 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -import { resolver } from "aurelia-dependency-injection"; -export var extend = function (destination, source) { - // tslint:disable-next-line:forin - for (var property in source) { - destination[property] = source[property]; - } - return destination; -}; -// tslint:disable-next-line:only-arrow-functions -export var isInteger = Number.isInteger || function (value) { - return typeof value === "number" && - isFinite(value) && - Math.floor(value) === value; -}; -export var assignObjectToKeys = function (root, obj) { - if (obj === undefined || obj === null) { - return obj; - } - var opts = {}; - Object.keys(obj).map(function (key) { - if (typeof obj[key] === "object") { - extend(opts, assignObjectToKeys(key, obj[key])); - } - else { - opts[root !== "" ? root + "." + key : key] = obj[key]; - } - }); - return opts; -}; -var LazyOptional = /** @class */ (function () { - function LazyOptional(key) { - this.key = key; - } - LazyOptional_1 = LazyOptional; - LazyOptional.of = function (key) { - return new LazyOptional_1(key); - }; - LazyOptional.prototype.get = function (container) { - var _this = this; - return function () { - if (container.hasResolver(_this.key, false)) { - return container.get(_this.key); - } - return null; - }; - }; - var LazyOptional_1; - LazyOptional = LazyOptional_1 = __decorate([ - resolver() - ], LazyOptional); - return LazyOptional; -}()); -export { LazyOptional }; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/dist/es2015/utils.js.map b/dist/es2015/utils.js.map deleted file mode 100644 index 8b406752..00000000 --- a/dist/es2015/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,QAAQ,EAET,MAAM,8BAA8B,CAAC;AAEtC,MAAM,CAAC,IAAI,MAAM,GAAG,UAAC,WAAgB,EAAE,MAAW;IAChD,iCAAiC;IACjC,KAAK,IAAM,QAAQ,IAAI,MAAM,EAAE;QAC7B,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;KAC1C;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,gDAAgD;AAChD,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,UAAS,KAAK;IACzD,OAAO,OAAO,KAAK,KAAK,QAAQ;QAC9B,QAAQ,CAAC,KAAK,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,CAAC,IAAI,kBAAkB,GAAG,UAAC,IAAS,EAAE,GAAQ;IAClD,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;QACrC,OAAO,GAAG,CAAC;KACZ;IAED,IAAM,IAAI,GAAG,EAAE,CAAC;IAEhB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,UAAC,GAAG;QACvB,IAAI,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;YAChC,MAAM,CAAC,IAAI,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACjD;aAAM;YACJ,IAAY,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;SAChE;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAGF;IAKE,sBAAoB,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;IAAI,CAAC;qBALzB,YAAY;IACT,eAAE,GAAhB,UAAiB,GAAQ;QACvB,OAAO,IAAI,cAAY,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAIM,0BAAG,GAAV,UAAW,SAAoB;QAA/B,iBAOC;QANC,OAAO;YACL,IAAI,SAAS,CAAC,WAAW,CAAC,KAAI,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;gBAC1C,OAAO,SAAS,CAAC,GAAG,CAAC,KAAI,CAAC,GAAG,CAAC,CAAC;aAChC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IACJ,CAAC;;IAdU,YAAY;QADxB,QAAQ,EAAE;OACE,YAAY,CAexB;IAAD,mBAAC;CAAA,AAfD,IAeC;SAfY,YAAY"} \ No newline at end of file diff --git a/dist/es2017/aurelia-i18n-loader.js b/dist/es2017/aurelia-i18n-loader.js deleted file mode 100644 index 03216fb0..00000000 --- a/dist/es2017/aurelia-i18n-loader.js +++ /dev/null @@ -1,66 +0,0 @@ -export class Backend { - constructor(services, options = {}) { - this.services = services; - this.options = options; - this.type = "backend"; - this.init(services, options); - } - static with(loader) { - this.loader = loader; - return this; - } - init(services, options = {}) { - this.services = services; - this.options = Object.assign({}, { - loadPath: "/locales/{{lng}}/{{ns}}.json", - addPath: "locales/add/{{lng}}/{{ns}}", - allowMultiLoading: false, - parse: JSON.parse - }, options); - } - readMulti(languages, namespaces, callback) { - let loadPath = this.options.loadPath; - if (typeof this.options.loadPath === "function") { - loadPath = this.options.loadPath(languages, namespaces); - } - const url = this.services - .interpolator - .interpolate(loadPath, { lng: languages.join("+"), ns: namespaces.join("+") }); - this.loadUrl(url, callback); - } - read(language, namespace, callback) { - let loadPath = this.options.loadPath; - if (typeof this.options.loadPath === "function") { - loadPath = this.options.loadPath([language], [namespace]); - } - const url = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }); - this.loadUrl(url, callback); - } - async loadUrl(url, callback) { - try { - const response = await Backend.loader.loadText(url); - let ret; - let err; - try { - ret = (response instanceof Object) ? response : this.options.parse(response, url); - } - catch (e) { - err = "failed parsing " + url + " to json"; - } - if (err) { - return callback(err, false); - } - callback(null, ret); - } - catch (_a) { - callback("failed loading " + url, false /* no retry */); - } - } - // tslint:disable-next-line:variable-name - create(_languages, _namespace, _key, _fallbackValue) { - // not supported - } -} -Backend.type = "backend"; -export default Backend; -//# sourceMappingURL=aurelia-i18n-loader.js.map \ No newline at end of file diff --git a/dist/es2017/aurelia-i18n-loader.js.map b/dist/es2017/aurelia-i18n-loader.js.map deleted file mode 100644 index 6e29ecca..00000000 --- a/dist/es2017/aurelia-i18n-loader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aurelia-i18n-loader.js","sourceRoot":"","sources":["../../src/aurelia-i18n-loader.ts"],"names":[],"mappings":"AAmBA,MAAM,OAAO,OAAO;IAWlB,YAAmB,QAAa,EAAS,UAAiC,EAAE;QAAzD,aAAQ,GAAR,QAAQ,CAAK;QAAS,YAAO,GAAP,OAAO,CAA4B;QAFrE,SAAI,GAAW,SAAS,CAAC;QAG9B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;IARM,MAAM,CAAC,IAAI,CAAC,MAAc;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAOM,IAAI,CAAC,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,QAAQ,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QAE/F,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,QAAsB;QACtD,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YACpD,IAAI,GAAG,CAAC;YACR,IAAI,GAAG,CAAC;YACR,IAAI;gBACF,GAAG,GAAG,CAAC,QAAe,YAAY,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;aAC3F;YAAC,OAAO,CAAC,EAAE;gBACV,GAAG,GAAG,iBAAiB,GAAG,GAAG,GAAG,UAAU,CAAC;aAC5C;YAED,IAAI,GAAG,EAAE;gBACP,OAAO,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;aAC7B;YACD,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SACrB;QAAC,WAAM;YACN,QAAQ,CAAC,iBAAiB,GAAG,GAAG,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;SACzD;IACH,CAAC;IAED,yCAAyC;IAClC,MAAM,CAAC,UAA6B,EAAE,UAAkB,EAAE,IAAY,EAAE,cAAsB;QACnG,gBAAgB;IAClB,CAAC;;AAxEa,YAAI,GAAW,SAAS,CAAC;AA2EzC,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/dist/es2017/aurelia-i18n.js b/dist/es2017/aurelia-i18n.js index 92c4ad68..efa09869 100644 --- a/dist/es2017/aurelia-i18n.js +++ b/dist/es2017/aurelia-i18n.js @@ -1,41 +1,1294 @@ -import { EventAggregator } from "aurelia-event-aggregator"; -import { ViewResources } from "aurelia-templating"; -import { BindingSignaler } from "aurelia-templating-resources"; -import { PLATFORM } from "aurelia-pal"; -import { I18N } from "./i18n"; -export * from "./i18n"; -export * from "./relativeTime"; -export * from "./aurelia-i18n-loader"; -export { DfValueConverter, DfBindingBehavior } from "./df"; -export { NfValueConverter, NfBindingBehavior } from "./nf"; -export { RtValueConverter, RtBindingBehavior } from "./rt"; -export { TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute } from "./t"; -export function configure(frameworkConfig, cb) { - if (cb === undefined || typeof cb !== "function") { +import i18next from 'i18next'; +import { getLogger } from 'aurelia-logging'; +import { resolver } from 'aurelia-dependency-injection'; +import { customAttribute, HtmlBehaviorResource, ViewResources } from 'aurelia-templating'; +import { metadata } from 'aurelia-metadata'; +import { DOM, PLATFORM } from 'aurelia-pal'; +import { valueConverter } from 'aurelia-framework'; +import { BindingSignaler, SignalBindingBehavior } from 'aurelia-templating-resources'; +import { EventAggregator } from 'aurelia-event-aggregator'; +import { ValueConverter, bindingBehavior, valueConverter as valueConverter$1 } from 'aurelia-binding'; + +const I18N_EA_SIGNAL = "i18n:locale:changed"; +class I18N { + constructor(ea, signaler) { + this.ea = ea; + this.signaler = signaler; + this.globalVars = {}; + this.i18next = i18next; + this.Intl = PLATFORM.global.Intl; + } + static inject() { return [EventAggregator, BindingSignaler]; } + async setup(options) { + const defaultOptions = { + skipTranslationOnMissingKey: false, + compatibilityAPI: "v1", + compatibilityJSON: "v1", + lng: "en", + attributes: ["t", "i18n"], + fallbackLng: "en", + debug: false + }; + this.i18nextDeferred = new Promise((resolve, reject) => { + this.i18next = this.i18next.init(options || defaultOptions, (err) => { + if (err) { + reject(err); + } + // make sure attributes is an array in case a string was provided + if (this.i18next.options.attributes instanceof String) { + this.i18next.options.attributes = [this.i18next.options.attributes]; + } + resolve(this.i18next); + }); + }); + return this.i18nextDeferred; + } + i18nextReady() { + return this.i18nextDeferred; + } + setLocale(locale) { + return new Promise((resolve, reject) => { + const oldLocale = this.getLocale(); + this.i18next.changeLanguage(locale, (err, tr) => { + if (err) { + reject(err); + } + this.ea.publish(I18N_EA_SIGNAL, { oldValue: oldLocale, newValue: locale }); + this.signaler.signal("aurelia-translation-signal"); + resolve(tr); + }); + }); + } + getLocale() { + return this.i18next.language; + } + nf(options, locales) { + return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); + } + uf(numberLike, locale) { + const nf = this.nf({}, locale || this.getLocale()); + const comparer = nf.format(10000 / 3); + let thousandSeparator = comparer[1]; + const decimalSeparator = comparer[5]; + if (thousandSeparator === ".") { + thousandSeparator = "\\."; + } + // remove all thousand seperators + const result = numberLike.replace(new RegExp(thousandSeparator, "g"), "") + // remove non-numeric signs except -> , . + .replace(/[^\d.,-]/g, "") + // replace original decimalSeparator with english one + .replace(decimalSeparator, "."); + // return real number + return Number(result); + } + df(options, locales) { + return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); + } + tr(key, options) { + let fullOptions = this.globalVars; + if (options !== undefined) { + fullOptions = Object.assign(Object.assign({}, this.globalVars), options); + } + return this.i18next.t(key, fullOptions); + } + registerGlobalVariable(key, value) { + this.globalVars[key] = value; + } + unregisterGlobalVariable(key) { + delete this.globalVars[key]; + } + /** + * Scans an element for children that have a translation attribute and + * updates their innerHTML with the current translation values. + * + * If an image is encountered the translated value will be applied to the src attribute. + * + * @param el HTMLElement to search within + */ + updateTranslations(el) { + if (!el || !el.querySelectorAll) { + return; + } + let i; + let l; + // create a selector from the specified attributes to look for + // var selector = [].concat(this.i18next.options.attributes); + const attributes = this.i18next.options.attributes; + let selector = [].concat(attributes); + for (i = 0, l = selector.length; i < l; i++) { + selector[i] = "[" + selector[i] + "]"; + } + selector = selector.join(","); + // get the nodes + const nodes = el.querySelectorAll(selector); + for (i = 0, l = nodes.length; i < l; i++) { + const node = nodes[i]; + let keys; + let params; + // test every attribute and get the first one that has a value + for (let i2 = 0, l2 = attributes.length; i2 < l2; i2++) { + keys = node.getAttribute(attributes[i2]); + const pname = attributes[i2] + "-params"; + if (pname && node.au && node.au[pname]) { + params = node.au[pname].viewModel.value; + } + if (keys) { + break; + } + } + // skip if nothing was found + if (!keys) { + continue; + } + // split the keys into multiple keys separated by a ; + this.updateValue(node, keys, params); + } + } + updateValue(node, value, params) { + if (value === null || value === undefined) { + return; + } + const keys = value.toString().split(";"); + let i = keys.length; + while (i--) { + let key = keys[i]; + // remove the optional attribute + const re = /\[([a-z\-, ]*)\]/ig; + let m; + let attr = "text"; + // set default attribute to src if this is an image node + if (node.nodeName === "IMG") { + attr = "src"; + } + // check if a attribute was specified in the key + // tslint:disable-next-line:no-conditional-assignment + while ((m = re.exec(key)) !== null) { + if (m.index === re.lastIndex) { + re.lastIndex++; + } + if (m) { + key = key.replace(m[0], ""); + attr = m[1]; + } + } + const attrs = attr.split(","); + let j = attrs.length; + while (j--) { + attr = attrs[j].trim(); + if (!node._textContent) { + node._textContent = node.textContent; + } + if (!node._innerHTML) { + node._innerHTML = node.innerHTML; + } + // convert to camelCase + // tslint:disable-next-line:only-arrow-functions + const attrCC = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); + const reservedNames = ["prepend", "append", "text", "html"]; + const i18nLogger = getLogger("i18n"); + if (reservedNames.indexOf(attr) > -1 && + node.au && + node.au.controller && + node.au.controller.viewModel && + attrCC in node.au.controller.viewModel) { + i18nLogger.warn(`Aurelia I18N reserved attribute name\n + [${reservedNames.join(", ")}]\n + Your custom element has a bindable named ${attr} which is a reserved word.\n + If you'd like Aurelia I18N to translate your bindable instead, please consider giving it another name.`); + } + if (this.i18next.options.skipTranslationOnMissingKey && + this.tr(key, params) === key) { + i18nLogger.warn(`Couldn't find translation for key: ${key}`); + return; + } + // handle various attributes + // anything other than text,prepend,append or html will be added as an attribute on the element. + switch (attr) { + case "text": + const newChild = DOM.createTextNode(this.tr(key, params)); + if (node._newChild && node._newChild.parentNode === node) { + node.removeChild(node._newChild); + } + node._newChild = newChild; + while (node.firstChild) { + node.removeChild(node.firstChild); + } + node.appendChild(node._newChild); + break; + case "prepend": + const prependParser = DOM.createElement("div"); + prependParser.innerHTML = this.tr(key, params); + for (let ni = node.childNodes.length - 1; ni >= 0; ni--) { + if (node.childNodes[ni]._prepended) { + node.removeChild(node.childNodes[ni]); + } + } + for (let pi = prependParser.childNodes.length - 1; pi >= 0; pi--) { + prependParser.childNodes[pi]._prepended = true; + if (node.firstChild) { + node.insertBefore(prependParser.childNodes[pi], node.firstChild); + } + else { + node.appendChild(prependParser.childNodes[pi]); + } + } + break; + case "append": + const appendParser = DOM.createElement("div"); + appendParser.innerHTML = this.tr(key, params); + for (let ni = node.childNodes.length - 1; ni >= 0; ni--) { + if (node.childNodes[ni]._appended) { + node.removeChild(node.childNodes[ni]); + } + } + while (appendParser.firstChild) { + appendParser.firstChild._appended = true; + node.appendChild(appendParser.firstChild); + } + break; + case "html": + node.innerHTML = this.tr(key, params); + break; + default: // normal html attribute + if (node.au && + node.au.controller && + node.au.controller.viewModel && + attrCC in node.au.controller.viewModel) { + node.au.controller.viewModel[attrCC] = this.tr(key, params); + } + else { + node.setAttribute(attr, this.tr(key, params)); + } + break; + } + } + } + } +} + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +let TBindingBehavior = class TBindingBehavior { + constructor(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + static inject() { return [SignalBindingBehavior]; } + bind(binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the TValueConverter. + // pass through any args to the binding behavior to the TValueConverter + const sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + const expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "t", sourceExpression.args, [expression, ...sourceExpression.args]); + } + unbind(binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + } +}; +TBindingBehavior = __decorate([ + bindingBehavior("t") +], TBindingBehavior); + +var LazyOptional_1; +// tslint:disable-next-line:only-arrow-functions +const isInteger = Number.isInteger || function (value) { + return typeof value === "number" && + isFinite(value) && + Math.floor(value) === value; +}; +let LazyOptional = LazyOptional_1 = class LazyOptional { + constructor(key) { + this.key = key; + } + static of(key) { + return new LazyOptional_1(key); + } + get(container) { + return () => { + if (container.hasResolver(this.key, false)) { + return container.get(this.key); + } + return null; + }; + } +}; +LazyOptional = LazyOptional_1 = __decorate([ + resolver() +], LazyOptional); + +var TParamsCustomAttribute_1; +let TParamsCustomAttribute = TParamsCustomAttribute_1 = class TParamsCustomAttribute { + constructor(element) { + this.element = element; + } + static inject() { + return [DOM.Element]; + } + static configureAliases(aliases) { + const r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TParamsCustomAttribute_1); + r.aliases = aliases; + } + valueChanged() { } +}; +TParamsCustomAttribute = TParamsCustomAttribute_1 = __decorate([ + customAttribute("t-params") +], TParamsCustomAttribute); + +var TCustomAttribute_1; +let TCustomAttribute = TCustomAttribute_1 = class TCustomAttribute { + constructor(element, service, ea, p) { + this.element = element; + this.service = service; + this.ea = ea; + this.lazyParams = p; + } + static inject() { + return [DOM.Element, I18N, EventAggregator, LazyOptional.of(TParamsCustomAttribute)]; + } + static configureAliases(aliases) { + const r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TCustomAttribute_1); + r.aliases = aliases; + } + bind() { + this.params = this.lazyParams(); + if (this.params) { + this.params.valueChanged = (newParams, oldParams) => { + this.paramsChanged(this.value, newParams, oldParams); + }; + } + const p = this.params !== null ? this.params.value : undefined; + this.subscription = this.ea.subscribe(I18N_EA_SIGNAL, () => { + this.service.updateValue(this.element, this.value, this.params !== null ? this.params.value : undefined); + }); + this.service.updateValue(this.element, this.value, p); + } + paramsChanged(newValue, newParams) { + this.service.updateValue(this.element, newValue, newParams); + } + valueChanged(newValue) { + const p = this.params !== null ? this.params.value : undefined; + this.service.updateValue(this.element, newValue, p); + } + unbind() { + // If unbind is called before timeout for subscription is triggered, subscription will be undefined + if (this.subscription) { + this.subscription.dispose(); + } + } +}; +TCustomAttribute = TCustomAttribute_1 = __decorate([ + customAttribute("t") +], TCustomAttribute); + +let TValueConverter = class TValueConverter { + constructor(service) { + this.service = service; + } + static inject() { return [I18N]; } + toView(value, options) { + return this.service.tr(value, options); + } +}; +TValueConverter = __decorate([ + valueConverter("t") +], TValueConverter); + +let NfBindingBehavior = class NfBindingBehavior { + constructor(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + static inject() { return [SignalBindingBehavior]; } + bind(binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the NfValueConverter. + // pass through any args to the binding behavior to the NfValueConverter + const sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + const expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "nf", sourceExpression.args, [expression, ...sourceExpression.args]); + } + unbind(binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + } +}; +NfBindingBehavior = __decorate([ + bindingBehavior("nf") +], NfBindingBehavior); + +let NfValueConverter = class NfValueConverter { + constructor(service) { + this.service = service; + } + static inject() { return [I18N]; } + toView(value, nfOrOptions, locale) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (nfOrOptions && (nfOrOptions instanceof Intl.NumberFormat && typeof nfOrOptions.format === "function")) { + return nfOrOptions.format(value); + } + const nf = this.service.nf(nfOrOptions, locale || this.service.getLocale()); + return nf.format(value); + } +}; +NfValueConverter = __decorate([ + valueConverter$1("nf") +], NfValueConverter); + +let DfBindingBehavior = class DfBindingBehavior { + constructor(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + static inject() { return [SignalBindingBehavior]; } + bind(binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the DfValueConverter. + // pass through any args to the binding behavior to the DfValueConverter + const sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + const expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "df", sourceExpression.args, [expression, ...sourceExpression.args]); + } + unbind(binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + } +}; +DfBindingBehavior = __decorate([ + bindingBehavior("df") +], DfBindingBehavior); + +let DfValueConverter = class DfValueConverter { + constructor(service) { + this.service = service; + } + static inject() { return [I18N]; } + toView(value, dfOrOptions, locale) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (typeof value === "string" && isNaN(value) && !isInteger(value)) { + value = new Date(value); + } + if (dfOrOptions && (dfOrOptions instanceof Intl.DateTimeFormat && typeof dfOrOptions.format === "function")) { + return dfOrOptions.format(value); + } + const df = this.service.df(dfOrOptions, locale || this.service.getLocale()); + return df.format(value); + } +}; +DfValueConverter = __decorate([ + valueConverter$1("df") +], DfValueConverter); + +let RtBindingBehavior = class RtBindingBehavior { + constructor(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + static inject() { return [SignalBindingBehavior]; } + bind(binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal", "aurelia-relativetime-signal"); + // rewrite the expression to use the RtValueConverter. + // pass through any args to the binding behavior to the RtValueConverter + const sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + const expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "rt", sourceExpression.args, [expression, ...sourceExpression.args]); + } + unbind(binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + } +}; +RtBindingBehavior = __decorate([ + bindingBehavior("rt") +], RtBindingBehavior); + +const translations = { + ar: { + translation: { + now: 'الآن', + second_ago: 'منذ __count__ ثانية', + second_ago_plural: 'منذ __count__ ثواني', + second_in: 'في __count__ ثانية', + second_in_plural: 'في __count__ ثواني', + minute_ago: 'منذ __count__ دقيقة', + minute_ago_plural: 'منذ __count__ دقائق', + minute_in: 'في __count__ دقيقة', + minute_in_plural: 'في __count__ دقائق', + hour_ago: 'منذ __count__ ساعة', + hour_ago_plural: 'منذ __count__ ساعات', + hour_in: 'في __count__ ساعة', + hour_in_plural: 'في __count__ ساعات', + day_ago: 'منذ __count__ يوم', + day_ago_plural: 'منذ __count__ أيام', + day_in: 'في __count__ يوم', + day_in_plural: 'في __count__ أيام', + month_ago: 'منذ __count__ شهر', + month_ago_plural: 'منذ __count__ أشهر', + month_in: 'في __count__ شهر', + month_in_plural: 'في __count__ أشهر', + year_ago: 'منذ __count__ سنة', + year_ago_plural: 'منذ __count__ سنوات', + year_in: 'في __count__ سنة', + year_in_plural: 'في __count__ سنوات' + } + }, + da: { + translation: { + now: 'lige nu', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'i __count__ sekund', + second_in_plural: 'i __count__ sekunder', + minute_ago: '__count__ minut siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'i __count__ minut', + minute_in_plural: 'i __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'i __count__ time', + hour_in_plural: 'i __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dage siden', + day_in: 'i __count__ dag', + day_in_plural: 'i __count__ dage', + month_ago: '__count__ måned siden', + month_ago_plural: '__count__ måneder siden', + month_in: 'i __count__ måned', + month_in_plural: 'i __count__ måneder', + year_ago: '__count__ år siden', + year_ago_plural: '__count__ år siden', + year_in: 'i __count__ år', + year_in_plural: 'i __count__ år' + } + }, + de: { + translation: { + now: 'jetzt gerade', + second_ago: 'vor __count__ Sekunde', + second_ago_plural: 'vor __count__ Sekunden', + second_in: 'in __count__ Sekunde', + second_in_plural: 'in __count__ Sekunden', + minute_ago: 'vor __count__ Minute', + minute_ago_plural: 'vor __count__ Minuten', + minute_in: 'in __count__ Minute', + minute_in_plural: 'in __count__ Minuten', + hour_ago: 'vor __count__ Stunde', + hour_ago_plural: 'vor __count__ Stunden', + hour_in: 'in __count__ Stunde', + hour_in_plural: 'in __count__ Stunden', + day_ago: 'vor __count__ Tag', + day_ago_plural: 'vor __count__ Tagen', + day_in: 'in __count__ Tag', + day_in_plural: 'in __count__ Tagen', + month_ago: 'vor __count__ Monat', + month_ago_plural: 'vor __count__ Monaten', + month_in: 'in __count__ Monat', + month_in_plural: 'in __count__ Monaten', + year_ago: 'vor __count__ Jahr', + year_ago_plural: 'vor __count__ Jahren', + year_in: 'in __count__ Jahr', + year_in_plural: 'in __count__ Jahren' + } + }, + en: { + translation: { + now: 'just now', + second_ago: '__count__ second ago', + second_ago_plural: '__count__ seconds ago', + second_in: 'in __count__ second', + second_in_plural: 'in __count__ seconds', + minute_ago: '__count__ minute ago', + minute_ago_plural: '__count__ minutes ago', + minute_in: 'in __count__ minute', + minute_in_plural: 'in __count__ minutes', + hour_ago: '__count__ hour ago', + hour_ago_plural: '__count__ hours ago', + hour_in: 'in __count__ hour', + hour_in_plural: 'in __count__ hours', + day_ago: '__count__ day ago', + day_ago_plural: '__count__ days ago', + day_in: 'in __count__ day', + day_in_plural: 'in __count__ days', + month_ago: '__count__ month ago', + month_ago_plural: '__count__ months ago', + month_in: 'in __count__ month', + month_in_plural: 'in __count__ months', + year_ago: '__count__ year ago', + year_ago_plural: '__count__ years ago', + year_in: 'in __count__ year', + year_in_plural: 'in __count__ years' + } + }, + es: { + translation: { + now: 'ahora mismo', + second_ago: 'hace __count__ segundo', + second_ago_plural: 'hace __count__ segundos', + second_in: 'en __count__ segundo', + second_in_plural: 'en __count__ segundos', + minute_ago: 'hace __count__ minuto', + minute_ago_plural: 'hace __count__ minutos', + minute_in: 'en __count__ minuto', + minute_in_plural: 'en __count__ minutos', + hour_ago: 'hace __count__ hora', + hour_ago_plural: 'hace __count__ horas', + hour_in: 'en __count__ hora', + hour_in_plural: 'en __count__ horas', + day_ago: 'hace __count__ día', + day_ago_plural: 'hace __count__ días', + day_in: 'en __count__ día', + day_in_plural: 'en __count__ días', + month_ago: 'hace __count__ mes', + month_ago_plural: 'hace __count__ meses', + month_in: 'en __count__ mes', + month_in_plural: 'en __count__ meses', + year_ago: 'hace __count__ año', + year_ago_plural: 'hace __count__ años', + year_in: 'en __count__ año', + year_in_plural: 'en __count__ años' + } + }, + fi: { + translation: { + now: 'Nyt', + second_ago: '__count__ sekuntti sitten', + second_ago_plural: '__count__ sekunttia sitten', + second_in: ' __count__ sekunnin kuluttua', + second_in_plural: ' __count__ sekunttien kuluttua', + minute_ago: '__count__ minuutti sitten', + minute_ago_plural: '__count__ minuuttia sitten', + minute_in: ' __count__ minuutin kuluttua', + minute_in_plural: ' __count__ minuuttien kuluttua', + hour_ago: '__count__ tunti sitten', + hour_ago_plural: '__count__ tuntia sitten', + hour_in: ' __count__ tunnin kuluttua', + hour_in_plural: ' __count__ tunnin kuluttua', + day_ago: '__count__ päivä sitten', + day_ago_plural: '__count__ päiviä sitten', + day_in: ' __count__ päivän kuluttua', + day_in_plural: '__count__ päivien kuluttua', + month_ago: '__count__ kuukausi sitten', + month_ago_plural: '__count__ kuukausia sitten', + month_in: ' __count__ kuukauden kuluttua', + month_in_plural: ' __count__ kuukausien kuluttua', + year_ago: '__count__ vuosi sitten', + year_ago_plural: '__count__ vuosia sitten', + year_in: ' __count__ vuoden kuluttua', + year_in_plural: ' __count__ vuosien kuluttua' + } + }, + fr: { + translation: { + now: 'maintenant', + second_ago: 'il y a __count__ seconde', + second_ago_plural: 'il y a __count__ secondes', + second_in: 'dans __count__ seconde', + second_in_plural: 'dans __count__ secondes', + minute_ago: 'il y a __count__ minute', + minute_ago_plural: 'il y a __count__ minutes', + minute_in: 'dans __count__ minute', + minute_in_plural: 'dans __count__ minutes', + hour_ago: 'il y a __count__ heure', + hour_ago_plural: 'il y a __count__ heures', + hour_in: 'dans __count__ heure', + hour_in_plural: 'dans __count__ heures', + day_ago: 'il y a __count__ jour', + day_ago_plural: 'il y a __count__ jours', + day_in: 'dans __count__ jour', + day_in_plural: 'dans __count__ jours', + month_ago: 'il y a __count__ mois', + month_ago_plural: 'il y a __count__ mois', + month_in: 'dans __count__ mois', + month_in_plural: 'dans __count__ mois', + year_ago: 'il y a __count__ an', + year_ago_plural: 'il y a __count__ ans', + year_in: 'dans __count__ an', + year_in_plural: 'dans __count__ ans' + } + }, + it: { + translation: { + now: 'adesso', + second_ago: '__count__ secondo fa', + second_ago_plural: '__count__ secondi fa', + second_in: 'in __count__ secondo', + second_in_plural: 'in __count__ secondi', + minute_ago: '__count__ minuto fa', + minute_ago_plural: '__count__ minuti fa', + minute_in: 'in __count__ minuto', + minute_in_plural: 'in __count__ minuti', + hour_ago: '__count__ ora fa', + hour_ago_plural: '__count__ ore fa', + hour_in: 'in __count__ ora', + hour_in_plural: 'in __count__ ore', + day_ago: '__count__ giorno fa', + day_ago_plural: '__count__ giorni fa', + day_in: 'in __count__ giorno', + day_in_plural: 'in __count__ giorni', + month_ago: '__count__ mese fa', + month_ago_plural: '__count__ mesi fa', + month_in: 'in __count__ mese', + month_in_plural: 'in __count__ mesi', + year_ago: '__count__ anno fa', + year_ago_plural: '__count__ anni fa', + year_in: 'in __count__ anno', + year_in_plural: 'in __count__ anni' + } + }, + ja: { + translation: { + now: 'たった今', + second_ago: '__count__ 秒前', + second_ago_plural: '__count__ 秒前', + second_in: 'あと __count__ 秒', + second_in_plural: 'あと __count__ 秒', + minute_ago: '__count__ 分前', + minute_ago_plural: '__count__ 分前', + minute_in: 'あと __count__ 分', + minute_in_plural: 'あと __count__ 分', + hour_ago: '__count__ 時間前', + hour_ago_plural: '__count__ 時間前', + hour_in: 'あと __count__ 時間', + hour_in_plural: 'あと __count__ 時間', + day_ago: '__count__ 日間前', + day_ago_plural: '__count__ 日間前', + day_in: 'あと __count__ 日間', + day_in_plural: 'あと __count__ 日間', + month_ago: '__count__ ヶ月前', + month_ago_plural: '__count__ ヶ月前', + month_in: 'あと __count__ ヶ月前', + month_in_plural: 'あと __count__ ヶ月前', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: 'あと __count__ 年', + year_in_plural: 'あと __count__ 年' + } + }, + nl: { + translation: { + now: 'zonet', + second_ago: '__count__ seconde geleden', + second_ago_plural: '__count__ seconden geleden', + second_in: 'in __count__ seconde', + second_in_plural: 'in __count__ seconden', + minute_ago: '__count__ minuut geleden', + minute_ago_plural: '__count__ minuten geleden', + minute_in: 'in __count__ minuut', + minute_in_plural: 'in __count__ minuten', + hour_ago: '__count__ uur geleden', + hour_ago_plural: '__count__ uren geleden', + hour_in: 'in __count__ uur', + hour_in_plural: 'in __count__ uren', + day_ago: '__count__ dag geleden', + day_ago_plural: '__count__ dagen geleden', + day_in: 'in __count__ dag', + day_in_plural: 'in __count__ dagen', + month_ago: '__count__ maand geleden', + month_ago_plural: '__count__ maanden geleden', + month_in: 'in __count__ maand', + month_in_plural: 'in __count__ maanden', + year_ago: '__count__ jaar geleden', + year_ago_plural: '__count__ jaren geleden', + year_in: 'in __count__ jaar', + year_in_plural: 'in __count__ jaren' + } + }, + nn: { + translation: { + now: 'akkurat nå', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minutt siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'om __count__ minutt', + minute_in_plural: 'om __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'om __count__ time', + hour_in_plural: 'om __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dager siden', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dager', + month_ago: '__count__ en måned siden', + month_ago_plural: '__count__ flere måneder siden', + month_in: 'I løpet av en __count__ måned', + month_in_plural: 'I løpet av __count__ måneder', + year_ago: '__count__ et år siden', + year_ago_plural: '__count__ flere å siden', + year_in: 'I løpet av ett år __count__ år', + year_in_plural: 'på flere __count__ år' + } + }, + no: { + translation: { + now: 'akkurat nå', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minutt siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'om __count__ minutt', + minute_in_plural: 'om __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'om __count__ time', + hour_in_plural: 'om __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dager siden', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dager', + month_ago: '__count__ en måned siden', + month_ago_plural: '__count__ flere måneder siden', + month_in: 'I løpet av en __count__ måned', + month_in_plural: 'I løpet av __count__ måneder', + year_ago: '__count__ et år siden', + year_ago_plural: '__count__ flere å siden', + year_in: 'I løpet av ett år __count__ år', + year_in_plural: 'på flere __count__ år' + } + }, + pt: { + translation: { + now: 'neste exato momento', + second_ago: '__count__ segundo atrás', + second_ago_plural: '__count__ segundos atrás', + second_in: 'em __count__ segundo', + second_in_plural: 'em __count__ segundos', + minute_ago: '__count__ minuto atrás', + minute_ago_plural: '__count__ minutos atrás', + minute_in: 'em __count__ minuto', + minute_in_plural: 'em __count__ minutos', + hour_ago: '__count__ hora atrás', + hour_ago_plural: '__count__ horas atrás', + hour_in: 'em __count__ hora', + hour_in_plural: 'em __count__ horas', + day_ago: '__count__ dia atrás', + day_ago_plural: '__count__ dias atrás', + day_in: 'em __count__ dia', + day_in_plural: 'em __count__ dias', + month_ago: '__count__ mês atrás', + month_ago_plural: '__count__ meses atrás', + month_in: 'em __count__ mês', + month_in_plural: 'em __count__ meses', + year_ago: '__count__ ano atrás', + year_ago_plural: '__count__ anos atrás', + year_in: 'em __count__ ano', + year_in_plural: 'em __count__ anos' + } + }, + sv: { + translation: { + now: 'nu', + second_ago: '__count__ sekund sedan', + second_ago_plural: '__count__ sekunder sedan', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minut sedan', + minute_ago_plural: '__count__ minuter sedan', + minute_in: 'om __count__ minut', + minute_in_plural: 'om __count__ minuter', + hour_ago: '__count__ timme sedan', + hour_ago_plural: '__count__ timmar sedan', + hour_in: 'om __count__ timme', + hour_in_plural: 'om __count__ timmar', + day_ago: '__count__ dag sedan', + day_ago_plural: '__count__ dagar sedan', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dagar', + month_ago: '__count__ månad sedan', + month_ago_plural: '__count__ månader sedan', + month_in: 'om __count__ månad', + month_in_plural: 'om __count__ månader', + year_ago: '__count__ år sedan', + year_ago_plural: '__count__ år sedan', + year_in: 'om __count__ år', + year_in_plural: 'om __count__ år' + } + }, + th: { + translation: { + now: 'เมื่อกี้', + second_ago: '__count__ วินาที ที่ผ่านมา', + second_ago_plural: '__count__ วินาที ที่ผ่านมา', + second_in: 'อีก __count__ วินาที', + second_in_plural: 'อีก __count__ วินาที', + minute_ago: '__count__ นาที ที่ผ่านมา', + minute_ago_plural: '__count__ นาที ที่ผ่านมา', + minute_in: 'อีก __count__ นาที', + minute_in_plural: 'อีก __count__ นาที', + hour_ago: '__count__ ชั่วโมง ที่ผ่านมา', + hour_ago_plural: '__count__ ชั่วโมง ที่ผ่านมา', + hour_in: 'อีก __count__ ชั่วโมง', + hour_in_plural: 'อีก __count__ ชั่วโมง', + day_ago: '__count__ วัน ที่ผ่านมา', + day_ago_plural: '__count__ วัน ที่ผ่านมา', + day_in: 'อีก __count__ วัน', + day_in_plural: 'อีก __count__ วัน' + } + }, + zh: { + translation: { + now: '刚才', + second_ago: '__count__ 秒钟前', + second_ago_plural: '__count__ 秒钟前', + second_in: '__count__ 秒内', + second_in_plural: '__count__ 秒内', + minute_ago: '__count__ 分钟前', + minute_ago_plural: '__count__ 分钟前', + minute_in: '__count__ 分钟内', + minute_in_plural: '__count__ 分钟内', + hour_ago: '__count__ 小时前', + hour_ago_plural: '__count__ 小时前', + hour_in: '__count__ 小时内', + hour_in_plural: '__count__ 小时内', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天内', + day_in_plural: '__count__ 天内', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月内', + month_in_plural: '__count__ 月内', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年内', + year_in_plural: '__count__ 年内' + } + }, + 'zh-CN': { + translation: { + now: '刚才', + second_ago: '__count__ 秒钟前', + second_ago_plural: '__count__ 秒钟前', + second_in: '__count__ 秒内', + second_in_plural: '__count__ 秒内', + minute_ago: '__count__ 分钟前', + minute_ago_plural: '__count__ 分钟前', + minute_in: '__count__ 分钟内', + minute_in_plural: '__count__ 分钟内', + hour_ago: '__count__ 小时前', + hour_ago_plural: '__count__ 小时前', + hour_in: '__count__ 小时内', + hour_in_plural: '__count__ 小时内', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天内', + day_in_plural: '__count__ 天内', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月内', + month_in_plural: '__count__ 月内', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年内', + year_in_plural: '__count__ 年内' + } + }, + 'zh-HK': { + translation: { + now: '剛才', + second_ago: '__count__ 秒鐘前', + second_ago_plural: '__count__ 秒鐘前', + second_in: '__count__ 秒內', + second_in_plural: '__count__ 秒內', + minute_ago: '__count__ 分鐘前', + minute_ago_plural: '__count__ 分鐘前', + minute_in: '__count__ 分鐘內', + minute_in_plural: '__count__ 分鐘內', + hour_ago: '__count__ 小時前', + hour_ago_plural: '__count__ 小時前', + hour_in: '__count__ 小時內', + hour_in_plural: '__count__ 小時內', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天內', + day_in_plural: '__count__ 天內', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月內', + month_in_plural: '__count__ 月內', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年內', + year_in_plural: '__count__ 年內' + } + }, + 'zh-TW': { + translation: { + now: '剛才', + second_ago: '__count__ 秒鐘前', + second_ago_plural: '__count__ 秒鐘前', + second_in: '__count__ 秒內', + second_in_plural: '__count__ 秒內', + minute_ago: '__count__ 分鐘前', + minute_ago_plural: '__count__ 分鐘前', + minute_in: '__count__ 分鐘內', + minute_in_plural: '__count__ 分鐘內', + hour_ago: '__count__ 小時前', + hour_ago_plural: '__count__ 小時前', + hour_in: '__count__ 小時內', + hour_in_plural: '__count__ 小時內', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天內', + day_in_plural: '__count__ 天內', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月內', + month_in_plural: '__count__ 月內', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年內', + year_in_plural: '__count__ 年內' + } + } +}; +// tslint:enable + +class RelativeTime { + constructor(service, ea) { + this.service = service; + this.ea = ea; + this.service.i18nextReady().then(() => { + this.setup(); + }); + this.ea.subscribe(I18N_EA_SIGNAL, (locales) => { + this.setup(locales); + }); + } + static inject() { return [I18N, EventAggregator]; } + setup(locales) { + const trans = translations; + const fallbackLng = this.service.i18next.fallbackLng; + let alternateFb = fallbackLng || this.service.i18next.options.fallbackLng; + if (Array.isArray(alternateFb) && alternateFb.length > 0) { + alternateFb = alternateFb[0]; + } + const key = ((locales && locales.newValue) + ? locales.newValue + : this.service.getLocale()) || alternateFb; + let index = 0; + // tslint:disable-next-line:no-conditional-assignment + if ((index = key.indexOf("-")) >= 0) { + const baseLocale = key.substring(0, index); + if (trans[baseLocale]) { + this.addTranslationResource(baseLocale, trans[baseLocale].translation); + } + } + if (trans[key]) { + this.addTranslationResource(key, trans[key].translation); + } + if (trans[fallbackLng]) { + this.addTranslationResource(key, trans[fallbackLng].translation); + } + } + addTranslationResource(key, translation) { + const options = this.service.i18next.options; + if (options.interpolation && (options.interpolation.prefix !== "__" || options.interpolation.suffix !== "__")) { + // tslint:disable-next-line:forin + for (const subkey in translation) { + translation[subkey] = translation[subkey] + .replace("__count__", `${options.interpolation.prefix || "{{"}count${options.interpolation.suffix || "}}"}`); + } + } + this.service.i18next.addResources(key, options.defaultNS || "translation", translation); + } + getRelativeTime(time) { + const now = new Date(); + const diff = now.getTime() - time.getTime(); + let timeDiff = this.getTimeDiffDescription(diff, "year", 31104000000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "month", 2592000000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "day", 86400000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "hour", 3600000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "minute", 60000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "second", 1000); + if (!timeDiff) { + timeDiff = this.service.tr("now"); + } + } + } + } + } + } + return timeDiff; + } + getTimeDiffDescription(diff, unit, timeDivisor) { + const unitAmount = parseInt((diff / timeDivisor).toFixed(0), 10); + if (unitAmount > 0) { + return this.service.tr(unit, { count: unitAmount, context: "ago" }); + } + else if (unitAmount < 0) { + const abs = Math.abs(unitAmount); + return this.service.tr(unit, { count: abs, context: "in" }); + } + return null; + } +} + +let RtValueConverter = class RtValueConverter { + constructor(service) { + this.service = service; + } + static inject() { return [RelativeTime]; } + toView(value) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (typeof value === "string" && isNaN(value) && !Number.isInteger(value)) { + value = new Date(value); + } + return this.service.getRelativeTime(value); + } +}; +RtValueConverter = __decorate([ + valueConverter$1("rt") +], RtValueConverter); + +class Backend { + constructor(services, options = {}) { + this.services = services; + this.options = options; + this.type = "backend"; + this.init(services, options); + } + static with(loader) { + this.loader = loader; + return this; + } + init(services, options = {}) { + this.services = services; + this.options = Object.assign({}, { + loadPath: "/locales/{{lng}}/{{ns}}.json", + addPath: "locales/add/{{lng}}/{{ns}}", + allowMultiLoading: false, + parse: JSON.parse + }, options); + } + readMulti(languages, namespaces, callback) { + let loadPath = this.options.loadPath; + if (typeof this.options.loadPath === "function") { + loadPath = this.options.loadPath(languages, namespaces); + } + const url = this.services + .interpolator + .interpolate(loadPath, { lng: languages.join("+"), ns: namespaces.join("+") }); + this.loadUrl(url, callback); + } + read(language, namespace, callback) { + let loadPath = this.options.loadPath; + if (typeof this.options.loadPath === "function") { + loadPath = this.options.loadPath([language], [namespace]); + } + const url = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }); + this.loadUrl(url, callback); + } + async loadUrl(url, callback) { + try { + const response = await Backend.loader.loadText(url); + let ret; + let err; + try { + ret = (response instanceof Object) ? response : this.options.parse(response, url); + } + catch (e) { + err = "failed parsing " + url + " to json"; + } + if (err) { + return callback(err, false); + } + callback(null, ret); + } + catch (_a) { + callback("failed loading " + url, false /* no retry */); + } + } + // tslint:disable-next-line:variable-name + create(_languages, _namespace, _key, _fallbackValue) { + // not supported + } +} +Backend.type = "backend"; + +function configure(frameworkConfig, cb) { + if (typeof cb !== "function") { const errorMsg = "You need to provide a callback method to properly configure the library"; throw errorMsg; } + const instance = frameworkConfig.container.get(I18N); + const ret = cb(instance); frameworkConfig.globalResources([ - PLATFORM.moduleName("./t/t-value-converter"), - PLATFORM.moduleName("./t/t-custom-attribute"), - PLATFORM.moduleName("./t/t-params-custom-attribute"), - PLATFORM.moduleName("./t/t-binding-behavior") - ]); - frameworkConfig.globalResources([ - PLATFORM.moduleName("./nf/nf-value-converter"), - PLATFORM.moduleName("./nf/nf-binding-behavior") - ]); - frameworkConfig.globalResources([ - PLATFORM.moduleName("./df/df-value-converter"), - PLATFORM.moduleName("./df/df-binding-behavior") - ]); - frameworkConfig.globalResources([ - PLATFORM.moduleName("./rt/rt-value-converter"), - PLATFORM.moduleName("./rt/rt-binding-behavior") + TValueConverter, + TBindingBehavior, + TCustomAttribute, + TParamsCustomAttribute, + NfValueConverter, + NfBindingBehavior, + DfValueConverter, + DfBindingBehavior, + RtValueConverter, + RtBindingBehavior ]); - const instance = new I18N(frameworkConfig.container.get(EventAggregator), frameworkConfig.container.get(BindingSignaler)); - frameworkConfig.container.registerInstance(I18N, instance); - const ret = cb(instance); frameworkConfig.postTask(() => { const resources = frameworkConfig.container.get(ViewResources); const htmlBehaviorResource = resources.getAttribute("t"); @@ -50,4 +1303,5 @@ export function configure(frameworkConfig, cb) { }); return ret; } -//# sourceMappingURL=aurelia-i18n.js.map \ No newline at end of file + +export { configure, DfValueConverter, DfBindingBehavior, NfValueConverter, NfBindingBehavior, RtValueConverter, RtBindingBehavior, TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute, I18N_EA_SIGNAL, I18N, RelativeTime, Backend }; diff --git a/dist/es2017/aurelia-i18n.js.map b/dist/es2017/aurelia-i18n.js.map deleted file mode 100644 index 13ec30f7..00000000 --- a/dist/es2017/aurelia-i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aurelia-i18n.js","sourceRoot":"","sources":["../../src/aurelia-i18n.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EACL,IAAI,EAEL,MAAM,QAAQ,CAAC;AAEhB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,MAAM,CAAC;AACd,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,MAAM,CAAC;AACd,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,MAAM,CAAC;AACd,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,KAAK,CAAC;AAEb,MAAM,UAAU,SAAS,CACvB,eAAuC,EACvC,EAA8C;IAE9C,IAAI,EAAE,KAAK,SAAS,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE;QAChD,MAAM,QAAQ,GAAG,yEAAyE,CAAC;QAC3F,MAAM,QAAQ,CAAC;KAChB;IAED,eAAe,CAAC,eAAe,CAAC;QAC9B,QAAQ,CAAC,UAAU,CAAC,uBAAuB,CAAC;QAC5C,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;QAC7C,QAAQ,CAAC,UAAU,CAAC,+BAA+B,CAAC;QACpD,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;KAC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,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,CAAC,CAAC,CAAC;QAC7F,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,GAAG,SAAS,EAAE,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;IAChH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC"} \ No newline at end of file diff --git a/dist/es2017/defaultTranslations/relative.time.js b/dist/es2017/defaultTranslations/relative.time.js deleted file mode 100644 index 7cb81e13..00000000 --- a/dist/es2017/defaultTranslations/relative.time.js +++ /dev/null @@ -1,494 +0,0 @@ -export const translations = { - ar: { - translation: { - "now": "الآن", - "second_ago": "منذ __count__ ثانية", - "second_ago_plural": "منذ __count__ ثواني", - "second_in": "في __count__ ثانية", - "second_in_plural": "في __count__ ثواني", - "minute_ago": "منذ __count__ دقيقة", - "minute_ago_plural": "منذ __count__ دقائق", - "minute_in": "في __count__ دقيقة", - "minute_in_plural": "في __count__ دقائق", - "hour_ago": "منذ __count__ ساعة", - "hour_ago_plural": "منذ __count__ ساعات", - "hour_in": "في __count__ ساعة", - "hour_in_plural": "في __count__ ساعات", - "day_ago": "منذ __count__ يوم", - "day_ago_plural": "منذ __count__ أيام", - "day_in": "في __count__ يوم", - "day_in_plural": "في __count__ أيام", - "month_ago": "منذ __count__ شهر", - "month_ago_plural": "منذ __count__ أشهر", - "month_in": "في __count__ شهر", - "month_in_plural": "في __count__ أشهر", - "year_ago": "منذ __count__ سنة", - "year_ago_plural": "منذ __count__ سنوات", - "year_in": "في __count__ سنة", - "year_in_plural": "في __count__ سنوات" - } - }, - en: { - translation: { - "now": "just now", - "second_ago": "__count__ second ago", - "second_ago_plural": "__count__ seconds ago", - "second_in": "in __count__ second", - "second_in_plural": "in __count__ seconds", - "minute_ago": "__count__ minute ago", - "minute_ago_plural": "__count__ minutes ago", - "minute_in": "in __count__ minute", - "minute_in_plural": "in __count__ minutes", - "hour_ago": "__count__ hour ago", - "hour_ago_plural": "__count__ hours ago", - "hour_in": "in __count__ hour", - "hour_in_plural": "in __count__ hours", - "day_ago": "__count__ day ago", - "day_ago_plural": "__count__ days ago", - "day_in": "in __count__ day", - "day_in_plural": "in __count__ days", - "month_ago": "__count__ month ago", - "month_ago_plural": "__count__ months ago", - "month_in": "in __count__ month", - "month_in_plural": "in __count__ months", - "year_ago": "__count__ year ago", - "year_ago_plural": "__count__ years ago", - "year_in": "in __count__ year", - "year_in_plural": "in __count__ years" - } - }, - es: { - translation: { - "now": "ahora mismo", - "second_ago": "hace __count__ segundo", - "second_ago_plural": "hace __count__ segundos", - "second_in": "en __count__ segundo", - "second_in_plural": "en __count__ segundos", - "minute_ago": "hace __count__ minuto", - "minute_ago_plural": "hace __count__ minutos", - "minute_in": "en __count__ minuto", - "minute_in_plural": "en __count__ minutos", - "hour_ago": "hace __count__ hora", - "hour_ago_plural": "hace __count__ horas", - "hour_in": "en __count__ hora", - "hour_in_plural": "en __count__ horas", - "day_ago": "hace __count__ día", - "day_ago_plural": "hace __count__ días", - "day_in": "en __count__ día", - "day_in_plural": "en __count__ días", - "month_ago": "hace __count__ mes", - "month_ago_plural": "hace __count__ meses", - "month_in": "en __count__ mes", - "month_in_plural": "en __count__ meses", - "year_ago": "hace __count__ año", - "year_ago_plural": "hace __count__ años", - "year_in": "en __count__ año", - "year_in_plural": "en __count__ años" - } - }, - it: { - translation: { - "now": "adesso", - "second_ago": "__count__ secondo fa", - "second_ago_plural": "__count__ secondi fa", - "second_in": "in __count__ secondo", - "second_in_plural": "in __count__ secondi", - "minute_ago": "__count__ minuto fa", - "minute_ago_plural": "__count__ minuti fa", - "minute_in": "in __count__ minuto", - "minute_in_plural": "in __count__ minuti", - "hour_ago": "__count__ ora fa", - "hour_ago_plural": "__count__ ore fa", - "hour_in": "in __count__ ora", - "hour_in_plural": "in __count__ ore", - "day_ago": "__count__ giorno fa", - "day_ago_plural": "__count__ giorni fa", - "day_in": "in __count__ giorno", - "day_in_plural": "in __count__ giorni", - "month_ago": "__count__ mese fa", - "month_ago_plural": "__count__ mesi fa", - "month_in": "in __count__ mese", - "month_in_plural": "in __count__ mesi", - "year_ago": "__count__ anno fa", - "year_ago_plural": "__count__ anni fa", - "year_in": "in __count__ anno", - "year_in_plural": "in __count__ anni" - } - }, - de: { - translation: { - "now": "jetzt gerade", - "second_ago": "vor __count__ Sekunde", - "second_ago_plural": "vor __count__ Sekunden", - "second_in": "in __count__ Sekunde", - "second_in_plural": "in __count__ Sekunden", - "minute_ago": "vor __count__ Minute", - "minute_ago_plural": "vor __count__ Minuten", - "minute_in": "in __count__ Minute", - "minute_in_plural": "in __count__ Minuten", - "hour_ago": "vor __count__ Stunde", - "hour_ago_plural": "vor __count__ Stunden", - "hour_in": "in __count__ Stunde", - "hour_in_plural": "in __count__ Stunden", - "day_ago": "vor __count__ Tag", - "day_ago_plural": "vor __count__ Tagen", - "day_in": "in __count__ Tag", - "day_in_plural": "in __count__ Tagen", - "month_ago": "vor __count__ Monat", - "month_ago_plural": "vor __count__ Monaten", - "month_in": "in __count__ Monat", - "month_in_plural": "in __count__ Monaten", - "year_ago": "vor __count__ Jahr", - "year_ago_plural": "vor __count__ Jahren", - "year_in": "in __count__ Jahr", - "year_in_plural": "in __count__ Jahren" - } - }, - nl: { - translation: { - "now": "zonet", - "second_ago": "__count__ seconde geleden", - "second_ago_plural": "__count__ seconden geleden", - "second_in": "in __count__ seconde", - "second_in_plural": "in __count__ seconden", - "minute_ago": "__count__ minuut geleden", - "minute_ago_plural": "__count__ minuten geleden", - "minute_in": "in __count__ minuut", - "minute_in_plural": "in __count__ minuten", - "hour_ago": "__count__ uur geleden", - "hour_ago_plural": "__count__ uren geleden", - "hour_in": "in __count__ uur", - "hour_in_plural": "in __count__ uren", - "day_ago": "__count__ dag geleden", - "day_ago_plural": "__count__ dagen geleden", - "day_in": "in __count__ dag", - "day_in_plural": "in __count__ dagen", - "month_ago": "__count__ maand geleden", - "month_ago_plural": "__count__ maanden geleden", - "month_in": "in __count__ maand", - "month_in_plural": "in __count__ maanden", - "year_ago": "__count__ jaar geleden", - "year_ago_plural": "__count__ jaren geleden", - "year_in": "in __count__ jaar", - "year_in_plural": "in __count__ jaren" - } - }, - fr: { - translation: { - "now": "maintenant", - "second_ago": "il y a __count__ seconde", - "second_ago_plural": "il y a __count__ secondes", - "second_in": "dans __count__ seconde", - "second_in_plural": "dans __count__ secondes", - "minute_ago": "il y a __count__ minute", - "minute_ago_plural": "il y a __count__ minutes", - "minute_in": "dans __count__ minute", - "minute_in_plural": "dans __count__ minutes", - "hour_ago": "il y a __count__ heure", - "hour_ago_plural": "il y a __count__ heures", - "hour_in": "dans __count__ heure", - "hour_in_plural": "dans __count__ heures", - "day_ago": "il y a __count__ jour", - "day_ago_plural": "il y a __count__ jours", - "day_in": "dans __count__ jour", - "day_in_plural": "dans __count__ jours", - "month_ago": "il y a __count__ mois", - "month_ago_plural": "il y a __count__ mois", - "month_in": "dans __count__ mois", - "month_in_plural": "dans __count__ mois", - "year_ago": "il y a __count__ an", - "year_ago_plural": "il y a __count__ ans", - "year_in": "dans __count__ an", - "year_in_plural": "dans __count__ ans" - } - }, - th: { - translation: { - "now": "เมื่อกี้", - "second_ago": "__count__ วินาที ที่ผ่านมา", - "second_ago_plural": "__count__ วินาที ที่ผ่านมา", - "second_in": "อีก __count__ วินาที", - "second_in_plural": "อีก __count__ วินาที", - "minute_ago": "__count__ นาที ที่ผ่านมา", - "minute_ago_plural": "__count__ นาที ที่ผ่านมา", - "minute_in": "อีก __count__ นาที", - "minute_in_plural": "อีก __count__ นาที", - "hour_ago": "__count__ ชั่วโมง ที่ผ่านมา", - "hour_ago_plural": "__count__ ชั่วโมง ที่ผ่านมา", - "hour_in": "อีก __count__ ชั่วโมง", - "hour_in_plural": "อีก __count__ ชั่วโมง", - "day_ago": "__count__ วัน ที่ผ่านมา", - "day_ago_plural": "__count__ วัน ที่ผ่านมา", - "day_in": "อีก __count__ วัน", - "day_in_plural": "อีก __count__ วัน" - } - }, - sv: { - translation: { - "now": "just nu", - "second_ago": "__count__ sekund sedan", - "second_ago_plural": "__count__ sekunder sedan", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minut sedan", - "minute_ago_plural": "__count__ minuter sedan", - "minute_in": "om __count__ minut", - "minute_in_plural": "om __count__ minuter", - "hour_ago": "__count__ timme sedan", - "hour_ago_plural": "__count__ timmar sedan", - "hour_in": "om __count__ timme", - "hour_in_plural": "om __count__ timmar", - "day_ago": "__count__ dag sedan", - "day_ago_plural": "__count__ dagar sedan", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dagar" - } - }, - da: { - translation: { - "now": "lige nu", - "second_ago": "__count__ sekunder siden", - "second_ago_plural": "__count__ sekunder siden", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minut siden", - "minute_ago_plural": "__count__ minutter siden", - "minute_in": "om __count__ minut", - "minute_in_plural": "om __count__ minutter", - "hour_ago": "__count__ time siden", - "hour_ago_plural": "__count__ timer siden", - "hour_in": "om __count__ time", - "hour_in_plural": "om __count__ timer", - "day_ago": "__count__ dag siden", - "day_ago_plural": "__count__ dage siden", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dage" - } - }, - no: { - translation: { - "now": "akkurat nå", - "second_ago": "__count__ sekund siden", - "second_ago_plural": "__count__ sekunder siden", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minutt siden", - "minute_ago_plural": "__count__ minutter siden", - "minute_in": "om __count__ minutt", - "minute_in_plural": "om __count__ minutter", - "hour_ago": "__count__ time siden", - "hour_ago_plural": "__count__ timer siden", - "hour_in": "om __count__ time", - "hour_in_plural": "om __count__ timer", - "day_ago": "__count__ dag siden", - "day_ago_plural": "__count__ dager siden", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dager" - } - }, - ja: { - translation: { - "now": "たった今", - "second_ago": "__count__ 秒前", - "second_ago_plural": "__count__ 秒前", - "second_in": "あと __count__ 秒", - "second_in_plural": "あと __count__ 秒", - "minute_ago": "__count__ 分前", - "minute_ago_plural": "__count__ 分前", - "minute_in": "あと __count__ 分", - "minute_in_plural": "あと __count__ 分", - "hour_ago": "__count__ 時間前", - "hour_ago_plural": "__count__ 時間前", - "hour_in": "あと __count__ 時間", - "hour_in_plural": "あと __count__ 時間", - "day_ago": "__count__ 日間前", - "day_ago_plural": "__count__ 日間前", - "day_in": "あと __count__ 日間", - "day_in_plural": "あと __count__ 日間", - "month_ago": "__count__ ヶ月前", - "month_ago_plural": "__count__ ヶ月前", - "month_in": "あと __count__ ヶ月前", - "month_in_plural": "あと __count__ ヶ月前", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "あと __count__ 年", - "year_in_plural": "あと __count__ 年" - } - }, - jp: { - translation: { - "now": "たった今", - "second_ago": "__count__ 秒前", - "second_ago_plural": "__count__ 秒前", - "second_in": "あと __count__ 秒", - "second_in_plural": "あと __count__ 秒", - "minute_ago": "__count__ 分前", - "minute_ago_plural": "__count__ 分前", - "minute_in": "あと __count__ 分", - "minute_in_plural": "あと __count__ 分", - "hour_ago": "__count__ 時間前", - "hour_ago_plural": "__count__ 時間前", - "hour_in": "あと __count__ 時間", - "hour_in_plural": "あと __count__ 時間", - "day_ago": "__count__ 日間前", - "day_ago_plural": "__count__ 日間前", - "day_in": "あと __count__ 日間", - "day_in_plural": "あと __count__ 日間", - "month_ago": "__count__ ヶ月前", - "month_ago_plural": "__count__ ヶ月前", - "month_in": "あと __count__ ヶ月前", - "month_in_plural": "あと __count__ ヶ月前", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "あと __count__ 年", - "year_in_plural": "あと __count__ 年" - } - }, - pt: { - translation: { - "now": "neste exato momento", - "second_ago": "__count__ segundo atrás", - "second_ago_plural": "__count__ segundos atrás", - "second_in": "em __count__ segundo", - "second_in_plural": "em __count__ segundos", - "minute_ago": "__count__ minuto atrás", - "minute_ago_plural": "__count__ minutos atrás", - "minute_in": "em __count__ minuto", - "minute_in_plural": "em __count__ minutos", - "hour_ago": "__count__ hora atrás", - "hour_ago_plural": "__count__ horas atrás", - "hour_in": "em __count__ hora", - "hour_in_plural": "em __count__ horas", - "day_ago": "__count__ dia atrás", - "day_ago_plural": "__count__ dias atrás", - "day_in": "em __count__ dia", - "day_in_plural": "em __count__ dias", - "month_ago": "__count__ mês atrás", - "month_ago_plural": "__count__ meses atrás", - "month_in": "em __count__ mês", - "month_in_plural": "em __count__ meses", - "year_ago": "__count__ ano atrás", - "year_ago_plural": "__count__ anos atrás", - "year_in": "em __count__ ano", - "year_in_plural": "em __count__ anos" - } - }, - zh: { - translation: { - "now": "刚才", - "second_ago": "__count__ 秒钟前", - "second_ago_plural": "__count__ 秒钟前", - "second_in": "__count__ 秒内", - "second_in_plural": "__count__ 秒内", - "minute_ago": "__count__ 分钟前", - "minute_ago_plural": "__count__ 分钟前", - "minute_in": "__count__ 分钟内", - "minute_in_plural": "__count__ 分钟内", - "hour_ago": "__count__ 小时前", - "hour_ago_plural": "__count__ 小时前", - "hour_in": "__count__ 小时内", - "hour_in_plural": "__count__ 小时内", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天内", - "day_in_plural": "__count__ 天内", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月内", - "month_in_plural": "__count__ 月内", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年内", - "year_in_plural": "__count__ 年内" - } - }, - "zh-CN": { - translation: { - "now": "刚才", - "second_ago": "__count__ 秒钟前", - "second_ago_plural": "__count__ 秒钟前", - "second_in": "__count__ 秒内", - "second_in_plural": "__count__ 秒内", - "minute_ago": "__count__ 分钟前", - "minute_ago_plural": "__count__ 分钟前", - "minute_in": "__count__ 分钟内", - "minute_in_plural": "__count__ 分钟内", - "hour_ago": "__count__ 小时前", - "hour_ago_plural": "__count__ 小时前", - "hour_in": "__count__ 小时内", - "hour_in_plural": "__count__ 小时内", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天内", - "day_in_plural": "__count__ 天内", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月内", - "month_in_plural": "__count__ 月内", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年内", - "year_in_plural": "__count__ 年内" - } - }, - "zh-HK": { - translation: { - "now": "剛才", - "second_ago": "__count__ 秒鐘前", - "second_ago_plural": "__count__ 秒鐘前", - "second_in": "__count__ 秒內", - "second_in_plural": "__count__ 秒內", - "minute_ago": "__count__ 分鐘前", - "minute_ago_plural": "__count__ 分鐘前", - "minute_in": "__count__ 分鐘內", - "minute_in_plural": "__count__ 分鐘內", - "hour_ago": "__count__ 小時前", - "hour_ago_plural": "__count__ 小時前", - "hour_in": "__count__ 小時內", - "hour_in_plural": "__count__ 小時內", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天內", - "day_in_plural": "__count__ 天內", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月內", - "month_in_plural": "__count__ 月內", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年內", - "year_in_plural": "__count__ 年內" - } - }, - "zh-TW": { - translation: { - "now": "剛才", - "second_ago": "__count__ 秒鐘前", - "second_ago_plural": "__count__ 秒鐘前", - "second_in": "__count__ 秒內", - "second_in_plural": "__count__ 秒內", - "minute_ago": "__count__ 分鐘前", - "minute_ago_plural": "__count__ 分鐘前", - "minute_in": "__count__ 分鐘內", - "minute_in_plural": "__count__ 分鐘內", - "hour_ago": "__count__ 小時前", - "hour_ago_plural": "__count__ 小時前", - "hour_in": "__count__ 小時內", - "hour_in_plural": "__count__ 小時內", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天內", - "day_in_plural": "__count__ 天內", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月內", - "month_in_plural": "__count__ 月內", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年內", - "year_in_plural": "__count__ 年內" - } - } -}; -// tslint:enable -//# sourceMappingURL=relative.time.js.map \ No newline at end of file diff --git a/dist/es2017/defaultTranslations/relative.time.js.map b/dist/es2017/defaultTranslations/relative.time.js.map deleted file mode 100644 index 55122f77..00000000 --- a/dist/es2017/defaultTranslations/relative.time.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"relative.time.js","sourceRoot":"","sources":["../../../src/defaultTranslations/relative.time.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,YAAY,GAAwB;IAC/C,EAAE,EAAE;QACF,WAAW,EAAE;YACX,KAAK,EAAE,MAAM;YACb,YAAY,EAAE,qBAAqB;YACnC,mBAAmB,EAAE,qBAAqB;YAC1C,WAAW,EAAE,oBAAoB;YACjC,kBAAkB,EAAE,oBAAoB;YACxC,YAAY,EAAE,qBAAqB;YACnC,mBAAmB,EAAE,qBAAqB;YAC1C,WAAW,EAAE,oBAAoB;YACjC,kBAAkB,EAAE,oBAAoB;YACxC,UAAU,EAAE,oBAAoB;YAChC,iBAAiB,EAAE,qBAAqB;YACxC,SAAS,EAAE,mBAAmB;YAC9B,gBAAgB,EAAE,oBAAoB;YACtC,SAAS,EAAE,mBAAmB;YAC9B,gBAAgB,EAAE,oBAAoB;YACtC,QAAQ,EAAE,kBAAkB;YAC5B,eAAe,EAAE,mBAAmB;YACpC,WAAW,EAAE,mBAAmB;YAChC,kBAAkB,EAAE,oBAAoB;YACxC,UAAU,EAAE,kBAAkB;YAC9B,iBAAiB,EAAE,mBAAmB;YACtC,UAAU,EAAE,mBAAmB;YAC/B,iBAAiB,E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AAU,EAAE,eAAe;YAC3B,iBAAiB,EAAE,eAAe;YAClC,SAAS,EAAE,eAAe;YAC1B,gBAAgB,EAAE,eAAe;YACjC,SAAS,EAAE,cAAc;YACzB,gBAAgB,EAAE,cAAc;YAChC,QAAQ,EAAE,cAAc;YACxB,eAAe,EAAE,cAAc;YAC/B,WAAW,EAAE,cAAc;YAC3B,kBAAkB,EAAE,cAAc;YAClC,UAAU,EAAE,cAAc;YAC1B,iBAAiB,EAAE,cAAc;YACjC,UAAU,EAAE,cAAc;YAC1B,iBAAiB,EAAE,cAAc;YACjC,SAAS,EAAE,cAAc;YACzB,gBAAgB,EAAE,cAAc;SACjC;KACF;CACF,CAAC;AACF,gBAAgB"} \ No newline at end of file diff --git a/dist/es2017/df/df-binding-behavior.js b/dist/es2017/df/df-binding-behavior.js deleted file mode 100644 index 23da230b..00000000 --- a/dist/es2017/df/df-binding-behavior.js +++ /dev/null @@ -1,27 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -import { ValueConverter } from "aurelia-binding"; -export class DfBindingBehavior { - constructor(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - static inject() { return [SignalBindingBehavior]; } - bind(binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the DfValueConverter. - // pass through any args to the binding behavior to the DfValueConverter - const sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - const expression = sourceExpression.expression; - sourceExpression.expression = new ValueConverter(expression, "df", sourceExpression.args, [expression, ...sourceExpression.args]); - } - unbind(binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - } -} -//# sourceMappingURL=df-binding-behavior.js.map \ No newline at end of file diff --git a/dist/es2017/df/df-binding-behavior.js.map b/dist/es2017/df/df-binding-behavior.js.map deleted file mode 100644 index 437521f6..00000000 --- a/dist/es2017/df/df-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"df-binding-behavior.js","sourceRoot":"","sources":["../../../src/df/df-binding-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,OAAO,iBAAiB;IAG5B,YAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAF9D,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAInD,IAAI,CAAC,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;QACxF,sDAAsD;QACtD,wEAAwE;QACxE,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,MAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,cAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAChF,CAAC;IACJ,CAAC;IACM,MAAM,CAAC,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;CACF"} \ No newline at end of file diff --git a/dist/es2017/df/df-value-converter.js b/dist/es2017/df/df-value-converter.js deleted file mode 100644 index 602d24e4..00000000 --- a/dist/es2017/df/df-value-converter.js +++ /dev/null @@ -1,24 +0,0 @@ -import { I18N } from "../i18n"; -import { isInteger } from "../utils"; -export class DfValueConverter { - constructor(service) { - this.service = service; - } - static inject() { return [I18N]; } - toView(value, dfOrOptions, locale) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (typeof value === "string" && isNaN(value) && !isInteger(value)) { - value = new Date(value); - } - if (dfOrOptions && (dfOrOptions instanceof Intl.DateTimeFormat && typeof dfOrOptions.format === "function")) { - return dfOrOptions.format(value); - } - const df = this.service.df(dfOrOptions, locale || this.service.getLocale()); - return df.format(value); - } -} -//# sourceMappingURL=df-value-converter.js.map \ No newline at end of file diff --git a/dist/es2017/df/df-value-converter.js.map b/dist/es2017/df/df-value-converter.js.map deleted file mode 100644 index 735f45cc..00000000 --- a/dist/es2017/df/df-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"df-value-converter.js","sourceRoot":"","sources":["../../../src/df/df-value-converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,OAAO,gBAAgB;IAG3B,YAAoB,OAAa;QAAb,YAAO,GAAP,OAAO,CAAM;IAAI,CAAC;IAF/B,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAIlC,MAAM,CACX,KAAU,EACV,WAA8D,EAC9D,MAAe;QAEf,IAAI,KAAK,KAAK,IAAI;eACb,OAAO,KAAK,KAAK,WAAW;eAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACrD;YACA,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAY,CAAC,IAAI,CAAC,SAAS,CAAC,KAAY,CAAC,EAAE;YAChF,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;QAED,IAAI,WAAW,IAAI,CAAC,WAAW,YAAY,IAAI,CAAC,cAAc,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE;YAC3G,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAClC;QAED,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAyC,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QAC1G,OAAO,EAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;CACF"} \ No newline at end of file diff --git a/dist/es2017/df/index.js b/dist/es2017/df/index.js deleted file mode 100644 index 8dca4c6d..00000000 --- a/dist/es2017/df/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./df-binding-behavior"; -export * from "./df-value-converter"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/es2017/df/index.js.map b/dist/es2017/df/index.js.map deleted file mode 100644 index bda5730c..00000000 --- a/dist/es2017/df/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/df/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/dist/es2017/i18n.js b/dist/es2017/i18n.js deleted file mode 100644 index a741d9ee..00000000 --- a/dist/es2017/i18n.js +++ /dev/null @@ -1,271 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -import i18next from "i18next"; -import { DOM, PLATFORM } from "aurelia-pal"; -import * as LogManager from "aurelia-logging"; -import { autoinject } from "aurelia-framework"; -export const I18N_EA_SIGNAL = "i18n:locale:changed"; -let I18N = class I18N { - constructor(ea, signaler) { - this.ea = ea; - this.signaler = signaler; - this.globalVars = {}; - this.i18next = i18next; - this.Intl = PLATFORM.global.Intl; - } - async setup(options) { - const defaultOptions = { - skipTranslationOnMissingKey: false, - compatibilityAPI: "v1", - compatibilityJSON: "v1", - lng: "en", - attributes: ["t", "i18n"], - fallbackLng: "en", - debug: false - }; - this.i18nextDeferred = new Promise((resolve, reject) => { - this.i18next = this.i18next.init(options || defaultOptions, (err) => { - if (err) { - reject(err); - } - // make sure attributes is an array in case a string was provided - if (this.i18next.options.attributes instanceof String) { - this.i18next.options.attributes = [this.i18next.options.attributes]; - } - resolve(this.i18next); - }); - }); - return this.i18nextDeferred; - } - i18nextReady() { - return this.i18nextDeferred; - } - setLocale(locale) { - return new Promise((resolve, reject) => { - const oldLocale = this.getLocale(); - this.i18next.changeLanguage(locale, (err, tr) => { - if (err) { - reject(err); - } - this.ea.publish(I18N_EA_SIGNAL, { oldValue: oldLocale, newValue: locale }); - this.signaler.signal("aurelia-translation-signal"); - resolve(tr); - }); - }); - } - getLocale() { - return this.i18next.language; - } - nf(options, locales) { - return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); - } - uf(numberLike, locale) { - const nf = this.nf({}, locale || this.getLocale()); - const comparer = nf.format(10000 / 3); - let thousandSeparator = comparer[1]; - const decimalSeparator = comparer[5]; - if (thousandSeparator === ".") { - thousandSeparator = "\\."; - } - // remove all thousand seperators - const result = numberLike.replace(new RegExp(thousandSeparator, "g"), "") - // remove non-numeric signs except -> , . - .replace(/[^\d.,-]/g, "") - // replace original decimalSeparator with english one - .replace(decimalSeparator, "."); - // return real number - return Number(result); - } - df(options, locales) { - return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); - } - tr(key, options) { - let fullOptions = this.globalVars; - if (options !== undefined) { - fullOptions = Object.assign(Object.assign({}, this.globalVars), options); - } - return this.i18next.t(key, fullOptions); - } - registerGlobalVariable(key, value) { - this.globalVars[key] = value; - } - unregisterGlobalVariable(key) { - delete this.globalVars[key]; - } - /** - * Scans an element for children that have a translation attribute and - * updates their innerHTML with the current translation values. - * - * If an image is encountered the translated value will be applied to the src attribute. - * - * @param el HTMLElement to search within - */ - updateTranslations(el) { - if (!el || !el.querySelectorAll) { - return; - } - let i; - let l; - // create a selector from the specified attributes to look for - // var selector = [].concat(this.i18next.options.attributes); - const attributes = this.i18next.options.attributes; - let selector = [].concat(attributes); - for (i = 0, l = selector.length; i < l; i++) { - selector[i] = "[" + selector[i] + "]"; - } - selector = selector.join(","); - // get the nodes - const nodes = el.querySelectorAll(selector); - for (i = 0, l = nodes.length; i < l; i++) { - const node = nodes[i]; - let keys; - let params; - // test every attribute and get the first one that has a value - for (let i2 = 0, l2 = attributes.length; i2 < l2; i2++) { - keys = node.getAttribute(attributes[i2]); - const pname = attributes[i2] + "-params"; - if (pname && node.au && node.au[pname]) { - params = node.au[pname].viewModel.value; - } - if (keys) { - break; - } - } - // skip if nothing was found - if (!keys) { - continue; - } - // split the keys into multiple keys separated by a ; - this.updateValue(node, keys, params); - } - } - updateValue(node, value, params) { - if (value === null || value === undefined) { - return; - } - const keys = value.toString().split(";"); - let i = keys.length; - while (i--) { - let key = keys[i]; - // remove the optional attribute - const re = /\[([a-z\-, ]*)\]/ig; - let m; - let attr = "text"; - // set default attribute to src if this is an image node - if (node.nodeName === "IMG") { - attr = "src"; - } - // check if a attribute was specified in the key - // tslint:disable-next-line:no-conditional-assignment - while ((m = re.exec(key)) !== null) { - if (m.index === re.lastIndex) { - re.lastIndex++; - } - if (m) { - key = key.replace(m[0], ""); - attr = m[1]; - } - } - const attrs = attr.split(","); - let j = attrs.length; - while (j--) { - attr = attrs[j].trim(); - if (!node._textContent) { - node._textContent = node.textContent; - } - if (!node._innerHTML) { - node._innerHTML = node.innerHTML; - } - // convert to camelCase - // tslint:disable-next-line:only-arrow-functions - const attrCC = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); - const reservedNames = ["prepend", "append", "text", "html"]; - const i18nLogger = LogManager.getLogger("i18n"); - if (reservedNames.indexOf(attr) > -1 && - node.au && - node.au.controller && - node.au.controller.viewModel && - attrCC in node.au.controller.viewModel) { - i18nLogger.warn(`Aurelia I18N reserved attribute name\n - [${reservedNames.join(", ")}]\n - Your custom element has a bindable named ${attr} which is a reserved word.\n - If you'd like Aurelia I18N to translate your bindable instead, please consider giving it another name.`); - } - if (this.i18next.options.skipTranslationOnMissingKey && - this.tr(key, params) === key) { - i18nLogger.warn(`Couldn't find translation for key: ${key}`); - return; - } - // handle various attributes - // anything other than text,prepend,append or html will be added as an attribute on the element. - switch (attr) { - case "text": - const newChild = DOM.createTextNode(this.tr(key, params)); - if (node._newChild && node._newChild.parentNode === node) { - node.removeChild(node._newChild); - } - node._newChild = newChild; - while (node.firstChild) { - node.removeChild(node.firstChild); - } - node.appendChild(node._newChild); - break; - case "prepend": - const prependParser = DOM.createElement("div"); - prependParser.innerHTML = this.tr(key, params); - for (let ni = node.childNodes.length - 1; ni >= 0; ni--) { - if (node.childNodes[ni]._prepended) { - node.removeChild(node.childNodes[ni]); - } - } - for (let pi = prependParser.childNodes.length - 1; pi >= 0; pi--) { - prependParser.childNodes[pi]._prepended = true; - if (node.firstChild) { - node.insertBefore(prependParser.childNodes[pi], node.firstChild); - } - else { - node.appendChild(prependParser.childNodes[pi]); - } - } - break; - case "append": - const appendParser = DOM.createElement("div"); - appendParser.innerHTML = this.tr(key, params); - for (let ni = node.childNodes.length - 1; ni >= 0; ni--) { - if (node.childNodes[ni]._appended) { - node.removeChild(node.childNodes[ni]); - } - } - while (appendParser.firstChild) { - appendParser.firstChild._appended = true; - node.appendChild(appendParser.firstChild); - } - break; - case "html": - node.innerHTML = this.tr(key, params); - break; - default: // normal html attribute - if (node.au && - node.au.controller && - node.au.controller.viewModel && - attrCC in node.au.controller.viewModel) { - node.au.controller.viewModel[attrCC] = this.tr(key, params); - } - else { - node.setAttribute(attr, this.tr(key, params)); - } - break; - } - } - } - } -}; -I18N = __decorate([ - autoinject() -], I18N); -export { I18N }; -//# sourceMappingURL=i18n.js.map \ No newline at end of file diff --git a/dist/es2017/i18n.js.map b/dist/es2017/i18n.js.map deleted file mode 100644 index 4f2296ee..00000000 --- a/dist/es2017/i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,OAGN,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,GAAG,EACH,QAAQ,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAiB/C,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAGpD,IAAa,IAAI,GAAjB,MAAa,IAAI;IAMf,YAAoB,EAAmB,EAAU,QAAyB;QAAtD,OAAE,GAAF,EAAE,CAAiB;QAAU,aAAQ,GAAR,QAAQ,CAAiB;QAFlE,eAAU,GAA2B,EAAE,CAAC;QAG9C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;IACnC,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,OAA8C;QAC/D,MAAM,cAAc,GAAG;YACrB,2BAA2B,EAAE,KAAK;YAClC,gBAAgB,EAAE,IAAI;YACtB,iBAAiB,EAAE,IAAI;YACvB,GAAG,EAAE,IAAI;YACT,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC;YACzB,WAAW,EAAE,IAAI;YACjB,KAAK,EAAE,KAAK;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,GAAG,IA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AAE;4BACvD,IAAK,IAAI,CAAC,UAAU,CAAC,EAAE,CAAS,CAAC,SAAS,EAAE;gCAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;6BACvC;yBACF;wBAED,OAAO,YAAY,CAAC,UAAU,EAAE;4BAC7B,YAAY,CAAC,UAAkB,CAAC,SAAS,GAAG,IAAI,CAAC;4BAClD,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;yBAC3C;wBACD,MAAM;oBACR,KAAK,MAAM;wBACT,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;wBACtC,MAAM;oBACR,SAAS,wBAAwB;wBAC/B,IAAI,IAAI,CAAC,EAAE;4BACT,IAAI,CAAC,EAAE,CAAC,UAAU;4BAClB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS;4BAC5B,MAAM,IAAI,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,EAAE;4BACxC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;yBAC7D;6BAAM;4BACL,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;yBAC/C;wBAED,MAAM;iBACT;aACF;SACF;IACH,CAAC;CACF,CAAA;AA9RY,IAAI;IADhB,UAAU,EAAE;GACA,IAAI,CA8RhB;SA9RY,IAAI"} \ No newline at end of file diff --git a/dist/es2017/nf/index.js b/dist/es2017/nf/index.js deleted file mode 100644 index d0ec24df..00000000 --- a/dist/es2017/nf/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./nf-binding-behavior"; -export * from "./nf-value-converter"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/es2017/nf/index.js.map b/dist/es2017/nf/index.js.map deleted file mode 100644 index 243f0577..00000000 --- a/dist/es2017/nf/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nf/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/dist/es2017/nf/nf-binding-behavior.js b/dist/es2017/nf/nf-binding-behavior.js deleted file mode 100644 index 2c8244c1..00000000 --- a/dist/es2017/nf/nf-binding-behavior.js +++ /dev/null @@ -1,27 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -import { ValueConverter } from "aurelia-binding"; -export class NfBindingBehavior { - constructor(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - static inject() { return [SignalBindingBehavior]; } - bind(binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the NfValueConverter. - // pass through any args to the binding behavior to the NfValueConverter - const sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - const expression = sourceExpression.expression; - sourceExpression.expression = new ValueConverter(expression, "nf", sourceExpression.args, [expression, ...sourceExpression.args]); - } - unbind(binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - } -} -//# sourceMappingURL=nf-binding-behavior.js.map \ No newline at end of file diff --git a/dist/es2017/nf/nf-binding-behavior.js.map b/dist/es2017/nf/nf-binding-behavior.js.map deleted file mode 100644 index 6e625dc6..00000000 --- a/dist/es2017/nf/nf-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nf-binding-behavior.js","sourceRoot":"","sources":["../../../src/nf/nf-binding-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,OAAO,iBAAiB;IAG5B,YAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAF9D,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAInD,IAAI,CAAC,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;QACxF,sDAAsD;QACtD,wEAAwE;QACxE,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,MAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,cAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAChF,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;CACF"} \ No newline at end of file diff --git a/dist/es2017/nf/nf-value-converter.js b/dist/es2017/nf/nf-value-converter.js deleted file mode 100644 index cc4f2be6..00000000 --- a/dist/es2017/nf/nf-value-converter.js +++ /dev/null @@ -1,20 +0,0 @@ -import { I18N } from "../i18n"; -export class NfValueConverter { - constructor(service) { - this.service = service; - } - static inject() { return [I18N]; } - toView(value, nfOrOptions, locale) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (nfOrOptions && (nfOrOptions instanceof Intl.NumberFormat && typeof nfOrOptions.format === "function")) { - return nfOrOptions.format(value); - } - const nf = this.service.nf(nfOrOptions, locale || this.service.getLocale()); - return nf.format(value); - } -} -//# sourceMappingURL=nf-value-converter.js.map \ No newline at end of file diff --git a/dist/es2017/nf/nf-value-converter.js.map b/dist/es2017/nf/nf-value-converter.js.map deleted file mode 100644 index 11f60f6f..00000000 --- a/dist/es2017/nf/nf-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nf-value-converter.js","sourceRoot":"","sources":["../../../src/nf/nf-value-converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,MAAM,OAAO,gBAAgB;IAE3B,YAAoB,OAAa;QAAb,YAAO,GAAP,OAAO,CAAM;IAAG,CAAC;IAD9B,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAGlC,MAAM,CACX,KAAU,EACV,WAA0D,EAC1D,MAAe;QAEf,IAAI,KAAK,KAAK,IAAI;eACb,OAAO,KAAK,KAAK,WAAW;eAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACnD;YACF,OAAO,KAAK,CAAC;SACd;QAED,IAAI,WAAW,IAAI,CAAC,WAAW,YAAY,IAAI,CAAC,YAAY,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE;YACzG,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAClC;QAED,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAuC,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACxG,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF"} \ No newline at end of file diff --git a/dist/es2017/relativeTime.js b/dist/es2017/relativeTime.js deleted file mode 100644 index e30b3b0f..00000000 --- a/dist/es2017/relativeTime.js +++ /dev/null @@ -1,88 +0,0 @@ -import { EventAggregator } from "aurelia-event-aggregator"; -import { I18N, I18N_EA_SIGNAL } from "./i18n"; -import { translations } from "./defaultTranslations/relative.time"; -export class RelativeTime { - constructor(service, ea) { - this.service = service; - this.ea = ea; - this.service.i18nextReady().then(() => { - this.setup(); - }); - this.ea.subscribe(I18N_EA_SIGNAL, (locales) => { - this.setup(locales); - }); - } - static inject() { return [I18N, EventAggregator]; } - setup(locales) { - const trans = translations.default || translations; - const fallbackLng = this.service.i18next.fallbackLng; - let alternateFb = fallbackLng || this.service.i18next.options.fallbackLng; - if (Array.isArray(alternateFb) && alternateFb.length > 0) { - alternateFb = alternateFb[0]; - } - const key = ((locales && locales.newValue) - ? locales.newValue - : this.service.getLocale()) || alternateFb; - let index = 0; - // tslint:disable-next-line:no-conditional-assignment - if ((index = key.indexOf("-")) >= 0) { - const baseLocale = key.substring(0, index); - if (trans[baseLocale]) { - this.addTranslationResource(baseLocale, trans[baseLocale].translation); - } - } - if (trans[key]) { - this.addTranslationResource(key, trans[key].translation); - } - if (trans[fallbackLng]) { - this.addTranslationResource(key, trans[fallbackLng].translation); - } - } - addTranslationResource(key, translation) { - const options = this.service.i18next.options; - if (options.interpolation && (options.interpolation.prefix !== "__" || options.interpolation.suffix !== "__")) { - // tslint:disable-next-line:forin - for (const subkey in translation) { - translation[subkey] = translation[subkey] - .replace("__count__", `${options.interpolation.prefix || "{{"}count${options.interpolation.suffix || "}}"}`); - } - } - this.service.i18next.addResources(key, options.defaultNS || "translation", translation); - } - getRelativeTime(time) { - const now = new Date(); - const diff = now.getTime() - time.getTime(); - let timeDiff = this.getTimeDiffDescription(diff, "year", 31104000000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "month", 2592000000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "day", 86400000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "hour", 3600000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "minute", 60000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "second", 1000); - if (!timeDiff) { - timeDiff = this.service.tr("now"); - } - } - } - } - } - } - return timeDiff; - } - getTimeDiffDescription(diff, unit, timeDivisor) { - const unitAmount = parseInt((diff / timeDivisor).toFixed(0), 10); - if (unitAmount > 0) { - return this.service.tr(unit, { count: unitAmount, context: "ago" }); - } - else if (unitAmount < 0) { - const abs = Math.abs(unitAmount); - return this.service.tr(unit, { count: abs, context: "in" }); - } - return null; - } -} -//# sourceMappingURL=relativeTime.js.map \ No newline at end of file diff --git a/dist/es2017/relativeTime.js.map b/dist/es2017/relativeTime.js.map deleted file mode 100644 index 92d168d8..00000000 --- a/dist/es2017/relativeTime.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"relativeTime.js","sourceRoot":"","sources":["../../src/relativeTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EACL,IAAI,EAEJ,cAAc,EACf,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE,MAAM,OAAO,YAAY;IAEvB,YAAoB,OAAa,EAAU,EAAmB;QAA1C,YAAO,GAAP,OAAO,CAAM;QAAU,OAAE,GAAF,EAAE,CAAiB;QAC5D,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;YACpC,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,OAAyB,EAAE,EAAE;YAC9D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IATM,MAAM,CAAC,MAAM,KAAK,O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97dc9..00000000 --- a/dist/es2017/rt/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./rt-binding-behavior"; -export * from "./rt-value-converter"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/es2017/rt/index.js.map b/dist/es2017/rt/index.js.map deleted file mode 100644 index 2532c310..00000000 --- a/dist/es2017/rt/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rt/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/dist/es2017/rt/rt-binding-behavior.js b/dist/es2017/rt/rt-binding-behavior.js deleted file mode 100644 index 48191bc3..00000000 --- a/dist/es2017/rt/rt-binding-behavior.js +++ /dev/null @@ -1,27 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -import { ValueConverter } from "aurelia-binding"; -export class RtBindingBehavior { - constructor(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - static inject() { return [SignalBindingBehavior]; } - bind(binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal", "aurelia-relativetime-signal"); - // rewrite the expression to use the RtValueConverter. - // pass through any args to the binding behavior to the RtValueConverter - const sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - const expression = sourceExpression.expression; - sourceExpression.expression = new ValueConverter(expression, "rt", sourceExpression.args, [expression, ...sourceExpression.args]); - } - unbind(binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - } -} -//# sourceMappingURL=rt-binding-behavior.js.map \ No newline at end of file diff --git a/dist/es2017/rt/rt-binding-behavior.js.map b/dist/es2017/rt/rt-binding-behavior.js.map deleted file mode 100644 index b9bc9057..00000000 --- a/dist/es2017/rt/rt-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rt-binding-behavior.js","sourceRoot":"","sources":["../../../src/rt/rt-binding-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,OAAO,iBAAiB;IAG5B,YAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAF9D,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAInD,IAAI,CAAC,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CACtC,OAAO,EAAE,MAAM,EAAE,4BAA4B,EAAE,6BAA6B,CAC7E,CAAC;QACF,sDAAsD;QACtD,wEAAwE;QACxE,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,MAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,cAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAChF,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;CACF"} \ No newline at end of file diff --git a/dist/es2017/rt/rt-value-converter.js b/dist/es2017/rt/rt-value-converter.js deleted file mode 100644 index 0d0a6cca..00000000 --- a/dist/es2017/rt/rt-value-converter.js +++ /dev/null @@ -1,19 +0,0 @@ -import { RelativeTime } from "../relativeTime"; -export class RtValueConverter { - constructor(service) { - this.service = service; - } - static inject() { return [RelativeTime]; } - toView(value) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (typeof value === "string" && isNaN(value) && !Number.isInteger(value)) { - value = new Date(value); - } - return this.service.getRelativeTime(value); - } -} -//# sourceMappingURL=rt-value-converter.js.map \ No newline at end of file diff --git a/dist/es2017/rt/rt-value-converter.js.map b/dist/es2017/rt/rt-value-converter.js.map deleted file mode 100644 index bb51c1f9..00000000 --- a/dist/es2017/rt/rt-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rt-value-converter.js","sourceRoot":"","sources":["../../../src/rt/rt-value-converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,OAAO,gBAAgB;IAE3B,YAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAG,CAAC;IADtC,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAG1C,MAAM,CAAC,KAAU;QACtB,IAAI,KAAK,KAAK,IAAI;eACb,OAAO,KAAK,KAAK,WAAW;eAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACnD;YACF,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAY,CAAC,EAAE;YACvF,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;CACF"} \ No newline at end of file diff --git a/dist/es2017/t/index.js b/dist/es2017/t/index.js deleted file mode 100644 index 16a538e2..00000000 --- a/dist/es2017/t/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./t-binding-behavior"; -export * from "./t-custom-attribute"; -export * from "./t-params-custom-attribute"; -export * from "./t-value-converter"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/es2017/t/index.js.map b/dist/es2017/t/index.js.map deleted file mode 100644 index 2a6666da..00000000 --- a/dist/es2017/t/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/t/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC"} \ No newline at end of file diff --git a/dist/es2017/t/t-binding-behavior.js b/dist/es2017/t/t-binding-behavior.js deleted file mode 100644 index b72a4341..00000000 --- a/dist/es2017/t/t-binding-behavior.js +++ /dev/null @@ -1,27 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -import { ValueConverter } from "aurelia-binding"; -export class TBindingBehavior { - constructor(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - bind(binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the TValueConverter. - // pass through any args to the binding behavior to the TValueConverter - const sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - const expression = sourceExpression.expression; - sourceExpression.expression = new ValueConverter(expression, "t", sourceExpression.args, [expression, ...sourceExpression.args]); - } - unbind(binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - } -} -TBindingBehavior.inject = [SignalBindingBehavior]; -//# sourceMappingURL=t-binding-behavior.js.map \ No newline at end of file diff --git a/dist/es2017/t/t-binding-behavior.js.map b/dist/es2017/t/t-binding-behavior.js.map deleted file mode 100644 index 332e5232..00000000 --- a/dist/es2017/t/t-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-binding-behavior.js","sourceRoot":"","sources":["../../../src/t/t-binding-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,OAAO,gBAAgB;IAG3B,YAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAE9D,IAAI,CAAC,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;QACxF,qDAAqD;QACrD,uEAAuE;QACvE,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,MAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,cAAc,CAC9C,UAAU,EAAE,GAAG,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAC/E,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;;AAxBa,uBAAM,GAAG,CAAC,qBAAqB,CAAC,CAAC"} \ No newline at end of file diff --git a/dist/es2017/t/t-custom-attribute.js b/dist/es2017/t/t-custom-attribute.js deleted file mode 100644 index b805c54f..00000000 --- a/dist/es2017/t/t-custom-attribute.js +++ /dev/null @@ -1,60 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var TCustomAttribute_1; -import { customAttribute, HtmlBehaviorResource } from "aurelia-templating"; -import { EventAggregator } from "aurelia-event-aggregator"; -import { metadata } from "aurelia-metadata"; -import { DOM } from "aurelia-pal"; -import { I18N, I18N_EA_SIGNAL } from "../i18n"; -import { LazyOptional } from "../utils"; -import { TParamsCustomAttribute } from "./t-params-custom-attribute"; -let TCustomAttribute = TCustomAttribute_1 = class TCustomAttribute { - constructor(element, service, ea, p) { - this.element = element; - this.service = service; - this.ea = ea; - this.lazyParams = p; - } - static inject() { - return [DOM.Element, I18N, EventAggregator, LazyOptional.of(TParamsCustomAttribute)]; - } - static configureAliases(aliases) { - const r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TCustomAttribute_1); - r.aliases = aliases; - } - bind() { - this.params = this.lazyParams(); - if (this.params) { - this.params.valueChanged = (newParams, oldParams) => { - this.paramsChanged(this.value, newParams, oldParams); - }; - } - const p = this.params !== null ? this.params.value : undefined; - this.subscription = this.ea.subscribe(I18N_EA_SIGNAL, () => { - this.service.updateValue(this.element, this.value, this.params !== null ? this.params.value : undefined); - }); - this.service.updateValue(this.element, this.value, p); - } - paramsChanged(newValue, newParams) { - this.service.updateValue(this.element, newValue, newParams); - } - valueChanged(newValue) { - const p = this.params !== null ? this.params.value : undefined; - this.service.updateValue(this.element, newValue, p); - } - unbind() { - // If unbind is called before timeout for subscription is triggered, subscription will be undefined - if (this.subscription) { - this.subscription.dispose(); - } - } -}; -TCustomAttribute = TCustomAttribute_1 = __decorate([ - customAttribute("t") -], TCustomAttribute); -export { TCustomAttribute }; -//# sourceMappingURL=t-custom-attribute.js.map \ No newline at end of file diff --git a/dist/es2017/t/t-custom-attribute.js.map b/dist/es2017/t/t-custom-attribute.js.map deleted file mode 100644 index 9925865b..00000000 --- a/dist/es2017/t/t-custom-attribute.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-custom-attribute.js","sourceRoot":"","sources":["../../../src/t/t-custom-attribute.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACL,eAAe,EACf,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EAEhB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,EACL,IAAI,EACJ,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,IAAa,gBAAgB,wBAA7B,MAAa,gBAAgB;IAc3B,YACU,OAA8B,EAC9B,OAAa,EACb,EAAmB,EAC3B,CAAM;QAHE,YAAO,GAAP,OAAO,CAAuB;QAC9B,YAAO,GAAP,OAAO,CAAM;QACb,OAAE,GAAF,EAAE,CAAiB;QAG3B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IACtB,CAAC;IApBM,MAAM,CAAC,MAAM;QAClB,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,YAAY,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAC;IACvF,CAAC;IACM,MAAM,CAAC,gBAAgB,CAAC,OAAiB;QAC9C,MAAM,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,EAAE,kBAAgB,CAAC,CAAC;QAC5F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IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC;IAEM,MAAM;QACX,mGAAmG;QACnG,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;SAC7B;IACH,CAAC;CACF,CAAA;AAvDY,gBAAgB;IAD5B,eAAe,CAAC,GAAG,CAAC;GACR,gBAAgB,CAuD5B;SAvDY,gBAAgB"} \ No newline at end of file diff --git a/dist/es2017/t/t-params-custom-attribute.js b/dist/es2017/t/t-params-custom-attribute.js deleted file mode 100644 index 5dc2c9f6..00000000 --- a/dist/es2017/t/t-params-custom-attribute.js +++ /dev/null @@ -1,28 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var TParamsCustomAttribute_1; -import { customAttribute, HtmlBehaviorResource } from "aurelia-templating"; -import { metadata } from "aurelia-metadata"; -import { DOM } from "aurelia-pal"; -let TParamsCustomAttribute = TParamsCustomAttribute_1 = class TParamsCustomAttribute { - constructor(element) { - this.element = element; - } - static inject() { - return [DOM.Element]; - } - static configureAliases(aliases) { - const r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TParamsCustomAttribute_1); - r.aliases = aliases; - } - valueChanged() { } -}; -TParamsCustomAttribute = TParamsCustomAttribute_1 = __decorate([ - customAttribute("t-params") -], TParamsCustomAttribute); -export { TParamsCustomAttribute }; -//# sourceMappingURL=t-params-custom-attribute.js.map \ No newline at end of file diff --git a/dist/es2017/t/t-params-custom-attribute.js.map b/dist/es2017/t/t-params-custom-attribute.js.map deleted file mode 100644 index 0de2e695..00000000 --- a/dist/es2017/t/t-params-custom-attribute.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-params-custom-attribute.js","sourceRoot":"","sources":["../../../src/t/t-params-custom-attribute.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACL,eAAe,EACf,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,IAAa,sBAAsB,8BAAnC,MAAa,sBAAsB;IAYjC,YAAmB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAI,CAAC;IAXjC,MAAM,CAAC,MAAM;QAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAEM,MAAM,CAAC,gBAAgB,CAAC,OAAiB;QAC9C,MAAM,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,EAAE,wBAAsB,CAAC,CAAC;QAClG,CAAS,CAAC,OAAO,GAAG,OAAO,CAAC;IAC/B,CAAC;IAMM,YAAY,KAAU,CAAC;CAC/B,CAAA;AAfY,sBAAsB;IADlC,eAAe,CAAC,UAAU,CAAC;GACf,sBAAsB,CAelC;SAfY,sBAAsB"} \ No newline at end of file diff --git a/dist/es2017/t/t-value-converter.js b/dist/es2017/t/t-value-converter.js deleted file mode 100644 index 71107b8e..00000000 --- a/dist/es2017/t/t-value-converter.js +++ /dev/null @@ -1,11 +0,0 @@ -import { I18N } from "../i18n"; -export class TValueConverter { - constructor(service) { - this.service = service; - } - static inject() { return [I18N]; } - toView(value, options) { - return this.service.tr(value, options); - } -} -//# sourceMappingURL=t-value-converter.js.map \ No newline at end of file diff --git a/dist/es2017/t/t-value-converter.js.map b/dist/es2017/t/t-value-converter.js.map deleted file mode 100644 index 7db2fbf4..00000000 --- a/dist/es2017/t/t-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-value-converter.js","sourceRoot":"","sources":["../../../src/t/t-value-converter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,MAAM,OAAO,eAAe;IAG1B,YAAoB,OAAa;QAAb,YAAO,GAAP,OAAO,CAAM;IAAI,CAAC;IAF/B,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAIlC,MAAM,CAAC,KAAU,EAAE,OAA4C;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;CACF"} \ No newline at end of file diff --git a/dist/es2017/utils.js b/dist/es2017/utils.js deleted file mode 100644 index f5a48db2..00000000 --- a/dist/es2017/utils.js +++ /dev/null @@ -1,57 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var LazyOptional_1; -import { resolver } from "aurelia-dependency-injection"; -export let extend = (destination, source) => { - // tslint:disable-next-line:forin - for (const property in source) { - destination[property] = source[property]; - } - return destination; -}; -// tslint:disable-next-line:only-arrow-functions -export const isInteger = Number.isInteger || function (value) { - return typeof value === "number" && - isFinite(value) && - Math.floor(value) === value; -}; -export let assignObjectToKeys = (root, obj) => { - if (obj === undefined || obj === null) { - return obj; - } - const opts = {}; - Object.keys(obj).map((key) => { - if (typeof obj[key] === "object") { - extend(opts, assignObjectToKeys(key, obj[key])); - } - else { - opts[root !== "" ? root + "." + key : key] = obj[key]; - } - }); - return opts; -}; -let LazyOptional = LazyOptional_1 = class LazyOptional { - constructor(key) { - this.key = key; - } - static of(key) { - return new LazyOptional_1(key); - } - get(container) { - return () => { - if (container.hasResolver(this.key, false)) { - return container.get(this.key); - } - return null; - }; - } -}; -LazyOptional = LazyOptional_1 = __decorate([ - resolver() -], LazyOptional); -export { LazyOptional }; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/dist/es2017/utils.js.map b/dist/es2017/utils.js.map deleted file mode 100644 index 53be6a37..00000000 --- a/dist/es2017/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACL,QAAQ,EAET,MAAM,8BAA8B,CAAC;AAEtC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,WAAgB,EAAE,MAAW,EAAE,EAAE;IACpD,iCAAiC;IACjC,KAAK,MAAM,QAAQ,IAAI,MAAM,EAAE;QAC7B,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;KAC1C;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,gDAAgD;AAChD,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,UAAS,KAAK;IACzD,OAAO,OAAO,KAAK,KAAK,QAAQ;QAC9B,QAAQ,CAAC,KAAK,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,CAAC,IAAI,kBAAkB,GAAG,CAAC,IAAS,EAAE,GAAQ,EAAE,EAAE;IACtD,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;QACrC,OAAO,GAAG,CAAC;KACZ;IAED,MAAM,IAAI,GAAG,EAAE,CAAC;IAEhB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAC3B,IAAI,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;YAChC,MAAM,CAAC,IAAI,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACjD;aAAM;YACJ,IAAY,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;SAChE;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAGF,IAAa,YAAY,oBAAzB,MAAa,YAAY;IAKvB,YAAoB,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;IAAI,CAAC;IAJ7B,MAAM,CAAC,EAAE,CAAC,GAAQ;QACvB,OAAO,IAAI,cAAY,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;IAIM,GAAG,CAAC,SAAoB;QAC7B,OAAO,GAAG,EAAE;YACV,IAAI,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;gBAC1C,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aAChC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IACJ,CAAC;CACF,CAAA;AAfY,YAAY;IADxB,QAAQ,EAAE;GACE,YAAY,CAexB;SAfY,YAAY"} \ No newline at end of file diff --git a/dist/native-modules/aurelia-i18n-loader.js b/dist/native-modules/aurelia-i18n-loader.js deleted file mode 100644 index 6c25c986..00000000 --- a/dist/native-modules/aurelia-i18n-loader.js +++ /dev/null @@ -1,117 +0,0 @@ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var Backend = /** @class */ (function () { - function Backend(services, options) { - if (options === void 0) { options = {}; } - this.services = services; - this.options = options; - this.type = "backend"; - this.init(services, options); - } - Backend.with = function (loader) { - this.loader = loader; - return this; - }; - Backend.prototype.init = function (services, options) { - if (options === void 0) { options = {}; } - this.services = services; - this.options = Object.assign({}, { - loadPath: "/locales/{{lng}}/{{ns}}.json", - addPath: "locales/add/{{lng}}/{{ns}}", - allowMultiLoading: false, - parse: JSON.parse - }, options); - }; - Backend.prototype.readMulti = function (languages, namespaces, callback) { - var loadPath = this.options.loadPath; - if (typeof this.options.loadPath === "function") { - loadPath = this.options.loadPath(languages, namespaces); - } - var url = this.services - .interpolator - .interpolate(loadPath, { lng: languages.join("+"), ns: namespaces.join("+") }); - this.loadUrl(url, callback); - }; - Backend.prototype.read = function (language, namespace, callback) { - var loadPath = this.options.loadPath; - if (typeof this.options.loadPath === "function") { - loadPath = this.options.loadPath([language], [namespace]); - } - var url = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }); - this.loadUrl(url, callback); - }; - Backend.prototype.loadUrl = function (url, callback) { - return __awaiter(this, void 0, void 0, function () { - var response, ret, err, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 2, , 3]); - return [4 /*yield*/, Backend.loader.loadText(url)]; - case 1: - response = _b.sent(); - ret = void 0; - err = void 0; - try { - ret = (response instanceof Object) ? response : this.options.parse(response, url); - } - catch (e) { - err = "failed parsing " + url + " to json"; - } - if (err) { - return [2 /*return*/, callback(err, false)]; - } - callback(null, ret); - return [3 /*break*/, 3]; - case 2: - _a = _b.sent(); - callback("failed loading " + url, false /* no retry */); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); - }; - // tslint:disable-next-line:variable-name - Backend.prototype.create = function (_languages, _namespace, _key, _fallbackValue) { - // not supported - }; - Backend.type = "backend"; - return Backend; -}()); -export { Backend }; -export default Backend; -//# sourceMappingURL=aurelia-i18n-loader.js.map \ No newline at end of file diff --git a/dist/native-modules/aurelia-i18n-loader.js.map b/dist/native-modules/aurelia-i18n-loader.js.map deleted file mode 100644 index 67917222..00000000 --- a/dist/native-modules/aurelia-i18n-loader.js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AAO,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,EAAC;yBAC7B;wBACD,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;;;;wBAEpB,QAAQ,CAAC,iBAAiB,GAAG,GAAG,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;;;;;;KAE3D;IAED,yCAAyC;IAClC,wBAAM,GAAb,UAAc,UAA6B,EAAE,UAAkB,EAAE,IAAY,EAAE,cAAsB;QACnG,gBAAgB;IAClB,CAAC;IAxEa,YAAI,GAAW,SAAS,CAAC;IAyEzC,cAAC;CAAA,AA3ED,IA2EC;SA3EY,OAAO;AA6EpB,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/dist/native-modules/aurelia-i18n.js b/dist/native-modules/aurelia-i18n.js index b3c91da3..8fdd7c57 100644 --- a/dist/native-modules/aurelia-i18n.js +++ b/dist/native-modules/aurelia-i18n.js @@ -1,41 +1,1369 @@ -import { EventAggregator } from "aurelia-event-aggregator"; -import { ViewResources } from "aurelia-templating"; -import { BindingSignaler } from "aurelia-templating-resources"; -import { PLATFORM } from "aurelia-pal"; -import { I18N } from "./i18n"; -export * from "./i18n"; -export * from "./relativeTime"; -export * from "./aurelia-i18n-loader"; -export { DfValueConverter, DfBindingBehavior } from "./df"; -export { NfValueConverter, NfBindingBehavior } from "./nf"; -export { RtValueConverter, RtBindingBehavior } from "./rt"; -export { TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute } from "./t"; -export function configure(frameworkConfig, cb) { - if (cb === undefined || typeof cb !== "function") { +import i18next from 'i18next'; +import { getLogger } from 'aurelia-logging'; +import { resolver } from 'aurelia-dependency-injection'; +import { customAttribute, HtmlBehaviorResource, ViewResources } from 'aurelia-templating'; +import { metadata } from 'aurelia-metadata'; +import { DOM, PLATFORM } from 'aurelia-pal'; +import { valueConverter } from 'aurelia-framework'; +import { BindingSignaler, SignalBindingBehavior } from 'aurelia-templating-resources'; +import { EventAggregator } from 'aurelia-event-aggregator'; +import { ValueConverter, bindingBehavior, valueConverter as valueConverter$1 } from 'aurelia-binding'; + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var I18N_EA_SIGNAL = "i18n:locale:changed"; +var I18N = /** @class */ (function () { + function I18N(ea, signaler) { + this.ea = ea; + this.signaler = signaler; + this.globalVars = {}; + this.i18next = i18next; + this.Intl = PLATFORM.global.Intl; + } + I18N.inject = function () { return [EventAggregator, BindingSignaler]; }; + I18N.prototype.setup = function (options) { + return __awaiter(this, void 0, void 0, function () { + var defaultOptions; + var _this = this; + return __generator(this, function (_a) { + defaultOptions = { + skipTranslationOnMissingKey: false, + compatibilityAPI: "v1", + compatibilityJSON: "v1", + lng: "en", + attributes: ["t", "i18n"], + fallbackLng: "en", + debug: false + }; + this.i18nextDeferred = new Promise(function (resolve, reject) { + _this.i18next = _this.i18next.init(options || defaultOptions, function (err) { + if (err) { + reject(err); + } + // make sure attributes is an array in case a string was provided + if (_this.i18next.options.attributes instanceof String) { + _this.i18next.options.attributes = [_this.i18next.options.attributes]; + } + resolve(_this.i18next); + }); + }); + return [2 /*return*/, this.i18nextDeferred]; + }); + }); + }; + I18N.prototype.i18nextReady = function () { + return this.i18nextDeferred; + }; + I18N.prototype.setLocale = function (locale) { + var _this = this; + return new Promise(function (resolve, reject) { + var oldLocale = _this.getLocale(); + _this.i18next.changeLanguage(locale, function (err, tr) { + if (err) { + reject(err); + } + _this.ea.publish(I18N_EA_SIGNAL, { oldValue: oldLocale, newValue: locale }); + _this.signaler.signal("aurelia-translation-signal"); + resolve(tr); + }); + }); + }; + I18N.prototype.getLocale = function () { + return this.i18next.language; + }; + I18N.prototype.nf = function (options, locales) { + return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); + }; + I18N.prototype.uf = function (numberLike, locale) { + var nf = this.nf({}, locale || this.getLocale()); + var comparer = nf.format(10000 / 3); + var thousandSeparator = comparer[1]; + var decimalSeparator = comparer[5]; + if (thousandSeparator === ".") { + thousandSeparator = "\\."; + } + // remove all thousand seperators + var result = numberLike.replace(new RegExp(thousandSeparator, "g"), "") + // remove non-numeric signs except -> , . + .replace(/[^\d.,-]/g, "") + // replace original decimalSeparator with english one + .replace(decimalSeparator, "."); + // return real number + return Number(result); + }; + I18N.prototype.df = function (options, locales) { + return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); + }; + I18N.prototype.tr = function (key, options) { + var fullOptions = this.globalVars; + if (options !== undefined) { + fullOptions = Object.assign(Object.assign({}, this.globalVars), options); + } + return this.i18next.t(key, fullOptions); + }; + I18N.prototype.registerGlobalVariable = function (key, value) { + this.globalVars[key] = value; + }; + I18N.prototype.unregisterGlobalVariable = function (key) { + delete this.globalVars[key]; + }; + /** + * Scans an element for children that have a translation attribute and + * updates their innerHTML with the current translation values. + * + * If an image is encountered the translated value will be applied to the src attribute. + * + * @param el HTMLElement to search within + */ + I18N.prototype.updateTranslations = function (el) { + if (!el || !el.querySelectorAll) { + return; + } + var i; + var l; + // create a selector from the specified attributes to look for + // var selector = [].concat(this.i18next.options.attributes); + var attributes = this.i18next.options.attributes; + var selector = [].concat(attributes); + for (i = 0, l = selector.length; i < l; i++) { + selector[i] = "[" + selector[i] + "]"; + } + selector = selector.join(","); + // get the nodes + var nodes = el.querySelectorAll(selector); + for (i = 0, l = nodes.length; i < l; i++) { + var node = nodes[i]; + var keys = void 0; + var params = void 0; + // test every attribute and get the first one that has a value + for (var i2 = 0, l2 = attributes.length; i2 < l2; i2++) { + keys = node.getAttribute(attributes[i2]); + var pname = attributes[i2] + "-params"; + if (pname && node.au && node.au[pname]) { + params = node.au[pname].viewModel.value; + } + if (keys) { + break; + } + } + // skip if nothing was found + if (!keys) { + continue; + } + // split the keys into multiple keys separated by a ; + this.updateValue(node, keys, params); + } + }; + I18N.prototype.updateValue = function (node, value, params) { + if (value === null || value === undefined) { + return; + } + var keys = value.toString().split(";"); + var i = keys.length; + while (i--) { + var key = keys[i]; + // remove the optional attribute + var re = /\[([a-z\-, ]*)\]/ig; + var m = void 0; + var attr = "text"; + // set default attribute to src if this is an image node + if (node.nodeName === "IMG") { + attr = "src"; + } + // check if a attribute was specified in the key + // tslint:disable-next-line:no-conditional-assignment + while ((m = re.exec(key)) !== null) { + if (m.index === re.lastIndex) { + re.lastIndex++; + } + if (m) { + key = key.replace(m[0], ""); + attr = m[1]; + } + } + var attrs = attr.split(","); + var j = attrs.length; + while (j--) { + attr = attrs[j].trim(); + if (!node._textContent) { + node._textContent = node.textContent; + } + if (!node._innerHTML) { + node._innerHTML = node.innerHTML; + } + // convert to camelCase + // tslint:disable-next-line:only-arrow-functions + var attrCC = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); + var reservedNames = ["prepend", "append", "text", "html"]; + var i18nLogger = getLogger("i18n"); + if (reservedNames.indexOf(attr) > -1 && + node.au && + node.au.controller && + node.au.controller.viewModel && + attrCC in node.au.controller.viewModel) { + i18nLogger.warn("Aurelia I18N reserved attribute name\n\n [" + reservedNames.join(", ") + "]\n\n Your custom element has a bindable named " + attr + " which is a reserved word.\n\n If you'd like Aurelia I18N to translate your bindable instead, please consider giving it another name."); + } + if (this.i18next.options.skipTranslationOnMissingKey && + this.tr(key, params) === key) { + i18nLogger.warn("Couldn't find translation for key: " + key); + return; + } + // handle various attributes + // anything other than text,prepend,append or html will be added as an attribute on the element. + switch (attr) { + case "text": + var newChild = DOM.createTextNode(this.tr(key, params)); + if (node._newChild && node._newChild.parentNode === node) { + node.removeChild(node._newChild); + } + node._newChild = newChild; + while (node.firstChild) { + node.removeChild(node.firstChild); + } + node.appendChild(node._newChild); + break; + case "prepend": + var prependParser = DOM.createElement("div"); + prependParser.innerHTML = this.tr(key, params); + for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { + if (node.childNodes[ni]._prepended) { + node.removeChild(node.childNodes[ni]); + } + } + for (var pi = prependParser.childNodes.length - 1; pi >= 0; pi--) { + prependParser.childNodes[pi]._prepended = true; + if (node.firstChild) { + node.insertBefore(prependParser.childNodes[pi], node.firstChild); + } + else { + node.appendChild(prependParser.childNodes[pi]); + } + } + break; + case "append": + var appendParser = DOM.createElement("div"); + appendParser.innerHTML = this.tr(key, params); + for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { + if (node.childNodes[ni]._appended) { + node.removeChild(node.childNodes[ni]); + } + } + while (appendParser.firstChild) { + appendParser.firstChild._appended = true; + node.appendChild(appendParser.firstChild); + } + break; + case "html": + node.innerHTML = this.tr(key, params); + break; + default: // normal html attribute + if (node.au && + node.au.controller && + node.au.controller.viewModel && + attrCC in node.au.controller.viewModel) { + node.au.controller.viewModel[attrCC] = this.tr(key, params); + } + else { + node.setAttribute(attr, this.tr(key, params)); + } + break; + } + } + } + }; + return I18N; +}()); + +var TBindingBehavior = /** @class */ (function () { + function TBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + TBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; + TBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the TValueConverter. + // pass through any args to the binding behavior to the TValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "t", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + TBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + TBindingBehavior = __decorate([ + bindingBehavior("t") + ], TBindingBehavior); + return TBindingBehavior; +}()); + +// tslint:disable-next-line:only-arrow-functions +var isInteger = Number.isInteger || function (value) { + return typeof value === "number" && + isFinite(value) && + Math.floor(value) === value; +}; +var LazyOptional = /** @class */ (function () { + function LazyOptional(key) { + this.key = key; + } + LazyOptional_1 = LazyOptional; + LazyOptional.of = function (key) { + return new LazyOptional_1(key); + }; + LazyOptional.prototype.get = function (container) { + var _this = this; + return function () { + if (container.hasResolver(_this.key, false)) { + return container.get(_this.key); + } + return null; + }; + }; + var LazyOptional_1; + LazyOptional = LazyOptional_1 = __decorate([ + resolver() + ], LazyOptional); + return LazyOptional; +}()); + +var TParamsCustomAttribute = /** @class */ (function () { + function TParamsCustomAttribute(element) { + this.element = element; + } + TParamsCustomAttribute_1 = TParamsCustomAttribute; + TParamsCustomAttribute.inject = function () { + return [DOM.Element]; + }; + TParamsCustomAttribute.configureAliases = function (aliases) { + var r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TParamsCustomAttribute_1); + r.aliases = aliases; + }; + TParamsCustomAttribute.prototype.valueChanged = function () { }; + var TParamsCustomAttribute_1; + TParamsCustomAttribute = TParamsCustomAttribute_1 = __decorate([ + customAttribute("t-params") + ], TParamsCustomAttribute); + return TParamsCustomAttribute; +}()); + +var TCustomAttribute = /** @class */ (function () { + function TCustomAttribute(element, service, ea, p) { + this.element = element; + this.service = service; + this.ea = ea; + this.lazyParams = p; + } + TCustomAttribute_1 = TCustomAttribute; + TCustomAttribute.inject = function () { + return [DOM.Element, I18N, EventAggregator, LazyOptional.of(TParamsCustomAttribute)]; + }; + TCustomAttribute.configureAliases = function (aliases) { + var r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TCustomAttribute_1); + r.aliases = aliases; + }; + TCustomAttribute.prototype.bind = function () { + var _this = this; + this.params = this.lazyParams(); + if (this.params) { + this.params.valueChanged = function (newParams, oldParams) { + _this.paramsChanged(_this.value, newParams, oldParams); + }; + } + var p = this.params !== null ? this.params.value : undefined; + this.subscription = this.ea.subscribe(I18N_EA_SIGNAL, function () { + _this.service.updateValue(_this.element, _this.value, _this.params !== null ? _this.params.value : undefined); + }); + this.service.updateValue(this.element, this.value, p); + }; + TCustomAttribute.prototype.paramsChanged = function (newValue, newParams) { + this.service.updateValue(this.element, newValue, newParams); + }; + TCustomAttribute.prototype.valueChanged = function (newValue) { + var p = this.params !== null ? this.params.value : undefined; + this.service.updateValue(this.element, newValue, p); + }; + TCustomAttribute.prototype.unbind = function () { + // If unbind is called before timeout for subscription is triggered, subscription will be undefined + if (this.subscription) { + this.subscription.dispose(); + } + }; + var TCustomAttribute_1; + TCustomAttribute = TCustomAttribute_1 = __decorate([ + customAttribute("t") + ], TCustomAttribute); + return TCustomAttribute; +}()); + +var TValueConverter = /** @class */ (function () { + function TValueConverter(service) { + this.service = service; + } + TValueConverter.inject = function () { return [I18N]; }; + TValueConverter.prototype.toView = function (value, options) { + return this.service.tr(value, options); + }; + TValueConverter = __decorate([ + valueConverter("t") + ], TValueConverter); + return TValueConverter; +}()); + +var NfBindingBehavior = /** @class */ (function () { + function NfBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + NfBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; + NfBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the NfValueConverter. + // pass through any args to the binding behavior to the NfValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "nf", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + NfBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + NfBindingBehavior = __decorate([ + bindingBehavior("nf") + ], NfBindingBehavior); + return NfBindingBehavior; +}()); + +var NfValueConverter = /** @class */ (function () { + function NfValueConverter(service) { + this.service = service; + } + NfValueConverter.inject = function () { return [I18N]; }; + NfValueConverter.prototype.toView = function (value, nfOrOptions, locale) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (nfOrOptions && (nfOrOptions instanceof Intl.NumberFormat && typeof nfOrOptions.format === "function")) { + return nfOrOptions.format(value); + } + var nf = this.service.nf(nfOrOptions, locale || this.service.getLocale()); + return nf.format(value); + }; + NfValueConverter = __decorate([ + valueConverter$1("nf") + ], NfValueConverter); + return NfValueConverter; +}()); + +var DfBindingBehavior = /** @class */ (function () { + function DfBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + DfBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; + DfBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the DfValueConverter. + // pass through any args to the binding behavior to the DfValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "df", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + DfBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + DfBindingBehavior = __decorate([ + bindingBehavior("df") + ], DfBindingBehavior); + return DfBindingBehavior; +}()); + +var DfValueConverter = /** @class */ (function () { + function DfValueConverter(service) { + this.service = service; + } + DfValueConverter.inject = function () { return [I18N]; }; + DfValueConverter.prototype.toView = function (value, dfOrOptions, locale) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (typeof value === "string" && isNaN(value) && !isInteger(value)) { + value = new Date(value); + } + if (dfOrOptions && (dfOrOptions instanceof Intl.DateTimeFormat && typeof dfOrOptions.format === "function")) { + return dfOrOptions.format(value); + } + var df = this.service.df(dfOrOptions, locale || this.service.getLocale()); + return df.format(value); + }; + DfValueConverter = __decorate([ + valueConverter$1("df") + ], DfValueConverter); + return DfValueConverter; +}()); + +var RtBindingBehavior = /** @class */ (function () { + function RtBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + RtBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; + RtBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal", "aurelia-relativetime-signal"); + // rewrite the expression to use the RtValueConverter. + // pass through any args to the binding behavior to the RtValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "rt", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + RtBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + RtBindingBehavior = __decorate([ + bindingBehavior("rt") + ], RtBindingBehavior); + return RtBindingBehavior; +}()); + +var translations = { + ar: { + translation: { + now: 'الآن', + second_ago: 'منذ __count__ ثانية', + second_ago_plural: 'منذ __count__ ثواني', + second_in: 'في __count__ ثانية', + second_in_plural: 'في __count__ ثواني', + minute_ago: 'منذ __count__ دقيقة', + minute_ago_plural: 'منذ __count__ دقائق', + minute_in: 'في __count__ دقيقة', + minute_in_plural: 'في __count__ دقائق', + hour_ago: 'منذ __count__ ساعة', + hour_ago_plural: 'منذ __count__ ساعات', + hour_in: 'في __count__ ساعة', + hour_in_plural: 'في __count__ ساعات', + day_ago: 'منذ __count__ يوم', + day_ago_plural: 'منذ __count__ أيام', + day_in: 'في __count__ يوم', + day_in_plural: 'في __count__ أيام', + month_ago: 'منذ __count__ شهر', + month_ago_plural: 'منذ __count__ أشهر', + month_in: 'في __count__ شهر', + month_in_plural: 'في __count__ أشهر', + year_ago: 'منذ __count__ سنة', + year_ago_plural: 'منذ __count__ سنوات', + year_in: 'في __count__ سنة', + year_in_plural: 'في __count__ سنوات' + } + }, + da: { + translation: { + now: 'lige nu', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'i __count__ sekund', + second_in_plural: 'i __count__ sekunder', + minute_ago: '__count__ minut siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'i __count__ minut', + minute_in_plural: 'i __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'i __count__ time', + hour_in_plural: 'i __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dage siden', + day_in: 'i __count__ dag', + day_in_plural: 'i __count__ dage', + month_ago: '__count__ måned siden', + month_ago_plural: '__count__ måneder siden', + month_in: 'i __count__ måned', + month_in_plural: 'i __count__ måneder', + year_ago: '__count__ år siden', + year_ago_plural: '__count__ år siden', + year_in: 'i __count__ år', + year_in_plural: 'i __count__ år' + } + }, + de: { + translation: { + now: 'jetzt gerade', + second_ago: 'vor __count__ Sekunde', + second_ago_plural: 'vor __count__ Sekunden', + second_in: 'in __count__ Sekunde', + second_in_plural: 'in __count__ Sekunden', + minute_ago: 'vor __count__ Minute', + minute_ago_plural: 'vor __count__ Minuten', + minute_in: 'in __count__ Minute', + minute_in_plural: 'in __count__ Minuten', + hour_ago: 'vor __count__ Stunde', + hour_ago_plural: 'vor __count__ Stunden', + hour_in: 'in __count__ Stunde', + hour_in_plural: 'in __count__ Stunden', + day_ago: 'vor __count__ Tag', + day_ago_plural: 'vor __count__ Tagen', + day_in: 'in __count__ Tag', + day_in_plural: 'in __count__ Tagen', + month_ago: 'vor __count__ Monat', + month_ago_plural: 'vor __count__ Monaten', + month_in: 'in __count__ Monat', + month_in_plural: 'in __count__ Monaten', + year_ago: 'vor __count__ Jahr', + year_ago_plural: 'vor __count__ Jahren', + year_in: 'in __count__ Jahr', + year_in_plural: 'in __count__ Jahren' + } + }, + en: { + translation: { + now: 'just now', + second_ago: '__count__ second ago', + second_ago_plural: '__count__ seconds ago', + second_in: 'in __count__ second', + second_in_plural: 'in __count__ seconds', + minute_ago: '__count__ minute ago', + minute_ago_plural: '__count__ minutes ago', + minute_in: 'in __count__ minute', + minute_in_plural: 'in __count__ minutes', + hour_ago: '__count__ hour ago', + hour_ago_plural: '__count__ hours ago', + hour_in: 'in __count__ hour', + hour_in_plural: 'in __count__ hours', + day_ago: '__count__ day ago', + day_ago_plural: '__count__ days ago', + day_in: 'in __count__ day', + day_in_plural: 'in __count__ days', + month_ago: '__count__ month ago', + month_ago_plural: '__count__ months ago', + month_in: 'in __count__ month', + month_in_plural: 'in __count__ months', + year_ago: '__count__ year ago', + year_ago_plural: '__count__ years ago', + year_in: 'in __count__ year', + year_in_plural: 'in __count__ years' + } + }, + es: { + translation: { + now: 'ahora mismo', + second_ago: 'hace __count__ segundo', + second_ago_plural: 'hace __count__ segundos', + second_in: 'en __count__ segundo', + second_in_plural: 'en __count__ segundos', + minute_ago: 'hace __count__ minuto', + minute_ago_plural: 'hace __count__ minutos', + minute_in: 'en __count__ minuto', + minute_in_plural: 'en __count__ minutos', + hour_ago: 'hace __count__ hora', + hour_ago_plural: 'hace __count__ horas', + hour_in: 'en __count__ hora', + hour_in_plural: 'en __count__ horas', + day_ago: 'hace __count__ día', + day_ago_plural: 'hace __count__ días', + day_in: 'en __count__ día', + day_in_plural: 'en __count__ días', + month_ago: 'hace __count__ mes', + month_ago_plural: 'hace __count__ meses', + month_in: 'en __count__ mes', + month_in_plural: 'en __count__ meses', + year_ago: 'hace __count__ año', + year_ago_plural: 'hace __count__ años', + year_in: 'en __count__ año', + year_in_plural: 'en __count__ años' + } + }, + fi: { + translation: { + now: 'Nyt', + second_ago: '__count__ sekuntti sitten', + second_ago_plural: '__count__ sekunttia sitten', + second_in: ' __count__ sekunnin kuluttua', + second_in_plural: ' __count__ sekunttien kuluttua', + minute_ago: '__count__ minuutti sitten', + minute_ago_plural: '__count__ minuuttia sitten', + minute_in: ' __count__ minuutin kuluttua', + minute_in_plural: ' __count__ minuuttien kuluttua', + hour_ago: '__count__ tunti sitten', + hour_ago_plural: '__count__ tuntia sitten', + hour_in: ' __count__ tunnin kuluttua', + hour_in_plural: ' __count__ tunnin kuluttua', + day_ago: '__count__ päivä sitten', + day_ago_plural: '__count__ päiviä sitten', + day_in: ' __count__ päivän kuluttua', + day_in_plural: '__count__ päivien kuluttua', + month_ago: '__count__ kuukausi sitten', + month_ago_plural: '__count__ kuukausia sitten', + month_in: ' __count__ kuukauden kuluttua', + month_in_plural: ' __count__ kuukausien kuluttua', + year_ago: '__count__ vuosi sitten', + year_ago_plural: '__count__ vuosia sitten', + year_in: ' __count__ vuoden kuluttua', + year_in_plural: ' __count__ vuosien kuluttua' + } + }, + fr: { + translation: { + now: 'maintenant', + second_ago: 'il y a __count__ seconde', + second_ago_plural: 'il y a __count__ secondes', + second_in: 'dans __count__ seconde', + second_in_plural: 'dans __count__ secondes', + minute_ago: 'il y a __count__ minute', + minute_ago_plural: 'il y a __count__ minutes', + minute_in: 'dans __count__ minute', + minute_in_plural: 'dans __count__ minutes', + hour_ago: 'il y a __count__ heure', + hour_ago_plural: 'il y a __count__ heures', + hour_in: 'dans __count__ heure', + hour_in_plural: 'dans __count__ heures', + day_ago: 'il y a __count__ jour', + day_ago_plural: 'il y a __count__ jours', + day_in: 'dans __count__ jour', + day_in_plural: 'dans __count__ jours', + month_ago: 'il y a __count__ mois', + month_ago_plural: 'il y a __count__ mois', + month_in: 'dans __count__ mois', + month_in_plural: 'dans __count__ mois', + year_ago: 'il y a __count__ an', + year_ago_plural: 'il y a __count__ ans', + year_in: 'dans __count__ an', + year_in_plural: 'dans __count__ ans' + } + }, + it: { + translation: { + now: 'adesso', + second_ago: '__count__ secondo fa', + second_ago_plural: '__count__ secondi fa', + second_in: 'in __count__ secondo', + second_in_plural: 'in __count__ secondi', + minute_ago: '__count__ minuto fa', + minute_ago_plural: '__count__ minuti fa', + minute_in: 'in __count__ minuto', + minute_in_plural: 'in __count__ minuti', + hour_ago: '__count__ ora fa', + hour_ago_plural: '__count__ ore fa', + hour_in: 'in __count__ ora', + hour_in_plural: 'in __count__ ore', + day_ago: '__count__ giorno fa', + day_ago_plural: '__count__ giorni fa', + day_in: 'in __count__ giorno', + day_in_plural: 'in __count__ giorni', + month_ago: '__count__ mese fa', + month_ago_plural: '__count__ mesi fa', + month_in: 'in __count__ mese', + month_in_plural: 'in __count__ mesi', + year_ago: '__count__ anno fa', + year_ago_plural: '__count__ anni fa', + year_in: 'in __count__ anno', + year_in_plural: 'in __count__ anni' + } + }, + ja: { + translation: { + now: 'たった今', + second_ago: '__count__ 秒前', + second_ago_plural: '__count__ 秒前', + second_in: 'あと __count__ 秒', + second_in_plural: 'あと __count__ 秒', + minute_ago: '__count__ 分前', + minute_ago_plural: '__count__ 分前', + minute_in: 'あと __count__ 分', + minute_in_plural: 'あと __count__ 分', + hour_ago: '__count__ 時間前', + hour_ago_plural: '__count__ 時間前', + hour_in: 'あと __count__ 時間', + hour_in_plural: 'あと __count__ 時間', + day_ago: '__count__ 日間前', + day_ago_plural: '__count__ 日間前', + day_in: 'あと __count__ 日間', + day_in_plural: 'あと __count__ 日間', + month_ago: '__count__ ヶ月前', + month_ago_plural: '__count__ ヶ月前', + month_in: 'あと __count__ ヶ月前', + month_in_plural: 'あと __count__ ヶ月前', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: 'あと __count__ 年', + year_in_plural: 'あと __count__ 年' + } + }, + nl: { + translation: { + now: 'zonet', + second_ago: '__count__ seconde geleden', + second_ago_plural: '__count__ seconden geleden', + second_in: 'in __count__ seconde', + second_in_plural: 'in __count__ seconden', + minute_ago: '__count__ minuut geleden', + minute_ago_plural: '__count__ minuten geleden', + minute_in: 'in __count__ minuut', + minute_in_plural: 'in __count__ minuten', + hour_ago: '__count__ uur geleden', + hour_ago_plural: '__count__ uren geleden', + hour_in: 'in __count__ uur', + hour_in_plural: 'in __count__ uren', + day_ago: '__count__ dag geleden', + day_ago_plural: '__count__ dagen geleden', + day_in: 'in __count__ dag', + day_in_plural: 'in __count__ dagen', + month_ago: '__count__ maand geleden', + month_ago_plural: '__count__ maanden geleden', + month_in: 'in __count__ maand', + month_in_plural: 'in __count__ maanden', + year_ago: '__count__ jaar geleden', + year_ago_plural: '__count__ jaren geleden', + year_in: 'in __count__ jaar', + year_in_plural: 'in __count__ jaren' + } + }, + nn: { + translation: { + now: 'akkurat nå', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minutt siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'om __count__ minutt', + minute_in_plural: 'om __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'om __count__ time', + hour_in_plural: 'om __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dager siden', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dager', + month_ago: '__count__ en måned siden', + month_ago_plural: '__count__ flere måneder siden', + month_in: 'I løpet av en __count__ måned', + month_in_plural: 'I løpet av __count__ måneder', + year_ago: '__count__ et år siden', + year_ago_plural: '__count__ flere å siden', + year_in: 'I løpet av ett år __count__ år', + year_in_plural: 'på flere __count__ år' + } + }, + no: { + translation: { + now: 'akkurat nå', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minutt siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'om __count__ minutt', + minute_in_plural: 'om __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'om __count__ time', + hour_in_plural: 'om __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dager siden', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dager', + month_ago: '__count__ en måned siden', + month_ago_plural: '__count__ flere måneder siden', + month_in: 'I løpet av en __count__ måned', + month_in_plural: 'I løpet av __count__ måneder', + year_ago: '__count__ et år siden', + year_ago_plural: '__count__ flere å siden', + year_in: 'I løpet av ett år __count__ år', + year_in_plural: 'på flere __count__ år' + } + }, + pt: { + translation: { + now: 'neste exato momento', + second_ago: '__count__ segundo atrás', + second_ago_plural: '__count__ segundos atrás', + second_in: 'em __count__ segundo', + second_in_plural: 'em __count__ segundos', + minute_ago: '__count__ minuto atrás', + minute_ago_plural: '__count__ minutos atrás', + minute_in: 'em __count__ minuto', + minute_in_plural: 'em __count__ minutos', + hour_ago: '__count__ hora atrás', + hour_ago_plural: '__count__ horas atrás', + hour_in: 'em __count__ hora', + hour_in_plural: 'em __count__ horas', + day_ago: '__count__ dia atrás', + day_ago_plural: '__count__ dias atrás', + day_in: 'em __count__ dia', + day_in_plural: 'em __count__ dias', + month_ago: '__count__ mês atrás', + month_ago_plural: '__count__ meses atrás', + month_in: 'em __count__ mês', + month_in_plural: 'em __count__ meses', + year_ago: '__count__ ano atrás', + year_ago_plural: '__count__ anos atrás', + year_in: 'em __count__ ano', + year_in_plural: 'em __count__ anos' + } + }, + sv: { + translation: { + now: 'nu', + second_ago: '__count__ sekund sedan', + second_ago_plural: '__count__ sekunder sedan', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minut sedan', + minute_ago_plural: '__count__ minuter sedan', + minute_in: 'om __count__ minut', + minute_in_plural: 'om __count__ minuter', + hour_ago: '__count__ timme sedan', + hour_ago_plural: '__count__ timmar sedan', + hour_in: 'om __count__ timme', + hour_in_plural: 'om __count__ timmar', + day_ago: '__count__ dag sedan', + day_ago_plural: '__count__ dagar sedan', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dagar', + month_ago: '__count__ månad sedan', + month_ago_plural: '__count__ månader sedan', + month_in: 'om __count__ månad', + month_in_plural: 'om __count__ månader', + year_ago: '__count__ år sedan', + year_ago_plural: '__count__ år sedan', + year_in: 'om __count__ år', + year_in_plural: 'om __count__ år' + } + }, + th: { + translation: { + now: 'เมื่อกี้', + second_ago: '__count__ วินาที ที่ผ่านมา', + second_ago_plural: '__count__ วินาที ที่ผ่านมา', + second_in: 'อีก __count__ วินาที', + second_in_plural: 'อีก __count__ วินาที', + minute_ago: '__count__ นาที ที่ผ่านมา', + minute_ago_plural: '__count__ นาที ที่ผ่านมา', + minute_in: 'อีก __count__ นาที', + minute_in_plural: 'อีก __count__ นาที', + hour_ago: '__count__ ชั่วโมง ที่ผ่านมา', + hour_ago_plural: '__count__ ชั่วโมง ที่ผ่านมา', + hour_in: 'อีก __count__ ชั่วโมง', + hour_in_plural: 'อีก __count__ ชั่วโมง', + day_ago: '__count__ วัน ที่ผ่านมา', + day_ago_plural: '__count__ วัน ที่ผ่านมา', + day_in: 'อีก __count__ วัน', + day_in_plural: 'อีก __count__ วัน' + } + }, + zh: { + translation: { + now: '刚才', + second_ago: '__count__ 秒钟前', + second_ago_plural: '__count__ 秒钟前', + second_in: '__count__ 秒内', + second_in_plural: '__count__ 秒内', + minute_ago: '__count__ 分钟前', + minute_ago_plural: '__count__ 分钟前', + minute_in: '__count__ 分钟内', + minute_in_plural: '__count__ 分钟内', + hour_ago: '__count__ 小时前', + hour_ago_plural: '__count__ 小时前', + hour_in: '__count__ 小时内', + hour_in_plural: '__count__ 小时内', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天内', + day_in_plural: '__count__ 天内', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月内', + month_in_plural: '__count__ 月内', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年内', + year_in_plural: '__count__ 年内' + } + }, + 'zh-CN': { + translation: { + now: '刚才', + second_ago: '__count__ 秒钟前', + second_ago_plural: '__count__ 秒钟前', + second_in: '__count__ 秒内', + second_in_plural: '__count__ 秒内', + minute_ago: '__count__ 分钟前', + minute_ago_plural: '__count__ 分钟前', + minute_in: '__count__ 分钟内', + minute_in_plural: '__count__ 分钟内', + hour_ago: '__count__ 小时前', + hour_ago_plural: '__count__ 小时前', + hour_in: '__count__ 小时内', + hour_in_plural: '__count__ 小时内', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天内', + day_in_plural: '__count__ 天内', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月内', + month_in_plural: '__count__ 月内', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年内', + year_in_plural: '__count__ 年内' + } + }, + 'zh-HK': { + translation: { + now: '剛才', + second_ago: '__count__ 秒鐘前', + second_ago_plural: '__count__ 秒鐘前', + second_in: '__count__ 秒內', + second_in_plural: '__count__ 秒內', + minute_ago: '__count__ 分鐘前', + minute_ago_plural: '__count__ 分鐘前', + minute_in: '__count__ 分鐘內', + minute_in_plural: '__count__ 分鐘內', + hour_ago: '__count__ 小時前', + hour_ago_plural: '__count__ 小時前', + hour_in: '__count__ 小時內', + hour_in_plural: '__count__ 小時內', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天內', + day_in_plural: '__count__ 天內', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月內', + month_in_plural: '__count__ 月內', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年內', + year_in_plural: '__count__ 年內' + } + }, + 'zh-TW': { + translation: { + now: '剛才', + second_ago: '__count__ 秒鐘前', + second_ago_plural: '__count__ 秒鐘前', + second_in: '__count__ 秒內', + second_in_plural: '__count__ 秒內', + minute_ago: '__count__ 分鐘前', + minute_ago_plural: '__count__ 分鐘前', + minute_in: '__count__ 分鐘內', + minute_in_plural: '__count__ 分鐘內', + hour_ago: '__count__ 小時前', + hour_ago_plural: '__count__ 小時前', + hour_in: '__count__ 小時內', + hour_in_plural: '__count__ 小時內', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天內', + day_in_plural: '__count__ 天內', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月內', + month_in_plural: '__count__ 月內', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年內', + year_in_plural: '__count__ 年內' + } + } +}; +// tslint:enable + +var RelativeTime = /** @class */ (function () { + function RelativeTime(service, ea) { + var _this = this; + this.service = service; + this.ea = ea; + this.service.i18nextReady().then(function () { + _this.setup(); + }); + this.ea.subscribe(I18N_EA_SIGNAL, function (locales) { + _this.setup(locales); + }); + } + RelativeTime.inject = function () { return [I18N, EventAggregator]; }; + RelativeTime.prototype.setup = function (locales) { + var trans = translations; + var fallbackLng = this.service.i18next.fallbackLng; + var alternateFb = fallbackLng || this.service.i18next.options.fallbackLng; + if (Array.isArray(alternateFb) && alternateFb.length > 0) { + alternateFb = alternateFb[0]; + } + var key = ((locales && locales.newValue) + ? locales.newValue + : this.service.getLocale()) || alternateFb; + var index = 0; + // tslint:disable-next-line:no-conditional-assignment + if ((index = key.indexOf("-")) >= 0) { + var baseLocale = key.substring(0, index); + if (trans[baseLocale]) { + this.addTranslationResource(baseLocale, trans[baseLocale].translation); + } + } + if (trans[key]) { + this.addTranslationResource(key, trans[key].translation); + } + if (trans[fallbackLng]) { + this.addTranslationResource(key, trans[fallbackLng].translation); + } + }; + RelativeTime.prototype.addTranslationResource = function (key, translation) { + var options = this.service.i18next.options; + if (options.interpolation && (options.interpolation.prefix !== "__" || options.interpolation.suffix !== "__")) { + // tslint:disable-next-line:forin + for (var subkey in translation) { + translation[subkey] = translation[subkey] + .replace("__count__", (options.interpolation.prefix || "{{") + "count" + (options.interpolation.suffix || "}}")); + } + } + this.service.i18next.addResources(key, options.defaultNS || "translation", translation); + }; + RelativeTime.prototype.getRelativeTime = function (time) { + var now = new Date(); + var diff = now.getTime() - time.getTime(); + var timeDiff = this.getTimeDiffDescription(diff, "year", 31104000000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "month", 2592000000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "day", 86400000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "hour", 3600000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "minute", 60000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "second", 1000); + if (!timeDiff) { + timeDiff = this.service.tr("now"); + } + } + } + } + } + } + return timeDiff; + }; + RelativeTime.prototype.getTimeDiffDescription = function (diff, unit, timeDivisor) { + var unitAmount = parseInt((diff / timeDivisor).toFixed(0), 10); + if (unitAmount > 0) { + return this.service.tr(unit, { count: unitAmount, context: "ago" }); + } + else if (unitAmount < 0) { + var abs = Math.abs(unitAmount); + return this.service.tr(unit, { count: abs, context: "in" }); + } + return null; + }; + return RelativeTime; +}()); + +var RtValueConverter = /** @class */ (function () { + function RtValueConverter(service) { + this.service = service; + } + RtValueConverter.inject = function () { return [RelativeTime]; }; + RtValueConverter.prototype.toView = function (value) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (typeof value === "string" && isNaN(value) && !Number.isInteger(value)) { + value = new Date(value); + } + return this.service.getRelativeTime(value); + }; + RtValueConverter = __decorate([ + valueConverter$1("rt") + ], RtValueConverter); + return RtValueConverter; +}()); + +var Backend = /** @class */ (function () { + function Backend(services, options) { + if (options === void 0) { options = {}; } + this.services = services; + this.options = options; + this.type = "backend"; + this.init(services, options); + } + Backend.with = function (loader) { + this.loader = loader; + return this; + }; + Backend.prototype.init = function (services, options) { + if (options === void 0) { options = {}; } + this.services = services; + this.options = Object.assign({}, { + loadPath: "/locales/{{lng}}/{{ns}}.json", + addPath: "locales/add/{{lng}}/{{ns}}", + allowMultiLoading: false, + parse: JSON.parse + }, options); + }; + Backend.prototype.readMulti = function (languages, namespaces, callback) { + var loadPath = this.options.loadPath; + if (typeof this.options.loadPath === "function") { + loadPath = this.options.loadPath(languages, namespaces); + } + var url = this.services + .interpolator + .interpolate(loadPath, { lng: languages.join("+"), ns: namespaces.join("+") }); + this.loadUrl(url, callback); + }; + Backend.prototype.read = function (language, namespace, callback) { + var loadPath = this.options.loadPath; + if (typeof this.options.loadPath === "function") { + loadPath = this.options.loadPath([language], [namespace]); + } + var url = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }); + this.loadUrl(url, callback); + }; + Backend.prototype.loadUrl = function (url, callback) { + return __awaiter(this, void 0, void 0, function () { + var response, ret, err, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 2, , 3]); + return [4 /*yield*/, Backend.loader.loadText(url)]; + case 1: + response = _b.sent(); + ret = void 0; + err = void 0; + try { + ret = (response instanceof Object) ? response : this.options.parse(response, url); + } + catch (e) { + err = "failed parsing " + url + " to json"; + } + if (err) { + return [2 /*return*/, callback(err, false)]; + } + callback(null, ret); + return [3 /*break*/, 3]; + case 2: + _a = _b.sent(); + callback("failed loading " + url, false /* no retry */); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + // tslint:disable-next-line:variable-name + Backend.prototype.create = function (_languages, _namespace, _key, _fallbackValue) { + // not supported + }; + Backend.type = "backend"; + return Backend; +}()); + +function configure(frameworkConfig, cb) { + if (typeof cb !== "function") { var errorMsg = "You need to provide a callback method to properly configure the library"; throw errorMsg; } + var instance = frameworkConfig.container.get(I18N); + var ret = cb(instance); frameworkConfig.globalResources([ - PLATFORM.moduleName("./t/t-value-converter"), - PLATFORM.moduleName("./t/t-custom-attribute"), - PLATFORM.moduleName("./t/t-params-custom-attribute"), - PLATFORM.moduleName("./t/t-binding-behavior") - ]); - frameworkConfig.globalResources([ - PLATFORM.moduleName("./nf/nf-value-converter"), - PLATFORM.moduleName("./nf/nf-binding-behavior") - ]); - frameworkConfig.globalResources([ - PLATFORM.moduleName("./df/df-value-converter"), - PLATFORM.moduleName("./df/df-binding-behavior") - ]); - frameworkConfig.globalResources([ - PLATFORM.moduleName("./rt/rt-value-converter"), - PLATFORM.moduleName("./rt/rt-binding-behavior") + TValueConverter, + TBindingBehavior, + TCustomAttribute, + TParamsCustomAttribute, + NfValueConverter, + NfBindingBehavior, + DfValueConverter, + DfBindingBehavior, + RtValueConverter, + RtBindingBehavior ]); - var instance = new I18N(frameworkConfig.container.get(EventAggregator), frameworkConfig.container.get(BindingSignaler)); - frameworkConfig.container.registerInstance(I18N, instance); - var ret = cb(instance); frameworkConfig.postTask(function () { var resources = frameworkConfig.container.get(ViewResources); var htmlBehaviorResource = resources.getAttribute("t"); @@ -50,4 +1378,5 @@ export function configure(frameworkConfig, cb) { }); return ret; } -//# sourceMappingURL=aurelia-i18n.js.map \ No newline at end of file + +export { configure, DfValueConverter, DfBindingBehavior, NfValueConverter, NfBindingBehavior, RtValueConverter, RtBindingBehavior, TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute, I18N_EA_SIGNAL, I18N, RelativeTime, Backend }; diff --git a/dist/native-modules/aurelia-i18n.js.map b/dist/native-modules/aurelia-i18n.js.map deleted file mode 100644 index a664c99b..00000000 --- a/dist/native-modules/aurelia-i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aurelia-i18n.js","sourceRoot":"","sources":["../../src/aurelia-i18n.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC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native-modules/defaultTranslations/relative.time.js b/dist/native-modules/defaultTranslations/relative.time.js deleted file mode 100644 index ee7a4c85..00000000 --- a/dist/native-modules/defaultTranslations/relative.time.js +++ /dev/null @@ -1,494 +0,0 @@ -export var translations = { - ar: { - translation: { - "now": "الآن", - "second_ago": "منذ __count__ ثانية", - "second_ago_plural": "منذ __count__ ثواني", - "second_in": "في __count__ ثانية", - "second_in_plural": "في __count__ ثواني", - "minute_ago": "منذ __count__ دقيقة", - "minute_ago_plural": "منذ __count__ دقائق", - "minute_in": "في __count__ دقيقة", - "minute_in_plural": "في __count__ دقائق", - "hour_ago": "منذ __count__ ساعة", - "hour_ago_plural": "منذ __count__ ساعات", - "hour_in": "في __count__ ساعة", - "hour_in_plural": "في __count__ ساعات", - "day_ago": "منذ __count__ يوم", - "day_ago_plural": "منذ __count__ أيام", - "day_in": "في __count__ يوم", - "day_in_plural": "في __count__ أيام", - "month_ago": "منذ __count__ شهر", - "month_ago_plural": "منذ __count__ أشهر", - "month_in": "في __count__ شهر", - "month_in_plural": "في __count__ أشهر", - "year_ago": "منذ __count__ سنة", - "year_ago_plural": "منذ __count__ سنوات", - "year_in": "في __count__ سنة", - "year_in_plural": "في __count__ سنوات" - } - }, - en: { - translation: { - "now": "just now", - "second_ago": "__count__ second ago", - "second_ago_plural": "__count__ seconds ago", - "second_in": "in __count__ second", - "second_in_plural": "in __count__ seconds", - "minute_ago": "__count__ minute ago", - "minute_ago_plural": "__count__ minutes ago", - "minute_in": "in __count__ minute", - "minute_in_plural": "in __count__ minutes", - "hour_ago": "__count__ hour ago", - "hour_ago_plural": "__count__ hours ago", - "hour_in": "in __count__ hour", - "hour_in_plural": "in __count__ hours", - "day_ago": "__count__ day ago", - "day_ago_plural": "__count__ days ago", - "day_in": "in __count__ day", - "day_in_plural": "in __count__ days", - "month_ago": "__count__ month ago", - "month_ago_plural": "__count__ months ago", - "month_in": "in __count__ month", - "month_in_plural": "in __count__ months", - "year_ago": "__count__ year ago", - "year_ago_plural": "__count__ years ago", - "year_in": "in __count__ year", - "year_in_plural": "in __count__ years" - } - }, - es: { - translation: { - "now": "ahora mismo", - "second_ago": "hace __count__ segundo", - "second_ago_plural": "hace __count__ segundos", - "second_in": "en __count__ segundo", - "second_in_plural": "en __count__ segundos", - "minute_ago": "hace __count__ minuto", - "minute_ago_plural": "hace __count__ minutos", - "minute_in": "en __count__ minuto", - "minute_in_plural": "en __count__ minutos", - "hour_ago": "hace __count__ hora", - "hour_ago_plural": "hace __count__ horas", - "hour_in": "en __count__ hora", - "hour_in_plural": "en __count__ horas", - "day_ago": "hace __count__ día", - "day_ago_plural": "hace __count__ días", - "day_in": "en __count__ día", - "day_in_plural": "en __count__ días", - "month_ago": "hace __count__ mes", - "month_ago_plural": "hace __count__ meses", - "month_in": "en __count__ mes", - "month_in_plural": "en __count__ meses", - "year_ago": "hace __count__ año", - "year_ago_plural": "hace __count__ años", - "year_in": "en __count__ año", - "year_in_plural": "en __count__ años" - } - }, - it: { - translation: { - "now": "adesso", - "second_ago": "__count__ secondo fa", - "second_ago_plural": "__count__ secondi fa", - "second_in": "in __count__ secondo", - "second_in_plural": "in __count__ secondi", - "minute_ago": "__count__ minuto fa", - "minute_ago_plural": "__count__ minuti fa", - "minute_in": "in __count__ minuto", - "minute_in_plural": "in __count__ minuti", - "hour_ago": "__count__ ora fa", - "hour_ago_plural": "__count__ ore fa", - "hour_in": "in __count__ ora", - "hour_in_plural": "in __count__ ore", - "day_ago": "__count__ giorno fa", - "day_ago_plural": "__count__ giorni fa", - "day_in": "in __count__ giorno", - "day_in_plural": "in __count__ giorni", - "month_ago": "__count__ mese fa", - "month_ago_plural": "__count__ mesi fa", - "month_in": "in __count__ mese", - "month_in_plural": "in __count__ mesi", - "year_ago": "__count__ anno fa", - "year_ago_plural": "__count__ anni fa", - "year_in": "in __count__ anno", - "year_in_plural": "in __count__ anni" - } - }, - de: { - translation: { - "now": "jetzt gerade", - "second_ago": "vor __count__ Sekunde", - "second_ago_plural": "vor __count__ Sekunden", - "second_in": "in __count__ Sekunde", - "second_in_plural": "in __count__ Sekunden", - "minute_ago": "vor __count__ Minute", - "minute_ago_plural": "vor __count__ Minuten", - "minute_in": "in __count__ Minute", - "minute_in_plural": "in __count__ Minuten", - "hour_ago": "vor __count__ Stunde", - "hour_ago_plural": "vor __count__ Stunden", - "hour_in": "in __count__ Stunde", - "hour_in_plural": "in __count__ Stunden", - "day_ago": "vor __count__ Tag", - "day_ago_plural": "vor __count__ Tagen", - "day_in": "in __count__ Tag", - "day_in_plural": "in __count__ Tagen", - "month_ago": "vor __count__ Monat", - "month_ago_plural": "vor __count__ Monaten", - "month_in": "in __count__ Monat", - "month_in_plural": "in __count__ Monaten", - "year_ago": "vor __count__ Jahr", - "year_ago_plural": "vor __count__ Jahren", - "year_in": "in __count__ Jahr", - "year_in_plural": "in __count__ Jahren" - } - }, - nl: { - translation: { - "now": "zonet", - "second_ago": "__count__ seconde geleden", - "second_ago_plural": "__count__ seconden geleden", - "second_in": "in __count__ seconde", - "second_in_plural": "in __count__ seconden", - "minute_ago": "__count__ minuut geleden", - "minute_ago_plural": "__count__ minuten geleden", - "minute_in": "in __count__ minuut", - "minute_in_plural": "in __count__ minuten", - "hour_ago": "__count__ uur geleden", - "hour_ago_plural": "__count__ uren geleden", - "hour_in": "in __count__ uur", - "hour_in_plural": "in __count__ uren", - "day_ago": "__count__ dag geleden", - "day_ago_plural": "__count__ dagen geleden", - "day_in": "in __count__ dag", - "day_in_plural": "in __count__ dagen", - "month_ago": "__count__ maand geleden", - "month_ago_plural": "__count__ maanden geleden", - "month_in": "in __count__ maand", - "month_in_plural": "in __count__ maanden", - "year_ago": "__count__ jaar geleden", - "year_ago_plural": "__count__ jaren geleden", - "year_in": "in __count__ jaar", - "year_in_plural": "in __count__ jaren" - } - }, - fr: { - translation: { - "now": "maintenant", - "second_ago": "il y a __count__ seconde", - "second_ago_plural": "il y a __count__ secondes", - "second_in": "dans __count__ seconde", - "second_in_plural": "dans __count__ secondes", - "minute_ago": "il y a __count__ minute", - "minute_ago_plural": "il y a __count__ minutes", - "minute_in": "dans __count__ minute", - "minute_in_plural": "dans __count__ minutes", - "hour_ago": "il y a __count__ heure", - "hour_ago_plural": "il y a __count__ heures", - "hour_in": "dans __count__ heure", - "hour_in_plural": "dans __count__ heures", - "day_ago": "il y a __count__ jour", - "day_ago_plural": "il y a __count__ jours", - "day_in": "dans __count__ jour", - "day_in_plural": "dans __count__ jours", - "month_ago": "il y a __count__ mois", - "month_ago_plural": "il y a __count__ mois", - "month_in": "dans __count__ mois", - "month_in_plural": "dans __count__ mois", - "year_ago": "il y a __count__ an", - "year_ago_plural": "il y a __count__ ans", - "year_in": "dans __count__ an", - "year_in_plural": "dans __count__ ans" - } - }, - th: { - translation: { - "now": "เมื่อกี้", - "second_ago": "__count__ วินาที ที่ผ่านมา", - "second_ago_plural": "__count__ วินาที ที่ผ่านมา", - "second_in": "อีก __count__ วินาที", - "second_in_plural": "อีก __count__ วินาที", - "minute_ago": "__count__ นาที ที่ผ่านมา", - "minute_ago_plural": "__count__ นาที ที่ผ่านมา", - "minute_in": "อีก __count__ นาที", - "minute_in_plural": "อีก __count__ นาที", - "hour_ago": "__count__ ชั่วโมง ที่ผ่านมา", - "hour_ago_plural": "__count__ ชั่วโมง ที่ผ่านมา", - "hour_in": "อีก __count__ ชั่วโมง", - "hour_in_plural": "อีก __count__ ชั่วโมง", - "day_ago": "__count__ วัน ที่ผ่านมา", - "day_ago_plural": "__count__ วัน ที่ผ่านมา", - "day_in": "อีก __count__ วัน", - "day_in_plural": "อีก __count__ วัน" - } - }, - sv: { - translation: { - "now": "just nu", - "second_ago": "__count__ sekund sedan", - "second_ago_plural": "__count__ sekunder sedan", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minut sedan", - "minute_ago_plural": "__count__ minuter sedan", - "minute_in": "om __count__ minut", - "minute_in_plural": "om __count__ minuter", - "hour_ago": "__count__ timme sedan", - "hour_ago_plural": "__count__ timmar sedan", - "hour_in": "om __count__ timme", - "hour_in_plural": "om __count__ timmar", - "day_ago": "__count__ dag sedan", - "day_ago_plural": "__count__ dagar sedan", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dagar" - } - }, - da: { - translation: { - "now": "lige nu", - "second_ago": "__count__ sekunder siden", - "second_ago_plural": "__count__ sekunder siden", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minut siden", - "minute_ago_plural": "__count__ minutter siden", - "minute_in": "om __count__ minut", - "minute_in_plural": "om __count__ minutter", - "hour_ago": "__count__ time siden", - "hour_ago_plural": "__count__ timer siden", - "hour_in": "om __count__ time", - "hour_in_plural": "om __count__ timer", - "day_ago": "__count__ dag siden", - "day_ago_plural": "__count__ dage siden", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dage" - } - }, - no: { - translation: { - "now": "akkurat nå", - "second_ago": "__count__ sekund siden", - "second_ago_plural": "__count__ sekunder siden", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minutt siden", - "minute_ago_plural": "__count__ minutter siden", - "minute_in": "om __count__ minutt", - "minute_in_plural": "om __count__ minutter", - "hour_ago": "__count__ time siden", - "hour_ago_plural": "__count__ timer siden", - "hour_in": "om __count__ time", - "hour_in_plural": "om __count__ timer", - "day_ago": "__count__ dag siden", - "day_ago_plural": "__count__ dager siden", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dager" - } - }, - ja: { - translation: { - "now": "たった今", - "second_ago": "__count__ 秒前", - "second_ago_plural": "__count__ 秒前", - "second_in": "あと __count__ 秒", - "second_in_plural": "あと __count__ 秒", - "minute_ago": "__count__ 分前", - "minute_ago_plural": "__count__ 分前", - "minute_in": "あと __count__ 分", - "minute_in_plural": "あと __count__ 分", - "hour_ago": "__count__ 時間前", - "hour_ago_plural": "__count__ 時間前", - "hour_in": "あと __count__ 時間", - "hour_in_plural": "あと __count__ 時間", - "day_ago": "__count__ 日間前", - "day_ago_plural": "__count__ 日間前", - "day_in": "あと __count__ 日間", - "day_in_plural": "あと __count__ 日間", - "month_ago": "__count__ ヶ月前", - "month_ago_plural": "__count__ ヶ月前", - "month_in": "あと __count__ ヶ月前", - "month_in_plural": "あと __count__ ヶ月前", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "あと __count__ 年", - "year_in_plural": "あと __count__ 年" - } - }, - jp: { - translation: { - "now": "たった今", - "second_ago": "__count__ 秒前", - "second_ago_plural": "__count__ 秒前", - "second_in": "あと __count__ 秒", - "second_in_plural": "あと __count__ 秒", - "minute_ago": "__count__ 分前", - "minute_ago_plural": "__count__ 分前", - "minute_in": "あと __count__ 分", - "minute_in_plural": "あと __count__ 分", - "hour_ago": "__count__ 時間前", - "hour_ago_plural": "__count__ 時間前", - "hour_in": "あと __count__ 時間", - "hour_in_plural": "あと __count__ 時間", - "day_ago": "__count__ 日間前", - "day_ago_plural": "__count__ 日間前", - "day_in": "あと __count__ 日間", - "day_in_plural": "あと __count__ 日間", - "month_ago": "__count__ ヶ月前", - "month_ago_plural": "__count__ ヶ月前", - "month_in": "あと __count__ ヶ月前", - "month_in_plural": "あと __count__ ヶ月前", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "あと __count__ 年", - "year_in_plural": "あと __count__ 年" - } - }, - pt: { - translation: { - "now": "neste exato momento", - "second_ago": "__count__ segundo atrás", - "second_ago_plural": "__count__ segundos atrás", - "second_in": "em __count__ segundo", - "second_in_plural": "em __count__ segundos", - "minute_ago": "__count__ minuto atrás", - "minute_ago_plural": "__count__ minutos atrás", - "minute_in": "em __count__ minuto", - "minute_in_plural": "em __count__ minutos", - "hour_ago": "__count__ hora atrás", - "hour_ago_plural": "__count__ horas atrás", - "hour_in": "em __count__ hora", - "hour_in_plural": "em __count__ horas", - "day_ago": "__count__ dia atrás", - "day_ago_plural": "__count__ dias atrás", - "day_in": "em __count__ dia", - "day_in_plural": "em __count__ dias", - "month_ago": "__count__ mês atrás", - "month_ago_plural": "__count__ meses atrás", - "month_in": "em __count__ mês", - "month_in_plural": "em __count__ meses", - "year_ago": "__count__ ano atrás", - "year_ago_plural": "__count__ anos atrás", - "year_in": "em __count__ ano", - "year_in_plural": "em __count__ anos" - } - }, - zh: { - translation: { - "now": "刚才", - "second_ago": "__count__ 秒钟前", - "second_ago_plural": "__count__ 秒钟前", - "second_in": "__count__ 秒内", - "second_in_plural": "__count__ 秒内", - "minute_ago": "__count__ 分钟前", - "minute_ago_plural": "__count__ 分钟前", - "minute_in": "__count__ 分钟内", - "minute_in_plural": "__count__ 分钟内", - "hour_ago": "__count__ 小时前", - "hour_ago_plural": "__count__ 小时前", - "hour_in": "__count__ 小时内", - "hour_in_plural": "__count__ 小时内", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天内", - "day_in_plural": "__count__ 天内", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月内", - "month_in_plural": "__count__ 月内", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年内", - "year_in_plural": "__count__ 年内" - } - }, - "zh-CN": { - translation: { - "now": "刚才", - "second_ago": "__count__ 秒钟前", - "second_ago_plural": "__count__ 秒钟前", - "second_in": "__count__ 秒内", - "second_in_plural": "__count__ 秒内", - "minute_ago": "__count__ 分钟前", - "minute_ago_plural": "__count__ 分钟前", - "minute_in": "__count__ 分钟内", - "minute_in_plural": "__count__ 分钟内", - "hour_ago": "__count__ 小时前", - "hour_ago_plural": "__count__ 小时前", - "hour_in": "__count__ 小时内", - "hour_in_plural": "__count__ 小时内", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天内", - "day_in_plural": "__count__ 天内", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月内", - "month_in_plural": "__count__ 月内", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年内", - "year_in_plural": "__count__ 年内" - } - }, - "zh-HK": { - translation: { - "now": "剛才", - "second_ago": "__count__ 秒鐘前", - "second_ago_plural": "__count__ 秒鐘前", - "second_in": "__count__ 秒內", - "second_in_plural": "__count__ 秒內", - "minute_ago": "__count__ 分鐘前", - "minute_ago_plural": "__count__ 分鐘前", - "minute_in": "__count__ 分鐘內", - "minute_in_plural": "__count__ 分鐘內", - "hour_ago": "__count__ 小時前", - "hour_ago_plural": "__count__ 小時前", - "hour_in": "__count__ 小時內", - "hour_in_plural": "__count__ 小時內", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天內", - "day_in_plural": "__count__ 天內", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月內", - "month_in_plural": "__count__ 月內", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年內", - "year_in_plural": "__count__ 年內" - } - }, - "zh-TW": { - translation: { - "now": "剛才", - "second_ago": "__count__ 秒鐘前", - "second_ago_plural": "__count__ 秒鐘前", - "second_in": "__count__ 秒內", - "second_in_plural": "__count__ 秒內", - "minute_ago": "__count__ 分鐘前", - "minute_ago_plural": "__count__ 分鐘前", - "minute_in": "__count__ 分鐘內", - "minute_in_plural": "__count__ 分鐘內", - "hour_ago": "__count__ 小時前", - "hour_ago_plural": "__count__ 小時前", - "hour_in": "__count__ 小時內", - "hour_in_plural": "__count__ 小時內", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天內", - "day_in_plural": "__count__ 天內", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月內", - "month_in_plural": "__count__ 月內", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年內", - "year_in_plural": "__count__ 年內" - } - } -}; -// tslint:enable -//# sourceMappingURL=relative.time.js.map \ No newline at end of file diff --git a/dist/native-modules/defaultTranslations/relative.time.js.map b/dist/native-modules/defaultTranslations/relative.time.js.map deleted file mode 100644 index 2086a256..00000000 --- a/dist/native-modules/defaultTranslations/relative.time.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"relative.time.js","sourceRoot":"","sources":["../../../src/defaultTranslations/relative.time.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,IAAM,YAAY,GAAwB;IAC/C,EAAE,EAAE;QACF,WAAW,EAAE;YACX,KAAK,EAAE,MAAM;YACb,YAAY,EAAE,qBAAqB;YACnC,mBAAmB,EAAE,qBAAqB;YAC1C,WAAW,EAAE,oBAAoB;YACjC,kBAAkB,EAAE,oBAAoB;YACxC,YAAY,EAAE,qBAAqB;YACnC,mBAAmB,EAAE,qBAAqB;YAC1C,WAAW,EAAE,oBAAoB;YACjC,kBAAkB,EAAE,oBAAoB;YACxC,UAAU,EAAE,oBAAoB;YAChC,iBAAiB,EAAE,qBAAqB;YACxC,SAAS,EAAE,mBAAmB;YAC9B,gBAAgB,EAAE,oBAAoB;YACtC,SAAS,EAAE,mBAAmB;YAC9B,gBAAgB,EAAE,oBAAoB;YACtC,QAAQ,EAAE,kBAAkB;YAC5B,eAAe,EAAE,mBAAmB;YACpC,WAAW,EAAE,mBAAmB;YAChC,kBAAkB,EAAE,oBAAoB;YACxC,UAAU,EAAE,kBAAkB;YAC9B,iBAAiB,EAAE,mBAAmB;YACtC,UAAU,EAAE,mBAAmB;YAC/B,iBAAiB,EAAE,qBAAqB;YACxC,SAAS,EAAE,kBAAkB;YAC7B,gBAAgB,EAAE,oBAAoB;SACvC;KACF;IACD,EAAE,EAAE;QACF,WAAW,EAAE;YACX,KAAK,EAAE,UAAU;YACjB,YAAY,EAAE,sBAAsB;YACpC,mBAAmB,EAAE,uBAAuB;YAC5C,WAAW,EAAE,qBAAqB;YAClC,kBAAkB,EAAE,sBAAsB;YAC1C,YAAY,EAAE,sBAAsB;YACpC,mBAAmB,EAAE,uBAAu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jC,UAAU,EAAE,cAAc;YAC1B,iBAAiB,EAAE,cAAc;YACjC,SAAS,EAAE,cAAc;YACzB,gBAAgB,EAAE,cAAc;SACjC;KACF;CACF,CAAC;AACF,gBAAgB"} \ No newline at end of file diff --git a/dist/native-modules/df/df-binding-behavior.js b/dist/native-modules/df/df-binding-behavior.js deleted file mode 100644 index 5498c28e..00000000 --- a/dist/native-modules/df/df-binding-behavior.js +++ /dev/null @@ -1,29 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -import { ValueConverter } from "aurelia-binding"; -var DfBindingBehavior = /** @class */ (function () { - function DfBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - DfBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; - DfBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the DfValueConverter. - // pass through any args to the binding behavior to the DfValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new ValueConverter(expression, "df", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - DfBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return DfBindingBehavior; -}()); -export { DfBindingBehavior }; -//# sourceMappingURL=df-binding-behavior.js.map \ No newline at end of file diff --git a/dist/native-modules/df/df-binding-behavior.js.map b/dist/native-modules/df/df-binding-behavior.js.map deleted file mode 100644 index ebcc05c6..00000000 --- a/dist/native-modules/df/df-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"df-binding-behavior.js","sourceRoot":"","sources":["../../../src/df/df-binding-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;IAGE,2BAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;QACxF,sDAAsD;QACtD,wEAAwE;QACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,cAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;IACJ,CAAC;IACM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IACH,wBAAC;AAAD,CAAC,AAzBD,IAyBC"} \ No newline at end of file diff --git a/dist/native-modules/df/df-value-converter.js b/dist/native-modules/df/df-value-converter.js deleted file mode 100644 index 37c5f521..00000000 --- a/dist/native-modules/df/df-value-converter.js +++ /dev/null @@ -1,26 +0,0 @@ -import { I18N } from "../i18n"; -import { isInteger } from "../utils"; -var DfValueConverter = /** @class */ (function () { - function DfValueConverter(service) { - this.service = service; - } - DfValueConverter.inject = function () { return [I18N]; }; - DfValueConverter.prototype.toView = function (value, dfOrOptions, locale) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (typeof value === "string" && isNaN(value) && !isInteger(value)) { - value = new Date(value); - } - if (dfOrOptions && (dfOrOptions instanceof Intl.DateTimeFormat && typeof dfOrOptions.format === "function")) { - return dfOrOptions.format(value); - } - var df = this.service.df(dfOrOptions, locale || this.service.getLocale()); - return df.format(value); - }; - return DfValueConverter; -}()); -export { DfValueConverter }; -//# sourceMappingURL=df-value-converter.js.map \ No newline at end of file diff --git a/dist/native-modules/df/df-value-converter.js.map b/dist/native-modules/df/df-value-converter.js.map deleted file mode 100644 index d30b0c7f..00000000 --- a/dist/native-modules/df/df-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"df-value-converter.js","sourceRoot":"","sources":["../../../src/df/df-value-converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC;IAGE,0BAAoB,OAAa;QAAb,YAAO,GAAP,OAAO,CAAM;IAAI,CAAC;IAFxB,uBAAM,GAApB,cAAyB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAIlC,iCAAM,GAAb,UACE,KAAU,EACV,WAA8D,EAC9D,MAAe;QAEf,IAAI,KAAK,KAAK,IAAI;eACb,OAAO,KAAK,KAAK,WAAW;eAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACrD;YACA,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAY,CAAC,IAAI,CAAC,SAAS,CAAC,KAAY,CAAC,EAAE;YAChF,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;QAED,IAAI,WAAW,IAAI,CAAC,WAAW,YAAY,IAAI,CAAC,cAAc,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE;YAC3G,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAClC;QAED,IAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAyC,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QAC1G,OAAO,EAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IACH,uBAAC;AAAD,CAAC,AA5BD,IA4BC"} \ No newline at end of file diff --git a/dist/native-modules/df/index.js b/dist/native-modules/df/index.js deleted file mode 100644 index 8dca4c6d..00000000 --- a/dist/native-modules/df/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./df-binding-behavior"; -export * from "./df-value-converter"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/native-modules/df/index.js.map b/dist/native-modules/df/index.js.map deleted file mode 100644 index bda5730c..00000000 --- a/dist/native-modules/df/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/df/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/dist/native-modules/i18n.js b/dist/native-modules/i18n.js deleted file mode 100644 index 71887daa..00000000 --- a/dist/native-modules/i18n.js +++ /dev/null @@ -1,311 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -import i18next from "i18next"; -import { DOM, PLATFORM } from "aurelia-pal"; -import * as LogManager from "aurelia-logging"; -import { autoinject } from "aurelia-framework"; -export var I18N_EA_SIGNAL = "i18n:locale:changed"; -var I18N = /** @class */ (function () { - function I18N(ea, signaler) { - this.ea = ea; - this.signaler = signaler; - this.globalVars = {}; - this.i18next = i18next; - this.Intl = PLATFORM.global.Intl; - } - I18N.prototype.setup = function (options) { - return __awaiter(this, void 0, void 0, function () { - var defaultOptions; - var _this = this; - return __generator(this, function (_a) { - defaultOptions = { - skipTranslationOnMissingKey: false, - compatibilityAPI: "v1", - compatibilityJSON: "v1", - lng: "en", - attributes: ["t", "i18n"], - fallbackLng: "en", - debug: false - }; - this.i18nextDeferred = new Promise(function (resolve, reject) { - _this.i18next = _this.i18next.init(options || defaultOptions, function (err) { - if (err) { - reject(err); - } - // make sure attributes is an array in case a string was provided - if (_this.i18next.options.attributes instanceof String) { - _this.i18next.options.attributes = [_this.i18next.options.attributes]; - } - resolve(_this.i18next); - }); - }); - return [2 /*return*/, this.i18nextDeferred]; - }); - }); - }; - I18N.prototype.i18nextReady = function () { - return this.i18nextDeferred; - }; - I18N.prototype.setLocale = function (locale) { - var _this = this; - return new Promise(function (resolve, reject) { - var oldLocale = _this.getLocale(); - _this.i18next.changeLanguage(locale, function (err, tr) { - if (err) { - reject(err); - } - _this.ea.publish(I18N_EA_SIGNAL, { oldValue: oldLocale, newValue: locale }); - _this.signaler.signal("aurelia-translation-signal"); - resolve(tr); - }); - }); - }; - I18N.prototype.getLocale = function () { - return this.i18next.language; - }; - I18N.prototype.nf = function (options, locales) { - return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); - }; - I18N.prototype.uf = function (numberLike, locale) { - var nf = this.nf({}, locale || this.getLocale()); - var comparer = nf.format(10000 / 3); - var thousandSeparator = comparer[1]; - var decimalSeparator = comparer[5]; - if (thousandSeparator === ".") { - thousandSeparator = "\\."; - } - // remove all thousand seperators - var result = numberLike.replace(new RegExp(thousandSeparator, "g"), "") - // remove non-numeric signs except -> , . - .replace(/[^\d.,-]/g, "") - // replace original decimalSeparator with english one - .replace(decimalSeparator, "."); - // return real number - return Number(result); - }; - I18N.prototype.df = function (options, locales) { - return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); - }; - I18N.prototype.tr = function (key, options) { - var fullOptions = this.globalVars; - if (options !== undefined) { - fullOptions = Object.assign(Object.assign({}, this.globalVars), options); - } - return this.i18next.t(key, fullOptions); - }; - I18N.prototype.registerGlobalVariable = function (key, value) { - this.globalVars[key] = value; - }; - I18N.prototype.unregisterGlobalVariable = function (key) { - delete this.globalVars[key]; - }; - /** - * Scans an element for children that have a translation attribute and - * updates their innerHTML with the current translation values. - * - * If an image is encountered the translated value will be applied to the src attribute. - * - * @param el HTMLElement to search within - */ - I18N.prototype.updateTranslations = function (el) { - if (!el || !el.querySelectorAll) { - return; - } - var i; - var l; - // create a selector from the specified attributes to look for - // var selector = [].concat(this.i18next.options.attributes); - var attributes = this.i18next.options.attributes; - var selector = [].concat(attributes); - for (i = 0, l = selector.length; i < l; i++) { - selector[i] = "[" + selector[i] + "]"; - } - selector = selector.join(","); - // get the nodes - var nodes = el.querySelectorAll(selector); - for (i = 0, l = nodes.length; i < l; i++) { - var node = nodes[i]; - var keys = void 0; - var params = void 0; - // test every attribute and get the first one that has a value - for (var i2 = 0, l2 = attributes.length; i2 < l2; i2++) { - keys = node.getAttribute(attributes[i2]); - var pname = attributes[i2] + "-params"; - if (pname && node.au && node.au[pname]) { - params = node.au[pname].viewModel.value; - } - if (keys) { - break; - } - } - // skip if nothing was found - if (!keys) { - continue; - } - // split the keys into multiple keys separated by a ; - this.updateValue(node, keys, params); - } - }; - I18N.prototype.updateValue = function (node, value, params) { - if (value === null || value === undefined) { - return; - } - var keys = value.toString().split(";"); - var i = keys.length; - while (i--) { - var key = keys[i]; - // remove the optional attribute - var re = /\[([a-z\-, ]*)\]/ig; - var m = void 0; - var attr = "text"; - // set default attribute to src if this is an image node - if (node.nodeName === "IMG") { - attr = "src"; - } - // check if a attribute was specified in the key - // tslint:disable-next-line:no-conditional-assignment - while ((m = re.exec(key)) !== null) { - if (m.index === re.lastIndex) { - re.lastIndex++; - } - if (m) { - key = key.replace(m[0], ""); - attr = m[1]; - } - } - var attrs = attr.split(","); - var j = attrs.length; - while (j--) { - attr = attrs[j].trim(); - if (!node._textContent) { - node._textContent = node.textContent; - } - if (!node._innerHTML) { - node._innerHTML = node.innerHTML; - } - // convert to camelCase - // tslint:disable-next-line:only-arrow-functions - var attrCC = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); - var reservedNames = ["prepend", "append", "text", "html"]; - var i18nLogger = LogManager.getLogger("i18n"); - if (reservedNames.indexOf(attr) > -1 && - node.au && - node.au.controller && - node.au.controller.viewModel && - attrCC in node.au.controller.viewModel) { - i18nLogger.warn("Aurelia I18N reserved attribute name\n\n [" + reservedNames.join(", ") + "]\n\n Your custom element has a bindable named " + attr + " which is a reserved word.\n\n If you'd like Aurelia I18N to translate your bindable instead, please consider giving it another name."); - } - if (this.i18next.options.skipTranslationOnMissingKey && - this.tr(key, params) === key) { - i18nLogger.warn("Couldn't find translation for key: " + key); - return; - } - // handle various attributes - // anything other than text,prepend,append or html will be added as an attribute on the element. - switch (attr) { - case "text": - var newChild = DOM.createTextNode(this.tr(key, params)); - if (node._newChild && node._newChild.parentNode === node) { - node.removeChild(node._newChild); - } - node._newChild = newChild; - while (node.firstChild) { - node.removeChild(node.firstChild); - } - node.appendChild(node._newChild); - break; - case "prepend": - var prependParser = DOM.createElement("div"); - prependParser.innerHTML = this.tr(key, params); - for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { - if (node.childNodes[ni]._prepended) { - node.removeChild(node.childNodes[ni]); - } - } - for (var pi = prependParser.childNodes.length - 1; pi >= 0; pi--) { - prependParser.childNodes[pi]._prepended = true; - if (node.firstChild) { - node.insertBefore(prependParser.childNodes[pi], node.firstChild); - } - else { - node.appendChild(prependParser.childNodes[pi]); - } - } - break; - case "append": - var appendParser = DOM.createElement("div"); - appendParser.innerHTML = this.tr(key, params); - for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { - if (node.childNodes[ni]._appended) { - node.removeChild(node.childNodes[ni]); - } - } - while (appendParser.firstChild) { - appendParser.firstChild._appended = true; - node.appendChild(appendParser.firstChild); - } - break; - case "html": - node.innerHTML = this.tr(key, params); - break; - default: // normal html attribute - if (node.au && - node.au.controller && - node.au.controller.viewModel && - attrCC in node.au.controller.viewModel) { - node.au.controller.viewModel[attrCC] = this.tr(key, params); - } - else { - node.setAttribute(attr, this.tr(key, params)); - } - break; - } - } - } - }; - I18N = __decorate([ - autoinject() - ], I18N); - return I18N; -}()); -export { I18N }; -//# sourceMappingURL=i18n.js.map \ No newline at end of file diff --git a/dist/native-modules/i18n.js.map b/dist/native-modules/i18n.js.map deleted file mode 100644 index 2f632d79..00000000 --- a/dist/native-modules/i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,OAGN,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,GAAG,EACH,QAAQ,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAiB/C,MAAM,CAAC,IAAM,cAAc,GAAG,qBAAqB,CAAC;AAGpD;IAME,cAAoB,EAAmB,EAAU,QAAyB;QAAtD,OAAE,GAAF,EAAE,CAAiB;QAAU,aAAQ,GAAR,QAAQ,CAAiB;QAFlE,eAAU,GAA2B,EAAE,CAAC;QAG9C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;IACnC,CAAC;IAEY,oBAAK,GAAlB,UAAmB,OAA8C;;;;;gBACzD,cAAc,GAAG;oBACrB,2BAA2B,EAAE,KAAK;oBAClC,gBAAgB,EAAE,IAAI;oBACtB,iBAAi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AAU,EAAE;OACA,IAAI,CA8RhB;IAAD,WAAC;CAAA,AA9RD,IA8RC;SA9RY,IAAI"} \ No newline at end of file diff --git a/dist/native-modules/nf/index.js b/dist/native-modules/nf/index.js deleted file mode 100644 index d0ec24df..00000000 --- a/dist/native-modules/nf/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./nf-binding-behavior"; -export * from "./nf-value-converter"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/native-modules/nf/index.js.map b/dist/native-modules/nf/index.js.map deleted file mode 100644 index 243f0577..00000000 --- a/dist/native-modules/nf/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nf/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/dist/native-modules/nf/nf-binding-behavior.js b/dist/native-modules/nf/nf-binding-behavior.js deleted file mode 100644 index ee012219..00000000 --- a/dist/native-modules/nf/nf-binding-behavior.js +++ /dev/null @@ -1,29 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -import { ValueConverter } from "aurelia-binding"; -var NfBindingBehavior = /** @class */ (function () { - function NfBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - NfBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; - NfBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the NfValueConverter. - // pass through any args to the binding behavior to the NfValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new ValueConverter(expression, "nf", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - NfBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return NfBindingBehavior; -}()); -export { NfBindingBehavior }; -//# sourceMappingURL=nf-binding-behavior.js.map \ No newline at end of file diff --git a/dist/native-modules/nf/nf-binding-behavior.js.map b/dist/native-modules/nf/nf-binding-behavior.js.map deleted file mode 100644 index eb5b33b4..00000000 --- a/dist/native-modules/nf/nf-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nf-binding-behavior.js","sourceRoot":"","sources":["../../../src/nf/nf-binding-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;IAGE,2BAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;QACxF,sDAAsD;QACtD,wEAAwE;QACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,cAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;IACJ,CAAC;IAEM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IACH,wBAAC;AAAD,CAAC,AA1BD,IA0BC"} \ No newline at end of file diff --git a/dist/native-modules/nf/nf-value-converter.js b/dist/native-modules/nf/nf-value-converter.js deleted file mode 100644 index 2fac1743..00000000 --- a/dist/native-modules/nf/nf-value-converter.js +++ /dev/null @@ -1,22 +0,0 @@ -import { I18N } from "../i18n"; -var NfValueConverter = /** @class */ (function () { - function NfValueConverter(service) { - this.service = service; - } - NfValueConverter.inject = function () { return [I18N]; }; - NfValueConverter.prototype.toView = function (value, nfOrOptions, locale) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (nfOrOptions && (nfOrOptions instanceof Intl.NumberFormat && typeof nfOrOptions.format === "function")) { - return nfOrOptions.format(value); - } - var nf = this.service.nf(nfOrOptions, locale || this.service.getLocale()); - return nf.format(value); - }; - return NfValueConverter; -}()); -export { NfValueConverter }; -//# sourceMappingURL=nf-value-converter.js.map \ No newline at end of file diff --git a/dist/native-modules/nf/nf-value-converter.js.map b/dist/native-modules/nf/nf-value-converter.js.map deleted file mode 100644 index d50dba82..00000000 --- a/dist/native-modules/nf/nf-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nf-value-converter.js","sourceRoot":"","sources":["../../../src/nf/nf-value-converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B;IAEE,0BAAoB,OAAa;QAAb,YAAO,GAAP,OAAO,CAAM;IAAG,CAAC;IADvB,uBAAM,GAApB,cAAyB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAGlC,iCAAM,GAAb,UACE,KAAU,EACV,WAA0D,EAC1D,MAAe;QAEf,IAAI,KAAK,KAAK,IAAI;eACb,OAAO,KAAK,KAAK,WAAW;eAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACnD;YACF,OAAO,KAAK,CAAC;SACd;QAED,IAAI,WAAW,IAAI,CAAC,WAAW,YAAY,IAAI,CAAC,YAAY,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE;YACzG,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAClC;QAED,IAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAuC,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACxG,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACH,uBAAC;AAAD,CAAC,AAvBD,IAuBC"} \ No newline at end of file diff --git a/dist/native-modules/relativeTime.js b/dist/native-modules/relativeTime.js deleted file mode 100644 index c65abdd7..00000000 --- a/dist/native-modules/relativeTime.js +++ /dev/null @@ -1,91 +0,0 @@ -import { EventAggregator } from "aurelia-event-aggregator"; -import { I18N, I18N_EA_SIGNAL } from "./i18n"; -import { translations } from "./defaultTranslations/relative.time"; -var RelativeTime = /** @class */ (function () { - function RelativeTime(service, ea) { - var _this = this; - this.service = service; - this.ea = ea; - this.service.i18nextReady().then(function () { - _this.setup(); - }); - this.ea.subscribe(I18N_EA_SIGNAL, function (locales) { - _this.setup(locales); - }); - } - RelativeTime.inject = function () { return [I18N, EventAggregator]; }; - RelativeTime.prototype.setup = function (locales) { - var trans = translations.default || translations; - var fallbackLng = this.service.i18next.fallbackLng; - var alternateFb = fallbackLng || this.service.i18next.options.fallbackLng; - if (Array.isArray(alternateFb) && alternateFb.length > 0) { - alternateFb = alternateFb[0]; - } - var key = ((locales && locales.newValue) - ? locales.newValue - : this.service.getLocale()) || alternateFb; - var index = 0; - // tslint:disable-next-line:no-conditional-assignment - if ((index = key.indexOf("-")) >= 0) { - var baseLocale = key.substring(0, index); - if (trans[baseLocale]) { - this.addTranslationResource(baseLocale, trans[baseLocale].translation); - } - } - if (trans[key]) { - this.addTranslationResource(key, trans[key].translation); - } - if (trans[fallbackLng]) { - this.addTranslationResource(key, trans[fallbackLng].translation); - } - }; - RelativeTime.prototype.addTranslationResource = function (key, translation) { - var options = this.service.i18next.options; - if (options.interpolation && (options.interpolation.prefix !== "__" || options.interpolation.suffix !== "__")) { - // tslint:disable-next-line:forin - for (var subkey in translation) { - translation[subkey] = translation[subkey] - .replace("__count__", (options.interpolation.prefix || "{{") + "count" + (options.interpolation.suffix || "}}")); - } - } - this.service.i18next.addResources(key, options.defaultNS || "translation", translation); - }; - RelativeTime.prototype.getRelativeTime = function (time) { - var now = new Date(); - var diff = now.getTime() - time.getTime(); - var timeDiff = this.getTimeDiffDescription(diff, "year", 31104000000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "month", 2592000000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "day", 86400000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "hour", 3600000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "minute", 60000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "second", 1000); - if (!timeDiff) { - timeDiff = this.service.tr("now"); - } - } - } - } - } - } - return timeDiff; - }; - RelativeTime.prototype.getTimeDiffDescription = function (diff, unit, timeDivisor) { - var unitAmount = parseInt((diff / timeDivisor).toFixed(0), 10); - if (unitAmount > 0) { - return this.service.tr(unit, { count: unitAmount, context: "ago" }); - } - else if (unitAmount < 0) { - var abs = Math.abs(unitAmount); - return this.service.tr(unit, { count: abs, context: "in" }); - } - return null; - }; - return RelativeTime; -}()); -export { RelativeTime }; -//# sourceMappingURL=relativeTime.js.map \ No newline at end of file diff --git a/dist/native-modules/relativeTime.js.map b/dist/native-modules/relativeTime.js.map deleted file mode 100644 index efab1c77..00000000 --- a/dist/native-modules/relativeTime.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"relativeTime.js","sourceRoot":"","sources":["../../src/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;QAEhG,IAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,IAAI,GAAG,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACjE,IAAI,UAAU,GAAG,CAAC,EAAE;YAClB,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;SACrE;aAAM,IAAI,UAAU,GAAG,CAAC,EAAE;YACzB,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACjC,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;SAC7D;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IACH,mBAAC;AAAD,CAAC,AAlGD,IAkGC"} \ No newline at end of file diff --git a/dist/native-modules/rt/index.js b/dist/native-modules/rt/index.js deleted file mode 100644 index edf97dc9..00000000 --- a/dist/native-modules/rt/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./rt-binding-behavior"; -export * from "./rt-value-converter"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/native-modules/rt/index.js.map b/dist/native-modules/rt/index.js.map deleted file mode 100644 index 2532c310..00000000 --- a/dist/native-modules/rt/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rt/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/dist/native-modules/rt/rt-binding-behavior.js b/dist/native-modules/rt/rt-binding-behavior.js deleted file mode 100644 index f2ab1d5e..00000000 --- a/dist/native-modules/rt/rt-binding-behavior.js +++ /dev/null @@ -1,29 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -import { ValueConverter } from "aurelia-binding"; -var RtBindingBehavior = /** @class */ (function () { - function RtBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - RtBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; - RtBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal", "aurelia-relativetime-signal"); - // rewrite the expression to use the RtValueConverter. - // pass through any args to the binding behavior to the RtValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new ValueConverter(expression, "rt", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - RtBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return RtBindingBehavior; -}()); -export { RtBindingBehavior }; -//# sourceMappingURL=rt-binding-behavior.js.map \ No newline at end of file diff --git a/dist/native-modules/rt/rt-binding-behavior.js.map b/dist/native-modules/rt/rt-binding-behavior.js.map deleted file mode 100644 index bf5aa967..00000000 --- a/dist/native-modules/rt/rt-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rt-binding-behavior.js","sourceRoot":"","sources":["../../../src/rt/rt-binding-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;IAGE,2BAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CACtC,OAAO,EAAE,MAAM,EAAE,4BAA4B,EAAE,6BAA6B,CAC7E,CAAC;QACF,sDAAsD;QACtD,wEAAwE;QACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,cAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;IACJ,CAAC;IAEM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IACH,wBAAC;AAAD,CAAC,AA5BD,IA4BC"} \ No newline at end of file diff --git a/dist/native-modules/rt/rt-value-converter.js b/dist/native-modules/rt/rt-value-converter.js deleted file mode 100644 index 91bea93c..00000000 --- a/dist/native-modules/rt/rt-value-converter.js +++ /dev/null @@ -1,21 +0,0 @@ -import { RelativeTime } from "../relativeTime"; -var RtValueConverter = /** @class */ (function () { - function RtValueConverter(service) { - this.service = service; - } - RtValueConverter.inject = function () { return [RelativeTime]; }; - RtValueConverter.prototype.toView = function (value) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (typeof value === "string" && isNaN(value) && !Number.isInteger(value)) { - value = new Date(value); - } - return this.service.getRelativeTime(value); - }; - return RtValueConverter; -}()); -export { RtValueConverter }; -//# sourceMappingURL=rt-value-converter.js.map \ No newline at end of file diff --git a/dist/native-modules/rt/rt-value-converter.js.map b/dist/native-modules/rt/rt-value-converter.js.map deleted file mode 100644 index b0529fe6..00000000 --- a/dist/native-modules/rt/rt-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rt-value-converter.js","sourceRoot":"","sources":["../../../src/rt/rt-value-converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;IAEE,0BAAoB,OAAqB;QAArB,YAAO,GAAP,OAAO,CAAc;IAAG,CAAC;IAD/B,uBAAM,GAApB,cAAyB,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAG1C,iCAAM,GAAb,UAAc,KAAU;QACtB,IAAI,KAAK,KAAK,IAAI;eACb,OAAO,KAAK,KAAK,WAAW;eAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACnD;YACF,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAY,CAAC,EAAE;YACvF,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;IACH,uBAAC;AAAD,CAAC,AAlBD,IAkBC"} \ No newline at end of file diff --git a/dist/native-modules/t/index.js b/dist/native-modules/t/index.js deleted file mode 100644 index 16a538e2..00000000 --- a/dist/native-modules/t/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./t-binding-behavior"; -export * from "./t-custom-attribute"; -export * from "./t-params-custom-attribute"; -export * from "./t-value-converter"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/native-modules/t/index.js.map b/dist/native-modules/t/index.js.map deleted file mode 100644 index 2a6666da..00000000 --- a/dist/native-modules/t/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/t/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC"} \ No newline at end of file diff --git a/dist/native-modules/t/t-binding-behavior.js b/dist/native-modules/t/t-binding-behavior.js deleted file mode 100644 index 497f4c8b..00000000 --- a/dist/native-modules/t/t-binding-behavior.js +++ /dev/null @@ -1,29 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -import { ValueConverter } from "aurelia-binding"; -var TBindingBehavior = /** @class */ (function () { - function TBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - TBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the TValueConverter. - // pass through any args to the binding behavior to the TValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new ValueConverter(expression, "t", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - TBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - TBindingBehavior.inject = [SignalBindingBehavior]; - return TBindingBehavior; -}()); -export { TBindingBehavior }; -//# sourceMappingURL=t-binding-behavior.js.map \ No newline at end of file diff --git a/dist/native-modules/t/t-binding-behavior.js.map b/dist/native-modules/t/t-binding-behavior.js.map deleted file mode 100644 index 1a766444..00000000 --- a/dist/native-modules/t/t-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-binding-behavior.js","sourceRoot":"","sources":["../../../src/t/t-binding-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;IAGE,0BAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAI,CAAC;IAE9D,+BAAI,GAAX,UAAY,OAAY,EAAE,MAAW;QACnC,2BAA2B;QAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;QACxF,qDAAqD;QACrD,uEAAuE;QACvE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,2CAA2C;QAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;YAC9B,OAAO;SACR;QACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;QAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,cAAc,CAC9C,UAAU,EAAE,GAAG,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC9E,CAAC;IACJ,CAAC;IAEM,iCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;QACrC,6BAA6B;QAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IAxBa,uBAAM,GAAG,CAAC,qBAAqB,CAAC,CAAC;IA0BjD,uBAAC;CAAA,AA3BD,IA2BC;SA3BY,gBAAgB"} \ No newline at end of file diff --git a/dist/native-modules/t/t-custom-attribute.js b/dist/native-modules/t/t-custom-attribute.js deleted file mode 100644 index 016d279e..00000000 --- a/dist/native-modules/t/t-custom-attribute.js +++ /dev/null @@ -1,63 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -import { customAttribute, HtmlBehaviorResource } from "aurelia-templating"; -import { EventAggregator } from "aurelia-event-aggregator"; -import { metadata } from "aurelia-metadata"; -import { DOM } from "aurelia-pal"; -import { I18N, I18N_EA_SIGNAL } from "../i18n"; -import { LazyOptional } from "../utils"; -import { TParamsCustomAttribute } from "./t-params-custom-attribute"; -var TCustomAttribute = /** @class */ (function () { - function TCustomAttribute(element, service, ea, p) { - this.element = element; - this.service = service; - this.ea = ea; - this.lazyParams = p; - } - TCustomAttribute_1 = TCustomAttribute; - TCustomAttribute.inject = function () { - return [DOM.Element, I18N, EventAggregator, LazyOptional.of(TParamsCustomAttribute)]; - }; - TCustomAttribute.configureAliases = function (aliases) { - var r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TCustomAttribute_1); - r.aliases = aliases; - }; - TCustomAttribute.prototype.bind = function () { - var _this = this; - this.params = this.lazyParams(); - if (this.params) { - this.params.valueChanged = function (newParams, oldParams) { - _this.paramsChanged(_this.value, newParams, oldParams); - }; - } - var p = this.params !== null ? this.params.value : undefined; - this.subscription = this.ea.subscribe(I18N_EA_SIGNAL, function () { - _this.service.updateValue(_this.element, _this.value, _this.params !== null ? _this.params.value : undefined); - }); - this.service.updateValue(this.element, this.value, p); - }; - TCustomAttribute.prototype.paramsChanged = function (newValue, newParams) { - this.service.updateValue(this.element, newValue, newParams); - }; - TCustomAttribute.prototype.valueChanged = function (newValue) { - var p = this.params !== null ? this.params.value : undefined; - this.service.updateValue(this.element, newValue, p); - }; - TCustomAttribute.prototype.unbind = function () { - // If unbind is called before timeout for subscription is triggered, subscription will be undefined - if (this.subscription) { - this.subscription.dispose(); - } - }; - var TCustomAttribute_1; - TCustomAttribute = TCustomAttribute_1 = __decorate([ - customAttribute("t") - ], TCustomAttribute); - return TCustomAttribute; -}()); -export { TCustomAttribute }; -//# sourceMappingURL=t-custom-attribute.js.map \ No newline at end of file diff --git a/dist/native-modules/t/t-custom-attribute.js.map b/dist/native-modules/t/t-custom-attribute.js.map deleted file mode 100644 index 3cdddd6c..00000000 --- a/dist/native-modules/t/t-custom-attribute.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-custom-attribute.js","sourceRoot":"","sources":["../../../src/t/t-custom-attribute.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,eAAe,EACf,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EAEhB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,EACL,IAAI,EACJ,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE;IAcE,0BACU,OAA8B,EAC9B,OAAa,EACb,EAAmB,EAC3B,CAAM;QAHE,YAAO,GAAP,OAAO,CAAuB;QAC9B,YAAO,GAAP,OAAO,CAAM;QACb,OAAE,GAAF,EAAE,CAAiB;QAG3B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IACtB,CAAC;yBArBU,gBAAgB;IACb,uBAAM,GAApB;QACE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,YAAY,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAC;IACvF,CAAC;IACa,iCAAgB,GAA9B,UAA+B,OAAiB;QAC9C,IAAM,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,EAAE,kBAAgB,CAAC,CAAC;QAC5F,CAAS,CAAC,OAAO,GAAG,OAAO,CAAC;IAC/B,CAAC;IAgBM,+BAAI,GA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,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC;IAEM,iCAAM,GAAb;QACE,mGAAmG;QACnG,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;SAC7B;IACH,CAAC;;IAtDU,gBAAgB;QAD5B,eAAe,CAAC,GAAG,CAAC;OACR,gBAAgB,CAuD5B;IAAD,uBAAC;CAAA,AAvDD,IAuDC;SAvDY,gBAAgB"} \ No newline at end of file diff --git a/dist/native-modules/t/t-params-custom-attribute.js b/dist/native-modules/t/t-params-custom-attribute.js deleted file mode 100644 index 20799688..00000000 --- a/dist/native-modules/t/t-params-custom-attribute.js +++ /dev/null @@ -1,30 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -import { customAttribute, HtmlBehaviorResource } from "aurelia-templating"; -import { metadata } from "aurelia-metadata"; -import { DOM } from "aurelia-pal"; -var TParamsCustomAttribute = /** @class */ (function () { - function TParamsCustomAttribute(element) { - this.element = element; - } - TParamsCustomAttribute_1 = TParamsCustomAttribute; - TParamsCustomAttribute.inject = function () { - return [DOM.Element]; - }; - TParamsCustomAttribute.configureAliases = function (aliases) { - var r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TParamsCustomAttribute_1); - r.aliases = aliases; - }; - TParamsCustomAttribute.prototype.valueChanged = function () { }; - var TParamsCustomAttribute_1; - TParamsCustomAttribute = TParamsCustomAttribute_1 = __decorate([ - customAttribute("t-params") - ], TParamsCustomAttribute); - return TParamsCustomAttribute; -}()); -export { TParamsCustomAttribute }; -//# sourceMappingURL=t-params-custom-attribute.js.map \ No newline at end of file diff --git a/dist/native-modules/t/t-params-custom-attribute.js.map b/dist/native-modules/t/t-params-custom-attribute.js.map deleted file mode 100644 index 3f691651..00000000 --- a/dist/native-modules/t/t-params-custom-attribute.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-params-custom-attribute.js","sourceRoot":"","sources":["../../../src/t/t-params-custom-attribute.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,eAAe,EACf,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC;IAYE,gCAAmB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAI,CAAC;+BAZ7B,sBAAsB;IACnB,6BAAM,GAApB;QACE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAEa,uCAAgB,GAA9B,UAA+B,OAAiB;QAC9C,IAAM,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,EAAE,wBAAsB,CAAC,CAAC;QAClG,CAAS,CAAC,OAAO,GAAG,OAAO,CAAC;IAC/B,CAAC;IAMM,6CAAY,GAAnB,cAA6B,CAAC;;IAdnB,sBAAsB;QADlC,eAAe,CAAC,UAAU,CAAC;OACf,sBAAsB,CAelC;IAAD,6BAAC;CAAA,AAfD,IAeC;SAfY,sBAAsB"} \ No newline at end of file diff --git a/dist/native-modules/t/t-value-converter.js b/dist/native-modules/t/t-value-converter.js deleted file mode 100644 index c231def0..00000000 --- a/dist/native-modules/t/t-value-converter.js +++ /dev/null @@ -1,13 +0,0 @@ -import { I18N } from "../i18n"; -var TValueConverter = /** @class */ (function () { - function TValueConverter(service) { - this.service = service; - } - TValueConverter.inject = function () { return [I18N]; }; - TValueConverter.prototype.toView = function (value, options) { - return this.service.tr(value, options); - }; - return TValueConverter; -}()); -export { TValueConverter }; -//# sourceMappingURL=t-value-converter.js.map \ No newline at end of file diff --git a/dist/native-modules/t/t-value-converter.js.map b/dist/native-modules/t/t-value-converter.js.map deleted file mode 100644 index 598e821d..00000000 --- a/dist/native-modules/t/t-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-value-converter.js","sourceRoot":"","sources":["../../../src/t/t-value-converter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B;IAGE,yBAAoB,OAAa;QAAb,YAAO,GAAP,OAAO,CAAM;IAAI,CAAC;IAFxB,sBAAM,GAApB,cAAyB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAIlC,gCAAM,GAAb,UAAc,KAAU,EAAE,OAA4C;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IACH,sBAAC;AAAD,CAAC,AARD,IAQC"} \ No newline at end of file diff --git a/dist/native-modules/utils.js b/dist/native-modules/utils.js deleted file mode 100644 index 924dea15..00000000 --- a/dist/native-modules/utils.js +++ /dev/null @@ -1,60 +0,0 @@ -var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -}; -import { resolver } from "aurelia-dependency-injection"; -export var extend = function (destination, source) { - // tslint:disable-next-line:forin - for (var property in source) { - destination[property] = source[property]; - } - return destination; -}; -// tslint:disable-next-line:only-arrow-functions -export var isInteger = Number.isInteger || function (value) { - return typeof value === "number" && - isFinite(value) && - Math.floor(value) === value; -}; -export var assignObjectToKeys = function (root, obj) { - if (obj === undefined || obj === null) { - return obj; - } - var opts = {}; - Object.keys(obj).map(function (key) { - if (typeof obj[key] === "object") { - extend(opts, assignObjectToKeys(key, obj[key])); - } - else { - opts[root !== "" ? root + "." + key : key] = obj[key]; - } - }); - return opts; -}; -var LazyOptional = /** @class */ (function () { - function LazyOptional(key) { - this.key = key; - } - LazyOptional_1 = LazyOptional; - LazyOptional.of = function (key) { - return new LazyOptional_1(key); - }; - LazyOptional.prototype.get = function (container) { - var _this = this; - return function () { - if (container.hasResolver(_this.key, false)) { - return container.get(_this.key); - } - return null; - }; - }; - var LazyOptional_1; - LazyOptional = LazyOptional_1 = __decorate([ - resolver() - ], LazyOptional); - return LazyOptional; -}()); -export { LazyOptional }; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/dist/native-modules/utils.js.map b/dist/native-modules/utils.js.map deleted file mode 100644 index 8b406752..00000000 --- a/dist/native-modules/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,QAAQ,EAET,MAAM,8BAA8B,CAAC;AAEtC,MAAM,CAAC,IAAI,MAAM,GAAG,UAAC,WAAgB,EAAE,MAAW;IAChD,iCAAiC;IACjC,KAAK,IAAM,QAAQ,IAAI,MAAM,EAAE;QAC7B,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;KAC1C;IAED,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,gDAAgD;AAChD,MAAM,CAAC,IAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,UAAS,KAAK;IACzD,OAAO,OAAO,KAAK,KAAK,QAAQ;QAC9B,QAAQ,CAAC,KAAK,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,KAAK,CAA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end of file diff --git a/dist/system/aurelia-i18n-loader.js b/dist/system/aurelia-i18n-loader.js deleted file mode 100644 index f08e534b..00000000 --- a/dist/system/aurelia-i18n-loader.js +++ /dev/null @@ -1,127 +0,0 @@ -System.register([], function (exports_1, context_1) { - "use strict"; - var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - var Backend; - var __moduleName = context_1 && context_1.id; - return { - setters: [], - execute: function () { - Backend = /** @class */ (function () { - function Backend(services, options) { - if (options === void 0) { options = {}; } - this.services = services; - this.options = options; - this.type = "backend"; - this.init(services, options); - } - Backend.with = function (loader) { - this.loader = loader; - return this; - }; - Backend.prototype.init = function (services, options) { - if (options === void 0) { options = {}; } - this.services = services; - this.options = Object.assign({}, { - loadPath: "/locales/{{lng}}/{{ns}}.json", - addPath: "locales/add/{{lng}}/{{ns}}", - allowMultiLoading: false, - parse: JSON.parse - }, options); - }; - Backend.prototype.readMulti = function (languages, namespaces, callback) { - var loadPath = this.options.loadPath; - if (typeof this.options.loadPath === "function") { - loadPath = this.options.loadPath(languages, namespaces); - } - var url = this.services - .interpolator - .interpolate(loadPath, { lng: languages.join("+"), ns: namespaces.join("+") }); - this.loadUrl(url, callback); - }; - Backend.prototype.read = function (language, namespace, callback) { - var loadPath = this.options.loadPath; - if (typeof this.options.loadPath === "function") { - loadPath = this.options.loadPath([language], [namespace]); - } - var url = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }); - this.loadUrl(url, callback); - }; - Backend.prototype.loadUrl = function (url, callback) { - return __awaiter(this, void 0, void 0, function () { - var response, ret, err, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 2, , 3]); - return [4 /*yield*/, Backend.loader.loadText(url)]; - case 1: - response = _b.sent(); - ret = void 0; - err = void 0; - try { - ret = (response instanceof Object) ? response : this.options.parse(response, url); - } - catch (e) { - err = "failed parsing " + url + " to json"; - } - if (err) { - return [2 /*return*/, callback(err, false)]; - } - callback(null, ret); - return [3 /*break*/, 3]; - case 2: - _a = _b.sent(); - callback("failed loading " + url, false /* no retry */); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); - }); - }; - // tslint:disable-next-line:variable-name - Backend.prototype.create = function (_languages, _namespace, _key, _fallbackValue) { - // not supported - }; - Backend.type = "backend"; - return Backend; - }()); - exports_1("Backend", Backend); - exports_1("default", Backend); - } - }; -}); -//# sourceMappingURL=aurelia-i18n-loader.js.map \ No newline at end of file diff --git a/dist/system/aurelia-i18n-loader.js.map b/dist/system/aurelia-i18n-loader.js.map deleted file mode 100644 index 2c080eb2..00000000 --- a/dist/system/aurelia-i18n-loader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aurelia-i18n-loader.js","sourceRoot":"","sources":["../../src/aurelia-i18n-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA8BE,iBAAmB,QAAa,EAAS,OAAmC;oBAAnC,wBAAA,EAAA,YAAmC;oBAAzD,aAAQ,GAAR,QAAQ,CAAK;oBAAS,YAAO,GAAP,OAAO,CAA4B;oBAFrE,SAAI,GAAW,SAAS,CAAC;oBAG9B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBAC/B,CAAC;gBARa,YAAI,GAAlB,UAAmB,MAAc;oBAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;oBACrB,OAAO,IAAI,CAAC;gBACd,CAAC;gBAOM,sBAAI,GAAX,UAAY,QAAa,EAAE,OAAmC;oBAAnC,wBAAA,EAAA,YAAmC;oBAC5D,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;oBACzB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE;wBAC/B,QAAQ,EAAE,8BAA8B;wBACxC,OAAO,EAAE,4BAA4B;wBACrC,iBAAiB,EAAE,KAAK;wBACxB,KAAK,EAAE,IAAI,CAAC,KAAK;qBAClB,EAAE,OAAO,CAAC,CAAC;gBACd,CAAC;gBAEM,2BAAS,GAAhB,UAAiB,SAAmB,EAAE,UAAoB,EAAE,QAAsB;oBAChF,IAAI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,CAAC;oCACJ,GAAG,SAAA,CAAC;oCACR,IAAI;wCACF,GAAG,GAAG,CAAC,QAAe,YAAY,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;qCAC3F;oCAAC,OAAO,CAAC,EAAE;wCACV,GAAG,GAAG,iBAAiB,GAAG,GAAG,GAAG,UAAU,CAAC;qCAC5C;oCAED,IAAI,GAAG,EAAE;wCACP,sBAAO,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,EAAC;qCAC7B;oCACD,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;;;;oCAEpB,QAAQ,CAAC,iBAAiB,GAAG,GAAG,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;;;;;;iBAE3D;gBAED,yCAAyC;gBAClC,wBAAM,GAAb,UAAc,UAA6B,EAAE,UAAkB,EAAE,IAAY,EAAE,cAAsB;oBACnG,gBAAgB;gBAClB,CAAC;gBAxEa,YAAI,GAAW,SAAS,CAAC;gBAyEzC,cAAC;aAAA,AA3ED;;iCA6Ee,OAAO"} \ No newline at end of file diff --git a/dist/system/aurelia-i18n.js b/dist/system/aurelia-i18n.js index cfea1c94..a0cc8fb9 100644 --- a/dist/system/aurelia-i18n.js +++ b/dist/system/aurelia-i18n.js @@ -1,121 +1,1408 @@ -System.register(["aurelia-event-aggregator", "aurelia-templating", "aurelia-templating-resources", "aurelia-pal", "./i18n", "./relativeTime", "./aurelia-i18n-loader", "./df", "./nf", "./rt", "./t"], function (exports_1, context_1) { - "use strict"; - var aurelia_event_aggregator_1, aurelia_templating_1, aurelia_templating_resources_1, aurelia_pal_1, i18n_1; - var __moduleName = context_1 && context_1.id; - function configure(frameworkConfig, cb) { - if (cb === undefined || typeof cb !== "function") { - var errorMsg = "You need to provide a callback method to properly configure the library"; - throw errorMsg; - } - frameworkConfig.globalResources([ - aurelia_pal_1.PLATFORM.moduleName("./t/t-value-converter"), - aurelia_pal_1.PLATFORM.moduleName("./t/t-custom-attribute"), - aurelia_pal_1.PLATFORM.moduleName("./t/t-params-custom-attribute"), - aurelia_pal_1.PLATFORM.moduleName("./t/t-binding-behavior") - ]); - frameworkConfig.globalResources([ - aurelia_pal_1.PLATFORM.moduleName("./nf/nf-value-converter"), - aurelia_pal_1.PLATFORM.moduleName("./nf/nf-binding-behavior") - ]); - frameworkConfig.globalResources([ - aurelia_pal_1.PLATFORM.moduleName("./df/df-value-converter"), - aurelia_pal_1.PLATFORM.moduleName("./df/df-binding-behavior") - ]); - frameworkConfig.globalResources([ - aurelia_pal_1.PLATFORM.moduleName("./rt/rt-value-converter"), - aurelia_pal_1.PLATFORM.moduleName("./rt/rt-binding-behavior") - ]); - var instance = new i18n_1.I18N(frameworkConfig.container.get(aurelia_event_aggregator_1.EventAggregator), frameworkConfig.container.get(aurelia_templating_resources_1.BindingSignaler)); - frameworkConfig.container.registerInstance(i18n_1.I18N, instance); - var ret = cb(instance); - frameworkConfig.postTask(function () { - var resources = frameworkConfig.container.get(aurelia_templating_1.ViewResources); - var htmlBehaviorResource = resources.getAttribute("t"); - var htmlParamsResource = resources.getAttribute("t-params"); - var attributes = instance.i18next.options.attributes; - // Register default attributes if none provided - if (!attributes) { - attributes = ["t", "i18n"]; - } - attributes.forEach(function (alias) { return resources.registerAttribute(alias, htmlBehaviorResource, "t"); }); - attributes.forEach(function (alias) { return resources.registerAttribute(alias + "-params", htmlParamsResource, "t-params"); }); - }); - return ret; - } - exports_1("configure", configure); - var exportedNames_1 = { - "configure": true, - "DfValueConverter": true, - "DfBindingBehavior": true, - "NfValueConverter": true, - "NfBindingBehavior": true, - "RtValueConverter": true, - "RtBindingBehavior": true, - "TValueConverter": true, - "TBindingBehavior": true, - "TCustomAttribute": true, - "TParamsCustomAttribute": true - }; - function exportStar_1(m) { - var exports = {}; - for (var n in m) { - if (n !== "default" && !exportedNames_1.hasOwnProperty(n)) exports[n] = m[n]; - } - exports_1(exports); - } +System.register(['i18next', 'aurelia-logging', 'aurelia-dependency-injection', 'aurelia-templating', 'aurelia-metadata', 'aurelia-pal', 'aurelia-framework', 'aurelia-templating-resources', 'aurelia-event-aggregator', 'aurelia-binding'], function (exports, module) { + 'use strict'; + var i18next, getLogger, resolver, customAttribute, HtmlBehaviorResource, ViewResources, metadata, DOM, PLATFORM, valueConverter, BindingSignaler, SignalBindingBehavior, EventAggregator, ValueConverter, bindingBehavior, valueConverter$1; return { - setters: [ - function (aurelia_event_aggregator_1_1) { - aurelia_event_aggregator_1 = aurelia_event_aggregator_1_1; - }, - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_templating_resources_1_1) { - aurelia_templating_resources_1 = aurelia_templating_resources_1_1; - }, - function (aurelia_pal_1_1) { - aurelia_pal_1 = aurelia_pal_1_1; - }, - function (i18n_1_1) { - i18n_1 = i18n_1_1; - exportStar_1(i18n_1_1); - }, - function (relativeTime_1_1) { - exportStar_1(relativeTime_1_1); - }, - function (aurelia_i18n_loader_1_1) { - exportStar_1(aurelia_i18n_loader_1_1); - }, - function (df_1_1) { - exports_1({ - "DfValueConverter": df_1_1["DfValueConverter"], - "DfBindingBehavior": df_1_1["DfBindingBehavior"] - }); - }, - function (nf_1_1) { - exports_1({ - "NfValueConverter": nf_1_1["NfValueConverter"], - "NfBindingBehavior": nf_1_1["NfBindingBehavior"] - }); - }, - function (rt_1_1) { - exports_1({ - "RtValueConverter": rt_1_1["RtValueConverter"], - "RtBindingBehavior": rt_1_1["RtBindingBehavior"] - }); - }, - function (t_1_1) { - exports_1({ - "TValueConverter": t_1_1["TValueConverter"], - "TBindingBehavior": t_1_1["TBindingBehavior"], - "TCustomAttribute": t_1_1["TCustomAttribute"], - "TParamsCustomAttribute": t_1_1["TParamsCustomAttribute"] + setters: [function (module) { + i18next = module.default; + }, function (module) { + getLogger = module.getLogger; + }, function (module) { + resolver = module.resolver; + }, function (module) { + customAttribute = module.customAttribute; + HtmlBehaviorResource = module.HtmlBehaviorResource; + ViewResources = module.ViewResources; + }, function (module) { + metadata = module.metadata; + }, function (module) { + DOM = module.DOM; + PLATFORM = module.PLATFORM; + }, function (module) { + valueConverter = module.valueConverter; + }, function (module) { + BindingSignaler = module.BindingSignaler; + SignalBindingBehavior = module.SignalBindingBehavior; + }, function (module) { + EventAggregator = module.EventAggregator; + }, function (module) { + ValueConverter = module.ValueConverter; + bindingBehavior = module.bindingBehavior; + valueConverter$1 = module.valueConverter; + }], + execute: function () { + + exports('configure', configure); + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + + function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + } + + var I18N_EA_SIGNAL = exports('I18N_EA_SIGNAL', "i18n:locale:changed"); + var I18N = exports('I18N', /** @class */ (function () { + function I18N(ea, signaler) { + this.ea = ea; + this.signaler = signaler; + this.globalVars = {}; + this.i18next = i18next; + this.Intl = PLATFORM.global.Intl; + } + I18N.inject = function () { return [EventAggregator, BindingSignaler]; }; + I18N.prototype.setup = function (options) { + return __awaiter(this, void 0, void 0, function () { + var defaultOptions; + var _this = this; + return __generator(this, function (_a) { + defaultOptions = { + skipTranslationOnMissingKey: false, + compatibilityAPI: "v1", + compatibilityJSON: "v1", + lng: "en", + attributes: ["t", "i18n"], + fallbackLng: "en", + debug: false + }; + this.i18nextDeferred = new Promise(function (resolve, reject) { + _this.i18next = _this.i18next.init(options || defaultOptions, function (err) { + if (err) { + reject(err); + } + // make sure attributes is an array in case a string was provided + if (_this.i18next.options.attributes instanceof String) { + _this.i18next.options.attributes = [_this.i18next.options.attributes]; + } + resolve(_this.i18next); + }); + }); + return [2 /*return*/, this.i18nextDeferred]; + }); + }); + }; + I18N.prototype.i18nextReady = function () { + return this.i18nextDeferred; + }; + I18N.prototype.setLocale = function (locale) { + var _this = this; + return new Promise(function (resolve, reject) { + var oldLocale = _this.getLocale(); + _this.i18next.changeLanguage(locale, function (err, tr) { + if (err) { + reject(err); + } + _this.ea.publish(I18N_EA_SIGNAL, { oldValue: oldLocale, newValue: locale }); + _this.signaler.signal("aurelia-translation-signal"); + resolve(tr); + }); + }); + }; + I18N.prototype.getLocale = function () { + return this.i18next.language; + }; + I18N.prototype.nf = function (options, locales) { + return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); + }; + I18N.prototype.uf = function (numberLike, locale) { + var nf = this.nf({}, locale || this.getLocale()); + var comparer = nf.format(10000 / 3); + var thousandSeparator = comparer[1]; + var decimalSeparator = comparer[5]; + if (thousandSeparator === ".") { + thousandSeparator = "\\."; + } + // remove all thousand seperators + var result = numberLike.replace(new RegExp(thousandSeparator, "g"), "") + // remove non-numeric signs except -> , . + .replace(/[^\d.,-]/g, "") + // replace original decimalSeparator with english one + .replace(decimalSeparator, "."); + // return real number + return Number(result); + }; + I18N.prototype.df = function (options, locales) { + return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); + }; + I18N.prototype.tr = function (key, options) { + var fullOptions = this.globalVars; + if (options !== undefined) { + fullOptions = Object.assign(Object.assign({}, this.globalVars), options); + } + return this.i18next.t(key, fullOptions); + }; + I18N.prototype.registerGlobalVariable = function (key, value) { + this.globalVars[key] = value; + }; + I18N.prototype.unregisterGlobalVariable = function (key) { + delete this.globalVars[key]; + }; + /** + * Scans an element for children that have a translation attribute and + * updates their innerHTML with the current translation values. + * + * If an image is encountered the translated value will be applied to the src attribute. + * + * @param el HTMLElement to search within + */ + I18N.prototype.updateTranslations = function (el) { + if (!el || !el.querySelectorAll) { + return; + } + var i; + var l; + // create a selector from the specified attributes to look for + // var selector = [].concat(this.i18next.options.attributes); + var attributes = this.i18next.options.attributes; + var selector = [].concat(attributes); + for (i = 0, l = selector.length; i < l; i++) { + selector[i] = "[" + selector[i] + "]"; + } + selector = selector.join(","); + // get the nodes + var nodes = el.querySelectorAll(selector); + for (i = 0, l = nodes.length; i < l; i++) { + var node = nodes[i]; + var keys = void 0; + var params = void 0; + // test every attribute and get the first one that has a value + for (var i2 = 0, l2 = attributes.length; i2 < l2; i2++) { + keys = node.getAttribute(attributes[i2]); + var pname = attributes[i2] + "-params"; + if (pname && node.au && node.au[pname]) { + params = node.au[pname].viewModel.value; + } + if (keys) { + break; + } + } + // skip if nothing was found + if (!keys) { + continue; + } + // split the keys into multiple keys separated by a ; + this.updateValue(node, keys, params); + } + }; + I18N.prototype.updateValue = function (node, value, params) { + if (value === null || value === undefined) { + return; + } + var keys = value.toString().split(";"); + var i = keys.length; + while (i--) { + var key = keys[i]; + // remove the optional attribute + var re = /\[([a-z\-, ]*)\]/ig; + var m = void 0; + var attr = "text"; + // set default attribute to src if this is an image node + if (node.nodeName === "IMG") { + attr = "src"; + } + // check if a attribute was specified in the key + // tslint:disable-next-line:no-conditional-assignment + while ((m = re.exec(key)) !== null) { + if (m.index === re.lastIndex) { + re.lastIndex++; + } + if (m) { + key = key.replace(m[0], ""); + attr = m[1]; + } + } + var attrs = attr.split(","); + var j = attrs.length; + while (j--) { + attr = attrs[j].trim(); + if (!node._textContent) { + node._textContent = node.textContent; + } + if (!node._innerHTML) { + node._innerHTML = node.innerHTML; + } + // convert to camelCase + // tslint:disable-next-line:only-arrow-functions + var attrCC = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); + var reservedNames = ["prepend", "append", "text", "html"]; + var i18nLogger = getLogger("i18n"); + if (reservedNames.indexOf(attr) > -1 && + node.au && + node.au.controller && + node.au.controller.viewModel && + attrCC in node.au.controller.viewModel) { + i18nLogger.warn("Aurelia I18N reserved attribute name\n\n [" + reservedNames.join(", ") + "]\n\n Your custom element has a bindable named " + attr + " which is a reserved word.\n\n If you'd like Aurelia I18N to translate your bindable instead, please consider giving it another name."); + } + if (this.i18next.options.skipTranslationOnMissingKey && + this.tr(key, params) === key) { + i18nLogger.warn("Couldn't find translation for key: " + key); + return; + } + // handle various attributes + // anything other than text,prepend,append or html will be added as an attribute on the element. + switch (attr) { + case "text": + var newChild = DOM.createTextNode(this.tr(key, params)); + if (node._newChild && node._newChild.parentNode === node) { + node.removeChild(node._newChild); + } + node._newChild = newChild; + while (node.firstChild) { + node.removeChild(node.firstChild); + } + node.appendChild(node._newChild); + break; + case "prepend": + var prependParser = DOM.createElement("div"); + prependParser.innerHTML = this.tr(key, params); + for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { + if (node.childNodes[ni]._prepended) { + node.removeChild(node.childNodes[ni]); + } + } + for (var pi = prependParser.childNodes.length - 1; pi >= 0; pi--) { + prependParser.childNodes[pi]._prepended = true; + if (node.firstChild) { + node.insertBefore(prependParser.childNodes[pi], node.firstChild); + } + else { + node.appendChild(prependParser.childNodes[pi]); + } + } + break; + case "append": + var appendParser = DOM.createElement("div"); + appendParser.innerHTML = this.tr(key, params); + for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { + if (node.childNodes[ni]._appended) { + node.removeChild(node.childNodes[ni]); + } + } + while (appendParser.firstChild) { + appendParser.firstChild._appended = true; + node.appendChild(appendParser.firstChild); + } + break; + case "html": + node.innerHTML = this.tr(key, params); + break; + default: // normal html attribute + if (node.au && + node.au.controller && + node.au.controller.viewModel && + attrCC in node.au.controller.viewModel) { + node.au.controller.viewModel[attrCC] = this.tr(key, params); + } + else { + node.setAttribute(attr, this.tr(key, params)); + } + break; + } + } + } + }; + return I18N; + }())); + + var TBindingBehavior = exports('TBindingBehavior', /** @class */ (function () { + function TBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + TBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; + TBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the TValueConverter. + // pass through any args to the binding behavior to the TValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "t", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + TBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + TBindingBehavior = __decorate([ + bindingBehavior("t") + ], TBindingBehavior); + return TBindingBehavior; + }())); + + // tslint:disable-next-line:only-arrow-functions + var isInteger = Number.isInteger || function (value) { + return typeof value === "number" && + isFinite(value) && + Math.floor(value) === value; + }; + var LazyOptional = /** @class */ (function () { + function LazyOptional(key) { + this.key = key; + } + LazyOptional_1 = LazyOptional; + LazyOptional.of = function (key) { + return new LazyOptional_1(key); + }; + LazyOptional.prototype.get = function (container) { + var _this = this; + return function () { + if (container.hasResolver(_this.key, false)) { + return container.get(_this.key); + } + return null; + }; + }; + var LazyOptional_1; + LazyOptional = LazyOptional_1 = __decorate([ + resolver() + ], LazyOptional); + return LazyOptional; + }()); + + var TParamsCustomAttribute = exports('TParamsCustomAttribute', /** @class */ (function () { + function TParamsCustomAttribute(element) { + this.element = element; + } + TParamsCustomAttribute_1 = TParamsCustomAttribute; + TParamsCustomAttribute.inject = function () { + return [DOM.Element]; + }; + TParamsCustomAttribute.configureAliases = function (aliases) { + var r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TParamsCustomAttribute_1); + r.aliases = aliases; + }; + TParamsCustomAttribute.prototype.valueChanged = function () { }; + var TParamsCustomAttribute_1; + TParamsCustomAttribute = TParamsCustomAttribute_1 = __decorate([ + customAttribute("t-params") + ], TParamsCustomAttribute); + return TParamsCustomAttribute; + }())); + + var TCustomAttribute = exports('TCustomAttribute', /** @class */ (function () { + function TCustomAttribute(element, service, ea, p) { + this.element = element; + this.service = service; + this.ea = ea; + this.lazyParams = p; + } + TCustomAttribute_1 = TCustomAttribute; + TCustomAttribute.inject = function () { + return [DOM.Element, I18N, EventAggregator, LazyOptional.of(TParamsCustomAttribute)]; + }; + TCustomAttribute.configureAliases = function (aliases) { + var r = metadata.getOrCreateOwn(metadata.resource, HtmlBehaviorResource, TCustomAttribute_1); + r.aliases = aliases; + }; + TCustomAttribute.prototype.bind = function () { + var _this = this; + this.params = this.lazyParams(); + if (this.params) { + this.params.valueChanged = function (newParams, oldParams) { + _this.paramsChanged(_this.value, newParams, oldParams); + }; + } + var p = this.params !== null ? this.params.value : undefined; + this.subscription = this.ea.subscribe(I18N_EA_SIGNAL, function () { + _this.service.updateValue(_this.element, _this.value, _this.params !== null ? _this.params.value : undefined); + }); + this.service.updateValue(this.element, this.value, p); + }; + TCustomAttribute.prototype.paramsChanged = function (newValue, newParams) { + this.service.updateValue(this.element, newValue, newParams); + }; + TCustomAttribute.prototype.valueChanged = function (newValue) { + var p = this.params !== null ? this.params.value : undefined; + this.service.updateValue(this.element, newValue, p); + }; + TCustomAttribute.prototype.unbind = function () { + // If unbind is called before timeout for subscription is triggered, subscription will be undefined + if (this.subscription) { + this.subscription.dispose(); + } + }; + var TCustomAttribute_1; + TCustomAttribute = TCustomAttribute_1 = __decorate([ + customAttribute("t") + ], TCustomAttribute); + return TCustomAttribute; + }())); + + var TValueConverter = exports('TValueConverter', /** @class */ (function () { + function TValueConverter(service) { + this.service = service; + } + TValueConverter.inject = function () { return [I18N]; }; + TValueConverter.prototype.toView = function (value, options) { + return this.service.tr(value, options); + }; + TValueConverter = __decorate([ + valueConverter("t") + ], TValueConverter); + return TValueConverter; + }())); + + var NfBindingBehavior = exports('NfBindingBehavior', /** @class */ (function () { + function NfBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + NfBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; + NfBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the NfValueConverter. + // pass through any args to the binding behavior to the NfValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "nf", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + NfBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + NfBindingBehavior = __decorate([ + bindingBehavior("nf") + ], NfBindingBehavior); + return NfBindingBehavior; + }())); + + var NfValueConverter = exports('NfValueConverter', /** @class */ (function () { + function NfValueConverter(service) { + this.service = service; + } + NfValueConverter.inject = function () { return [I18N]; }; + NfValueConverter.prototype.toView = function (value, nfOrOptions, locale) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (nfOrOptions && (nfOrOptions instanceof Intl.NumberFormat && typeof nfOrOptions.format === "function")) { + return nfOrOptions.format(value); + } + var nf = this.service.nf(nfOrOptions, locale || this.service.getLocale()); + return nf.format(value); + }; + NfValueConverter = __decorate([ + valueConverter$1("nf") + ], NfValueConverter); + return NfValueConverter; + }())); + + var DfBindingBehavior = exports('DfBindingBehavior', /** @class */ (function () { + function DfBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + DfBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; + DfBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); + // rewrite the expression to use the DfValueConverter. + // pass through any args to the binding behavior to the DfValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "df", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + DfBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + DfBindingBehavior = __decorate([ + bindingBehavior("df") + ], DfBindingBehavior); + return DfBindingBehavior; + }())); + + var DfValueConverter = exports('DfValueConverter', /** @class */ (function () { + function DfValueConverter(service) { + this.service = service; + } + DfValueConverter.inject = function () { return [I18N]; }; + DfValueConverter.prototype.toView = function (value, dfOrOptions, locale) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (typeof value === "string" && isNaN(value) && !isInteger(value)) { + value = new Date(value); + } + if (dfOrOptions && (dfOrOptions instanceof Intl.DateTimeFormat && typeof dfOrOptions.format === "function")) { + return dfOrOptions.format(value); + } + var df = this.service.df(dfOrOptions, locale || this.service.getLocale()); + return df.format(value); + }; + DfValueConverter = __decorate([ + valueConverter$1("df") + ], DfValueConverter); + return DfValueConverter; + }())); + + var RtBindingBehavior = exports('RtBindingBehavior', /** @class */ (function () { + function RtBindingBehavior(signalBindingBehavior) { + this.signalBindingBehavior = signalBindingBehavior; + } + RtBindingBehavior.inject = function () { return [SignalBindingBehavior]; }; + RtBindingBehavior.prototype.bind = function (binding, source) { + // bind the signal behavior + this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal", "aurelia-relativetime-signal"); + // rewrite the expression to use the RtValueConverter. + // pass through any args to the binding behavior to the RtValueConverter + var sourceExpression = binding.sourceExpression; + // do create the sourceExpression only once + if (sourceExpression.rewritten) { + return; + } + sourceExpression.rewritten = true; + var expression = sourceExpression.expression; + sourceExpression.expression = new ValueConverter(expression, "rt", sourceExpression.args, [expression].concat(sourceExpression.args)); + }; + RtBindingBehavior.prototype.unbind = function (binding, source) { + // unbind the signal behavior + this.signalBindingBehavior.unbind(binding, source); + }; + RtBindingBehavior = __decorate([ + bindingBehavior("rt") + ], RtBindingBehavior); + return RtBindingBehavior; + }())); + + var translations = { + ar: { + translation: { + now: 'الآن', + second_ago: 'منذ __count__ ثانية', + second_ago_plural: 'منذ __count__ ثواني', + second_in: 'في __count__ ثانية', + second_in_plural: 'في __count__ ثواني', + minute_ago: 'منذ __count__ دقيقة', + minute_ago_plural: 'منذ __count__ دقائق', + minute_in: 'في __count__ دقيقة', + minute_in_plural: 'في __count__ دقائق', + hour_ago: 'منذ __count__ ساعة', + hour_ago_plural: 'منذ __count__ ساعات', + hour_in: 'في __count__ ساعة', + hour_in_plural: 'في __count__ ساعات', + day_ago: 'منذ __count__ يوم', + day_ago_plural: 'منذ __count__ أيام', + day_in: 'في __count__ يوم', + day_in_plural: 'في __count__ أيام', + month_ago: 'منذ __count__ شهر', + month_ago_plural: 'منذ __count__ أشهر', + month_in: 'في __count__ شهر', + month_in_plural: 'في __count__ أشهر', + year_ago: 'منذ __count__ سنة', + year_ago_plural: 'منذ __count__ سنوات', + year_in: 'في __count__ سنة', + year_in_plural: 'في __count__ سنوات' + } + }, + da: { + translation: { + now: 'lige nu', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'i __count__ sekund', + second_in_plural: 'i __count__ sekunder', + minute_ago: '__count__ minut siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'i __count__ minut', + minute_in_plural: 'i __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'i __count__ time', + hour_in_plural: 'i __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dage siden', + day_in: 'i __count__ dag', + day_in_plural: 'i __count__ dage', + month_ago: '__count__ måned siden', + month_ago_plural: '__count__ måneder siden', + month_in: 'i __count__ måned', + month_in_plural: 'i __count__ måneder', + year_ago: '__count__ år siden', + year_ago_plural: '__count__ år siden', + year_in: 'i __count__ år', + year_in_plural: 'i __count__ år' + } + }, + de: { + translation: { + now: 'jetzt gerade', + second_ago: 'vor __count__ Sekunde', + second_ago_plural: 'vor __count__ Sekunden', + second_in: 'in __count__ Sekunde', + second_in_plural: 'in __count__ Sekunden', + minute_ago: 'vor __count__ Minute', + minute_ago_plural: 'vor __count__ Minuten', + minute_in: 'in __count__ Minute', + minute_in_plural: 'in __count__ Minuten', + hour_ago: 'vor __count__ Stunde', + hour_ago_plural: 'vor __count__ Stunden', + hour_in: 'in __count__ Stunde', + hour_in_plural: 'in __count__ Stunden', + day_ago: 'vor __count__ Tag', + day_ago_plural: 'vor __count__ Tagen', + day_in: 'in __count__ Tag', + day_in_plural: 'in __count__ Tagen', + month_ago: 'vor __count__ Monat', + month_ago_plural: 'vor __count__ Monaten', + month_in: 'in __count__ Monat', + month_in_plural: 'in __count__ Monaten', + year_ago: 'vor __count__ Jahr', + year_ago_plural: 'vor __count__ Jahren', + year_in: 'in __count__ Jahr', + year_in_plural: 'in __count__ Jahren' + } + }, + en: { + translation: { + now: 'just now', + second_ago: '__count__ second ago', + second_ago_plural: '__count__ seconds ago', + second_in: 'in __count__ second', + second_in_plural: 'in __count__ seconds', + minute_ago: '__count__ minute ago', + minute_ago_plural: '__count__ minutes ago', + minute_in: 'in __count__ minute', + minute_in_plural: 'in __count__ minutes', + hour_ago: '__count__ hour ago', + hour_ago_plural: '__count__ hours ago', + hour_in: 'in __count__ hour', + hour_in_plural: 'in __count__ hours', + day_ago: '__count__ day ago', + day_ago_plural: '__count__ days ago', + day_in: 'in __count__ day', + day_in_plural: 'in __count__ days', + month_ago: '__count__ month ago', + month_ago_plural: '__count__ months ago', + month_in: 'in __count__ month', + month_in_plural: 'in __count__ months', + year_ago: '__count__ year ago', + year_ago_plural: '__count__ years ago', + year_in: 'in __count__ year', + year_in_plural: 'in __count__ years' + } + }, + es: { + translation: { + now: 'ahora mismo', + second_ago: 'hace __count__ segundo', + second_ago_plural: 'hace __count__ segundos', + second_in: 'en __count__ segundo', + second_in_plural: 'en __count__ segundos', + minute_ago: 'hace __count__ minuto', + minute_ago_plural: 'hace __count__ minutos', + minute_in: 'en __count__ minuto', + minute_in_plural: 'en __count__ minutos', + hour_ago: 'hace __count__ hora', + hour_ago_plural: 'hace __count__ horas', + hour_in: 'en __count__ hora', + hour_in_plural: 'en __count__ horas', + day_ago: 'hace __count__ día', + day_ago_plural: 'hace __count__ días', + day_in: 'en __count__ día', + day_in_plural: 'en __count__ días', + month_ago: 'hace __count__ mes', + month_ago_plural: 'hace __count__ meses', + month_in: 'en __count__ mes', + month_in_plural: 'en __count__ meses', + year_ago: 'hace __count__ año', + year_ago_plural: 'hace __count__ años', + year_in: 'en __count__ año', + year_in_plural: 'en __count__ años' + } + }, + fi: { + translation: { + now: 'Nyt', + second_ago: '__count__ sekuntti sitten', + second_ago_plural: '__count__ sekunttia sitten', + second_in: ' __count__ sekunnin kuluttua', + second_in_plural: ' __count__ sekunttien kuluttua', + minute_ago: '__count__ minuutti sitten', + minute_ago_plural: '__count__ minuuttia sitten', + minute_in: ' __count__ minuutin kuluttua', + minute_in_plural: ' __count__ minuuttien kuluttua', + hour_ago: '__count__ tunti sitten', + hour_ago_plural: '__count__ tuntia sitten', + hour_in: ' __count__ tunnin kuluttua', + hour_in_plural: ' __count__ tunnin kuluttua', + day_ago: '__count__ päivä sitten', + day_ago_plural: '__count__ päiviä sitten', + day_in: ' __count__ päivän kuluttua', + day_in_plural: '__count__ päivien kuluttua', + month_ago: '__count__ kuukausi sitten', + month_ago_plural: '__count__ kuukausia sitten', + month_in: ' __count__ kuukauden kuluttua', + month_in_plural: ' __count__ kuukausien kuluttua', + year_ago: '__count__ vuosi sitten', + year_ago_plural: '__count__ vuosia sitten', + year_in: ' __count__ vuoden kuluttua', + year_in_plural: ' __count__ vuosien kuluttua' + } + }, + fr: { + translation: { + now: 'maintenant', + second_ago: 'il y a __count__ seconde', + second_ago_plural: 'il y a __count__ secondes', + second_in: 'dans __count__ seconde', + second_in_plural: 'dans __count__ secondes', + minute_ago: 'il y a __count__ minute', + minute_ago_plural: 'il y a __count__ minutes', + minute_in: 'dans __count__ minute', + minute_in_plural: 'dans __count__ minutes', + hour_ago: 'il y a __count__ heure', + hour_ago_plural: 'il y a __count__ heures', + hour_in: 'dans __count__ heure', + hour_in_plural: 'dans __count__ heures', + day_ago: 'il y a __count__ jour', + day_ago_plural: 'il y a __count__ jours', + day_in: 'dans __count__ jour', + day_in_plural: 'dans __count__ jours', + month_ago: 'il y a __count__ mois', + month_ago_plural: 'il y a __count__ mois', + month_in: 'dans __count__ mois', + month_in_plural: 'dans __count__ mois', + year_ago: 'il y a __count__ an', + year_ago_plural: 'il y a __count__ ans', + year_in: 'dans __count__ an', + year_in_plural: 'dans __count__ ans' + } + }, + it: { + translation: { + now: 'adesso', + second_ago: '__count__ secondo fa', + second_ago_plural: '__count__ secondi fa', + second_in: 'in __count__ secondo', + second_in_plural: 'in __count__ secondi', + minute_ago: '__count__ minuto fa', + minute_ago_plural: '__count__ minuti fa', + minute_in: 'in __count__ minuto', + minute_in_plural: 'in __count__ minuti', + hour_ago: '__count__ ora fa', + hour_ago_plural: '__count__ ore fa', + hour_in: 'in __count__ ora', + hour_in_plural: 'in __count__ ore', + day_ago: '__count__ giorno fa', + day_ago_plural: '__count__ giorni fa', + day_in: 'in __count__ giorno', + day_in_plural: 'in __count__ giorni', + month_ago: '__count__ mese fa', + month_ago_plural: '__count__ mesi fa', + month_in: 'in __count__ mese', + month_in_plural: 'in __count__ mesi', + year_ago: '__count__ anno fa', + year_ago_plural: '__count__ anni fa', + year_in: 'in __count__ anno', + year_in_plural: 'in __count__ anni' + } + }, + ja: { + translation: { + now: 'たった今', + second_ago: '__count__ 秒前', + second_ago_plural: '__count__ 秒前', + second_in: 'あと __count__ 秒', + second_in_plural: 'あと __count__ 秒', + minute_ago: '__count__ 分前', + minute_ago_plural: '__count__ 分前', + minute_in: 'あと __count__ 分', + minute_in_plural: 'あと __count__ 分', + hour_ago: '__count__ 時間前', + hour_ago_plural: '__count__ 時間前', + hour_in: 'あと __count__ 時間', + hour_in_plural: 'あと __count__ 時間', + day_ago: '__count__ 日間前', + day_ago_plural: '__count__ 日間前', + day_in: 'あと __count__ 日間', + day_in_plural: 'あと __count__ 日間', + month_ago: '__count__ ヶ月前', + month_ago_plural: '__count__ ヶ月前', + month_in: 'あと __count__ ヶ月前', + month_in_plural: 'あと __count__ ヶ月前', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: 'あと __count__ 年', + year_in_plural: 'あと __count__ 年' + } + }, + nl: { + translation: { + now: 'zonet', + second_ago: '__count__ seconde geleden', + second_ago_plural: '__count__ seconden geleden', + second_in: 'in __count__ seconde', + second_in_plural: 'in __count__ seconden', + minute_ago: '__count__ minuut geleden', + minute_ago_plural: '__count__ minuten geleden', + minute_in: 'in __count__ minuut', + minute_in_plural: 'in __count__ minuten', + hour_ago: '__count__ uur geleden', + hour_ago_plural: '__count__ uren geleden', + hour_in: 'in __count__ uur', + hour_in_plural: 'in __count__ uren', + day_ago: '__count__ dag geleden', + day_ago_plural: '__count__ dagen geleden', + day_in: 'in __count__ dag', + day_in_plural: 'in __count__ dagen', + month_ago: '__count__ maand geleden', + month_ago_plural: '__count__ maanden geleden', + month_in: 'in __count__ maand', + month_in_plural: 'in __count__ maanden', + year_ago: '__count__ jaar geleden', + year_ago_plural: '__count__ jaren geleden', + year_in: 'in __count__ jaar', + year_in_plural: 'in __count__ jaren' + } + }, + nn: { + translation: { + now: 'akkurat nå', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minutt siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'om __count__ minutt', + minute_in_plural: 'om __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'om __count__ time', + hour_in_plural: 'om __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dager siden', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dager', + month_ago: '__count__ en måned siden', + month_ago_plural: '__count__ flere måneder siden', + month_in: 'I løpet av en __count__ måned', + month_in_plural: 'I løpet av __count__ måneder', + year_ago: '__count__ et år siden', + year_ago_plural: '__count__ flere å siden', + year_in: 'I løpet av ett år __count__ år', + year_in_plural: 'på flere __count__ år' + } + }, + no: { + translation: { + now: 'akkurat nå', + second_ago: '__count__ sekund siden', + second_ago_plural: '__count__ sekunder siden', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minutt siden', + minute_ago_plural: '__count__ minutter siden', + minute_in: 'om __count__ minutt', + minute_in_plural: 'om __count__ minutter', + hour_ago: '__count__ time siden', + hour_ago_plural: '__count__ timer siden', + hour_in: 'om __count__ time', + hour_in_plural: 'om __count__ timer', + day_ago: '__count__ dag siden', + day_ago_plural: '__count__ dager siden', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dager', + month_ago: '__count__ en måned siden', + month_ago_plural: '__count__ flere måneder siden', + month_in: 'I løpet av en __count__ måned', + month_in_plural: 'I løpet av __count__ måneder', + year_ago: '__count__ et år siden', + year_ago_plural: '__count__ flere å siden', + year_in: 'I løpet av ett år __count__ år', + year_in_plural: 'på flere __count__ år' + } + }, + pt: { + translation: { + now: 'neste exato momento', + second_ago: '__count__ segundo atrás', + second_ago_plural: '__count__ segundos atrás', + second_in: 'em __count__ segundo', + second_in_plural: 'em __count__ segundos', + minute_ago: '__count__ minuto atrás', + minute_ago_plural: '__count__ minutos atrás', + minute_in: 'em __count__ minuto', + minute_in_plural: 'em __count__ minutos', + hour_ago: '__count__ hora atrás', + hour_ago_plural: '__count__ horas atrás', + hour_in: 'em __count__ hora', + hour_in_plural: 'em __count__ horas', + day_ago: '__count__ dia atrás', + day_ago_plural: '__count__ dias atrás', + day_in: 'em __count__ dia', + day_in_plural: 'em __count__ dias', + month_ago: '__count__ mês atrás', + month_ago_plural: '__count__ meses atrás', + month_in: 'em __count__ mês', + month_in_plural: 'em __count__ meses', + year_ago: '__count__ ano atrás', + year_ago_plural: '__count__ anos atrás', + year_in: 'em __count__ ano', + year_in_plural: 'em __count__ anos' + } + }, + sv: { + translation: { + now: 'nu', + second_ago: '__count__ sekund sedan', + second_ago_plural: '__count__ sekunder sedan', + second_in: 'om __count__ sekund', + second_in_plural: 'om __count__ sekunder', + minute_ago: '__count__ minut sedan', + minute_ago_plural: '__count__ minuter sedan', + minute_in: 'om __count__ minut', + minute_in_plural: 'om __count__ minuter', + hour_ago: '__count__ timme sedan', + hour_ago_plural: '__count__ timmar sedan', + hour_in: 'om __count__ timme', + hour_in_plural: 'om __count__ timmar', + day_ago: '__count__ dag sedan', + day_ago_plural: '__count__ dagar sedan', + day_in: 'om __count__ dag', + day_in_plural: 'om __count__ dagar', + month_ago: '__count__ månad sedan', + month_ago_plural: '__count__ månader sedan', + month_in: 'om __count__ månad', + month_in_plural: 'om __count__ månader', + year_ago: '__count__ år sedan', + year_ago_plural: '__count__ år sedan', + year_in: 'om __count__ år', + year_in_plural: 'om __count__ år' + } + }, + th: { + translation: { + now: 'เมื่อกี้', + second_ago: '__count__ วินาที ที่ผ่านมา', + second_ago_plural: '__count__ วินาที ที่ผ่านมา', + second_in: 'อีก __count__ วินาที', + second_in_plural: 'อีก __count__ วินาที', + minute_ago: '__count__ นาที ที่ผ่านมา', + minute_ago_plural: '__count__ นาที ที่ผ่านมา', + minute_in: 'อีก __count__ นาที', + minute_in_plural: 'อีก __count__ นาที', + hour_ago: '__count__ ชั่วโมง ที่ผ่านมา', + hour_ago_plural: '__count__ ชั่วโมง ที่ผ่านมา', + hour_in: 'อีก __count__ ชั่วโมง', + hour_in_plural: 'อีก __count__ ชั่วโมง', + day_ago: '__count__ วัน ที่ผ่านมา', + day_ago_plural: '__count__ วัน ที่ผ่านมา', + day_in: 'อีก __count__ วัน', + day_in_plural: 'อีก __count__ วัน' + } + }, + zh: { + translation: { + now: '刚才', + second_ago: '__count__ 秒钟前', + second_ago_plural: '__count__ 秒钟前', + second_in: '__count__ 秒内', + second_in_plural: '__count__ 秒内', + minute_ago: '__count__ 分钟前', + minute_ago_plural: '__count__ 分钟前', + minute_in: '__count__ 分钟内', + minute_in_plural: '__count__ 分钟内', + hour_ago: '__count__ 小时前', + hour_ago_plural: '__count__ 小时前', + hour_in: '__count__ 小时内', + hour_in_plural: '__count__ 小时内', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天内', + day_in_plural: '__count__ 天内', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月内', + month_in_plural: '__count__ 月内', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年内', + year_in_plural: '__count__ 年内' + } + }, + 'zh-CN': { + translation: { + now: '刚才', + second_ago: '__count__ 秒钟前', + second_ago_plural: '__count__ 秒钟前', + second_in: '__count__ 秒内', + second_in_plural: '__count__ 秒内', + minute_ago: '__count__ 分钟前', + minute_ago_plural: '__count__ 分钟前', + minute_in: '__count__ 分钟内', + minute_in_plural: '__count__ 分钟内', + hour_ago: '__count__ 小时前', + hour_ago_plural: '__count__ 小时前', + hour_in: '__count__ 小时内', + hour_in_plural: '__count__ 小时内', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天内', + day_in_plural: '__count__ 天内', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月内', + month_in_plural: '__count__ 月内', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年内', + year_in_plural: '__count__ 年内' + } + }, + 'zh-HK': { + translation: { + now: '剛才', + second_ago: '__count__ 秒鐘前', + second_ago_plural: '__count__ 秒鐘前', + second_in: '__count__ 秒內', + second_in_plural: '__count__ 秒內', + minute_ago: '__count__ 分鐘前', + minute_ago_plural: '__count__ 分鐘前', + minute_in: '__count__ 分鐘內', + minute_in_plural: '__count__ 分鐘內', + hour_ago: '__count__ 小時前', + hour_ago_plural: '__count__ 小時前', + hour_in: '__count__ 小時內', + hour_in_plural: '__count__ 小時內', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天內', + day_in_plural: '__count__ 天內', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月內', + month_in_plural: '__count__ 月內', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年內', + year_in_plural: '__count__ 年內' + } + }, + 'zh-TW': { + translation: { + now: '剛才', + second_ago: '__count__ 秒鐘前', + second_ago_plural: '__count__ 秒鐘前', + second_in: '__count__ 秒內', + second_in_plural: '__count__ 秒內', + minute_ago: '__count__ 分鐘前', + minute_ago_plural: '__count__ 分鐘前', + minute_in: '__count__ 分鐘內', + minute_in_plural: '__count__ 分鐘內', + hour_ago: '__count__ 小時前', + hour_ago_plural: '__count__ 小時前', + hour_in: '__count__ 小時內', + hour_in_plural: '__count__ 小時內', + day_ago: '__count__ 天前', + day_ago_plural: '__count__ 天前', + day_in: '__count__ 天內', + day_in_plural: '__count__ 天內', + month_ago: '__count__ 月前', + month_ago_plural: '__count__ 月前', + month_in: '__count__ 月內', + month_in_plural: '__count__ 月內', + year_ago: '__count__ 年前', + year_ago_plural: '__count__ 年前', + year_in: '__count__ 年內', + year_in_plural: '__count__ 年內' + } + } + }; + // tslint:enable + + var RelativeTime = exports('RelativeTime', /** @class */ (function () { + function RelativeTime(service, ea) { + var _this = this; + this.service = service; + this.ea = ea; + this.service.i18nextReady().then(function () { + _this.setup(); + }); + this.ea.subscribe(I18N_EA_SIGNAL, function (locales) { + _this.setup(locales); + }); + } + RelativeTime.inject = function () { return [I18N, EventAggregator]; }; + RelativeTime.prototype.setup = function (locales) { + var trans = translations; + var fallbackLng = this.service.i18next.fallbackLng; + var alternateFb = fallbackLng || this.service.i18next.options.fallbackLng; + if (Array.isArray(alternateFb) && alternateFb.length > 0) { + alternateFb = alternateFb[0]; + } + var key = ((locales && locales.newValue) + ? locales.newValue + : this.service.getLocale()) || alternateFb; + var index = 0; + // tslint:disable-next-line:no-conditional-assignment + if ((index = key.indexOf("-")) >= 0) { + var baseLocale = key.substring(0, index); + if (trans[baseLocale]) { + this.addTranslationResource(baseLocale, trans[baseLocale].translation); + } + } + if (trans[key]) { + this.addTranslationResource(key, trans[key].translation); + } + if (trans[fallbackLng]) { + this.addTranslationResource(key, trans[fallbackLng].translation); + } + }; + RelativeTime.prototype.addTranslationResource = function (key, translation) { + var options = this.service.i18next.options; + if (options.interpolation && (options.interpolation.prefix !== "__" || options.interpolation.suffix !== "__")) { + // tslint:disable-next-line:forin + for (var subkey in translation) { + translation[subkey] = translation[subkey] + .replace("__count__", (options.interpolation.prefix || "{{") + "count" + (options.interpolation.suffix || "}}")); + } + } + this.service.i18next.addResources(key, options.defaultNS || "translation", translation); + }; + RelativeTime.prototype.getRelativeTime = function (time) { + var now = new Date(); + var diff = now.getTime() - time.getTime(); + var timeDiff = this.getTimeDiffDescription(diff, "year", 31104000000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "month", 2592000000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "day", 86400000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "hour", 3600000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "minute", 60000); + if (!timeDiff) { + timeDiff = this.getTimeDiffDescription(diff, "second", 1000); + if (!timeDiff) { + timeDiff = this.service.tr("now"); + } + } + } + } + } + } + return timeDiff; + }; + RelativeTime.prototype.getTimeDiffDescription = function (diff, unit, timeDivisor) { + var unitAmount = parseInt((diff / timeDivisor).toFixed(0), 10); + if (unitAmount > 0) { + return this.service.tr(unit, { count: unitAmount, context: "ago" }); + } + else if (unitAmount < 0) { + var abs = Math.abs(unitAmount); + return this.service.tr(unit, { count: abs, context: "in" }); + } + return null; + }; + return RelativeTime; + }())); + + var RtValueConverter = exports('RtValueConverter', /** @class */ (function () { + function RtValueConverter(service) { + this.service = service; + } + RtValueConverter.inject = function () { return [RelativeTime]; }; + RtValueConverter.prototype.toView = function (value) { + if (value === null + || typeof value === "undefined" + || (typeof value === "string" && value.trim() === "")) { + return value; + } + if (typeof value === "string" && isNaN(value) && !Number.isInteger(value)) { + value = new Date(value); + } + return this.service.getRelativeTime(value); + }; + RtValueConverter = __decorate([ + valueConverter$1("rt") + ], RtValueConverter); + return RtValueConverter; + }())); + + var Backend = exports('Backend', /** @class */ (function () { + function Backend(services, options) { + if (options === void 0) { options = {}; } + this.services = services; + this.options = options; + this.type = "backend"; + this.init(services, options); + } + Backend.with = function (loader) { + this.loader = loader; + return this; + }; + Backend.prototype.init = function (services, options) { + if (options === void 0) { options = {}; } + this.services = services; + this.options = Object.assign({}, { + loadPath: "/locales/{{lng}}/{{ns}}.json", + addPath: "locales/add/{{lng}}/{{ns}}", + allowMultiLoading: false, + parse: JSON.parse + }, options); + }; + Backend.prototype.readMulti = function (languages, namespaces, callback) { + var loadPath = this.options.loadPath; + if (typeof this.options.loadPath === "function") { + loadPath = this.options.loadPath(languages, namespaces); + } + var url = this.services + .interpolator + .interpolate(loadPath, { lng: languages.join("+"), ns: namespaces.join("+") }); + this.loadUrl(url, callback); + }; + Backend.prototype.read = function (language, namespace, callback) { + var loadPath = this.options.loadPath; + if (typeof this.options.loadPath === "function") { + loadPath = this.options.loadPath([language], [namespace]); + } + var url = this.services.interpolator.interpolate(loadPath, { lng: language, ns: namespace }); + this.loadUrl(url, callback); + }; + Backend.prototype.loadUrl = function (url, callback) { + return __awaiter(this, void 0, void 0, function () { + var response, ret, err, _a; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 2, , 3]); + return [4 /*yield*/, Backend.loader.loadText(url)]; + case 1: + response = _b.sent(); + ret = void 0; + err = void 0; + try { + ret = (response instanceof Object) ? response : this.options.parse(response, url); + } + catch (e) { + err = "failed parsing " + url + " to json"; + } + if (err) { + return [2 /*return*/, callback(err, false)]; + } + callback(null, ret); + return [3 /*break*/, 3]; + case 2: + _a = _b.sent(); + callback("failed loading " + url, false /* no retry */); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); + }; + // tslint:disable-next-line:variable-name + Backend.prototype.create = function (_languages, _namespace, _key, _fallbackValue) { + // not supported + }; + Backend.type = "backend"; + return Backend; + }())); + + function configure(frameworkConfig, cb) { + if (typeof cb !== "function") { + var errorMsg = "You need to provide a callback method to properly configure the library"; + throw errorMsg; + } + var instance = frameworkConfig.container.get(I18N); + var ret = cb(instance); + frameworkConfig.globalResources([ + TValueConverter, + TBindingBehavior, + TCustomAttribute, + TParamsCustomAttribute, + NfValueConverter, + NfBindingBehavior, + DfValueConverter, + DfBindingBehavior, + RtValueConverter, + RtBindingBehavior + ]); + frameworkConfig.postTask(function () { + var resources = frameworkConfig.container.get(ViewResources); + var htmlBehaviorResource = resources.getAttribute("t"); + var htmlParamsResource = resources.getAttribute("t-params"); + var attributes = instance.i18next.options.attributes; + // Register default attributes if none provided + if (!attributes) { + attributes = ["t", "i18n"]; + } + attributes.forEach(function (alias) { return resources.registerAttribute(alias, htmlBehaviorResource, "t"); }); + attributes.forEach(function (alias) { return resources.registerAttribute(alias + "-params", htmlParamsResource, "t-params"); }); }); + return ret; } - ], - execute: function () { + } }; }); -//# sourceMappingURL=aurelia-i18n.js.map \ No newline at end of file diff --git a/dist/system/aurelia-i18n.js.map b/dist/system/aurelia-i18n.js.map deleted file mode 100644 index e834053c..00000000 --- a/dist/system/aurelia-i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"aurelia-i18n.js","sourceRoot":"","sources":["../../src/aurelia-i18n.ts"],"names":[],"mappings":";;;;IAiCA,SAAgB,SAAS,CACvB,eAAuC,EACvC,EAA8C;QAE9C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AG,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YACzD,IAAM,kBAAkB,GAAG,SAAS,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;YAC9D,IAAI,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,UAAsB,CAAC;YAEjE,+CAA+C;YAC/C,IAAI,CAAC,UAAU,EAAE;gBACf,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;aAC5B;YAED,UAAU,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,oBAAoB,EAAE,GAAG,CAAC,EAA7D,CAA6D,CAAC,CAAC;YAC7F,UAAU,CAAC,OAAO,CAAC,UAAC,KAAK,IAAK,OAAA,SAAS,CAAC,iBAAiB,CAAC,KAAK,GAAG,SAAS,EAAE,kBAAkB,EAAE,UAAU,CAAC,EAA9E,CAA8E,CAAC,CAAC;QAChH,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACb,CAAC"} \ No newline at end of file diff --git a/dist/system/defaultTranslations/relative.time.js b/dist/system/defaultTranslations/relative.time.js deleted file mode 100644 index 7d1b1355..00000000 --- a/dist/system/defaultTranslations/relative.time.js +++ /dev/null @@ -1,503 +0,0 @@ -System.register([], function (exports_1, context_1) { - "use strict"; - var translations; - var __moduleName = context_1 && context_1.id; - return { - setters: [], - execute: function () { - exports_1("translations", translations = { - ar: { - translation: { - "now": "الآن", - "second_ago": "منذ __count__ ثانية", - "second_ago_plural": "منذ __count__ ثواني", - "second_in": "في __count__ ثانية", - "second_in_plural": "في __count__ ثواني", - "minute_ago": "منذ __count__ دقيقة", - "minute_ago_plural": "منذ __count__ دقائق", - "minute_in": "في __count__ دقيقة", - "minute_in_plural": "في __count__ دقائق", - "hour_ago": "منذ __count__ ساعة", - "hour_ago_plural": "منذ __count__ ساعات", - "hour_in": "في __count__ ساعة", - "hour_in_plural": "في __count__ ساعات", - "day_ago": "منذ __count__ يوم", - "day_ago_plural": "منذ __count__ أيام", - "day_in": "في __count__ يوم", - "day_in_plural": "في __count__ أيام", - "month_ago": "منذ __count__ شهر", - "month_ago_plural": "منذ __count__ أشهر", - "month_in": "في __count__ شهر", - "month_in_plural": "في __count__ أشهر", - "year_ago": "منذ __count__ سنة", - "year_ago_plural": "منذ __count__ سنوات", - "year_in": "في __count__ سنة", - "year_in_plural": "في __count__ سنوات" - } - }, - en: { - translation: { - "now": "just now", - "second_ago": "__count__ second ago", - "second_ago_plural": "__count__ seconds ago", - "second_in": "in __count__ second", - "second_in_plural": "in __count__ seconds", - "minute_ago": "__count__ minute ago", - "minute_ago_plural": "__count__ minutes ago", - "minute_in": "in __count__ minute", - "minute_in_plural": "in __count__ minutes", - "hour_ago": "__count__ hour ago", - "hour_ago_plural": "__count__ hours ago", - "hour_in": "in __count__ hour", - "hour_in_plural": "in __count__ hours", - "day_ago": "__count__ day ago", - "day_ago_plural": "__count__ days ago", - "day_in": "in __count__ day", - "day_in_plural": "in __count__ days", - "month_ago": "__count__ month ago", - "month_ago_plural": "__count__ months ago", - "month_in": "in __count__ month", - "month_in_plural": "in __count__ months", - "year_ago": "__count__ year ago", - "year_ago_plural": "__count__ years ago", - "year_in": "in __count__ year", - "year_in_plural": "in __count__ years" - } - }, - es: { - translation: { - "now": "ahora mismo", - "second_ago": "hace __count__ segundo", - "second_ago_plural": "hace __count__ segundos", - "second_in": "en __count__ segundo", - "second_in_plural": "en __count__ segundos", - "minute_ago": "hace __count__ minuto", - "minute_ago_plural": "hace __count__ minutos", - "minute_in": "en __count__ minuto", - "minute_in_plural": "en __count__ minutos", - "hour_ago": "hace __count__ hora", - "hour_ago_plural": "hace __count__ horas", - "hour_in": "en __count__ hora", - "hour_in_plural": "en __count__ horas", - "day_ago": "hace __count__ día", - "day_ago_plural": "hace __count__ días", - "day_in": "en __count__ día", - "day_in_plural": "en __count__ días", - "month_ago": "hace __count__ mes", - "month_ago_plural": "hace __count__ meses", - "month_in": "en __count__ mes", - "month_in_plural": "en __count__ meses", - "year_ago": "hace __count__ año", - "year_ago_plural": "hace __count__ años", - "year_in": "en __count__ año", - "year_in_plural": "en __count__ años" - } - }, - it: { - translation: { - "now": "adesso", - "second_ago": "__count__ secondo fa", - "second_ago_plural": "__count__ secondi fa", - "second_in": "in __count__ secondo", - "second_in_plural": "in __count__ secondi", - "minute_ago": "__count__ minuto fa", - "minute_ago_plural": "__count__ minuti fa", - "minute_in": "in __count__ minuto", - "minute_in_plural": "in __count__ minuti", - "hour_ago": "__count__ ora fa", - "hour_ago_plural": "__count__ ore fa", - "hour_in": "in __count__ ora", - "hour_in_plural": "in __count__ ore", - "day_ago": "__count__ giorno fa", - "day_ago_plural": "__count__ giorni fa", - "day_in": "in __count__ giorno", - "day_in_plural": "in __count__ giorni", - "month_ago": "__count__ mese fa", - "month_ago_plural": "__count__ mesi fa", - "month_in": "in __count__ mese", - "month_in_plural": "in __count__ mesi", - "year_ago": "__count__ anno fa", - "year_ago_plural": "__count__ anni fa", - "year_in": "in __count__ anno", - "year_in_plural": "in __count__ anni" - } - }, - de: { - translation: { - "now": "jetzt gerade", - "second_ago": "vor __count__ Sekunde", - "second_ago_plural": "vor __count__ Sekunden", - "second_in": "in __count__ Sekunde", - "second_in_plural": "in __count__ Sekunden", - "minute_ago": "vor __count__ Minute", - "minute_ago_plural": "vor __count__ Minuten", - "minute_in": "in __count__ Minute", - "minute_in_plural": "in __count__ Minuten", - "hour_ago": "vor __count__ Stunde", - "hour_ago_plural": "vor __count__ Stunden", - "hour_in": "in __count__ Stunde", - "hour_in_plural": "in __count__ Stunden", - "day_ago": "vor __count__ Tag", - "day_ago_plural": "vor __count__ Tagen", - "day_in": "in __count__ Tag", - "day_in_plural": "in __count__ Tagen", - "month_ago": "vor __count__ Monat", - "month_ago_plural": "vor __count__ Monaten", - "month_in": "in __count__ Monat", - "month_in_plural": "in __count__ Monaten", - "year_ago": "vor __count__ Jahr", - "year_ago_plural": "vor __count__ Jahren", - "year_in": "in __count__ Jahr", - "year_in_plural": "in __count__ Jahren" - } - }, - nl: { - translation: { - "now": "zonet", - "second_ago": "__count__ seconde geleden", - "second_ago_plural": "__count__ seconden geleden", - "second_in": "in __count__ seconde", - "second_in_plural": "in __count__ seconden", - "minute_ago": "__count__ minuut geleden", - "minute_ago_plural": "__count__ minuten geleden", - "minute_in": "in __count__ minuut", - "minute_in_plural": "in __count__ minuten", - "hour_ago": "__count__ uur geleden", - "hour_ago_plural": "__count__ uren geleden", - "hour_in": "in __count__ uur", - "hour_in_plural": "in __count__ uren", - "day_ago": "__count__ dag geleden", - "day_ago_plural": "__count__ dagen geleden", - "day_in": "in __count__ dag", - "day_in_plural": "in __count__ dagen", - "month_ago": "__count__ maand geleden", - "month_ago_plural": "__count__ maanden geleden", - "month_in": "in __count__ maand", - "month_in_plural": "in __count__ maanden", - "year_ago": "__count__ jaar geleden", - "year_ago_plural": "__count__ jaren geleden", - "year_in": "in __count__ jaar", - "year_in_plural": "in __count__ jaren" - } - }, - fr: { - translation: { - "now": "maintenant", - "second_ago": "il y a __count__ seconde", - "second_ago_plural": "il y a __count__ secondes", - "second_in": "dans __count__ seconde", - "second_in_plural": "dans __count__ secondes", - "minute_ago": "il y a __count__ minute", - "minute_ago_plural": "il y a __count__ minutes", - "minute_in": "dans __count__ minute", - "minute_in_plural": "dans __count__ minutes", - "hour_ago": "il y a __count__ heure", - "hour_ago_plural": "il y a __count__ heures", - "hour_in": "dans __count__ heure", - "hour_in_plural": "dans __count__ heures", - "day_ago": "il y a __count__ jour", - "day_ago_plural": "il y a __count__ jours", - "day_in": "dans __count__ jour", - "day_in_plural": "dans __count__ jours", - "month_ago": "il y a __count__ mois", - "month_ago_plural": "il y a __count__ mois", - "month_in": "dans __count__ mois", - "month_in_plural": "dans __count__ mois", - "year_ago": "il y a __count__ an", - "year_ago_plural": "il y a __count__ ans", - "year_in": "dans __count__ an", - "year_in_plural": "dans __count__ ans" - } - }, - th: { - translation: { - "now": "เมื่อกี้", - "second_ago": "__count__ วินาที ที่ผ่านมา", - "second_ago_plural": "__count__ วินาที ที่ผ่านมา", - "second_in": "อีก __count__ วินาที", - "second_in_plural": "อีก __count__ วินาที", - "minute_ago": "__count__ นาที ที่ผ่านมา", - "minute_ago_plural": "__count__ นาที ที่ผ่านมา", - "minute_in": "อีก __count__ นาที", - "minute_in_plural": "อีก __count__ นาที", - "hour_ago": "__count__ ชั่วโมง ที่ผ่านมา", - "hour_ago_plural": "__count__ ชั่วโมง ที่ผ่านมา", - "hour_in": "อีก __count__ ชั่วโมง", - "hour_in_plural": "อีก __count__ ชั่วโมง", - "day_ago": "__count__ วัน ที่ผ่านมา", - "day_ago_plural": "__count__ วัน ที่ผ่านมา", - "day_in": "อีก __count__ วัน", - "day_in_plural": "อีก __count__ วัน" - } - }, - sv: { - translation: { - "now": "just nu", - "second_ago": "__count__ sekund sedan", - "second_ago_plural": "__count__ sekunder sedan", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minut sedan", - "minute_ago_plural": "__count__ minuter sedan", - "minute_in": "om __count__ minut", - "minute_in_plural": "om __count__ minuter", - "hour_ago": "__count__ timme sedan", - "hour_ago_plural": "__count__ timmar sedan", - "hour_in": "om __count__ timme", - "hour_in_plural": "om __count__ timmar", - "day_ago": "__count__ dag sedan", - "day_ago_plural": "__count__ dagar sedan", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dagar" - } - }, - da: { - translation: { - "now": "lige nu", - "second_ago": "__count__ sekunder siden", - "second_ago_plural": "__count__ sekunder siden", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minut siden", - "minute_ago_plural": "__count__ minutter siden", - "minute_in": "om __count__ minut", - "minute_in_plural": "om __count__ minutter", - "hour_ago": "__count__ time siden", - "hour_ago_plural": "__count__ timer siden", - "hour_in": "om __count__ time", - "hour_in_plural": "om __count__ timer", - "day_ago": "__count__ dag siden", - "day_ago_plural": "__count__ dage siden", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dage" - } - }, - no: { - translation: { - "now": "akkurat nå", - "second_ago": "__count__ sekund siden", - "second_ago_plural": "__count__ sekunder siden", - "second_in": "om __count__ sekund", - "second_in_plural": "om __count__ sekunder", - "minute_ago": "__count__ minutt siden", - "minute_ago_plural": "__count__ minutter siden", - "minute_in": "om __count__ minutt", - "minute_in_plural": "om __count__ minutter", - "hour_ago": "__count__ time siden", - "hour_ago_plural": "__count__ timer siden", - "hour_in": "om __count__ time", - "hour_in_plural": "om __count__ timer", - "day_ago": "__count__ dag siden", - "day_ago_plural": "__count__ dager siden", - "day_in": "om __count__ dag", - "day_in_plural": "om __count__ dager" - } - }, - ja: { - translation: { - "now": "たった今", - "second_ago": "__count__ 秒前", - "second_ago_plural": "__count__ 秒前", - "second_in": "あと __count__ 秒", - "second_in_plural": "あと __count__ 秒", - "minute_ago": "__count__ 分前", - "minute_ago_plural": "__count__ 分前", - "minute_in": "あと __count__ 分", - "minute_in_plural": "あと __count__ 分", - "hour_ago": "__count__ 時間前", - "hour_ago_plural": "__count__ 時間前", - "hour_in": "あと __count__ 時間", - "hour_in_plural": "あと __count__ 時間", - "day_ago": "__count__ 日間前", - "day_ago_plural": "__count__ 日間前", - "day_in": "あと __count__ 日間", - "day_in_plural": "あと __count__ 日間", - "month_ago": "__count__ ヶ月前", - "month_ago_plural": "__count__ ヶ月前", - "month_in": "あと __count__ ヶ月前", - "month_in_plural": "あと __count__ ヶ月前", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "あと __count__ 年", - "year_in_plural": "あと __count__ 年" - } - }, - jp: { - translation: { - "now": "たった今", - "second_ago": "__count__ 秒前", - "second_ago_plural": "__count__ 秒前", - "second_in": "あと __count__ 秒", - "second_in_plural": "あと __count__ 秒", - "minute_ago": "__count__ 分前", - "minute_ago_plural": "__count__ 分前", - "minute_in": "あと __count__ 分", - "minute_in_plural": "あと __count__ 分", - "hour_ago": "__count__ 時間前", - "hour_ago_plural": "__count__ 時間前", - "hour_in": "あと __count__ 時間", - "hour_in_plural": "あと __count__ 時間", - "day_ago": "__count__ 日間前", - "day_ago_plural": "__count__ 日間前", - "day_in": "あと __count__ 日間", - "day_in_plural": "あと __count__ 日間", - "month_ago": "__count__ ヶ月前", - "month_ago_plural": "__count__ ヶ月前", - "month_in": "あと __count__ ヶ月前", - "month_in_plural": "あと __count__ ヶ月前", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "あと __count__ 年", - "year_in_plural": "あと __count__ 年" - } - }, - pt: { - translation: { - "now": "neste exato momento", - "second_ago": "__count__ segundo atrás", - "second_ago_plural": "__count__ segundos atrás", - "second_in": "em __count__ segundo", - "second_in_plural": "em __count__ segundos", - "minute_ago": "__count__ minuto atrás", - "minute_ago_plural": "__count__ minutos atrás", - "minute_in": "em __count__ minuto", - "minute_in_plural": "em __count__ minutos", - "hour_ago": "__count__ hora atrás", - "hour_ago_plural": "__count__ horas atrás", - "hour_in": "em __count__ hora", - "hour_in_plural": "em __count__ horas", - "day_ago": "__count__ dia atrás", - "day_ago_plural": "__count__ dias atrás", - "day_in": "em __count__ dia", - "day_in_plural": "em __count__ dias", - "month_ago": "__count__ mês atrás", - "month_ago_plural": "__count__ meses atrás", - "month_in": "em __count__ mês", - "month_in_plural": "em __count__ meses", - "year_ago": "__count__ ano atrás", - "year_ago_plural": "__count__ anos atrás", - "year_in": "em __count__ ano", - "year_in_plural": "em __count__ anos" - } - }, - zh: { - translation: { - "now": "刚才", - "second_ago": "__count__ 秒钟前", - "second_ago_plural": "__count__ 秒钟前", - "second_in": "__count__ 秒内", - "second_in_plural": "__count__ 秒内", - "minute_ago": "__count__ 分钟前", - "minute_ago_plural": "__count__ 分钟前", - "minute_in": "__count__ 分钟内", - "minute_in_plural": "__count__ 分钟内", - "hour_ago": "__count__ 小时前", - "hour_ago_plural": "__count__ 小时前", - "hour_in": "__count__ 小时内", - "hour_in_plural": "__count__ 小时内", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天内", - "day_in_plural": "__count__ 天内", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月内", - "month_in_plural": "__count__ 月内", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年内", - "year_in_plural": "__count__ 年内" - } - }, - "zh-CN": { - translation: { - "now": "刚才", - "second_ago": "__count__ 秒钟前", - "second_ago_plural": "__count__ 秒钟前", - "second_in": "__count__ 秒内", - "second_in_plural": "__count__ 秒内", - "minute_ago": "__count__ 分钟前", - "minute_ago_plural": "__count__ 分钟前", - "minute_in": "__count__ 分钟内", - "minute_in_plural": "__count__ 分钟内", - "hour_ago": "__count__ 小时前", - "hour_ago_plural": "__count__ 小时前", - "hour_in": "__count__ 小时内", - "hour_in_plural": "__count__ 小时内", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天内", - "day_in_plural": "__count__ 天内", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月内", - "month_in_plural": "__count__ 月内", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年内", - "year_in_plural": "__count__ 年内" - } - }, - "zh-HK": { - translation: { - "now": "剛才", - "second_ago": "__count__ 秒鐘前", - "second_ago_plural": "__count__ 秒鐘前", - "second_in": "__count__ 秒內", - "second_in_plural": "__count__ 秒內", - "minute_ago": "__count__ 分鐘前", - "minute_ago_plural": "__count__ 分鐘前", - "minute_in": "__count__ 分鐘內", - "minute_in_plural": "__count__ 分鐘內", - "hour_ago": "__count__ 小時前", - "hour_ago_plural": "__count__ 小時前", - "hour_in": "__count__ 小時內", - "hour_in_plural": "__count__ 小時內", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天內", - "day_in_plural": "__count__ 天內", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月內", - "month_in_plural": "__count__ 月內", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年內", - "year_in_plural": "__count__ 年內" - } - }, - "zh-TW": { - translation: { - "now": "剛才", - "second_ago": "__count__ 秒鐘前", - "second_ago_plural": "__count__ 秒鐘前", - "second_in": "__count__ 秒內", - "second_in_plural": "__count__ 秒內", - "minute_ago": "__count__ 分鐘前", - "minute_ago_plural": "__count__ 分鐘前", - "minute_in": "__count__ 分鐘內", - "minute_in_plural": "__count__ 分鐘內", - "hour_ago": "__count__ 小時前", - "hour_ago_plural": "__count__ 小時前", - "hour_in": "__count__ 小時內", - "hour_in_plural": "__count__ 小時內", - "day_ago": "__count__ 天前", - "day_ago_plural": "__count__ 天前", - "day_in": "__count__ 天內", - "day_in_plural": "__count__ 天內", - "month_ago": "__count__ 月前", - "month_ago_plural": "__count__ 月前", - "month_in": "__count__ 月內", - "month_in_plural": "__count__ 月內", - "year_ago": "__count__ 年前", - "year_ago_plural": "__count__ 年前", - "year_in": "__count__ 年內", - "year_in_plural": "__count__ 年內" - } - } - }); - } - }; -}); -//# sourceMappingURL=relative.time.js.map \ No newline at end of file diff --git a/dist/system/defaultTranslations/relative.time.js.map b/dist/system/defaultTranslations/relative.time.js.map deleted file mode 100644 index c1c08f11..00000000 --- a/dist/system/defaultTranslations/relative.time.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"relative.time.js","sourceRoot":"","sources":["../../../src/defaultTranslations/relative.time.ts"],"names":[],"mappings":";;;;;;;YAKA,0BAAa,YAAY,GAAwB;gBAC/C,EAAE,EAAE;oBACF,WAAW,EAAE;wBACX,KAAK,EAAE,MAAM;wBACb,YAAY,EAAE,qBAAqB;wBACnC,mBAAmB,EAAE,qBAAqB;wBAC1C,WAAW,EAAE,oBAAoB;wBACjC,kBAAkB,EAAE,oBAAoB;wBACxC,YAAY,EAAE,qBAAqB;wBACnC,mBAAm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AE,cAAc;wBAC3B,kBAAkB,EAAE,cAAc;wBAClC,UAAU,EAAE,cAAc;wBAC1B,iBAAiB,EAAE,cAAc;wBACjC,UAAU,EAAE,cAAc;wBAC1B,iBAAiB,EAAE,cAAc;wBACjC,SAAS,EAAE,cAAc;wBACzB,gBAAgB,EAAE,cAAc;qBACjC;iBACF;aACF,EAAC"} \ No newline at end of file diff --git a/dist/system/df/df-binding-behavior.js b/dist/system/df/df-binding-behavior.js deleted file mode 100644 index 6579a2d0..00000000 --- a/dist/system/df/df-binding-behavior.js +++ /dev/null @@ -1,44 +0,0 @@ -System.register(["aurelia-templating-resources", "aurelia-binding"], function (exports_1, context_1) { - "use strict"; - var aurelia_templating_resources_1, aurelia_binding_1, DfBindingBehavior; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (aurelia_templating_resources_1_1) { - aurelia_templating_resources_1 = aurelia_templating_resources_1_1; - }, - function (aurelia_binding_1_1) { - aurelia_binding_1 = aurelia_binding_1_1; - } - ], - execute: function () { - DfBindingBehavior = /** @class */ (function () { - function DfBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - DfBindingBehavior.inject = function () { return [aurelia_templating_resources_1.SignalBindingBehavior]; }; - DfBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the DfValueConverter. - // pass through any args to the binding behavior to the DfValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new aurelia_binding_1.ValueConverter(expression, "df", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - DfBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return DfBindingBehavior; - }()); - exports_1("DfBindingBehavior", DfBindingBehavior); - } - }; -}); -//# sourceMappingURL=df-binding-behavior.js.map \ No newline at end of file diff --git a/dist/system/df/df-binding-behavior.js.map b/dist/system/df/df-binding-behavior.js.map deleted file mode 100644 index 76e544d6..00000000 --- a/dist/system/df/df-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"df-binding-behavior.js","sourceRoot":"","sources":["../../../src/df/df-binding-behavior.ts"],"names":[],"mappings":";;;;;;;;;;;;;;YAGA;gBAGE,2BAAoB,qBAA4C;oBAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;gBAAI,CAAC;gBAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,oDAAqB,CAAC,CAAC,CAAC,CAAC;gBAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;oBACnC,2BAA2B;oBAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;oBACxF,sDAAsD;oBACtD,wEAAwE;oBACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;oBAClD,2CAA2C;oBAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;wBAC9B,OAAO;qBACR;oBACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;oBAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;oBAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,gCAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;gBACJ,CAAC;gBACM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;oBACrC,6BAA6B;oBAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACrD,CAAC;gBACH,wBAAC;YAAD,CAAC,AAzBD,IAyBC"} \ No newline at end of file diff --git a/dist/system/df/df-value-converter.js b/dist/system/df/df-value-converter.js deleted file mode 100644 index f0258304..00000000 --- a/dist/system/df/df-value-converter.js +++ /dev/null @@ -1,41 +0,0 @@ -System.register(["../i18n", "../utils"], function (exports_1, context_1) { - "use strict"; - var i18n_1, utils_1, DfValueConverter; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (i18n_1_1) { - i18n_1 = i18n_1_1; - }, - function (utils_1_1) { - utils_1 = utils_1_1; - } - ], - execute: function () { - DfValueConverter = /** @class */ (function () { - function DfValueConverter(service) { - this.service = service; - } - DfValueConverter.inject = function () { return [i18n_1.I18N]; }; - DfValueConverter.prototype.toView = function (value, dfOrOptions, locale) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (typeof value === "string" && isNaN(value) && !utils_1.isInteger(value)) { - value = new Date(value); - } - if (dfOrOptions && (dfOrOptions instanceof Intl.DateTimeFormat && typeof dfOrOptions.format === "function")) { - return dfOrOptions.format(value); - } - var df = this.service.df(dfOrOptions, locale || this.service.getLocale()); - return df.format(value); - }; - return DfValueConverter; - }()); - exports_1("DfValueConverter", DfValueConverter); - } - }; -}); -//# sourceMappingURL=df-value-converter.js.map \ No newline at end of file diff --git a/dist/system/df/df-value-converter.js.map b/dist/system/df/df-value-converter.js.map deleted file mode 100644 index 96eeb3ab..00000000 --- a/dist/system/df/df-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"df-value-converter.js","sourceRoot":"","sources":["../../../src/df/df-value-converter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;YAGA;gBAGE,0BAAoB,OAAa;oBAAb,YAAO,GAAP,OAAO,CAAM;gBAAI,CAAC;gBAFxB,uBAAM,GAApB,cAAyB,OAAO,CAAC,WAAI,CAAC,CAAC,CAAC,CAAC;gBAIlC,iCAAM,GAAb,UACE,KAAU,EACV,WAA8D,EAC9D,MAAe;oBAEf,IAAI,KAAK,KAAK,IAAI;2BACb,OAAO,KAAK,KAAK,WAAW;2BAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACrD;wBACA,OAAO,KAAK,CAAC;qBACd;oBAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAY,CAAC,IAAI,CAAC,iBAAS,CAAC,KAAY,CAAC,EAAE;wBAChF,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;qBACzB;oBAED,IAAI,WAAW,IAAI,CAAC,WAAW,YAAY,IAAI,CAAC,cAAc,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE;wBAC3G,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;qBAClC;oBAED,IAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAyC,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;oBAC1G,OAAO,EAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC3B,CAAC;gBACH,uBAAC;YAAD,CAAC,AA5BD,IA4BC"} \ No newline at end of file diff --git a/dist/system/df/index.js b/dist/system/df/index.js deleted file mode 100644 index a3e1e841..00000000 --- a/dist/system/df/index.js +++ /dev/null @@ -1,24 +0,0 @@ -System.register(["./df-binding-behavior", "./df-value-converter"], function (exports_1, context_1) { - "use strict"; - var __moduleName = context_1 && context_1.id; - function exportStar_1(m) { - var exports = {}; - for (var n in m) { - if (n !== "default") exports[n] = m[n]; - } - exports_1(exports); - } - return { - setters: [ - function (df_binding_behavior_1_1) { - exportStar_1(df_binding_behavior_1_1); - }, - function (df_value_converter_1_1) { - exportStar_1(df_value_converter_1_1); - } - ], - execute: function () { - } - }; -}); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/system/df/index.js.map b/dist/system/df/index.js.map deleted file mode 100644 index 4dcdb080..00000000 --- a/dist/system/df/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/df/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/system/i18n.js b/dist/system/i18n.js deleted file mode 100644 index dd683ac9..00000000 --- a/dist/system/i18n.js +++ /dev/null @@ -1,330 +0,0 @@ -System.register(["i18next", "aurelia-pal", "aurelia-logging", "aurelia-framework"], function (exports_1, context_1) { - "use strict"; - var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - var i18next_1, aurelia_pal_1, LogManager, aurelia_framework_1, I18N_EA_SIGNAL, I18N; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (i18next_1_1) { - i18next_1 = i18next_1_1; - }, - function (aurelia_pal_1_1) { - aurelia_pal_1 = aurelia_pal_1_1; - }, - function (LogManager_1) { - LogManager = LogManager_1; - }, - function (aurelia_framework_1_1) { - aurelia_framework_1 = aurelia_framework_1_1; - } - ], - execute: function () { - exports_1("I18N_EA_SIGNAL", I18N_EA_SIGNAL = "i18n:locale:changed"); - I18N = /** @class */ (function () { - function I18N(ea, signaler) { - this.ea = ea; - this.signaler = signaler; - this.globalVars = {}; - this.i18next = i18next_1.default; - this.Intl = aurelia_pal_1.PLATFORM.global.Intl; - } - I18N.prototype.setup = function (options) { - return __awaiter(this, void 0, void 0, function () { - var defaultOptions; - var _this = this; - return __generator(this, function (_a) { - defaultOptions = { - skipTranslationOnMissingKey: false, - compatibilityAPI: "v1", - compatibilityJSON: "v1", - lng: "en", - attributes: ["t", "i18n"], - fallbackLng: "en", - debug: false - }; - this.i18nextDeferred = new Promise(function (resolve, reject) { - _this.i18next = _this.i18next.init(options || defaultOptions, function (err) { - if (err) { - reject(err); - } - // make sure attributes is an array in case a string was provided - if (_this.i18next.options.attributes instanceof String) { - _this.i18next.options.attributes = [_this.i18next.options.attributes]; - } - resolve(_this.i18next); - }); - }); - return [2 /*return*/, this.i18nextDeferred]; - }); - }); - }; - I18N.prototype.i18nextReady = function () { - return this.i18nextDeferred; - }; - I18N.prototype.setLocale = function (locale) { - var _this = this; - return new Promise(function (resolve, reject) { - var oldLocale = _this.getLocale(); - _this.i18next.changeLanguage(locale, function (err, tr) { - if (err) { - reject(err); - } - _this.ea.publish(I18N_EA_SIGNAL, { oldValue: oldLocale, newValue: locale }); - _this.signaler.signal("aurelia-translation-signal"); - resolve(tr); - }); - }); - }; - I18N.prototype.getLocale = function () { - return this.i18next.language; - }; - I18N.prototype.nf = function (options, locales) { - return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); - }; - I18N.prototype.uf = function (numberLike, locale) { - var nf = this.nf({}, locale || this.getLocale()); - var comparer = nf.format(10000 / 3); - var thousandSeparator = comparer[1]; - var decimalSeparator = comparer[5]; - if (thousandSeparator === ".") { - thousandSeparator = "\\."; - } - // remove all thousand seperators - var result = numberLike.replace(new RegExp(thousandSeparator, "g"), "") - // remove non-numeric signs except -> , . - .replace(/[^\d.,-]/g, "") - // replace original decimalSeparator with english one - .replace(decimalSeparator, "."); - // return real number - return Number(result); - }; - I18N.prototype.df = function (options, locales) { - return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); - }; - I18N.prototype.tr = function (key, options) { - var fullOptions = this.globalVars; - if (options !== undefined) { - fullOptions = Object.assign(Object.assign({}, this.globalVars), options); - } - return this.i18next.t(key, fullOptions); - }; - I18N.prototype.registerGlobalVariable = function (key, value) { - this.globalVars[key] = value; - }; - I18N.prototype.unregisterGlobalVariable = function (key) { - delete this.globalVars[key]; - }; - /** - * Scans an element for children that have a translation attribute and - * updates their innerHTML with the current translation values. - * - * If an image is encountered the translated value will be applied to the src attribute. - * - * @param el HTMLElement to search within - */ - I18N.prototype.updateTranslations = function (el) { - if (!el || !el.querySelectorAll) { - return; - } - var i; - var l; - // create a selector from the specified attributes to look for - // var selector = [].concat(this.i18next.options.attributes); - var attributes = this.i18next.options.attributes; - var selector = [].concat(attributes); - for (i = 0, l = selector.length; i < l; i++) { - selector[i] = "[" + selector[i] + "]"; - } - selector = selector.join(","); - // get the nodes - var nodes = el.querySelectorAll(selector); - for (i = 0, l = nodes.length; i < l; i++) { - var node = nodes[i]; - var keys = void 0; - var params = void 0; - // test every attribute and get the first one that has a value - for (var i2 = 0, l2 = attributes.length; i2 < l2; i2++) { - keys = node.getAttribute(attributes[i2]); - var pname = attributes[i2] + "-params"; - if (pname && node.au && node.au[pname]) { - params = node.au[pname].viewModel.value; - } - if (keys) { - break; - } - } - // skip if nothing was found - if (!keys) { - continue; - } - // split the keys into multiple keys separated by a ; - this.updateValue(node, keys, params); - } - }; - I18N.prototype.updateValue = function (node, value, params) { - if (value === null || value === undefined) { - return; - } - var keys = value.toString().split(";"); - var i = keys.length; - while (i--) { - var key = keys[i]; - // remove the optional attribute - var re = /\[([a-z\-, ]*)\]/ig; - var m = void 0; - var attr = "text"; - // set default attribute to src if this is an image node - if (node.nodeName === "IMG") { - attr = "src"; - } - // check if a attribute was specified in the key - // tslint:disable-next-line:no-conditional-assignment - while ((m = re.exec(key)) !== null) { - if (m.index === re.lastIndex) { - re.lastIndex++; - } - if (m) { - key = key.replace(m[0], ""); - attr = m[1]; - } - } - var attrs = attr.split(","); - var j = attrs.length; - while (j--) { - attr = attrs[j].trim(); - if (!node._textContent) { - node._textContent = node.textContent; - } - if (!node._innerHTML) { - node._innerHTML = node.innerHTML; - } - // convert to camelCase - // tslint:disable-next-line:only-arrow-functions - var attrCC = attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); - var reservedNames = ["prepend", "append", "text", "html"]; - var i18nLogger = LogManager.getLogger("i18n"); - if (reservedNames.indexOf(attr) > -1 && - node.au && - node.au.controller && - node.au.controller.viewModel && - attrCC in node.au.controller.viewModel) { - i18nLogger.warn("Aurelia I18N reserved attribute name\n\n [" + reservedNames.join(", ") + "]\n\n Your custom element has a bindable named " + attr + " which is a reserved word.\n\n If you'd like Aurelia I18N to translate your bindable instead, please consider giving it another name."); - } - if (this.i18next.options.skipTranslationOnMissingKey && - this.tr(key, params) === key) { - i18nLogger.warn("Couldn't find translation for key: " + key); - return; - } - // handle various attributes - // anything other than text,prepend,append or html will be added as an attribute on the element. - switch (attr) { - case "text": - var newChild = aurelia_pal_1.DOM.createTextNode(this.tr(key, params)); - if (node._newChild && node._newChild.parentNode === node) { - node.removeChild(node._newChild); - } - node._newChild = newChild; - while (node.firstChild) { - node.removeChild(node.firstChild); - } - node.appendChild(node._newChild); - break; - case "prepend": - var prependParser = aurelia_pal_1.DOM.createElement("div"); - prependParser.innerHTML = this.tr(key, params); - for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { - if (node.childNodes[ni]._prepended) { - node.removeChild(node.childNodes[ni]); - } - } - for (var pi = prependParser.childNodes.length - 1; pi >= 0; pi--) { - prependParser.childNodes[pi]._prepended = true; - if (node.firstChild) { - node.insertBefore(prependParser.childNodes[pi], node.firstChild); - } - else { - node.appendChild(prependParser.childNodes[pi]); - } - } - break; - case "append": - var appendParser = aurelia_pal_1.DOM.createElement("div"); - appendParser.innerHTML = this.tr(key, params); - for (var ni = node.childNodes.length - 1; ni >= 0; ni--) { - if (node.childNodes[ni]._appended) { - node.removeChild(node.childNodes[ni]); - } - } - while (appendParser.firstChild) { - appendParser.firstChild._appended = true; - node.appendChild(appendParser.firstChild); - } - break; - case "html": - node.innerHTML = this.tr(key, params); - break; - default: // normal html attribute - if (node.au && - node.au.controller && - node.au.controller.viewModel && - attrCC in node.au.controller.viewModel) { - node.au.controller.viewModel[attrCC] = this.tr(key, params); - } - else { - node.setAttribute(attr, this.tr(key, params)); - } - break; - } - } - } - }; - I18N = __decorate([ - aurelia_framework_1.autoinject() - ], I18N); - return I18N; - }()); - exports_1("I18N", I18N); - } - }; -}); -//# sourceMappingURL=i18n.js.map \ No newline at end of file diff --git a/dist/system/i18n.js.map b/dist/system/i18n.js.map deleted file mode 100644 index 9c75b22b..00000000 --- a/dist/system/i18n.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4BA,4BAAa,cAAc,GAAG,qBAAqB,EAAC;;gBASlD,cAAoB,EAAmB,EAAU,QAAyB;oBAAtD,OAAE,GAAF,EAAE,CAAiB;oBAAU,aAAQ,GAAR,QAAQ,CAAiB;oBAFlE,eAAU,GAA2B,EAAE,CAAC;oBAG9C,IAAI,CAAC,OAAO,GAAG,iBAAO,CAAC;oBACvB,IAAI,CAAC,IAAI,GAAG,sBAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;gBACnC,CAAC;gBAEY,oBAAK,GAAlB,UAAmB,OAA8C;;;;;4BACzD,cAAc,GAAG;gCACrB,2BAA2B,EAAE,KAAK;gCAClC,gBAAgB,EAAE,IAAI;gCACtB,iBAAiB,EAAE,IAAI;gCACvB,GAAG,EAAE,IAAI;gCACT,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC;gCACzB,WAAW,EAAE,IAAI;gCACjB,KAAK,EAAE,KAAK;6BACb,CAAC;4BAEF,IAAI,CAAC,eAAe,GAAG,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;gCACjD,KAAI,CAAC,OAAO,GAAG,KAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,cAAc,EAAE,UAAC,GAAG;oCAC9D,IAAI,GAAG,EAAE;wCACP,MAAM,CAAC,GAAG,CAAC,CAAC;qCACb;oCAED,iEAAiE;oCACjE,IAAI,KAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,YAAY,MAAM,EAAE;wCACrD,KAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,GAAG,C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ACvC;qCACF;oCAED,OAAO,YAAY,CAAC,UAAU,EAAE;wCAC7B,YAAY,CAAC,UAAkB,CAAC,SAAS,GAAG,IAAI,CAAC;wCAClD,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;qCAC3C;oCACD,MAAM;gCACR,KAAK,MAAM;oCACT,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;oCACtC,MAAM;gCACR,SAAS,wBAAwB;oCAC/B,IAAI,IAAI,CAAC,EAAE;wCACT,IAAI,CAAC,EAAE,CAAC,UAAU;wCAClB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS;wCAC5B,MAAM,IAAI,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,EAAE;wCACxC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;qCAC7D;yCAAM;wCACL,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;qCAC/C;oCAED,MAAM;6BACT;yBACF;qBACF;gBACH,CAAC;gBA7RU,IAAI;oBADhB,8BAAU,EAAE;mBACA,IAAI,CA8RhB;gBAAD,WAAC;aAAA,AA9RD"} \ No newline at end of file diff --git a/dist/system/nf/index.js b/dist/system/nf/index.js deleted file mode 100644 index d136a225..00000000 --- a/dist/system/nf/index.js +++ /dev/null @@ -1,24 +0,0 @@ -System.register(["./nf-binding-behavior", "./nf-value-converter"], function (exports_1, context_1) { - "use strict"; - var __moduleName = context_1 && context_1.id; - function exportStar_1(m) { - var exports = {}; - for (var n in m) { - if (n !== "default") exports[n] = m[n]; - } - exports_1(exports); - } - return { - setters: [ - function (nf_binding_behavior_1_1) { - exportStar_1(nf_binding_behavior_1_1); - }, - function (nf_value_converter_1_1) { - exportStar_1(nf_value_converter_1_1); - } - ], - execute: function () { - } - }; -}); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/system/nf/index.js.map b/dist/system/nf/index.js.map deleted file mode 100644 index 3d5c8e90..00000000 --- a/dist/system/nf/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nf/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/system/nf/nf-binding-behavior.js b/dist/system/nf/nf-binding-behavior.js deleted file mode 100644 index 4db5d271..00000000 --- a/dist/system/nf/nf-binding-behavior.js +++ /dev/null @@ -1,44 +0,0 @@ -System.register(["aurelia-templating-resources", "aurelia-binding"], function (exports_1, context_1) { - "use strict"; - var aurelia_templating_resources_1, aurelia_binding_1, NfBindingBehavior; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (aurelia_templating_resources_1_1) { - aurelia_templating_resources_1 = aurelia_templating_resources_1_1; - }, - function (aurelia_binding_1_1) { - aurelia_binding_1 = aurelia_binding_1_1; - } - ], - execute: function () { - NfBindingBehavior = /** @class */ (function () { - function NfBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - NfBindingBehavior.inject = function () { return [aurelia_templating_resources_1.SignalBindingBehavior]; }; - NfBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the NfValueConverter. - // pass through any args to the binding behavior to the NfValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new aurelia_binding_1.ValueConverter(expression, "nf", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - NfBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return NfBindingBehavior; - }()); - exports_1("NfBindingBehavior", NfBindingBehavior); - } - }; -}); -//# sourceMappingURL=nf-binding-behavior.js.map \ No newline at end of file diff --git a/dist/system/nf/nf-binding-behavior.js.map b/dist/system/nf/nf-binding-behavior.js.map deleted file mode 100644 index 5def6e22..00000000 --- a/dist/system/nf/nf-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nf-binding-behavior.js","sourceRoot":"","sources":["../../../src/nf/nf-binding-behavior.ts"],"names":[],"mappings":";;;;;;;;;;;;;;YAGA;gBAGE,2BAAoB,qBAA4C;oBAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;gBAAI,CAAC;gBAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,oDAAqB,CAAC,CAAC,CAAC,CAAC;gBAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;oBACnC,2BAA2B;oBAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;oBACxF,sDAAsD;oBACtD,wEAAwE;oBACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;oBAClD,2CAA2C;oBAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;wBAC9B,OAAO;qBACR;oBACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;oBAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;oBAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,gCAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;gBACJ,CAAC;gBAEM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;oBACrC,6BAA6B;oBAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACrD,CAAC;gBACH,wBAAC;YAAD,CAAC,AA1BD,IA0BC"} \ No newline at end of file diff --git a/dist/system/nf/nf-value-converter.js b/dist/system/nf/nf-value-converter.js deleted file mode 100644 index 82e05f46..00000000 --- a/dist/system/nf/nf-value-converter.js +++ /dev/null @@ -1,35 +0,0 @@ -System.register(["../i18n"], function (exports_1, context_1) { - "use strict"; - var i18n_1, NfValueConverter; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (i18n_1_1) { - i18n_1 = i18n_1_1; - } - ], - execute: function () { - NfValueConverter = /** @class */ (function () { - function NfValueConverter(service) { - this.service = service; - } - NfValueConverter.inject = function () { return [i18n_1.I18N]; }; - NfValueConverter.prototype.toView = function (value, nfOrOptions, locale) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (nfOrOptions && (nfOrOptions instanceof Intl.NumberFormat && typeof nfOrOptions.format === "function")) { - return nfOrOptions.format(value); - } - var nf = this.service.nf(nfOrOptions, locale || this.service.getLocale()); - return nf.format(value); - }; - return NfValueConverter; - }()); - exports_1("NfValueConverter", NfValueConverter); - } - }; -}); -//# sourceMappingURL=nf-value-converter.js.map \ No newline at end of file diff --git a/dist/system/nf/nf-value-converter.js.map b/dist/system/nf/nf-value-converter.js.map deleted file mode 100644 index 8a6126bd..00000000 --- a/dist/system/nf/nf-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nf-value-converter.js","sourceRoot":"","sources":["../../../src/nf/nf-value-converter.ts"],"names":[],"mappings":";;;;;;;;;;;YAEA;gBAEE,0BAAoB,OAAa;oBAAb,YAAO,GAAP,OAAO,CAAM;gBAAG,CAAC;gBADvB,uBAAM,GAApB,cAAyB,OAAO,CAAC,WAAI,CAAC,CAAC,CAAC,CAAC;gBAGlC,iCAAM,GAAb,UACE,KAAU,EACV,WAA0D,EAC1D,MAAe;oBAEf,IAAI,KAAK,KAAK,IAAI;2BACb,OAAO,KAAK,KAAK,WAAW;2BAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACnD;wBACF,OAAO,KAAK,CAAC;qBACd;oBAED,IAAI,WAAW,IAAI,CAAC,WAAW,YAAY,IAAI,CAAC,YAAY,IAAI,OAAO,WAAW,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE;wBACzG,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;qBAClC;oBAED,IAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAuC,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;oBACxG,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC;gBACH,uBAAC;YAAD,CAAC,AAvBD,IAuBC"} \ No newline at end of file diff --git a/dist/system/relativeTime.js b/dist/system/relativeTime.js deleted file mode 100644 index 5f5a0178..00000000 --- a/dist/system/relativeTime.js +++ /dev/null @@ -1,108 +0,0 @@ -System.register(["aurelia-event-aggregator", "./i18n", "./defaultTranslations/relative.time"], function (exports_1, context_1) { - "use strict"; - var aurelia_event_aggregator_1, i18n_1, relative_time_1, RelativeTime; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (aurelia_event_aggregator_1_1) { - aurelia_event_aggregator_1 = aurelia_event_aggregator_1_1; - }, - function (i18n_1_1) { - i18n_1 = i18n_1_1; - }, - function (relative_time_1_1) { - relative_time_1 = relative_time_1_1; - } - ], - execute: function () { - RelativeTime = /** @class */ (function () { - function RelativeTime(service, ea) { - var _this = this; - this.service = service; - this.ea = ea; - this.service.i18nextReady().then(function () { - _this.setup(); - }); - this.ea.subscribe(i18n_1.I18N_EA_SIGNAL, function (locales) { - _this.setup(locales); - }); - } - RelativeTime.inject = function () { return [i18n_1.I18N, aurelia_event_aggregator_1.EventAggregator]; }; - RelativeTime.prototype.setup = function (locales) { - var trans = relative_time_1.translations.default || relative_time_1.translations; - var fallbackLng = this.service.i18next.fallbackLng; - var alternateFb = fallbackLng || this.service.i18next.options.fallbackLng; - if (Array.isArray(alternateFb) && alternateFb.length > 0) { - alternateFb = alternateFb[0]; - } - var key = ((locales && locales.newValue) - ? locales.newValue - : this.service.getLocale()) || alternateFb; - var index = 0; - // tslint:disable-next-line:no-conditional-assignment - if ((index = key.indexOf("-")) >= 0) { - var baseLocale = key.substring(0, index); - if (trans[baseLocale]) { - this.addTranslationResource(baseLocale, trans[baseLocale].translation); - } - } - if (trans[key]) { - this.addTranslationResource(key, trans[key].translation); - } - if (trans[fallbackLng]) { - this.addTranslationResource(key, trans[fallbackLng].translation); - } - }; - RelativeTime.prototype.addTranslationResource = function (key, translation) { - var options = this.service.i18next.options; - if (options.interpolation && (options.interpolation.prefix !== "__" || options.interpolation.suffix !== "__")) { - // tslint:disable-next-line:forin - for (var subkey in translation) { - translation[subkey] = translation[subkey] - .replace("__count__", (options.interpolation.prefix || "{{") + "count" + (options.interpolation.suffix || "}}")); - } - } - this.service.i18next.addResources(key, options.defaultNS || "translation", translation); - }; - RelativeTime.prototype.getRelativeTime = function (time) { - var now = new Date(); - var diff = now.getTime() - time.getTime(); - var timeDiff = this.getTimeDiffDescription(diff, "year", 31104000000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "month", 2592000000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "day", 86400000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "hour", 3600000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "minute", 60000); - if (!timeDiff) { - timeDiff = this.getTimeDiffDescription(diff, "second", 1000); - if (!timeDiff) { - timeDiff = this.service.tr("now"); - } - } - } - } - } - } - return timeDiff; - }; - RelativeTime.prototype.getTimeDiffDescription = function (diff, unit, timeDivisor) { - var unitAmount = parseInt((diff / timeDivisor).toFixed(0), 10); - if (unitAmount > 0) { - return this.service.tr(unit, { count: unitAmount, context: "ago" }); - } - else if (unitAmount < 0) { - var abs = Math.abs(unitAmount); - return this.service.tr(unit, { count: abs, context: "in" }); - } - return null; - }; - return RelativeTime; - }()); - exports_1("RelativeTime", RelativeTime); - } - }; -}); -//# sourceMappingURL=relativeTime.js.map \ No newline at end of file diff --git a/dist/system/relativeTime.js.map b/dist/system/relativeTime.js.map deleted file mode 100644 index 21066915..00000000 --- a/dist/system/relativeTime.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"relativeTime.js","sourceRoot":"","sources":["../../src/relativeTime.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;YASA;gBAEE,sBAAoB,OAAa,EAAU,EAAmB;oBAA9D,iBAQC;oBARmB,YAAO,GAAP,OAAO,CAAM;oBAAU,OAAE,GAAF,EAAE,CAAiB;oBAC5D,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC;wBAC/B,KAAI,CAAC,KAAK,EAAE,CAAC;oBACf,CAAC,CAAC,CAAC;oBAEH,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,qBAAc,EAAE,UAAC,OAAyB;wBAC1D,KAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBACtB,CAAC,CAAC,CAAC;gBACL,CAAC;gBATa,mBAAM,GAApB,cAAyB,OAAO,CAAC,WAAI,EAAE,0CAAe,CAAC,CAAC,CAAC,CAAC;gBAWnD,4BAAK,GAAZ,UAAa,OAAgD;oBAC3D,IAAM,KAAK,GAAI,4BAAoB,CAAC,OAAO,IAAI,4BAAY,CAAC;oBAC5D,IAAM,WAAW,GAAI,IAAI,CAAC,OAAO,CAAC,OAAe,CAAC,WAAW,CAAC;oBAE9D,IAAI,WAAW,GAAG,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;oBAC1E,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;wBACxD,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;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EAAE;4CACb,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;yCACnC;qCACF;iCACF;6BACF;yBACF;qBACF;oBAED,OAAO,QAAQ,CAAC;gBAClB,CAAC;gBAEM,6CAAsB,GAA7B,UACE,IAAY,EAAE,IAA6D,EAAE,WAAmB;oBAEhG,IAAM,UAAU,GAAG,QAAQ,CAAC,CAAC,IAAI,GAAG,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBACjE,IAAI,UAAU,GAAG,CAAC,EAAE;wBAClB,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;qBACrE;yBAAM,IAAI,UAAU,GAAG,CAAC,EAAE;wBACzB,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;wBACjC,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;qBAC7D;oBAED,OAAO,IAAI,CAAC;gBACd,CAAC;gBACH,mBAAC;YAAD,CAAC,AAlGD,IAkGC"} \ No newline at end of file diff --git a/dist/system/rt/index.js b/dist/system/rt/index.js deleted file mode 100644 index 45f273f2..00000000 --- a/dist/system/rt/index.js +++ /dev/null @@ -1,24 +0,0 @@ -System.register(["./rt-binding-behavior", "./rt-value-converter"], function (exports_1, context_1) { - "use strict"; - var __moduleName = context_1 && context_1.id; - function exportStar_1(m) { - var exports = {}; - for (var n in m) { - if (n !== "default") exports[n] = m[n]; - } - exports_1(exports); - } - return { - setters: [ - function (rt_binding_behavior_1_1) { - exportStar_1(rt_binding_behavior_1_1); - }, - function (rt_value_converter_1_1) { - exportStar_1(rt_value_converter_1_1); - } - ], - execute: function () { - } - }; -}); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/system/rt/index.js.map b/dist/system/rt/index.js.map deleted file mode 100644 index 85f6e6c9..00000000 --- a/dist/system/rt/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rt/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/system/rt/rt-binding-behavior.js b/dist/system/rt/rt-binding-behavior.js deleted file mode 100644 index a08ddb06..00000000 --- a/dist/system/rt/rt-binding-behavior.js +++ /dev/null @@ -1,44 +0,0 @@ -System.register(["aurelia-templating-resources", "aurelia-binding"], function (exports_1, context_1) { - "use strict"; - var aurelia_templating_resources_1, aurelia_binding_1, RtBindingBehavior; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (aurelia_templating_resources_1_1) { - aurelia_templating_resources_1 = aurelia_templating_resources_1_1; - }, - function (aurelia_binding_1_1) { - aurelia_binding_1 = aurelia_binding_1_1; - } - ], - execute: function () { - RtBindingBehavior = /** @class */ (function () { - function RtBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - RtBindingBehavior.inject = function () { return [aurelia_templating_resources_1.SignalBindingBehavior]; }; - RtBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal", "aurelia-relativetime-signal"); - // rewrite the expression to use the RtValueConverter. - // pass through any args to the binding behavior to the RtValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new aurelia_binding_1.ValueConverter(expression, "rt", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - RtBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - return RtBindingBehavior; - }()); - exports_1("RtBindingBehavior", RtBindingBehavior); - } - }; -}); -//# sourceMappingURL=rt-binding-behavior.js.map \ No newline at end of file diff --git a/dist/system/rt/rt-binding-behavior.js.map b/dist/system/rt/rt-binding-behavior.js.map deleted file mode 100644 index 408085cf..00000000 --- a/dist/system/rt/rt-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rt-binding-behavior.js","sourceRoot":"","sources":["../../../src/rt/rt-binding-behavior.ts"],"names":[],"mappings":";;;;;;;;;;;;;;YAGA;gBAGE,2BAAoB,qBAA4C;oBAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;gBAAI,CAAC;gBAFvD,wBAAM,GAApB,cAAyB,OAAO,CAAC,oDAAqB,CAAC,CAAC,CAAC,CAAC;gBAInD,gCAAI,GAAX,UAAY,OAAY,EAAE,MAAW;oBACnC,2BAA2B;oBAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CACtC,OAAO,EAAE,MAAM,EAAE,4BAA4B,EAAE,6BAA6B,CAC7E,CAAC;oBACF,sDAAsD;oBACtD,wEAAwE;oBACxE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;oBAClD,2CAA2C;oBAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;wBAC9B,OAAO;qBACR;oBACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;oBAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;oBAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,gCAAc,CAC9C,UAAU,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC/E,CAAC;gBACJ,CAAC;gBAEM,kCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;oBACrC,6BAA6B;oBAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACrD,CAAC;gBACH,wBAAC;YAAD,CAAC,AA5BD,IA4BC"} \ No newline at end of file diff --git a/dist/system/rt/rt-value-converter.js b/dist/system/rt/rt-value-converter.js deleted file mode 100644 index e84ff8a6..00000000 --- a/dist/system/rt/rt-value-converter.js +++ /dev/null @@ -1,34 +0,0 @@ -System.register(["../relativeTime"], function (exports_1, context_1) { - "use strict"; - var relativeTime_1, RtValueConverter; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (relativeTime_1_1) { - relativeTime_1 = relativeTime_1_1; - } - ], - execute: function () { - RtValueConverter = /** @class */ (function () { - function RtValueConverter(service) { - this.service = service; - } - RtValueConverter.inject = function () { return [relativeTime_1.RelativeTime]; }; - RtValueConverter.prototype.toView = function (value) { - if (value === null - || typeof value === "undefined" - || (typeof value === "string" && value.trim() === "")) { - return value; - } - if (typeof value === "string" && isNaN(value) && !Number.isInteger(value)) { - value = new Date(value); - } - return this.service.getRelativeTime(value); - }; - return RtValueConverter; - }()); - exports_1("RtValueConverter", RtValueConverter); - } - }; -}); -//# sourceMappingURL=rt-value-converter.js.map \ No newline at end of file diff --git a/dist/system/rt/rt-value-converter.js.map b/dist/system/rt/rt-value-converter.js.map deleted file mode 100644 index f3d6f9cd..00000000 --- a/dist/system/rt/rt-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rt-value-converter.js","sourceRoot":"","sources":["../../../src/rt/rt-value-converter.ts"],"names":[],"mappings":";;;;;;;;;;;YAEA;gBAEE,0BAAoB,OAAqB;oBAArB,YAAO,GAAP,OAAO,CAAc;gBAAG,CAAC;gBAD/B,uBAAM,GAApB,cAAyB,OAAO,CAAC,2BAAY,CAAC,CAAC,CAAC,CAAC;gBAG1C,iCAAM,GAAb,UAAc,KAAU;oBACtB,IAAI,KAAK,KAAK,IAAI;2BACb,OAAO,KAAK,KAAK,WAAW;2BAC5B,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EACnD;wBACF,OAAO,KAAK,CAAC;qBACd;oBAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAY,CAAC,EAAE;wBACvF,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;qBACzB;oBAED,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;gBAC7C,CAAC;gBACH,uBAAC;YAAD,CAAC,AAlBD,IAkBC"} \ No newline at end of file diff --git a/dist/system/t/index.js b/dist/system/t/index.js deleted file mode 100644 index 1d0e9cb1..00000000 --- a/dist/system/t/index.js +++ /dev/null @@ -1,30 +0,0 @@ -System.register(["./t-binding-behavior", "./t-custom-attribute", "./t-params-custom-attribute", "./t-value-converter"], function (exports_1, context_1) { - "use strict"; - var __moduleName = context_1 && context_1.id; - function exportStar_1(m) { - var exports = {}; - for (var n in m) { - if (n !== "default") exports[n] = m[n]; - } - exports_1(exports); - } - return { - setters: [ - function (t_binding_behavior_1_1) { - exportStar_1(t_binding_behavior_1_1); - }, - function (t_custom_attribute_1_1) { - exportStar_1(t_custom_attribute_1_1); - }, - function (t_params_custom_attribute_1_1) { - exportStar_1(t_params_custom_attribute_1_1); - }, - function (t_value_converter_1_1) { - exportStar_1(t_value_converter_1_1); - } - ], - execute: function () { - } - }; -}); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/system/t/index.js.map b/dist/system/t/index.js.map deleted file mode 100644 index 4e179d59..00000000 --- a/dist/system/t/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/t/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/system/t/t-binding-behavior.js b/dist/system/t/t-binding-behavior.js deleted file mode 100644 index 6e931e51..00000000 --- a/dist/system/t/t-binding-behavior.js +++ /dev/null @@ -1,44 +0,0 @@ -System.register(["aurelia-templating-resources", "aurelia-binding"], function (exports_1, context_1) { - "use strict"; - var aurelia_templating_resources_1, aurelia_binding_1, TBindingBehavior; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (aurelia_templating_resources_1_1) { - aurelia_templating_resources_1 = aurelia_templating_resources_1_1; - }, - function (aurelia_binding_1_1) { - aurelia_binding_1 = aurelia_binding_1_1; - } - ], - execute: function () { - TBindingBehavior = /** @class */ (function () { - function TBindingBehavior(signalBindingBehavior) { - this.signalBindingBehavior = signalBindingBehavior; - } - TBindingBehavior.prototype.bind = function (binding, source) { - // bind the signal behavior - this.signalBindingBehavior.bind(binding, source, "aurelia-translation-signal"); - // rewrite the expression to use the TValueConverter. - // pass through any args to the binding behavior to the TValueConverter - var sourceExpression = binding.sourceExpression; - // do create the sourceExpression only once - if (sourceExpression.rewritten) { - return; - } - sourceExpression.rewritten = true; - var expression = sourceExpression.expression; - sourceExpression.expression = new aurelia_binding_1.ValueConverter(expression, "t", sourceExpression.args, [expression].concat(sourceExpression.args)); - }; - TBindingBehavior.prototype.unbind = function (binding, source) { - // unbind the signal behavior - this.signalBindingBehavior.unbind(binding, source); - }; - TBindingBehavior.inject = [aurelia_templating_resources_1.SignalBindingBehavior]; - return TBindingBehavior; - }()); - exports_1("TBindingBehavior", TBindingBehavior); - } - }; -}); -//# sourceMappingURL=t-binding-behavior.js.map \ No newline at end of file diff --git a/dist/system/t/t-binding-behavior.js.map b/dist/system/t/t-binding-behavior.js.map deleted file mode 100644 index 3065c427..00000000 --- a/dist/system/t/t-binding-behavior.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-binding-behavior.js","sourceRoot":"","sources":["../../../src/t/t-binding-behavior.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;gBAME,0BAAoB,qBAA4C;oBAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;gBAAI,CAAC;gBAE9D,+BAAI,GAAX,UAAY,OAAY,EAAE,MAAW;oBACnC,2BAA2B;oBAC1B,IAAI,CAAC,qBAAqB,CAAC,IAAY,CAAC,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;oBACxF,qDAAqD;oBACrD,uEAAuE;oBACvE,IAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;oBAClD,2CAA2C;oBAC3C,IAAI,gBAAgB,CAAC,SAAS,EAAE;wBAC9B,OAAO;qBACR;oBACD,gBAAgB,CAAC,SAAS,GAAG,IAAI,CAAC;oBAClC,IAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC;oBAC/C,gBAAgB,CAAC,UAAU,GAAG,IAAI,gCAAc,CAC9C,UAAU,EAAE,GAAG,EAAE,gBAAgB,CAAC,IAAI,GAAG,UAAU,SAAK,gBAAgB,CAAC,IAAI,EAC9E,CAAC;gBACJ,CAAC;gBAEM,iCAAM,GAAb,UAAc,OAAY,EAAE,MAAW;oBACrC,6BAA6B;oBAC7B,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBACrD,CAAC;gBAxBa,uBAAM,GAAG,CAAC,oDAAqB,CAAC,CAAC;gBA0BjD,uBAAC;aAAA,AA3BD"} \ No newline at end of file diff --git a/dist/system/t/t-custom-attribute.js b/dist/system/t/t-custom-attribute.js deleted file mode 100644 index 394c74b0..00000000 --- a/dist/system/t/t-custom-attribute.js +++ /dev/null @@ -1,88 +0,0 @@ -System.register(["aurelia-templating", "aurelia-event-aggregator", "aurelia-metadata", "aurelia-pal", "../i18n", "../utils", "./t-params-custom-attribute"], function (exports_1, context_1) { - "use strict"; - var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var aurelia_templating_1, aurelia_event_aggregator_1, aurelia_metadata_1, aurelia_pal_1, i18n_1, utils_1, t_params_custom_attribute_1, TCustomAttribute; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_event_aggregator_1_1) { - aurelia_event_aggregator_1 = aurelia_event_aggregator_1_1; - }, - function (aurelia_metadata_1_1) { - aurelia_metadata_1 = aurelia_metadata_1_1; - }, - function (aurelia_pal_1_1) { - aurelia_pal_1 = aurelia_pal_1_1; - }, - function (i18n_1_1) { - i18n_1 = i18n_1_1; - }, - function (utils_1_1) { - utils_1 = utils_1_1; - }, - function (t_params_custom_attribute_1_1) { - t_params_custom_attribute_1 = t_params_custom_attribute_1_1; - } - ], - execute: function () { - TCustomAttribute = /** @class */ (function () { - function TCustomAttribute(element, service, ea, p) { - this.element = element; - this.service = service; - this.ea = ea; - this.lazyParams = p; - } - TCustomAttribute_1 = TCustomAttribute; - TCustomAttribute.inject = function () { - return [aurelia_pal_1.DOM.Element, i18n_1.I18N, aurelia_event_aggregator_1.EventAggregator, utils_1.LazyOptional.of(t_params_custom_attribute_1.TParamsCustomAttribute)]; - }; - TCustomAttribute.configureAliases = function (aliases) { - var r = aurelia_metadata_1.metadata.getOrCreateOwn(aurelia_metadata_1.metadata.resource, aurelia_templating_1.HtmlBehaviorResource, TCustomAttribute_1); - r.aliases = aliases; - }; - TCustomAttribute.prototype.bind = function () { - var _this = this; - this.params = this.lazyParams(); - if (this.params) { - this.params.valueChanged = function (newParams, oldParams) { - _this.paramsChanged(_this.value, newParams, oldParams); - }; - } - var p = this.params !== null ? this.params.value : undefined; - this.subscription = this.ea.subscribe(i18n_1.I18N_EA_SIGNAL, function () { - _this.service.updateValue(_this.element, _this.value, _this.params !== null ? _this.params.value : undefined); - }); - this.service.updateValue(this.element, this.value, p); - }; - TCustomAttribute.prototype.paramsChanged = function (newValue, newParams) { - this.service.updateValue(this.element, newValue, newParams); - }; - TCustomAttribute.prototype.valueChanged = function (newValue) { - var p = this.params !== null ? this.params.value : undefined; - this.service.updateValue(this.element, newValue, p); - }; - TCustomAttribute.prototype.unbind = function () { - // If unbind is called before timeout for subscription is triggered, subscription will be undefined - if (this.subscription) { - this.subscription.dispose(); - } - }; - var TCustomAttribute_1; - TCustomAttribute = TCustomAttribute_1 = __decorate([ - aurelia_templating_1.customAttribute("t") - ], TCustomAttribute); - return TCustomAttribute; - }()); - exports_1("TCustomAttribute", TCustomAttribute); - } - }; -}); -//# sourceMappingURL=t-custom-attribute.js.map \ No newline at end of file diff --git a/dist/system/t/t-custom-attribute.js.map b/dist/system/t/t-custom-attribute.js.map deleted file mode 100644 index 0c18d720..00000000 --- a/dist/system/t/t-custom-attribute.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-custom-attribute.js","sourceRoot":"","sources":["../../../src/t/t-custom-attribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAiCE,0BACU,OAA8B,EAC9B,OAAa,EACb,EAAmB,EAC3B,CAAM;oBAHE,YAAO,GAAP,OAAO,CAAuB;oBAC9B,YAAO,GAAP,OAAO,CAAM;oBACb,OAAE,GAAF,EAAE,CAAiB;oBAG3B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;gBACtB,CAAC;qCArBU,gBAAgB;gBACb,uBAAM,GAApB;oBACE,OAAO,CAAC,iBAAG,CAAC,OAAO,EAAE,WAAI,EAAE,0CAAe,EAAE,oBAAY,CAAC,EAAE,CAAC,kDAAsB,CAAC,CAAC,CAAC;gBACvF,CAAC;gBACa,iCAAgB,GAA9B,UAA+B,OAAiB;oBAC9C,IAAM,CAAC,GAAG,2BAAQ,CAAC,cAAc,CAAC,2BAAQ,CAAC,QAAQ,EAAE,yCAAoB,EAAE,kBAAgB,CAAC,CAAC;oBAC5F,CAAS,CAAC,OAAO,GAAG,OAAO,CAAC;gBAC/B,CAAC;gBAgBM,+BAAI,GAAX;oBAAA,i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CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;gBACtD,CAAC;gBAEM,iCAAM,GAAb;oBACE,mGAAmG;oBACnG,IAAI,IAAI,CAAC,YAAY,EAAE;wBACrB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;qBAC7B;gBACH,CAAC;;gBAtDU,gBAAgB;oBAD5B,oCAAe,CAAC,GAAG,CAAC;mBACR,gBAAgB,CAuD5B;gBAAD,uBAAC;aAAA,AAvDD"} \ No newline at end of file diff --git a/dist/system/t/t-params-custom-attribute.js b/dist/system/t/t-params-custom-attribute.js deleted file mode 100644 index 76f728f2..00000000 --- a/dist/system/t/t-params-custom-attribute.js +++ /dev/null @@ -1,47 +0,0 @@ -System.register(["aurelia-templating", "aurelia-metadata", "aurelia-pal"], function (exports_1, context_1) { - "use strict"; - var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var aurelia_templating_1, aurelia_metadata_1, aurelia_pal_1, TParamsCustomAttribute; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (aurelia_templating_1_1) { - aurelia_templating_1 = aurelia_templating_1_1; - }, - function (aurelia_metadata_1_1) { - aurelia_metadata_1 = aurelia_metadata_1_1; - }, - function (aurelia_pal_1_1) { - aurelia_pal_1 = aurelia_pal_1_1; - } - ], - execute: function () { - TParamsCustomAttribute = /** @class */ (function () { - function TParamsCustomAttribute(element) { - this.element = element; - } - TParamsCustomAttribute_1 = TParamsCustomAttribute; - TParamsCustomAttribute.inject = function () { - return [aurelia_pal_1.DOM.Element]; - }; - TParamsCustomAttribute.configureAliases = function (aliases) { - var r = aurelia_metadata_1.metadata.getOrCreateOwn(aurelia_metadata_1.metadata.resource, aurelia_templating_1.HtmlBehaviorResource, TParamsCustomAttribute_1); - r.aliases = aliases; - }; - TParamsCustomAttribute.prototype.valueChanged = function () { }; - var TParamsCustomAttribute_1; - TParamsCustomAttribute = TParamsCustomAttribute_1 = __decorate([ - aurelia_templating_1.customAttribute("t-params") - ], TParamsCustomAttribute); - return TParamsCustomAttribute; - }()); - exports_1("TParamsCustomAttribute", TParamsCustomAttribute); - } - }; -}); -//# sourceMappingURL=t-params-custom-attribute.js.map \ No newline at end of file diff --git a/dist/system/t/t-params-custom-attribute.js.map b/dist/system/t/t-params-custom-attribute.js.map deleted file mode 100644 index 50dba390..00000000 --- a/dist/system/t/t-params-custom-attribute.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-params-custom-attribute.js","sourceRoot":"","sources":["../../../src/t/t-params-custom-attribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;gBAoBE,gCAAmB,OAAgB;oBAAhB,YAAO,GAAP,OAAO,CAAS;gBAAI,CAAC;2CAZ7B,sBAAsB;gBACnB,6BAAM,GAApB;oBACE,OAAO,CAAC,iBAAG,CAAC,OAAO,CAAC,CAAC;gBACvB,CAAC;gBAEa,uCAAgB,GAA9B,UAA+B,OAAiB;oBAC9C,IAAM,CAAC,GAAG,2BAAQ,CAAC,cAAc,CAAC,2BAAQ,CAAC,QAAQ,EAAE,yCAAoB,EAAE,wBAAsB,CAAC,CAAC;oBAClG,CAAS,CAAC,OAAO,GAAG,OAAO,CAAC;gBAC/B,CAAC;gBAMM,6CAAY,GAAnB,cAA6B,CAAC;;gBAdnB,sBAAsB;oBADlC,oCAAe,CAAC,UAAU,CAAC;mBACf,sBAAsB,CAelC;gBAAD,6BAAC;aAAA,AAfD"} \ No newline at end of file diff --git a/dist/system/t/t-value-converter.js b/dist/system/t/t-value-converter.js deleted file mode 100644 index 4fc0ced2..00000000 --- a/dist/system/t/t-value-converter.js +++ /dev/null @@ -1,26 +0,0 @@ -System.register(["../i18n"], function (exports_1, context_1) { - "use strict"; - var i18n_1, TValueConverter; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (i18n_1_1) { - i18n_1 = i18n_1_1; - } - ], - execute: function () { - TValueConverter = /** @class */ (function () { - function TValueConverter(service) { - this.service = service; - } - TValueConverter.inject = function () { return [i18n_1.I18N]; }; - TValueConverter.prototype.toView = function (value, options) { - return this.service.tr(value, options); - }; - return TValueConverter; - }()); - exports_1("TValueConverter", TValueConverter); - } - }; -}); -//# sourceMappingURL=t-value-converter.js.map \ No newline at end of file diff --git a/dist/system/t/t-value-converter.js.map b/dist/system/t/t-value-converter.js.map deleted file mode 100644 index 1ba90ec8..00000000 --- a/dist/system/t/t-value-converter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"t-value-converter.js","sourceRoot":"","sources":["../../../src/t/t-value-converter.ts"],"names":[],"mappings":";;;;;;;;;;;YAIA;gBAGE,yBAAoB,OAAa;oBAAb,YAAO,GAAP,OAAO,CAAM;gBAAI,CAAC;gBAFxB,sBAAM,GAApB,cAAyB,OAAO,CAAC,WAAI,CAAC,CAAC,CAAC,CAAC;gBAIlC,gCAAM,GAAb,UAAc,KAAU,EAAE,OAA4C;oBACpE,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;gBACzC,CAAC;gBACH,sBAAC;YAAD,CAAC,AARD,IAQC"} \ No newline at end of file diff --git a/dist/system/utils.js b/dist/system/utils.js deleted file mode 100644 index e63964ea..00000000 --- a/dist/system/utils.js +++ /dev/null @@ -1,73 +0,0 @@ -System.register(["aurelia-dependency-injection"], function (exports_1, context_1) { - "use strict"; - var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var aurelia_dependency_injection_1, extend, isInteger, assignObjectToKeys, LazyOptional; - var __moduleName = context_1 && context_1.id; - return { - setters: [ - function (aurelia_dependency_injection_1_1) { - aurelia_dependency_injection_1 = aurelia_dependency_injection_1_1; - } - ], - execute: function () { - exports_1("extend", extend = function (destination, source) { - // tslint:disable-next-line:forin - for (var property in source) { - destination[property] = source[property]; - } - return destination; - }); - // tslint:disable-next-line:only-arrow-functions - exports_1("isInteger", isInteger = Number.isInteger || function (value) { - return typeof value === "number" && - isFinite(value) && - Math.floor(value) === value; - }); - exports_1("assignObjectToKeys", assignObjectToKeys = function (root, obj) { - if (obj === undefined || obj === null) { - return obj; - } - var opts = {}; - Object.keys(obj).map(function (key) { - if (typeof obj[key] === "object") { - extend(opts, assignObjectToKeys(key, obj[key])); - } - else { - opts[root !== "" ? root + "." + key : key] = obj[key]; - } - }); - return opts; - }); - LazyOptional = /** @class */ (function () { - function LazyOptional(key) { - this.key = key; - } - LazyOptional_1 = LazyOptional; - LazyOptional.of = function (key) { - return new LazyOptional_1(key); - }; - LazyOptional.prototype.get = function (container) { - var _this = this; - return function () { - if (container.hasResolver(_this.key, false)) { - return container.get(_this.key); - } - return null; - }; - }; - var LazyOptional_1; - LazyOptional = LazyOptional_1 = __decorate([ - aurelia_dependency_injection_1.resolver() - ], LazyOptional); - return LazyOptional; - }()); - exports_1("LazyOptional", LazyOptional); - } - }; -}); -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/dist/system/utils.js.map b/dist/system/utils.js.map deleted file mode 100644 index 582b9f94..00000000 --- a/dist/system/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"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AAE,GAAhB,UAAiB,GAAQ;oBACvB,OAAO,IAAI,cAAY,CAAC,GAAG,CAAC,CAAC;gBAC/B,CAAC;gBAIM,0BAAG,GAAV,UAAW,SAAoB;oBAA/B,iBAOC;oBANC,OAAO;wBACL,IAAI,SAAS,CAAC,WAAW,CAAC,KAAI,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE;4BAC1C,OAAO,SAAS,CAAC,GAAG,CAAC,KAAI,CAAC,GAAG,CAAC,CAAC;yBAChC;wBACD,OAAO,IAAI,CAAC;oBACd,CAAC,CAAC;gBACJ,CAAC;;gBAdU,YAAY;oBADxB,uCAAQ,EAAE;mBACE,YAAY,CAexB;gBAAD,mBAAC;aAAA,AAfD"} \ No newline at end of file diff --git a/dist/typings/aurelia-i18n-loader.d.ts b/dist/typings/aurelia-i18n-loader.d.ts deleted file mode 100644 index 3119feb7..00000000 --- a/dist/typings/aurelia-i18n-loader.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Loader } from "aurelia-loader"; -export declare type LoadPathOption = string | ((lngs: string[], namespaces: string[]) => string); -export declare type LoadCallback = (error: any, result: string | false | undefined) => void; -export interface AureliaBackendOptions { - loadPath?: LoadPathOption; - parse?(data: string, url: string): string; -} -export declare class Backend { - services: any; - options: AureliaBackendOptions; - static type: string; - static loader: Loader; - static with(loader: Loader): typeof Backend; - type: string; - constructor(services: any, options?: AureliaBackendOptions); - init(services: any, options?: AureliaBackendOptions): void; - readMulti(languages: string[], namespaces: string[], callback: LoadCallback): void; - read(language: string, namespace: string, callback: LoadCallback): void; - loadUrl(url: string, callback: LoadCallback): Promise; - create(_languages: string | string[], _namespace: string, _key: string, _fallbackValue: string): void; -} -export default Backend; diff --git a/dist/typings/aurelia-i18n.d.ts b/dist/typings/aurelia-i18n.d.ts deleted file mode 100644 index 182a9bc5..00000000 --- a/dist/typings/aurelia-i18n.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FrameworkConfiguration } from "aurelia-framework"; -import { I18N, AureliaEnhancedI18Next } from "./i18n"; -export * from "./i18n"; -export * from "./relativeTime"; -export * from "./aurelia-i18n-loader"; -export { DfValueConverter, DfBindingBehavior } from "./df"; -export { NfValueConverter, NfBindingBehavior } from "./nf"; -export { RtValueConverter, RtBindingBehavior } from "./rt"; -export { TValueConverter, TBindingBehavior, TCustomAttribute, TParamsCustomAttribute } from "./t"; -export declare function configure(frameworkConfig: FrameworkConfiguration, cb: (instance: I18N) => AureliaEnhancedI18Next): AureliaEnhancedI18Next; diff --git a/dist/typings/defaultTranslations/relative.time.d.ts b/dist/typings/defaultTranslations/relative.time.d.ts deleted file mode 100644 index 0c4769a8..00000000 --- a/dist/typings/defaultTranslations/relative.time.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare type DefaultTranslations = { - [key: string]: string | DefaultTranslations; -}; -export declare const translations: DefaultTranslations; diff --git a/dist/typings/df/df-binding-behavior.d.ts b/dist/typings/df/df-binding-behavior.d.ts deleted file mode 100644 index 8dc85be9..00000000 --- a/dist/typings/df/df-binding-behavior.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -export declare class DfBindingBehavior { - private signalBindingBehavior; - static inject(): (typeof SignalBindingBehavior)[]; - constructor(signalBindingBehavior: SignalBindingBehavior); - bind(binding: any, source: any): void; - unbind(binding: any, source: any): void; -} diff --git a/dist/typings/df/df-value-converter.d.ts b/dist/typings/df/df-value-converter.d.ts deleted file mode 100644 index 8f1ad39f..00000000 --- a/dist/typings/df/df-value-converter.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { I18N } from "../i18n"; -export declare class DfValueConverter { - private service; - static inject(): (typeof I18N)[]; - constructor(service: I18N); - toView(value: any, dfOrOptions?: Intl.DateTimeFormat | Intl.DateTimeFormatOptions, locale?: string): any; -} diff --git a/dist/typings/df/index.d.ts b/dist/typings/df/index.d.ts deleted file mode 100644 index eaa0c289..00000000 --- a/dist/typings/df/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./df-binding-behavior"; -export * from "./df-value-converter"; diff --git a/dist/typings/i18n.d.ts b/dist/typings/i18n.d.ts deleted file mode 100644 index b36f6941..00000000 --- a/dist/typings/i18n.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import i18next, { i18n, InitOptions } from "i18next"; -import { EventAggregator } from "aurelia-event-aggregator"; -import { BindingSignaler } from "aurelia-templating-resources"; -export interface AureliaEnhancedOptions extends InitOptions { - attributes?: string[]; - skipTranslationOnMissingKey?: boolean; -} -export interface AureliaEnhancedI18Next extends i18n { - options: AureliaEnhancedOptions; -} -export interface I18NEventPayload { - oldValue: string; - newValue: string; -} -export declare const I18N_EA_SIGNAL = "i18n:locale:changed"; -export declare class I18N { - private ea; - private signaler; - i18nextDeferred: Promise; - i18next: AureliaEnhancedI18Next; - Intl: typeof Intl; - private globalVars; - constructor(ea: EventAggregator, signaler: BindingSignaler); - setup(options?: AureliaEnhancedOptions & InitOptions): Promise; - i18nextReady(): Promise; - setLocale(locale: string): Promise; - getLocale(): string; - nf(options?: Intl.NumberFormatOptions, locales?: string | string[]): Intl.NumberFormat; - uf(numberLike: string, locale?: string): number; - df(options?: Intl.DateTimeFormatOptions, locales?: string | string[]): Intl.DateTimeFormat; - tr(key: string | string[], options?: i18next.TranslationOptions): any; - registerGlobalVariable(key: string, value: any): void; - unregisterGlobalVariable(key: string): void; - /** - * Scans an element for children that have a translation attribute and - * updates their innerHTML with the current translation values. - * - * If an image is encountered the translated value will be applied to the src attribute. - * - * @param el HTMLElement to search within - */ - updateTranslations(el: HTMLElement): void; - updateValue(node: Element & { - au: any; - }, value: string, params: any): void; -} diff --git a/dist/typings/nf/index.d.ts b/dist/typings/nf/index.d.ts deleted file mode 100644 index a2b5d1de..00000000 --- a/dist/typings/nf/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./nf-binding-behavior"; -export * from "./nf-value-converter"; diff --git a/dist/typings/nf/nf-binding-behavior.d.ts b/dist/typings/nf/nf-binding-behavior.d.ts deleted file mode 100644 index 7860e063..00000000 --- a/dist/typings/nf/nf-binding-behavior.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -export declare class NfBindingBehavior { - private signalBindingBehavior; - static inject(): (typeof SignalBindingBehavior)[]; - constructor(signalBindingBehavior: SignalBindingBehavior); - bind(binding: any, source: any): void; - unbind(binding: any, source: any): void; -} diff --git a/dist/typings/nf/nf-value-converter.d.ts b/dist/typings/nf/nf-value-converter.d.ts deleted file mode 100644 index 958e7ec5..00000000 --- a/dist/typings/nf/nf-value-converter.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { I18N } from "../i18n"; -export declare class NfValueConverter { - private service; - static inject(): (typeof I18N)[]; - constructor(service: I18N); - toView(value: any, nfOrOptions?: Intl.NumberFormat | Intl.NumberFormatOptions, locale?: string): any; -} diff --git a/dist/typings/relativeTime.d.ts b/dist/typings/relativeTime.d.ts deleted file mode 100644 index 89dc0aa3..00000000 --- a/dist/typings/relativeTime.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { EventAggregator } from "aurelia-event-aggregator"; -import { I18N } from "./i18n"; -export declare class RelativeTime { - private service; - private ea; - static inject(): (typeof EventAggregator | typeof I18N)[]; - constructor(service: I18N, ea: EventAggregator); - setup(locales?: { - oldValue: string; - newValue: string; - }): void; - addTranslationResource(key: string, translation: any): void; - getRelativeTime(time: Date): any; - getTimeDiffDescription(diff: number, unit: "year" | "month" | "day" | "hour" | "minute" | "second", timeDivisor: number): any; -} diff --git a/dist/typings/rt/index.d.ts b/dist/typings/rt/index.d.ts deleted file mode 100644 index 2da756fb..00000000 --- a/dist/typings/rt/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./rt-binding-behavior"; -export * from "./rt-value-converter"; diff --git a/dist/typings/rt/rt-binding-behavior.d.ts b/dist/typings/rt/rt-binding-behavior.d.ts deleted file mode 100644 index f32ce1a8..00000000 --- a/dist/typings/rt/rt-binding-behavior.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -export declare class RtBindingBehavior { - private signalBindingBehavior; - static inject(): (typeof SignalBindingBehavior)[]; - constructor(signalBindingBehavior: SignalBindingBehavior); - bind(binding: any, source: any): void; - unbind(binding: any, source: any): void; -} diff --git a/dist/typings/rt/rt-value-converter.d.ts b/dist/typings/rt/rt-value-converter.d.ts deleted file mode 100644 index 611d1845..00000000 --- a/dist/typings/rt/rt-value-converter.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { RelativeTime } from "../relativeTime"; -export declare class RtValueConverter { - private service; - static inject(): (typeof RelativeTime)[]; - constructor(service: RelativeTime); - toView(value: any): any; -} diff --git a/dist/typings/t/index.d.ts b/dist/typings/t/index.d.ts deleted file mode 100644 index a575ac6b..00000000 --- a/dist/typings/t/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./t-binding-behavior"; -export * from "./t-custom-attribute"; -export * from "./t-params-custom-attribute"; -export * from "./t-value-converter"; diff --git a/dist/typings/t/t-binding-behavior.d.ts b/dist/typings/t/t-binding-behavior.d.ts deleted file mode 100644 index e62e417e..00000000 --- a/dist/typings/t/t-binding-behavior.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { SignalBindingBehavior } from "aurelia-templating-resources"; -export declare class TBindingBehavior { - private signalBindingBehavior; - static inject: (typeof SignalBindingBehavior)[]; - constructor(signalBindingBehavior: SignalBindingBehavior); - bind(binding: any, source: any): void; - unbind(binding: any, source: any): void; -} diff --git a/dist/typings/t/t-custom-attribute.d.ts b/dist/typings/t/t-custom-attribute.d.ts deleted file mode 100644 index 01096533..00000000 --- a/dist/typings/t/t-custom-attribute.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { EventAggregator } from "aurelia-event-aggregator"; -import { I18N } from "../i18n"; -import { LazyOptional } from "../utils"; -export declare class TCustomAttribute { - private element; - private service; - private ea; - static inject(): ({ - new (): Element; - prototype: Element; - } | typeof EventAggregator | typeof I18N | LazyOptional)[]; - static configureAliases(aliases: string[]): void; - private params; - private lazyParams; - private subscription; - private value; - constructor(element: Element & { - au: any; - }, service: I18N, ea: EventAggregator, p: any); - bind(): void; - paramsChanged(newValue: any, newParams: any): void; - valueChanged(newValue: any): void; - unbind(): void; -} diff --git a/dist/typings/t/t-params-custom-attribute.d.ts b/dist/typings/t/t-params-custom-attribute.d.ts deleted file mode 100644 index eaf6c2cc..00000000 --- a/dist/typings/t/t-params-custom-attribute.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export declare class TParamsCustomAttribute { - element: Element; - static inject(): { - new (): Element; - prototype: Element; - }[]; - static configureAliases(aliases: string[]): void; - service: any; - constructor(element: Element); - valueChanged(): void; -} diff --git a/dist/typings/t/t-value-converter.d.ts b/dist/typings/t/t-value-converter.d.ts deleted file mode 100644 index a3b1dc1a..00000000 --- a/dist/typings/t/t-value-converter.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import i18next from "i18next"; -import { I18N } from "../i18n"; -export declare class TValueConverter { - private service; - static inject(): (typeof I18N)[]; - constructor(service: I18N); - toView(value: any, options?: i18next.TranslationOptions): any; -} diff --git a/dist/typings/utils.d.ts b/dist/typings/utils.d.ts deleted file mode 100644 index 4f7dde8e..00000000 --- a/dist/typings/utils.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Container } from "aurelia-dependency-injection"; -export declare let extend: (destination: any, source: any) => any; -export declare const isInteger: (number: number) => boolean; -export declare let assignObjectToKeys: (root: any, obj: any) => any; -export declare class LazyOptional { - private key; - static of(key: any): LazyOptional; - constructor(key: string); - get(container: Container): () => any; -} diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index e4e2565e..9ee76491 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,17 @@ + +# [3.0.0-beta.3](https://github.com/aurelia/i18n/compare/3.0.0-beta.2...3.0.0-beta.3) (2018-11-16) + + +### Bug Fixes + +* **build:** auto fix type def generation ([a3b9056](https://github.com/aurelia/i18n/commit/a3b9056)) +* **main:** reexport df, nf & rt ([d2a61b6](https://github.com/aurelia/i18n/commit/d2a61b6)) +* **package-json:** adjust typings path, test watch script ([42f3726](https://github.com/aurelia/i18n/commit/42f3726)) +* **relative-time:** update for da, sv, nn/no and fi, reformat and sort ([#284](https://github.com/aurelia/i18n/issues/284)) ([a1b942b](https://github.com/aurelia/i18n/commit/a1b942b)) +* **test:** path mappings for win and linux ([561c33e](https://github.com/aurelia/i18n/commit/561c33e)) + + + # [3.0.0-beta.2](https://github.com/aurelia/i18n/compare/3.0.0-beta.1...3.0.0-beta.2) (2018-09-11) diff --git a/doc/api.json b/doc/api.json deleted file mode 100644 index 22fbbc0b..00000000 --- a/doc/api.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"aurelia-i18n","children":[{"id":64,"name":"Backend","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":69,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":70,"name":"new Backend","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":71,"name":"services","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":72,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"Backend","id":64}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":83,"character":33}]},{"id":65,"name":"loader","kind":1024,"kindString":"Property","flags":{"isStatic":true,"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":80,"character":15}],"type":{"type":"instrinct","name":"any"}},{"id":91,"name":"create","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":92,"name":"create","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":93,"name":"languages","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":94,"name":"namespace","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":95,"name":"key","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":96,"name":"fallbackValue","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":89,"character":8}]},{"id":73,"name":"init","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":74,"name":"init","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":75,"name":"services","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":76,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":85,"character":6}]},{"id":87,"name":"loadUrl","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":88,"name":"loadUrl","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":89,"name":"url","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":90,"name":"callback","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":88,"character":9}]},{"id":82,"name":"read","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":83,"name":"read","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":84,"name":"language","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":85,"name":"namespace","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":86,"name":"callback","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":87,"character":6}]},{"id":77,"name":"readMulti","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":78,"name":"readMulti","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":79,"name":"languages","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":80,"name":"namespaces","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":81,"name":"callback","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":86,"character":11}]},{"id":66,"name":"with","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":67,"name":"with","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":68,"name":"loader","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":83,"character":13}]}],"groups":[{"title":"Constructors","kind":512,"children":[69]},{"title":"Properties","kind":1024,"children":[65]},{"title":"Methods","kind":2048,"children":[91,73,87,82,77,66]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":79,"character":28}]},{"id":97,"name":"BaseI18N","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":100,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":101,"name":"new BaseI18N","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":102,"name":"i18n","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":103,"name":"element","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":104,"name":"ea","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"BaseI18N","id":97}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":92,"character":23}]},{"id":105,"name":"attached","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":106,"name":"attached","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":94,"character":10}]},{"id":107,"name":"detached","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":108,"name":"detached","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":95,"character":10}]},{"id":98,"name":"inject","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":99,"name":"inject","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":92,"character":15}]}],"groups":[{"title":"Constructors","kind":512,"children":[100]},{"title":"Methods","kind":2048,"children":[105,107,98]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":91,"character":29}]},{"id":121,"name":"DfBindingBehavior","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":124,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":125,"name":"new DfBindingBehavior","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":126,"name":"signalBindingBehavior","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"DfBindingBehavior","id":121}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":103,"character":23}]},{"id":127,"name":"bind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":128,"name":"bind","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":129,"name":"binding","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":130,"name":"source","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":105,"character":6}]},{"id":131,"name":"unbind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":132,"name":"unbind","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":133,"name":"binding","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":134,"name":"source","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":106,"character":8}]},{"id":122,"name":"inject","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":123,"name":"inject","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":103,"character":15}]}],"groups":[{"title":"Constructors","kind":512,"children":[124]},{"title":"Methods","kind":2048,"children":[127,131,122]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":102,"character":38}]},{"id":109,"name":"DfValueConverter","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":112,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":113,"name":"new DfValueConverter","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":114,"name":"i18n","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"DfValueConverter","id":109}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":98,"character":23}]},{"id":115,"name":"toView","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":116,"name":"toView","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":117,"name":"value","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":118,"name":"dfOrOptions","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":119,"name":"locale","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":120,"name":"df","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":100,"character":8}]},{"id":110,"name":"inject","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":111,"name":"inject","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":98,"character":15}]}],"groups":[{"title":"Constructors","kind":512,"children":[112]},{"title":"Methods","kind":2048,"children":[115,110]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":97,"character":37}]},{"id":12,"name":"I18N","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":19,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":20,"name":"new I18N","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":21,"name":"ea","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":22,"name":"signaler","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"I18N","id":12}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":46,"character":22}]},{"id":18,"name":"ea","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":46,"character":4}],"type":{"type":"reference","name":"EventAggregator"}},{"id":14,"name":"globalVars","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":42,"character":12}],"type":{"type":"instrinct","name":"any"}},{"id":17,"name":"i18next","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":45,"character":9}],"type":{"type":"instrinct","name":"any"}},{"id":16,"name":"i18nextDefered","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":44,"character":16}],"type":{"type":"instrinct","name":"any"}},{"id":15,"name":"params","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":43,"character":8}],"type":{"type":"instrinct","name":"any"}},{"id":13,"name":"inject","kind":1024,"kindString":"Property","flags":{"isStatic":true,"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":41,"character":15}],"type":{"type":"instrinct","name":"any"}},{"id":41,"name":"df","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":42,"name":"df","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":43,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":44,"name":"locales","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":54,"character":4}]},{"id":31,"name":"getLocale","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":32,"name":"getLocale","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"string"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":51,"character":11}]},{"id":26,"name":"i18nextReady","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":27,"name":"i18nextReady","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"reference","name":"Promise","typeArguments":[{"type":"instrinct","name":"any"}]}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":49,"character":14}]},{"id":33,"name":"nf","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":34,"name":"nf","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":35,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":36,"name":"locales","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":52,"character":4}]},{"id":49,"name":"registerGlobalVariable","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":50,"name":"registerGlobalVariable","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":51,"name":"key","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":52,"name":"value","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"void"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":56,"character":24}]},{"id":28,"name":"setLocale","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":29,"name":"setLocale","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":30,"name":"locale","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"Promise","typeArguments":[{"type":"instrinct","name":"any"}]}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":50,"character":11}]},{"id":23,"name":"setup","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":24,"name":"setup","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":25,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"Promise","typeArguments":[{"type":"instrinct","name":"any"}]}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":48,"character":7}]},{"id":45,"name":"tr","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":46,"name":"tr","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":47,"name":"key","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":48,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"string"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":55,"character":4}]},{"id":37,"name":"uf","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":38,"name":"uf","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":39,"name":"number","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":40,"name":"locale","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"number"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":53,"character":4}]},{"id":53,"name":"unregisterGlobalVariable","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":54,"name":"unregisterGlobalVariable","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":55,"name":"key","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"void"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":57,"character":26}]},{"id":56,"name":"updateTranslations","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":57,"name":"updateTranslations","kind":4096,"kindString":"Call signature","flags":{},"comment":{"shortText":"Scans an element for children that have a translation attribute and\nupdates their innerHTML with the current translation values.","text":"If an image is encountered the translated value will be applied to the src attribute.\n"},"parameters":[{"id":58,"name":"el","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"comment":{"text":"HTMLElement to search within\n"},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"void"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":67,"character":20}]},{"id":59,"name":"updateValue","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":60,"name":"updateValue","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":61,"name":"node","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":62,"name":"value","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":63,"name":"params","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":68,"character":13}]}],"groups":[{"title":"Constructors","kind":512,"children":[19]},{"title":"Properties","kind":1024,"children":[18,14,17,16,15,13]},{"title":"Methods","kind":2048,"children":[41,31,26,33,49,28,23,45,37,53,56,59]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":40,"character":25}]},{"id":2,"name":"LazyOptional","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":3,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":4,"name":"new LazyOptional","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":5,"name":"key","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"LazyOptional","id":2}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":33,"character":35}]},{"id":6,"name":"get","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":7,"name":"get","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":8,"name":"container","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":35,"character":5}]},{"id":9,"name":"of","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":10,"name":"of","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":11,"name":"key","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":36,"character":11}]}],"groups":[{"title":"Constructors","kind":512,"children":[3]},{"title":"Methods","kind":2048,"children":[6,9]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":33,"character":33}]},{"id":147,"name":"NfBindingBehavior","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":150,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":151,"name":"new NfBindingBehavior","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":152,"name":"signalBindingBehavior","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"NfBindingBehavior","id":147}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":114,"character":23}]},{"id":153,"name":"bind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":154,"name":"bind","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":155,"name":"binding","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":156,"name":"source","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":116,"character":6}]},{"id":157,"name":"unbind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":158,"name":"unbind","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":159,"name":"binding","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":160,"name":"source","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":117,"character":8}]},{"id":148,"name":"inject","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":149,"name":"inject","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":114,"character":15}]}],"groups":[{"title":"Constructors","kind":512,"children":[150]},{"title":"Methods","kind":2048,"children":[153,157,148]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":113,"character":38}]},{"id":135,"name":"NfValueConverter","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":138,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":139,"name":"new NfValueConverter","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":140,"name":"i18n","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"NfValueConverter","id":135}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":109,"character":23}]},{"id":141,"name":"toView","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":142,"name":"toView","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":143,"name":"value","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":144,"name":"nfOrOptions","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":145,"name":"locale","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":146,"name":"nf","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":111,"character":8}]},{"id":136,"name":"inject","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":137,"name":"inject","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":109,"character":15}]}],"groups":[{"title":"Constructors","kind":512,"children":[138]},{"title":"Methods","kind":2048,"children":[141,136]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":108,"character":37}]},{"id":161,"name":"RelativeTime","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":164,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":165,"name":"new RelativeTime","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":166,"name":"i18n","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":167,"name":"ea","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"RelativeTime","id":161}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":120,"character":23}]},{"id":171,"name":"addTranslationResource","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":172,"name":"addTranslationResource","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":173,"name":"key","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":174,"name":"translation","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":123,"character":24}]},{"id":175,"name":"getRelativeTime","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":176,"name":"getRelativeTime","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":177,"name":"time","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":124,"character":17}]},{"id":178,"name":"getTimeDiffDescription","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":179,"name":"getTimeDiffDescription","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":180,"name":"diff","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":181,"name":"unit","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":182,"name":"timeDivisor","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":125,"character":24}]},{"id":168,"name":"setup","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":169,"name":"setup","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":170,"name":"locales","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":122,"character":7}]},{"id":162,"name":"inject","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":163,"name":"inject","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":120,"character":15}]}],"groups":[{"title":"Constructors","kind":512,"children":[164]},{"title":"Methods","kind":2048,"children":[171,175,178,168,162]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":119,"character":33}]},{"id":250,"name":"RtBindingBehavior","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":253,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":254,"name":"new RtBindingBehavior","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":255,"name":"signalBindingBehavior","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"RtBindingBehavior","id":250}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":160,"character":23}]},{"id":256,"name":"bind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":257,"name":"bind","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":258,"name":"binding","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":259,"name":"source","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":162,"character":6}]},{"id":260,"name":"unbind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":261,"name":"unbind","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":262,"name":"binding","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":263,"name":"source","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":163,"character":8}]},{"id":251,"name":"inject","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":252,"name":"inject","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":160,"character":15}]}],"groups":[{"title":"Constructors","kind":512,"children":[253]},{"title":"Methods","kind":2048,"children":[256,260,251]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":159,"character":38}]},{"id":241,"name":"RtValueConverter","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":244,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":245,"name":"new RtValueConverter","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":246,"name":"relativeTime","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"RtValueConverter","id":241}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":155,"character":23}]},{"id":247,"name":"toView","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":248,"name":"toView","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":249,"name":"value","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":157,"character":8}]},{"id":242,"name":"inject","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":243,"name":"inject","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":155,"character":15}]}],"groups":[{"title":"Constructors","kind":512,"children":[244]},{"title":"Methods","kind":2048,"children":[247,242]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":154,"character":37}]},{"id":228,"name":"TBindingBehavior","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":230,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":231,"name":"new TBindingBehavior","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":232,"name":"signalBindingBehavior","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"TBindingBehavior","id":228}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":149,"character":21}]},{"id":229,"name":"inject","kind":1024,"kindString":"Property","flags":{"isStatic":true,"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":149,"character":15}],"type":{"type":"instrinct","name":"any"}},{"id":233,"name":"bind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":234,"name":"bind","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":235,"name":"binding","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":236,"name":"source","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":151,"character":6}]},{"id":237,"name":"unbind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":238,"name":"unbind","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":239,"name":"binding","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":240,"name":"source","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":152,"character":8}]}],"groups":[{"title":"Constructors","kind":512,"children":[230]},{"title":"Properties","kind":1024,"children":[229]},{"title":"Methods","kind":2048,"children":[233,237]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":148,"character":37}]},{"id":205,"name":"TCustomAttribute","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":211,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":212,"name":"new TCustomAttribute","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":213,"name":"element","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":214,"name":"i18n","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":215,"name":"ea","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":216,"name":"tparams","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"TCustomAttribute","id":205}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":141,"character":46}]},{"id":217,"name":"bind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":218,"name":"bind","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":143,"character":6}]},{"id":219,"name":"paramsChanged","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":220,"name":"paramsChanged","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":221,"name":"newValue","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":222,"name":"newParams","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":144,"character":15}]},{"id":226,"name":"unbind","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":227,"name":"unbind","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":146,"character":8}]},{"id":223,"name":"valueChanged","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":224,"name":"valueChanged","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":225,"name":"newValue","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":145,"character":14}]},{"id":208,"name":"configureAliases","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":209,"name":"configureAliases","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":210,"name":"aliases","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":141,"character":25}]},{"id":206,"name":"inject","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":207,"name":"inject","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":140,"character":15}]}],"groups":[{"title":"Constructors","kind":512,"children":[211]},{"title":"Methods","kind":2048,"children":[217,219,226,223,208,206]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":139,"character":37}]},{"id":193,"name":"TParamsCustomAttribute","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":200,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":201,"name":"new TParamsCustomAttribute","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":202,"name":"element","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"TParamsCustomAttribute","id":193}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":135,"character":15}]},{"id":199,"name":"service","kind":1024,"kindString":"Property","flags":{"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":135,"character":9}],"type":{"type":"instrinct","name":"any"}},{"id":203,"name":"valueChanged","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":204,"name":"valueChanged","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":137,"character":14}]},{"id":196,"name":"configureAliases","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":197,"name":"configureAliases","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":198,"name":"aliases","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":134,"character":25}]},{"id":194,"name":"inject","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":195,"name":"inject","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":133,"character":15}]}],"groups":[{"title":"Constructors","kind":512,"children":[200]},{"title":"Properties","kind":1024,"children":[199]},{"title":"Methods","kind":2048,"children":[203,196,194]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":132,"character":43}]},{"id":183,"name":"TValueConverter","kind":128,"kindString":"Class","flags":{"isExported":true},"children":[{"id":186,"name":"constructor","kind":512,"kindString":"Constructor","flags":{"isExported":true},"signatures":[{"id":187,"name":"new TValueConverter","kind":16384,"kindString":"Constructor signature","flags":{},"parameters":[{"id":188,"name":"i18n","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"reference","name":"TValueConverter","id":183}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":128,"character":23}]},{"id":189,"name":"toView","kind":2048,"kindString":"Method","flags":{"isExported":true},"signatures":[{"id":190,"name":"toView","kind":4096,"kindString":"Call signature","flags":{},"parameters":[{"id":191,"name":"value","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}},{"id":192,"name":"options","kind":32768,"kindString":"Parameter","flags":{"isOptional":true},"type":{"type":"instrinct","name":"any"}}],"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":130,"character":8}]},{"id":184,"name":"inject","kind":2048,"kindString":"Method","flags":{"isStatic":true,"isExported":true},"signatures":[{"id":185,"name":"inject","kind":4096,"kindString":"Call signature","flags":{},"type":{"type":"instrinct","name":"any"}}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":128,"character":15}]}],"groups":[{"title":"Constructors","kind":512,"children":[186]},{"title":"Methods","kind":2048,"children":[189,184]}],"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":127,"character":36}]},{"id":267,"name":"assignObjectToKeys","kind":32,"kindString":"Variable","flags":{"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":32,"character":37}],"type":{"type":"instrinct","name":"any"}},{"id":265,"name":"extend","kind":32,"kindString":"Variable","flags":{"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":30,"character":25}],"type":{"type":"instrinct","name":"any"}},{"id":266,"name":"isInteger","kind":32,"kindString":"Variable","flags":{"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":31,"character":30}],"type":{"type":"instrinct","name":"any"}},{"id":264,"name":"translations","kind":32,"kindString":"Variable","flags":{"isExported":true},"sources":[{"fileName":"dist/aurelia-i18n.d.ts","line":29,"character":33}],"type":{"type":"instrinct","name":"any"}}],"groups":[{"title":"Classes","kind":128,"children":[64,97,121,109,12,2,147,135,161,250,241,228,205,193,183]},{"title":"Variables","kind":32,"children":[267,265,266,264]}]} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ccea1903..9887b15c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3360,10 +3360,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/full-icu/-/full-icu-1.2.1.tgz", "integrity": "sha512-E2s1b4GVbt8PyG+iaRN6ks8N0Oy2LOJz7SIMUwWWWx7Mr5Z08hKkfpkKQbOtOGqzkFpckDJHjjZ8qfigN2W86A==", - "dev": true, - "requires": { - "icu4c-data": "^0.60.2" - } + "dev": true }, "function-bind": { "version": "1.1.1", @@ -3865,12 +3862,6 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "icu4c-data": { - "version": "0.60.2", - "resolved": "https://registry.npmjs.org/icu4c-data/-/icu4c-data-0.60.2.tgz", - "integrity": "sha512-4ScORTYJPIDJRPtAkQWXfKqGk8u1ThOxFWCJ3jkq+rj/MU4cK6isCvhFiEjunivw1/bJ10LqNAaJ9pAK68DEZg==", - "dev": true - }, "import-local": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", diff --git a/package.json b/package.json index 55deea30..e2dcc1df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-i18n", - "version": "3.0.0-beta.2", + "version": "3.0.0-beta.3", "description": "A plugin that provides i18n support.", "keywords": [ "aurelia", @@ -22,13 +22,10 @@ "build": "cross-env TS_NODE_PROJECT=build/tsconfig.json ts-node build/build.ts", "build:dts": "dts-bundle-generator -o dist/aurelia-i18n.d.ts src/aurelia-i18n.ts --external-types --no-check", "precommit": "npm run lint", - "predoc": "cross-env rimraf doc/api.json && rimraf dist/doc-temp && tsc --p tsconfig-build.json --module amd --outFile dist/doc-temp/aurelia-store.js && node doc/shape-defs && copyfiles tsconfig.json dist/doc-temp", - "doc": "cross-env typedoc --json doc/api.json --excludeExternals --includeDeclarations --mode modules --target ES6 --name aurelia-store-docs dist/doc-temp/", - "postdoc": "cross-env node doc/shape-doc && rimraf dist/doc-temp", "changelog": "cross-env conventional-changelog -p angular -i doc/CHANGELOG.md -s", "bump-version": "npm --no-git-tag-version version", "preprepare-release": "cross-env npm run test", - "prepare-release": "cross-env npm run changelog && npm run build && npm run doc" + "prepare-release": "cross-env npm run changelog && npm run build" }, "jest": { "globals": {