Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
contactJS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MOTIVATE
contactJS
Commits
91c95186
Commit
91c95186
authored
9 years ago
by
Helena Jank
Browse files
Options
Downloads
Patches
Plain Diff
+ added module Translation (as part of discoverer)
parent
21f656e6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/config.js
+1
-0
1 addition, 0 deletions
js/config.js
js/modules/discoverer/discoverer.js
+23
-1
23 additions, 1 deletion
js/modules/discoverer/discoverer.js
js/modules/discoverer/translation.js
+63
-0
63 additions, 0 deletions
js/modules/discoverer/translation.js
with
87 additions
and
1 deletion
js/config.js
+
1
−
0
View file @
91c95186
...
...
@@ -26,6 +26,7 @@ requirejs.config({
interpreterDescription
:
'
modules/descriptions/interpreterDescription
'
,
widgetDescription
:
'
modules/descriptions/widgetDescription
'
,
discoverer
:
'
modules/discoverer/discoverer
'
,
translation
:
'
modules/discoverer/translation
'
,
interpreter
:
'
modules/interpreter/interpreter
'
,
interpreterResult
:
'
modules/interpreter/interpreterResult
'
,
callback
:
'
modules/subscriber/callback
'
,
...
...
This diff is collapsed.
Click to expand it.
js/modules/discoverer/discoverer.js
+
23
−
1
View file @
91c95186
...
...
@@ -37,6 +37,15 @@ define([ 'easejs', 'attributeTypeList', 'widget', 'interpreter', 'aggregator' ],
*/
'
private interpreter
'
:
{},
/**
* @alias translations
* @private
* @type {Array}
* @memberof Discoverer#
* @desc List of available attributeType translations (or synonyms).
*/
'
private translations
'
:
{},
/**
* Constructor: All known components given in the associated functions will be registered as startup.
*
...
...
@@ -46,7 +55,8 @@ define([ 'easejs', 'attributeTypeList', 'widget', 'interpreter', 'aggregator' ],
* @requires AttributeTypeList
* @constructs Discoverer
*/
'
public __construct
'
:
function
()
{
'
public __construct
'
:
function
(
_translations
)
{
this
.
translations
=
_translations
;
this
.
register
();
},
...
...
@@ -327,6 +337,18 @@ define([ 'easejs', 'attributeTypeList', 'widget', 'interpreter', 'aggregator' ],
}
return
componentList
;
},
/**
* Returns the (associative array of) this discoverer's translations.
*
* @public
* @alias getTranslations
* @memberof Discoverer#
* @returns {Object}
*/
'
public getTranslations
'
:
function
()
{
return
this
.
translations
;
},
/***********************************************************************
* Helper *
...
...
This diff is collapsed.
Click to expand it.
js/modules/discoverer/translation.js
0 → 100644
+
63
−
0
View file @
91c95186
/**
* This module represents the helper class Translation.
*
* @module Translation
* @fileOverview
*/
define
(
'
translation
'
,
[
'
easejs
'
,
'
attributeType
'
],
function
(
easejs
,
AttributeType
)
{
var
Class
=
easejs
.
Class
;
var
Translation
=
Class
(
'
Translation
'
,
{
'
private fromAttributeType
'
:
{},
'
private toAttributeType
'
:
{},
/**
* Constructor: Constructs a translation tuple.
*
* @class Translation
* @classdesc This class represents a translation tuple.
* It holds two synonymous attribute types.
* @requires easejs
* @requires attributeType
* @constructs Translation
*/
'
public __construct
'
:
function
(
_fromAttributeType
,
_toAttributeType
)
{
this
.
fromAttributeType
=
_fromAttributeType
;
this
.
toAttributeType
=
_toAttributeType
;
},
/**
* Look for a translation and return the found synonym.
*
* @public
* @alias getSynonym
* @memberof Translation#
* @param {AttributeType} attributeType AttributeType whose synonym is queried
* @returns {AttributeType} The synonym if one exists, otherwise the given attributeType
*/
'
public getSynonym
'
:
function
(
_attributeType
)
{
return
this
.
hasSynonym
(
_attributeType
)
?
this
.
toAttributeType
:
_attributeType
;
},
/**
* Look for a translation and return true if one exists.
*
* @public
* @alias hasSynonym
* @memberof Translation#
* @param {AttributeType} attributeType AttributeType whose synonym is queried
* @returns {boolean}
*/
'
public hasSynonym
'
:
function
(
_attributeType
)
{
return
this
.
fromAttributeType
.
equals
(
_attributeType
);
}
});
return
Translation
;
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment