@@ -21,8 +21,8 @@ def to_s
21
21
next if segments . empty?
22
22
current = self . class . sentence ( segments )
23
23
end
24
- f = I18n . t ( 'ice_cube.string.format' ) [ type ] ? type : 'default'
25
- string = I18n . t ( "ice_cube.string.format.#{ f } " , rest : string , current : current )
24
+ f = IceCube :: I18n . t ( 'ice_cube.string.format' ) [ type ] ? type : 'default'
25
+ string = IceCube :: I18n . t ( "ice_cube.string.format.#{ f } " , rest : string , current : current )
26
26
end
27
27
string
28
28
end
@@ -43,8 +43,8 @@ def sentence(array)
43
43
case array . length
44
44
when 0 ; ''
45
45
when 1 ; array [ 0 ] . to_s
46
- when 2 ; "#{ array [ 0 ] } #{ I18n . t ( 'ice_cube.array.two_words_connector' ) } #{ array [ 1 ] } "
47
- else ; "#{ array [ 0 ...-1 ] . join ( I18n . t ( 'ice_cube.array.words_connector' ) ) } #{ I18n . t ( 'ice_cube.array.last_word_connector' ) } #{ array [ -1 ] } "
46
+ when 2 ; "#{ array [ 0 ] } #{ IceCube :: I18n . t ( 'ice_cube.array.two_words_connector' ) } #{ array [ 1 ] } "
47
+ else ; "#{ array [ 0 ...-1 ] . join ( IceCube :: I18n . t ( 'ice_cube.array.words_connector' ) ) } #{ IceCube :: I18n . t ( 'ice_cube.array.last_word_connector' ) } #{ array [ -1 ] } "
48
48
end
49
49
end
50
50
@@ -53,18 +53,18 @@ def nice_number(number)
53
53
end
54
54
55
55
def ordinalize ( number )
56
- I18n . t ( 'ice_cube.integer.ordinal' , number : number , ordinal : ordinal ( number ) )
56
+ IceCube :: I18n . t ( 'ice_cube.integer.ordinal' , number : number , ordinal : ordinal ( number ) )
57
57
end
58
58
59
59
def literal_ordinal ( number )
60
- I18n . t ( "ice_cube.integer.literal_ordinals" ) [ number ]
60
+ IceCube :: I18n . t ( "ice_cube.integer.literal_ordinals" ) [ number ]
61
61
end
62
62
63
63
def ordinal ( number )
64
- ord = I18n . t ( "ice_cube.integer.ordinals" ) [ number ] ||
65
- I18n . t ( "ice_cube.integer.ordinals" ) [ number % 10 ] ||
66
- I18n . t ( 'ice_cube.integer.ordinals' ) [ :default ]
67
- number >= 0 ? ord : I18n . t ( "ice_cube.integer.negative" , ordinal : ord )
64
+ ord = IceCube :: I18n . t ( "ice_cube.integer.ordinals" ) [ number ] ||
65
+ IceCube :: I18n . t ( "ice_cube.integer.ordinals" ) [ number % 10 ] ||
66
+ IceCube :: I18n . t ( 'ice_cube.integer.ordinals' ) [ :default ]
67
+ number >= 0 ? ord : IceCube :: I18n . t ( "ice_cube.integer.negative" , ordinal : ord )
68
68
end
69
69
70
70
end
0 commit comments