stringex 2.3.0 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/Gemfile +0 -1
- data/MIT-LICENSE +1 -1
- data/README.rdoc +3 -3
- data/VERSION +1 -1
- data/locales/sv.yml +76 -0
- data/stringex.gemspec +7 -7
- data/test/unit/localization/sv_test.rb +118 -0
- metadata +11 -23
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
YjNjMDc2N2QxODJhODJhZWVlNDBiMjkwODBhNWMwODlhNTEwODM4ODVlMWEy
|
10
|
-
MGI4OTU4NzhiY2EyYTM3OTE4Y2E5YzQwZTFmYzc5NGE1Nzk0YzYxYmFjOGIw
|
11
|
-
Y2NlODI0Njg2NzQ3NWUzZGNiYWQwN2EzOGI5ZDc3Y2UxODk3MzE=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NTUxYjg0NDExOTk5OTk4OGE0NmZmZmE4NDY0OTM1MDkzYjZlMWUwOTY1Njhl
|
14
|
-
ZGI1M2QxM2I0MDAwMzdlNzNhNjJiNjY4NGNiNGNmZTc2MGNhZGI5Y2E3NTIz
|
15
|
-
NTVjZGM3MzUwOTU1MmZkYWFlNTIwOWY1MDg5MmZkNDM2MTc0YzE=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e54d3401e251632a002f0ff76ad650deb9eaf879
|
4
|
+
data.tar.gz: 0a7904f83a54e305ec131a74a36eeb317aefc57a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fde55bde80b0767971b5f3b9e73fef5ef899302be7b9f4efe958c71be1126233f15c4f2780992658b85a4ad6ef8c10f26959cc4519c4deecfd77e1c27a0559f6
|
7
|
+
data.tar.gz: 249f0c17a418159b2fea8dd2c4f84460ea580244968a7cadc57098eb306aabd1db7e349a43a61475ea0752eb94776190b5c5812f4e7718cae4bc8703444cb0ea
|
data/Gemfile
CHANGED
data/MIT-LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -59,7 +59,7 @@ Unlike other permalink solutions, ActsAsUrl doesn't rely on Iconv (which is inco
|
|
59
59
|
"$12 worth of Ruby power".to_url => "12-dollars-worth-of-ruby-power"
|
60
60
|
"10% off if you act now".to_url => "10-percent-off-if-you-act-now"
|
61
61
|
|
62
|
-
# You
|
62
|
+
# You dont EVEN wanna rely on Iconv for this next part
|
63
63
|
"kick it en Français".to_url => "kick-it-en-francais"
|
64
64
|
"rock it Español style".to_url => "rock-it-espanol-style"
|
65
65
|
"tell your readers 你好".to_url => "tell-your-readers-ni-hao"
|
@@ -113,12 +113,12 @@ Currently, built-in translations are available for the following languages:
|
|
113
113
|
|
114
114
|
* English (en)
|
115
115
|
* Danish (da)
|
116
|
+
* Swedish (sv)
|
116
117
|
* Dutch (nl)
|
117
118
|
* German (de)
|
118
119
|
* Portuguese Brazilian (pt-BR)
|
119
120
|
* Russian (ru)
|
120
121
|
|
121
|
-
|
122
122
|
You can easily add your own or customize the built-in translations - read here[https://github.com/rsl/stringex/wiki/Localization-of-Stringex-conversions]. If you add a new language, please submit a pull request so we can make it available to other users also.
|
123
123
|
|
124
124
|
If you don't want to use the Stringex built-in translations, you can force Stringex to use English (or another language), regardless what is in your +I18n.locale+. In an initializer, e.g. +config/initializers/stringex.rb+:
|
@@ -137,4 +137,4 @@ If it's not obvious, some of the code for ActsAsUrl is based on Rick Olsen's per
|
|
137
137
|
|
138
138
|
GIANT thanks to the many contributors who have helped make Stringex better and better: http://github.com/rsl/stringex/contributors
|
139
139
|
|
140
|
-
copyright (c) 2008-
|
140
|
+
copyright (c) 2008-2014 Lucky Sneaks, released under the MIT license
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.4.1
|
data/locales/sv.yml
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# NOTE: Some translation keys make use of matches from regular expressions
|
2
|
+
# to manipulate whitespace and order. Please consult the source code for
|
3
|
+
# Stringex::Localization::ConversionExpressions to see what those
|
4
|
+
# regular expressions look like if you need to manipulate the order
|
5
|
+
# differently than the usage below.
|
6
|
+
sv:
|
7
|
+
stringex:
|
8
|
+
characters:
|
9
|
+
and: och
|
10
|
+
at: snabel-a
|
11
|
+
divide: delat med
|
12
|
+
degrees: grader
|
13
|
+
dot: \1 punkt \2
|
14
|
+
ellipsis: punkt punkt punkt
|
15
|
+
equals: lika med
|
16
|
+
number: nummer
|
17
|
+
percent: procent
|
18
|
+
plus: plus
|
19
|
+
slash: slash
|
20
|
+
star: stjärna
|
21
|
+
currencies:
|
22
|
+
generic: \1 kronor
|
23
|
+
dollars: \1 dollar
|
24
|
+
dollars_cents: \1 dollar \2 cent
|
25
|
+
pounds: \1 pund
|
26
|
+
pounds_pence: \1 pund \2 pence
|
27
|
+
euros: \1 euro
|
28
|
+
euros_cents: \1 euro \2 cent
|
29
|
+
yen: \1 yen
|
30
|
+
reais: \1 reais
|
31
|
+
reais_cents: \1 reais \2 cent
|
32
|
+
html_entities:
|
33
|
+
amp: och
|
34
|
+
cent: " cents"
|
35
|
+
copy: (c)
|
36
|
+
deg: " grader "
|
37
|
+
divide: " delat med "
|
38
|
+
double_quote: '"'
|
39
|
+
ellipsis: "..."
|
40
|
+
en_dash: "-"
|
41
|
+
em_dash: "--"
|
42
|
+
frac14: en fjärdedel
|
43
|
+
frac12: halv
|
44
|
+
frac34: tre fjärdedelar
|
45
|
+
gt: ">"
|
46
|
+
lt: <
|
47
|
+
nbsp: " "
|
48
|
+
pound: " pund "
|
49
|
+
reg: (r)
|
50
|
+
single_quote: "'"
|
51
|
+
times: x
|
52
|
+
trade: (tm)
|
53
|
+
yen: " yen "
|
54
|
+
vulgar_fractions:
|
55
|
+
half: halv
|
56
|
+
one_third: en tredjedel
|
57
|
+
two_thirds: två tredjedelar
|
58
|
+
one_fourth: en fjärdedel
|
59
|
+
three_fourths: tre fjärdedelar
|
60
|
+
one_fifth: en femtedel
|
61
|
+
two_fifths: två femtedelar
|
62
|
+
three_fifths: tre femtedelar
|
63
|
+
four_fifths: fyra femtedelar
|
64
|
+
one_sixth: en sjättedel
|
65
|
+
five_sixths: fem sjättedelar
|
66
|
+
one_eighth: en åttondel
|
67
|
+
three_eighths: tre åttondelar
|
68
|
+
five_eighths: fem åttondelar
|
69
|
+
seven_eighths: sju åttondelar
|
70
|
+
transliterations:
|
71
|
+
Å: A
|
72
|
+
Ä: AE
|
73
|
+
Ö: OE
|
74
|
+
å: a
|
75
|
+
ä: ae
|
76
|
+
ö: oe
|
data/stringex.gemspec
CHANGED
@@ -2,14 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: stringex 2.4.1 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "stringex"
|
8
|
-
s.version = "2.
|
9
|
+
s.version = "2.4.1"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["Russell Norris"]
|
12
|
-
s.date = "2014-03-
|
14
|
+
s.date = "2014-03-17"
|
13
15
|
s.description = "Some [hopefully] useful extensions to Ruby's String class. Stringex is made up of three libraries: ActsAsUrl [permalink solution with better character translation], Unidecoder [Unicode to ASCII transliteration], and StringExtensions [miscellaneous helper methods for the String class]."
|
14
16
|
s.email = "rsl@luckysneaks.com"
|
15
17
|
s.extra_rdoc_files = [
|
@@ -234,6 +236,7 @@ Gem::Specification.new do |s|
|
|
234
236
|
"locales/nl.yml",
|
235
237
|
"locales/pt-BR.yml",
|
236
238
|
"locales/ru.yml",
|
239
|
+
"locales/sv.yml",
|
237
240
|
"stringex.gemspec",
|
238
241
|
"test/performance/localization_performance_test.rb",
|
239
242
|
"test/test_helper.rb",
|
@@ -249,6 +252,7 @@ Gem::Specification.new do |s|
|
|
249
252
|
"test/unit/localization/nl_test.rb",
|
250
253
|
"test/unit/localization/pt_br_test.rb",
|
251
254
|
"test/unit/localization/ru_test.rb",
|
255
|
+
"test/unit/localization/sv_test.rb",
|
252
256
|
"test/unit/localization_18n_failure_test.rb",
|
253
257
|
"test/unit/localization_test.rb",
|
254
258
|
"test/unit/string_extensions_configuration_test.rb",
|
@@ -264,8 +268,7 @@ Gem::Specification.new do |s|
|
|
264
268
|
s.homepage = "http://github.com/rsl/stringex"
|
265
269
|
s.licenses = ["MIT"]
|
266
270
|
s.rdoc_options = ["--main", "README.rdoc", "--charset", "utf-8", "--line-numbers"]
|
267
|
-
s.
|
268
|
-
s.rubygems_version = "2.0.3"
|
271
|
+
s.rubygems_version = "2.2.1"
|
269
272
|
s.summary = "Some [hopefully] useful extensions to Ruby's String class"
|
270
273
|
|
271
274
|
if s.respond_to? :specification_version then
|
@@ -278,7 +281,6 @@ Gem::Specification.new do |s|
|
|
278
281
|
s.add_development_dependency(%q<sqlite3>, ["= 1.3.7"])
|
279
282
|
s.add_development_dependency(%q<activerecord>, ["= 4.0.3"])
|
280
283
|
s.add_development_dependency(%q<i18n>, ["= 0.6.9"])
|
281
|
-
s.add_development_dependency(%q<i18n>, ["= 0.6.9"])
|
282
284
|
else
|
283
285
|
s.add_dependency(%q<jeweler>, ["= 2.0.1"])
|
284
286
|
s.add_dependency(%q<travis-lint>, ["= 1.7.0"])
|
@@ -286,7 +288,6 @@ Gem::Specification.new do |s|
|
|
286
288
|
s.add_dependency(%q<sqlite3>, ["= 1.3.7"])
|
287
289
|
s.add_dependency(%q<activerecord>, ["= 4.0.3"])
|
288
290
|
s.add_dependency(%q<i18n>, ["= 0.6.9"])
|
289
|
-
s.add_dependency(%q<i18n>, ["= 0.6.9"])
|
290
291
|
end
|
291
292
|
else
|
292
293
|
s.add_dependency(%q<jeweler>, ["= 2.0.1"])
|
@@ -295,7 +296,6 @@ Gem::Specification.new do |s|
|
|
295
296
|
s.add_dependency(%q<sqlite3>, ["= 1.3.7"])
|
296
297
|
s.add_dependency(%q<activerecord>, ["= 4.0.3"])
|
297
298
|
s.add_dependency(%q<i18n>, ["= 0.6.9"])
|
298
|
-
s.add_dependency(%q<i18n>, ["= 0.6.9"])
|
299
299
|
end
|
300
300
|
end
|
301
301
|
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'test_helper'
|
4
|
+
require 'i18n'
|
5
|
+
require 'stringex'
|
6
|
+
|
7
|
+
class SwedishYAMLLocalizationTest < Test::Unit::TestCase
|
8
|
+
def setup
|
9
|
+
Stringex::Localization.reset!
|
10
|
+
Stringex::Localization.backend = :i18n
|
11
|
+
Stringex::Localization.backend.load_translations :sv
|
12
|
+
Stringex::Localization.locale = :sv
|
13
|
+
end
|
14
|
+
|
15
|
+
{
|
16
|
+
"foo & bar" => "foo och bar",
|
17
|
+
"AT&T" => "AT och T",
|
18
|
+
"99° is normal" => "99 grader is normal",
|
19
|
+
"4 ÷ 2 is 2" => "4 delat med 2 is 2",
|
20
|
+
"webcrawler.com" => "webcrawler punkt com",
|
21
|
+
"Well..." => "Well punkt punkt punkt",
|
22
|
+
"x=1" => "x lika med 1",
|
23
|
+
"a #2 pencil" => "a nummer 2 pencil",
|
24
|
+
"100%" => "100 procent",
|
25
|
+
"cost+tax" => "cost plus tax",
|
26
|
+
"batman/robin fan fiction" => "batman slash robin fan fiction",
|
27
|
+
"dial *69" => "dial stjärna 69",
|
28
|
+
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
|
29
|
+
}.each do |original, converted|
|
30
|
+
define_method "test_character_conversion: '#{original}'" do
|
31
|
+
assert_equal converted, original.convert_miscellaneous_characters
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
{
|
36
|
+
"¤20" => "20 kronor",
|
37
|
+
"$100" => "100 dollar",
|
38
|
+
"$19.99" => "19 dollar 99 cent",
|
39
|
+
"£100" => "100 pund",
|
40
|
+
"£19.99" => "19 pund 99 pence",
|
41
|
+
"€100" => "100 euro",
|
42
|
+
"€19.99" => "19 euro 99 cent",
|
43
|
+
"¥1000" => "1000 yen"
|
44
|
+
}.each do |original, converted|
|
45
|
+
define_method "test_currency_conversion: '#{original}'" do
|
46
|
+
assert_equal converted, original.convert_miscellaneous_characters
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
{
|
51
|
+
"Tea & Sympathy" => "Tea och Sympathy",
|
52
|
+
"10¢" => "10 cents",
|
53
|
+
"©2000" => "(c)2000",
|
54
|
+
"98° is fine" => "98 grader is fine",
|
55
|
+
"10÷5" => "10 delat med 5",
|
56
|
+
""quoted"" => '"quoted"',
|
57
|
+
"to be continued…" => "to be continued...",
|
58
|
+
"2000–2004" => "2000-2004",
|
59
|
+
"I wish—oh, never mind" => "I wish--oh, never mind",
|
60
|
+
"½ ounce of gold" => "halv ounce of gold",
|
61
|
+
"1 and ¼ ounces of silver" => "1 and en fjärdedel ounces of silver",
|
62
|
+
"9 and ¾ ounces of platinum" => "9 and tre fjärdedelar ounces of platinum",
|
63
|
+
"3>2" => "3>2",
|
64
|
+
"2<3" => "2<3",
|
65
|
+
"two words" => "two words",
|
66
|
+
"£100" => "pund 100",
|
67
|
+
"Walmart®" => "Walmart(r)",
|
68
|
+
"'single quoted'" => "'single quoted'",
|
69
|
+
"2×4" => "2x4",
|
70
|
+
"Programming™" => "Programming(tm)",
|
71
|
+
"¥20000" => "yen 20000",
|
72
|
+
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
|
73
|
+
}.each do |original, converted|
|
74
|
+
define_method "test_html_entity_conversion: '#{original}'" do
|
75
|
+
assert_equal converted, original.convert_miscellaneous_html_entities
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
{
|
80
|
+
"½" => "halv",
|
81
|
+
"½" => "halv",
|
82
|
+
"½" => "halv",
|
83
|
+
"⅓" => "en tredjedel",
|
84
|
+
"⅓" => "en tredjedel",
|
85
|
+
"⅔" => "två tredjedelar",
|
86
|
+
"⅔" => "två tredjedelar",
|
87
|
+
"¼" => "en fjärdedel",
|
88
|
+
"¼" => "en fjärdedel",
|
89
|
+
"¼" => "en fjärdedel",
|
90
|
+
"¾" => "tre fjärdedelar",
|
91
|
+
"¾" => "tre fjärdedelar",
|
92
|
+
"¾" => "tre fjärdedelar",
|
93
|
+
"⅕" => "en femtedel",
|
94
|
+
"⅕" => "en femtedel",
|
95
|
+
"⅖" => "två femtedelar",
|
96
|
+
"⅖" => "två femtedelar",
|
97
|
+
"⅗" => "tre femtedelar",
|
98
|
+
"⅗" => "tre femtedelar",
|
99
|
+
"⅘" => "fyra femtedelar",
|
100
|
+
"⅘" => "fyra femtedelar",
|
101
|
+
"⅙" => "en sjättedel",
|
102
|
+
"⅙" => "en sjättedel",
|
103
|
+
"⅚" => "fem sjättedelar",
|
104
|
+
"⅚" => "fem sjättedelar",
|
105
|
+
"⅛" => "en åttondel",
|
106
|
+
"⅛" => "en åttondel",
|
107
|
+
"⅜" => "tre åttondelar",
|
108
|
+
"⅜" => "tre åttondelar",
|
109
|
+
"⅝" => "fem åttondelar",
|
110
|
+
"⅝" => "fem åttondelar",
|
111
|
+
"⅞" => "sju åttondelar",
|
112
|
+
"⅞" => "sju åttondelar"
|
113
|
+
}.each do |original, converted|
|
114
|
+
define_method "test_vulgar_fractions_conversion: #{original}" do
|
115
|
+
assert_equal converted, original.convert_vulgar_fractions
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stringex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Norris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jeweler
|
@@ -94,21 +94,7 @@ dependencies:
|
|
94
94
|
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 0.6.9
|
97
|
-
|
98
|
-
name: i18n
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - '='
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 0.6.9
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - '='
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 0.6.9
|
111
|
-
description: ! 'Some [hopefully] useful extensions to Ruby''s String class. Stringex
|
97
|
+
description: 'Some [hopefully] useful extensions to Ruby''s String class. Stringex
|
112
98
|
is made up of three libraries: ActsAsUrl [permalink solution with better character
|
113
99
|
translation], Unidecoder [Unicode to ASCII transliteration], and StringExtensions
|
114
100
|
[miscellaneous helper methods for the String class].'
|
@@ -336,6 +322,7 @@ files:
|
|
336
322
|
- locales/nl.yml
|
337
323
|
- locales/pt-BR.yml
|
338
324
|
- locales/ru.yml
|
325
|
+
- locales/sv.yml
|
339
326
|
- stringex.gemspec
|
340
327
|
- test/performance/localization_performance_test.rb
|
341
328
|
- test/test_helper.rb
|
@@ -351,6 +338,7 @@ files:
|
|
351
338
|
- test/unit/localization/nl_test.rb
|
352
339
|
- test/unit/localization/pt_br_test.rb
|
353
340
|
- test/unit/localization/ru_test.rb
|
341
|
+
- test/unit/localization/sv_test.rb
|
354
342
|
- test/unit/localization_18n_failure_test.rb
|
355
343
|
- test/unit/localization_test.rb
|
356
344
|
- test/unit/string_extensions_configuration_test.rb
|
@@ -368,26 +356,26 @@ licenses:
|
|
368
356
|
metadata: {}
|
369
357
|
post_install_message:
|
370
358
|
rdoc_options:
|
371
|
-
- --main
|
359
|
+
- "--main"
|
372
360
|
- README.rdoc
|
373
|
-
- --charset
|
361
|
+
- "--charset"
|
374
362
|
- utf-8
|
375
|
-
- --line-numbers
|
363
|
+
- "--line-numbers"
|
376
364
|
require_paths:
|
377
365
|
- lib
|
378
366
|
required_ruby_version: !ruby/object:Gem::Requirement
|
379
367
|
requirements:
|
380
|
-
- -
|
368
|
+
- - ">="
|
381
369
|
- !ruby/object:Gem::Version
|
382
370
|
version: '0'
|
383
371
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
384
372
|
requirements:
|
385
|
-
- -
|
373
|
+
- - ">="
|
386
374
|
- !ruby/object:Gem::Version
|
387
375
|
version: '0'
|
388
376
|
requirements: []
|
389
377
|
rubyforge_project:
|
390
|
-
rubygems_version: 2.
|
378
|
+
rubygems_version: 2.2.1
|
391
379
|
signing_key:
|
392
380
|
specification_version: 4
|
393
381
|
summary: Some [hopefully] useful extensions to Ruby's String class
|