speakingurl-rails 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -12
- data/lib/speakingurl.js +158 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb9a2cc9261e0948c950ff3dd3b3cbcee2778464
|
4
|
+
data.tar.gz: f95640dd24e937a195560f3903d6e9bb1af18254
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c93312aa48eee0f08b4b8d176b3fdf957346bf5f1d6453871029e29b29c1739e9dad10ef1b7b9d1356987816b20816b88fd2fa162abd22985c12db0225471b0
|
7
|
+
data.tar.gz: 51031095e684c6fca413b56076e6e081c952b2fca72261cd824e127c5dc19bd1199853424f84f0d234dfeaf13f667d3d03c446f81b6c29415da423a456660144
|
data/README.md
CHANGED
@@ -11,15 +11,6 @@ SpeakingURL
|
|
11
11
|
|
12
12
|
For use in browser and server - no dependencies!
|
13
13
|
|
14
|
-
###### Notes
|
15
|
-
|
16
|
-
Never use the slug to reference to the unique page in the database – if the title will change, you want to change the slug – you run into problems.
|
17
|
-
|
18
|
-
1. Use a unique reference to the record – e.g. a unique key "12345" =\> /my-little-title-12345.html
|
19
|
-
2. Store all historical slugs in the page record; but you have to re-calculate the slug from all pages – every time you update speakingurl
|
20
|
-
|
21
|
-
Redirect with 301 to the last/current slug.
|
22
|
-
|
23
14
|
##### NPM Badge
|
24
15
|
|
25
16
|
[![Module Status](https://nodei.co/npm/speakingurl.png?downloads=true&stars=true)](https://npmjs.org/package/speakingurl)
|
@@ -64,11 +55,11 @@ copy the file speakingurl.min.js to your script directory
|
|
64
55
|
|
65
56
|
#### [CDN/cloudflare](https://www.cloudflare.com/)
|
66
57
|
|
67
|
-
available versions: http://cdnjs.com/libraries/speakingurl/ use [//cdnjs.cloudflare.com/ajax/libs/speakingurl/
|
58
|
+
available versions: http://cdnjs.com/libraries/speakingurl/ use [//cdnjs.cloudflare.com/ajax/libs/speakingurl/3.0.0/speakingurl.min.js](https://cdnjs.cloudflare.com/ajax/libs/speakingurl/3.0.0/speakingurl.min.js)
|
68
59
|
|
69
60
|
#### [CDN/maxcdn](https://www.maxcdn.com/)
|
70
61
|
|
71
|
-
available versions: http://www.jsdelivr.com/#!speakingurl use [//cdn.jsdelivr.net/speakingurl/
|
62
|
+
available versions: http://www.jsdelivr.com/#!speakingurl use [//cdn.jsdelivr.net/speakingurl/3.0.0/speakingurl.min.js](https://cdn.jsdelivr.net/speakingurl/3.0.0/speakingurl.min.js)
|
72
63
|
|
73
64
|
Usage
|
74
65
|
-----
|
@@ -85,7 +76,7 @@ Usage
|
|
85
76
|
- char that replace the whitespaces
|
86
77
|
- `lang` {string} default: 'en'
|
87
78
|
- false -> don't convert symbols
|
88
|
-
- language
|
79
|
+
- language specific transliteration ('ar', 'az', 'cz', 'de', 'en', 'es', 'fr', 'hu', 'it', 'lt', 'lv', 'my, 'nl', 'pl', pt', 'ru', 'sk', 'tr' and 'vn'; more coming soon, please help!)
|
89
80
|
- false -\> don't convert symbols
|
90
81
|
- `maintainCase` {boolean} default: false
|
91
82
|
- true -\> maintain case chars
|
data/lib/speakingurl.js
CHANGED
@@ -394,10 +394,10 @@
|
|
394
394
|
'İ': 'I',
|
395
395
|
// 'ç': 'c', // duplicate
|
396
396
|
// 'Ç': 'C', // duplicate
|
397
|
-
// 'ü': '
|
398
|
-
// 'Ü': '
|
399
|
-
// 'ö': '
|
400
|
-
// 'Ö': '
|
397
|
+
// 'ü': 'u', // duplicate, see langCharMap
|
398
|
+
// 'Ü': 'U', // duplicate, see langCharMap
|
399
|
+
// 'ö': 'o', // duplicate, see langCharMap
|
400
|
+
// 'Ö': 'O', // duplicate, see langCharMap
|
401
401
|
'ğ': 'g',
|
402
402
|
'Ğ': 'G',
|
403
403
|
|
@@ -517,6 +517,20 @@
|
|
517
517
|
'Ĺ': 'L',
|
518
518
|
'Ŕ': 'R',
|
519
519
|
|
520
|
+
// serbian
|
521
|
+
'ђ': 'dj',
|
522
|
+
'ј': 'j',
|
523
|
+
// 'љ': 'lj', // duplicate
|
524
|
+
// 'њ': 'nj', // duplicate
|
525
|
+
'ћ': 'c',
|
526
|
+
'џ': 'dz',
|
527
|
+
'Ђ': 'Dj',
|
528
|
+
'Ј': 'j',
|
529
|
+
// 'Љ': 'Lj', // duplicate
|
530
|
+
// 'Њ': 'Nj', // duplicate
|
531
|
+
'Ћ': 'C',
|
532
|
+
'Џ': 'Dz',
|
533
|
+
|
520
534
|
// polish
|
521
535
|
'ą': 'a',
|
522
536
|
'ć': 'c',
|
@@ -844,6 +858,7 @@
|
|
844
858
|
'္': '',
|
845
859
|
'့': '',
|
846
860
|
'း': ''
|
861
|
+
|
847
862
|
};
|
848
863
|
|
849
864
|
/**
|
@@ -922,6 +937,7 @@
|
|
922
937
|
*/
|
923
938
|
var langCharMap = {
|
924
939
|
'en': {}, // default language
|
940
|
+
|
925
941
|
'hu': {
|
926
942
|
'ä': 'a', // ok
|
927
943
|
'Ä': 'A', // ok
|
@@ -936,11 +952,136 @@
|
|
936
952
|
'ű': 'u',
|
937
953
|
'Ű': 'U'
|
938
954
|
},
|
955
|
+
|
956
|
+
'cs': { // Czech
|
957
|
+
'č': 'c',
|
958
|
+
'ď': 'd',
|
959
|
+
'ě': 'e',
|
960
|
+
'ň': 'n',
|
961
|
+
'ř': 'r',
|
962
|
+
'š': 's',
|
963
|
+
'ť': 't',
|
964
|
+
'ů': 'u',
|
965
|
+
'ž': 'z',
|
966
|
+
'Č': 'C',
|
967
|
+
'Ď': 'D',
|
968
|
+
'Ě': 'E',
|
969
|
+
'Ň': 'N',
|
970
|
+
'Ř': 'R',
|
971
|
+
'Š': 'S',
|
972
|
+
'Ť': 'T',
|
973
|
+
'Ů': 'U',
|
974
|
+
'Ž': 'Z'
|
975
|
+
},
|
976
|
+
|
977
|
+
'pl': { // Polish
|
978
|
+
'ą': 'a',
|
979
|
+
'ć': 'c',
|
980
|
+
'ę': 'e',
|
981
|
+
'ł': 'l',
|
982
|
+
'ń': 'n',
|
983
|
+
'ó': 'o',
|
984
|
+
'ś': 's',
|
985
|
+
'ź': 'z',
|
986
|
+
'ż': 'z',
|
987
|
+
'Ą': 'A',
|
988
|
+
'Ć': 'C',
|
989
|
+
'Ę': 'e',
|
990
|
+
'Ł': 'L',
|
991
|
+
'Ń': 'N',
|
992
|
+
'Ó': 'O',
|
993
|
+
'Ś': 'S',
|
994
|
+
'Ź': 'Z',
|
995
|
+
'Ż': 'Z'
|
996
|
+
},
|
997
|
+
|
998
|
+
'ro': { // Romanian
|
999
|
+
'ă': 'a',
|
1000
|
+
'â': 'a',
|
1001
|
+
'î': 'i',
|
1002
|
+
'ș': 's',
|
1003
|
+
'ț': 't',
|
1004
|
+
'Ţ': 'T',
|
1005
|
+
'ţ': 't'
|
1006
|
+
},
|
1007
|
+
|
939
1008
|
'sk': {
|
940
1009
|
'ä': 'a',
|
941
1010
|
'Ä': 'A'
|
942
1011
|
},
|
943
|
-
|
1012
|
+
|
1013
|
+
'lv': { // Latvian
|
1014
|
+
'ā': 'a',
|
1015
|
+
'č': 'c',
|
1016
|
+
'ē': 'e',
|
1017
|
+
'ģ': 'g',
|
1018
|
+
'ī': 'i',
|
1019
|
+
'ķ': 'k',
|
1020
|
+
'ļ': 'l',
|
1021
|
+
'ņ': 'n',
|
1022
|
+
'š': 's',
|
1023
|
+
'ū': 'u',
|
1024
|
+
'ž': 'z',
|
1025
|
+
'Ā': 'A',
|
1026
|
+
'Č': 'C',
|
1027
|
+
'Ē': 'E',
|
1028
|
+
'Ģ': 'G',
|
1029
|
+
'Ī': 'i',
|
1030
|
+
'Ķ': 'k',
|
1031
|
+
'Ļ': 'L',
|
1032
|
+
'Ņ': 'N',
|
1033
|
+
'Š': 'S',
|
1034
|
+
'Ū': 'u',
|
1035
|
+
'Ž': 'Z'
|
1036
|
+
},
|
1037
|
+
|
1038
|
+
'lt': { // Lithuanian
|
1039
|
+
'ą': 'a',
|
1040
|
+
'č': 'c',
|
1041
|
+
'ę': 'e',
|
1042
|
+
'ė': 'e',
|
1043
|
+
'į': 'i',
|
1044
|
+
'š': 's',
|
1045
|
+
'ų': 'u',
|
1046
|
+
'ū': 'u',
|
1047
|
+
'ž': 'z',
|
1048
|
+
'Ą': 'A',
|
1049
|
+
'Č': 'C',
|
1050
|
+
'Ę': 'E',
|
1051
|
+
'Ė': 'E',
|
1052
|
+
'Į': 'I',
|
1053
|
+
'Š': 'S',
|
1054
|
+
'Ų': 'U',
|
1055
|
+
'Ū': 'U'
|
1056
|
+
},
|
1057
|
+
|
1058
|
+
'sr': { // Serbian
|
1059
|
+
'љ': 'lj',
|
1060
|
+
'њ': 'nj',
|
1061
|
+
'Љ': 'Lj',
|
1062
|
+
'Њ': 'Nj',
|
1063
|
+
'đ': 'dj',
|
1064
|
+
'Đ': 'Dj'
|
1065
|
+
},
|
1066
|
+
|
1067
|
+
'az': { // Azerbaijani
|
1068
|
+
'ç': 'c',
|
1069
|
+
'ə': 'e',
|
1070
|
+
'ğ': 'g',
|
1071
|
+
'ı': 'i',
|
1072
|
+
'ö': 'o',
|
1073
|
+
'ş': 's',
|
1074
|
+
'ü': 'u',
|
1075
|
+
'Ç': 'C',
|
1076
|
+
'Ə': 'E',
|
1077
|
+
'Ğ': 'G',
|
1078
|
+
'İ': 'I',
|
1079
|
+
'Ö': 'O',
|
1080
|
+
'Ş': 'S',
|
1081
|
+
'Ü': 'U'
|
1082
|
+
},
|
1083
|
+
|
1084
|
+
'tr': { // Turkish
|
944
1085
|
'Ü': 'U',
|
945
1086
|
'Ö': 'O',
|
946
1087
|
'ü': 'u',
|
@@ -1075,6 +1216,18 @@
|
|
1075
1216
|
'¤': 'moneta'
|
1076
1217
|
},
|
1077
1218
|
|
1219
|
+
'pl': {
|
1220
|
+
'∆': 'delta',
|
1221
|
+
'∞': 'nieskonczonosc',
|
1222
|
+
'♥': 'milosc',
|
1223
|
+
'&': 'i',
|
1224
|
+
'|': 'lub',
|
1225
|
+
'<': 'mniejsze niz',
|
1226
|
+
'>': 'wieksze niz',
|
1227
|
+
'∑': 'suma',
|
1228
|
+
'¤': 'waluta'
|
1229
|
+
},
|
1230
|
+
|
1078
1231
|
'pt': {
|
1079
1232
|
'∆': 'delta',
|
1080
1233
|
'∞': 'infinito',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: speakingurl-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sascha Droste
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|