Skip to content

Commit e841b99

Browse files
authored
Merge pull request #133 from on2-dev/readme_sp
Improve README content + spelling
2 parents c1feec9 + 12fdb13 commit e841b99

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

README.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
# Share API Polyfill
22

3-
This is a (6kb) polyfill for the `Web Share API` that can be used in desktop too, so your users can share in their twitter, facebook, messenger, linkedin, sms, e-mail, print, telegram or whatsapp.
3+
This is a (6kb) polyfill for the `Web Share API` that can be used on desktop, too, so your users can share in their Twitter, Facebook, Messenger, LinkedIn, SMS, email, print, Telegram or WhatsApp.
44

5-
It also supports multilanguage ([see the list of languages](#multi-language) and you can help us with that :) ).
5+
It also supports multi-language ([see the list of languages](#multi-language) - and you can help us with that :) ).
66

7-
This is a very simple, single file import polyfill.
7+
This is a single file import polyfill which relies on the `navigator.share()` method of the [Web Share API](https://www.w3.org/TR/web-share/).
88

99
![JavaScript Share API Polyfill in a Browser](https://github.com/on2-dev/share-api-polyfill/blob/master/demo/demo.gif?raw=true)
10-
[see the share api polyfill in action](https://on2-dev.github.io/share-api-polyfill/demo/)
10+
[see the Share API Polyfill in action](https://on2-dev.github.io/share-api-polyfill/demo/)
1111

1212
## Installing it:
1313

14-
Just import it like so:
14+
Import it like so:
1515

1616
```html
1717
<script src="https://unpkg.com/share-api-polyfill/dist/share-min.js"></script>
1818
```
1919

20-
> Note that we are using the unpkg cdn to load it, you could also save it in your own structure so you can cache it with service workers and have it "close" to your own domain.
20+
> Note that we are using the unpkg CDN to load it. You could also save it in your own structure so you can cache it with service workers and have it "close" to your own domain.
2121
2222
You can also install it using npm:
2323

@@ -27,13 +27,13 @@ npm install share-api-polyfill --save
2727
yarn add share-api-polyfill
2828
```
2929

30-
Now, it will use the native share panel if it is available (only available on mobile devices) and, if not, it will enable an HTML structure in your page showing options for your users.
30+
Now, it will use the native share panel if it is available (only available on mobile devices), and if not, it will enable an HTML structure on your page showing options for your users.
3131

3232
Here, check this demo and see the [share api polyfill in action](https://on2-dev.github.io/share-api-polyfill/demo/).
3333

3434
## The Share API
3535

36-
The oficial share api works like this:
36+
The official Share Api works like this:
3737

3838
```js
3939
navigator.share({
@@ -46,7 +46,7 @@ navigator.share({
4646
```
4747

4848
But in this case, you can also pass your `Facebook App Id` to enable sharing with **messenger**.
49-
Also, you can pass in a list of hashtags to be used when sharing with twitter or facebook. Only one hashtag can be shared with facebook so the first one in the list will be shared.
49+
Also, you can pass in a list of hashtags to be used when sharing on Twitter or Facebook. Only one hashtag can be shared on Facebook, so the first one on the list will be shared.
5050

5151
```js
5252
navigator.share({
@@ -62,22 +62,24 @@ navigator.share({
6262
.catch( error => console.log('Oh noh! You couldn\'t share it! :\'(\n', error));
6363
```
6464

65-
> You can pass the hashtags as a single (comma separated) string, or as an array.
65+
> You can pass the hashtags as a single (comma-separated) string or as an array.
6666
67-
### Multi language
67+
### Multi-language
6868

69-
It will try and use the supported languages based on user's `browser language` configuration.
70-
If the language is not found, it will uses a fallback (default english).
69+
It will try and use the supported languages based on the user's `browser language` configuration.
70+
If the language is not found, it will use a fallback (default English).
7171

7272
Currently supported languages:
7373

74+
- bn
7475
- cs
7576
- de
7677
- it
7778
- da
7879
- en
7980
- es
8081
- fr
82+
- hi
8183
- hu
8284
- is
8385
- ja
@@ -92,11 +94,11 @@ Currently supported languages:
9294
- tr
9395
- zh
9496

95-
> Feel free to contribute with more languages sending Pull Requests for them :)
97+
> Feel free to contribute with more languages by sending Pull Requests for them :)
9698
97-
### Turning features off, in Desktop
99+
### Turning features off - on Desktop
98100

99-
You can disable some of the social buttons from the tool by passing a second object as argument.
101+
You can disable some of the social buttons from the tool by passing a second object as the argument.
100102
As your mobile device will probably have native support for the share API, it will be ignored, being applied only for desktops.
101103

102104
Example:
@@ -111,7 +113,7 @@ navigator.share({
111113
hashtags: 'javascript,shareAPI,polyfill'
112114
},
113115
{
114-
// change this configurations to hide specific unnecessary icons
116+
// change these configurations to hide specific unnecessary icons
115117
copy: true,
116118
email: true,
117119
print: true,
@@ -131,34 +133,34 @@ navigator.share({
131133
.catch( error => console.log('Oh noh! You couldn\'t share it! :\'(\n', error));
132134
```
133135

134-
> If you disable Skype, it will no longer load Skype's SDK, what might be something you want, in case you would like to improve the privacy in your project, avoiding loading **third party libraries**.
136+
> If you disable Skype, it will no longer load Skype's SDK, which might be something you want, in case you would like to improve the privacy in your project, avoiding loading **third-party libraries**.
135137
136138
## It's open source
137139

138-
Yup, it's open source and you can contribute to it :)
140+
Yup, it's open source, and you can contribute to it! :)
139141

140142
Please refer to our [CONTRIBUTING.md](https://github.com/on2-dev/share-api-polyfill/blob/master/CONTRIBUTING.md) and help us improve this tool.
141143

142-
To re-build id, just install the dependencies:
144+
To build it locally, install the dependencies:
143145

144146
```sh
145147
npm install
146148
```
147149

148-
And build it with gulp
150+
Build it with gulp:
149151

150152
```sh
151153
npm run build
152154
```
153155

154-
And try it locally
156+
And try it locally:
155157

156158
```sh
157159
npm run demo
158160
```
159161

160162
Also, if you need to change the icons, they are SVGs located on the share.js script.
161-
You will find the oridinal vector (.svg) in the src/icons directory in case you want to change it and copy the svg code.
163+
You will find the original vector (.svg) in the src/icons directory in case you want to change it and copy the SVG code.
162164

163165
## Donate ❤️
164166

0 commit comments

Comments
 (0)