Skip to content

Commit

Permalink
Added basic functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
eoussama committed Dec 9, 2018
1 parent 3277659 commit 5116881
Show file tree
Hide file tree
Showing 7 changed files with 1,573 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/assets/js/lib/translate.min.js

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

28 changes: 23 additions & 5 deletions docs/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,26 @@
*
*/

'use strict';

window.addEventListener('load', () => {
console.log('Hello, world!');
});
'use strict';

window.addEventListener('load', () => {

// The dictionary.
const dictionary = {
"About": {
'fr': 'A propos',
'es': 'nos'
},
"Hello": {
'fr': 'Bonjour',
'es': 'Hola',
'br': 'Jola'
}
};

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

// Translating.
Translator.translate('br');
});
9 changes: 8 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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="temmejs">
<meta name="application-name" content="translatejs">
<meta name="description" content="A simple javascript library for translating web content.">
<meta name="keywords" content="translate, javascript-library, translated-text, node-package">

Expand All @@ -39,8 +39,15 @@

<main class="container">
<h1>Translate JS</h1>
<hr>

<p class="trnsjs">Hello</p>
<p class="trnsjs">About</p>
</main>

<!-- Translate JS. -->
<script src="assets/js/lib/translate.min.js"></script>

<!-- The main script. -->
<script src="assets/js/main.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const

// Building the code for production.
gulp.task('build', () => {
gulp.src('src/translatejs.js')
gulp.src('src/translate.js')

// Translating code.
.pipe(babel({
Expand Down
Loading

0 comments on commit 5116881

Please sign in to comment.