Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API | online translate Persian to Fingish via github.io pages #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 2 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,5 @@
# F2F
Farsi to Finglish, a Persian transliterator

A javascript port of [aminmarashi/onezero-f2f](https://github.com/aminmarashi/onezero-f2f) by [Amin Marashi](https://github.com/aminmarashi)

[![Build Status](https://img.shields.io/travis/brothersincode/f2f/master.svg?style=flat-square)](https://travis-ci.org/brothersincode/f2f)
[![Dependency Status](https://img.shields.io/david/brothersincode/f2f.svg?style=flat-square)](https://david-dm.org/brothersincode/f2f)
[![NPM version](https://img.shields.io/npm/v/f2f.svg?style=flat-square)](https://www.npmjs.com/package/f2f)
[![GitHub issues](https://img.shields.io/github/issues/brothersincode/f2f.svg?style=flat-square)](https://github.com/brothersincode/f2f/issues)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/brothersincode/f2f/master/LICENSE)
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)

## Install
``` bash
npm install f2f
```

## Usage
```js
var f2f = require('f2f');
var F2F = new f2f();

F2F.simplef2f('ثقلین'); // Outputs: "saghlin"
F2F.simplef2f('قسطنطنیه'); // Outputs: "ghastntnih"
```

### Browser
```html
<script src="lib/f2f.js"></script>
<script>
var F2F = new f2f();
alert(F2F.simplef2f("قسطنطنیه"));
</script>
```

#### F2F.simplef2f([text])

##### text
Type: `string`

String in Persian to be converted.

## License

This software is licensed under the MIT License. [View the license](LICENSE).
# API
## https://peymanmajidi.github.io/finglish_js/?word=سلام
25 changes: 25 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Finglish API</title>
<script src="lib/f2f.js"></script>
</head>
<body>

<script>
console.log("How to use");
console.log("Add this paramerter at the end of url: ?word=سلام");
console.log("Like this: https://peymanmajidi.github.io/finglish_js/?word=سلام");
var url_string = window.location.href;
var url = new URL(url_string);
var word = url.searchParams.get("word");
var finglish = new f2f();
var result = finglish.simplef2f(word);
document.body.innerHTML = ""
document.write(result);
</script>
</body>
</html>