Skip to content

Commit

Permalink
Expose canonical namespace name too (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pchelolo authored and Marko Obrovac committed Jun 22, 2016
1 parent 0b553dc commit 7699e5c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ for (var ns in nameSpaceIds) {
}

/**
* Get the canonical name string for this namespace.
* Get the normalized localized name string for this namespace.
*
* @returns {string}
*/
Expand All @@ -151,6 +151,15 @@ Namespace.prototype.getNormalizedText = function() {
return nsName.replace(/ /g, '_');
};

/**
* Get the canonical non-localized name string for this namespace.
*
* @returns {string}
*/
Namespace.prototype.getCanonicalText = function() {
return this._siteInfo.namespaces[this._id + ''].canonical.replace(/ /g, '_');
};

/**
* Are subpages allowed for this namespace?
*
Expand Down

0 comments on commit 7699e5c

Please sign in to comment.