Skip to content

Commit

Permalink
Name changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
eoussama committed Dec 9, 2018
1 parent 917b10a commit 08c71dd
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 33 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<p align="center">
<img src="docs/assets/img/logo.svg" width="130" />
<h1 align="center">translateJS</h1>
<h1 align="center">translatorjs</h1>
</p>

## What's this?

translateJS is a lightweight very simple-to-use Javascript library that facilitates the process of translating web pages. For more about how this works, read along.
translatorjs is a lightweight very simple-to-use Javascript library that facilitates the process of translating web pages. For more about how this works, read along.


## How does this work?

translateJS doesn't depend on any external APIs or resources to work, in fact, there is a crucial part of this magic that requires a little bit of work, but not the kind of work that made you look up a library for this need.
translatorjs doesn't depend on any external APIs or resources to work, in fact, there is a crucial part of this magic that requires a little bit of work, but not the kind of work that made you look up a library for this need.
You should create your own dictionary, containing the words and/or sentences you want to translate with their respective translations, and then target the whole web page or just a specific section.
Not everything gets translated, only the elements that have the class `trnsjs` toggeled.


## Syntax

Something that scares people away from using most of the other libraries is their unnecessary complexity, after all, we use libraries to avoid excessive pain. translateJS operates on one and only function that takes three parameters `translate(element, dictionary, language)`.
Something that scares people away from using most of the other libraries is their unnecessary complexity, after all, we use libraries to avoid excessive pain. translatorjs operates on one and only function that takes three parameters `translate(element, dictionary, language)`.

| element | dictionary | language |
|----------|:-------------:|------|
Expand All @@ -26,7 +26,7 @@ Something that scares people away from using most of the other libraries is thei

## Usage

In order to start using translateJS, you should first include it on your HTML file;
In order to start using translatorjs, you should first include it on your HTML file;
```html
<script src="translate.js"></script>
```
Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "translatejs",
"name": "translatorjs",
"description": "A simple javascript library for translating web content.",
"main": "",
"authors": [
Expand All @@ -12,7 +12,7 @@
"text-translation",
"node-package"
],
"homepage": "https://github.com/EOussama/translatejs",
"homepage": "https://github.com/EOussama/translatorjs",
"ignore": [
"**/.*",
"node_modules",
Expand Down
6 changes: 3 additions & 3 deletions docs/assets/css/main.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
*
* @name: translatejs
* @version: 2.0.0
* @name: translatorjs
* @version: 2.0.1
* @author: EOussama
* @license MIT
* @source: https://github.com/EOussama/translatejs
* @source: https://github.com/EOussama/translatorjs
*
* A simple javascript library for translating web content.
*
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/lib/translate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions docs/assets/js/main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
*
* @name: translatejs
* @version: 2.0.0
* @name: translatorjs
* @version: 2.0.1
* @author: EOussama
* @license MIT
* @source: https://github.com/EOussama/translatejs
* @source: https://github.com/EOussama/translatorjs
*
* A simple javascript library for translating web content.
*
Expand All @@ -28,8 +28,8 @@ window.addEventListener('load', () => {
};

// The translator.
const Translator = new Translate(dictionary);
const translator = new Translator(dictionary);

// Translating.
Translator.translate('br');
translator.translate('br');
});
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!--
@name: translatejs
@version: 2.0.0
@name: translatorjs
@version: 2.0.1
@author: EOussama
@license MIT
@source: https://github.com/EOussama/translatejs
@source: https://github.com/EOussama/translatorjs
A simple javascript library for translating web content.
Expand All @@ -21,7 +21,7 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="EOussama">
<meta name="application-name" content="translatejs">
<meta name="application-name" content="translatorjs">
<meta name="description" content="A simple javascript library for translating web content.">
<meta name="keywords" content="translate, javascript-library, translated-text, node-package">

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "translatejs",
"version": "2.0.0",
"name": "translatorjs",
"version": "2.0.1",
"description": "A simple javascript library for translating web content.",
"scripts": {
"build": "npx gulp"
Expand All @@ -10,14 +10,14 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/EOussama/translatejs.git"
"url": "git+https://github.com/EOussama/translatorjs.git"
},
"author": "EOussama",
"license": "MIT",
"bugs": {
"url": "https://github.com/EOussama/translatejs/issues"
"url": "https://github.com/EOussama/translatorjs/issues"
},
"homepage": "https://github.com/EOussama/translatejs#readme",
"homepage": "https://github.com/EOussama/translatorjs#readme",
"devDependencies": {
"@babel/core": "^7.2.0",
"@babel/preset-env": "^7.2.0",
Expand Down
12 changes: 6 additions & 6 deletions src/translate.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
*
* @name: translatejs
* @version: 2.0.0
* @name: translatorjs
* @version: 2.0.1
* @author: EOussama
* @license MIT
* @source: https://github.com/EOussama/translatejs
* @source: https://github.com/EOussama/translatorjs
*
* A simple javascript library for translating web content.
*
Expand All @@ -15,7 +15,7 @@
/**
* The translate JS class.
*/
class Translate {
class Translator {

/**
* The local language, by default `en` for `english`.
Expand Down Expand Up @@ -125,8 +125,8 @@
}

if (typeof exports !== 'undefined') {
module.exports = Translate;
module.exports = Translator;
} else {
obj.Translate = Translate;
obj.Translator = Translator;
}
})((typeof window !== 'undefined') ? window : this);

0 comments on commit 08c71dd

Please sign in to comment.