aboutsummaryrefslogtreecommitdiffstats
path: root/services/activity-spec/activity-spec-web/activity-spec-api-docs/lang/translator.js
diff options
context:
space:
mode:
authorsheetalm <sheetal.mudholkar@amdocs.com>2018-03-13 19:32:08 +0530
committersheetalm <sheetal.mudholkar@amdocs.com>2018-03-26 14:38:06 +0530
commited12890b0bb0c07acd3eb7bcbd10bfcca3046a2b (patch)
treebd37e0e117fc9e8a1b818f94a9e5a120ca4df0a6 /services/activity-spec/activity-spec-web/activity-spec-api-docs/lang/translator.js
parentf2cee7829ae7d8fae58239dd0018b2aa790c0251 (diff)
Activity Spec Service - Dockerization
Resolving merge conflict Fixing todo items after rebase. URL to be /activity-spec-api. Removing unused image. Renaming css Configuring docker registry to push images and adding docker profile Add maven docker module to generate below docker images 1 activity-spec-init:1.2.0-SNAPSHOT - creates cassandra keyspace and tables in already running cassandra docker image 2 activity-spec-be:1.2.0-SNAPSHOT - deploys activity spec war and swagger war on base jetty docker image Change-Id: Ic638e2cb9c224e9e6c91cf0f7198594593a77ae5 Issue-ID: SDC-1048 Signed-off-by: sheetalm <sheetal.mudholkar@amdocs.com>
Diffstat (limited to 'services/activity-spec/activity-spec-web/activity-spec-api-docs/lang/translator.js')
-rw-r--r--services/activity-spec/activity-spec-web/activity-spec-api-docs/lang/translator.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/services/activity-spec/activity-spec-web/activity-spec-api-docs/lang/translator.js b/services/activity-spec/activity-spec-web/activity-spec-api-docs/lang/translator.js
new file mode 100644
index 0000000000..591f6d4094
--- /dev/null
+++ b/services/activity-spec/activity-spec-web/activity-spec-api-docs/lang/translator.js
@@ -0,0 +1,39 @@
+'use strict';
+
+/**
+ * Translator for documentation pages.
+ *
+ * To enable translation you should include one of language-files in your index.html
+ * after <script src='lang/translator.js' type='text/javascript'></script>.
+ * For example - <script src='lang/ru.js' type='text/javascript'></script>
+ *
+ * If you wish to translate some new texsts you should do two things:
+ * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too.
+ * 2. Mark that text it templates this way <anyHtmlTag data-sw-translate>New Phrase</anyHtmlTag> or <anyHtmlTag data-sw-translate value='New Phrase'/>.
+ * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate.
+ *
+ */
+window.SwaggerTranslator = {
+
+ _words:[],
+
+ translate: function(sel) {
+ var $this = this;
+ sel = sel || '[data-sw-translate]';
+
+ $(sel).each(function() {
+ $(this).html($this._tryTranslate($(this).html()));
+
+ $(this).val($this._tryTranslate($(this).val()));
+ $(this).attr('title', $this._tryTranslate($(this).attr('title')));
+ });
+ },
+
+ _tryTranslate: function(word) {
+ return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word;
+ },
+
+ learn: function(wordsMap) {
+ this._words = wordsMap;
+ }
+};