Skip to content

Commit

Permalink
some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kariminf committed May 31, 2021
1 parent 369fd81 commit f0e0caf
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 225 deletions.
3 changes: 2 additions & 1 deletion jsdoc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"source": {
"exclude": ["docs", "out", "test", ".git", "dist", "node_modules"]
"exclude": ["docs", "out", "test", ".git", "dist", "node_modules"],
"includePattern": "src/[^/]+\\.m?js$"
},
"opts": {
"template": "node_modules/tui-jsdoc-template",
Expand Down
23 changes: 9 additions & 14 deletions src/info.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* Information module
* @module info
*/

/**
* A class which affords some information about a language
* @hideconstructor
*/
class Info {
//ISO639-2/5 code: ara, eng, jpn, etc.
static code = "";
Expand All @@ -22,10 +31,8 @@ class Info {
/**
* Get the name of the language
*
* @method getName
* @public
* @static
* @memberof Info
* @return {String} the language name: arabic, english, japanese, etc.
*/
static getName() {
Expand All @@ -35,10 +42,8 @@ class Info {
/**
* Get the name of the language in its own writing system
*
* @method getOrigName
* @public
* @static
* @memberof Info
* @return {String} the language original name: عربية, english, 日本語, etc.
*/
static getOrigName() {
Expand All @@ -48,10 +53,8 @@ class Info {
/**
* Get the code of the language
*
* @method getCode
* @public
* @static
* @memberof Info
* @return {String} The language ISO639-2 code: "ara", "jpn", "eng", etc.
*/
static getCode() {
Expand All @@ -61,10 +64,8 @@ class Info {
/**
* Get the family of the language
*
* @method getFamily
* @public
* @static
* @memberof Info
* @return {String} The language family: Afro-asiatic, Japonic, etc.
*/
static getFamily() {
Expand All @@ -74,10 +75,8 @@ class Info {
/**
* Get the branch of the language, if any
*
* @method getBranch
* @public
* @static
* @memberof Info
* @return {String} The language branch: semitic, etc.
*/
static getBranch() {
Expand All @@ -87,10 +86,8 @@ class Info {
/**
* Get the direction of writing of the language: ltr or rtl
*
* @method getDir
* @public
* @static
* @memberof Info
* @return {String} The language direction: left to right (ltr) or right to left (rtl)
*/
static getDir() {
Expand All @@ -106,10 +103,8 @@ class Info {
* </ul>
* For example, English is "svo"
*
* @method getWordOrder
* @public
* @static
* @memberof Info
* @return {String} The words order in the language
*/
static getWordOrder() {
Expand Down
21 changes: 10 additions & 11 deletions src/jslingua.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
/**
* Global module
* @module jslingua
*/

/**
* Global class which affords services for a specific language
* @hideconstructor
*/
class JsLingua {
static version = "0.12.2";
static version = "0.12.3";
static rtls = ["ara", "heb", "aze", "div", "kur", "per", "fas", "urd"];
static services = {};

Expand Down Expand Up @@ -28,7 +37,6 @@ class JsLingua {
/**
* Add a service for a specific language
*
* @method aserv
* @public
* @static
* @param {String} serviceID The services name: "Info", "Lang", etc.
Expand All @@ -48,7 +56,6 @@ class JsLingua {
/**
* Get the codes of available languages of a given service
*
* @method llang
* @public
* @static
* @param {String} serviceID The name of the service (the super-classe): "Info", "Lang", etc.
Expand All @@ -64,7 +71,6 @@ class JsLingua {
* Get the service class for a given language and service name.<br>
* For example: JsLingua.gserv("Info", "ara") Gives a class AraInfo
*
* @method gserv
* @public
* @static
* @param {String} serviceID The name of the service (the super-classe): "Info", "Lang", etc.
Expand All @@ -83,7 +89,6 @@ class JsLingua {
* Get an object of a service class for a given language and service name.<br>
* For example: JsLingua.nserv("Info", "ara") Gives an object of the class AraInfo
*
* @method nserv
* @public
* @static
* @param {String} serviceID The name of the service (the super-classe): "Info", "Lang", etc.
Expand All @@ -99,7 +104,6 @@ class JsLingua {
/**
* Returns the version of JsLingua
*
* @method gversion
* @public
* @static
* @return {String} JsLingua version
Expand All @@ -115,7 +119,6 @@ class JsLingua {
* version is to be afforded, so we don't import the js file for each
* language in each webpage.
*
* @method gdir
* @public
* @static
* @param {String} langCode The language ISO639-2 code: "ara", "jpn", "eng", etc.
Expand All @@ -138,7 +141,6 @@ class JsLingua {
* Get the service class for a given language and service name.<br>
* For example: JsLingua.getService("Info", "ara") Gives a class AraInfo
*
* @method getService
* @public
* @static
* @param {String} serviceID The name of the service (the super-classe): "Info", "Lang", etc.
Expand All @@ -152,7 +154,6 @@ class JsLingua {
/**
* Get the codes of available languages of a given service
*
* @method listLanguages
* @public
* @static
* @param {String} serviceID The name of the service (the super-classe): "Info", "Lang", etc.
Expand All @@ -169,7 +170,6 @@ class JsLingua {
* version is to be afforded, so we don't import the js file for each
* language in each webpage.
*
* @method getDir
* @public
* @static
* @param {String} langCode The language ISO639-2 code: "ara", "jpn", "eng", etc.
Expand All @@ -182,7 +182,6 @@ class JsLingua {
/**
* Returns the version of JsLingua
*
* @method getVersion
* @public
* @static
* @return {String} JsLingua version
Expand Down
Loading

0 comments on commit f0e0caf

Please sign in to comment.