tolk 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,7 +33,7 @@
|
|
33
33
|
<% if params[:q].present? -%>
|
34
34
|
<%= highlight(format_i18n_value(phrase.translations.primary.text), params[:q]) -%>
|
35
35
|
<% else -%>
|
36
|
-
<%= format_i18n_value(phrase.translations.primary.text)
|
36
|
+
<%= format_i18n_value(phrase.translations.primary.text) -%>
|
37
37
|
<% end -%>
|
38
38
|
<span class="key" title="<%= phrase.key %>"><%= truncate(phrase.key, :length => 100) %></span>
|
39
39
|
</td>
|
data/lib/tolk/import.rb
CHANGED
@@ -22,6 +22,7 @@ module Tolk
|
|
22
22
|
def import_locale(locale_name)
|
23
23
|
locale = Tolk::Locale.find_or_create_by_name(locale_name)
|
24
24
|
data = locale.read_locale_file
|
25
|
+
return unless data
|
25
26
|
|
26
27
|
phrases = Tolk::Phrase.all
|
27
28
|
count = 0
|
@@ -46,7 +47,14 @@ module Tolk
|
|
46
47
|
locale_file = "#{self.locales_config_path}/#{self.name}.yml"
|
47
48
|
raise "Locale file #{locale_file} does not exists" unless File.exists?(locale_file)
|
48
49
|
|
49
|
-
|
50
|
+
puts "[INFO] Reading #{locale_file} for locale #{self.name}"
|
51
|
+
begin
|
52
|
+
self.class.flat_hash(YAML::load(IO.read(locale_file))[self.name])
|
53
|
+
rescue
|
54
|
+
puts "[ERROR] File #{locale_file} expected to declare #{self.name} locale, but it does not. Skipping this file."
|
55
|
+
nil
|
56
|
+
end
|
57
|
+
|
50
58
|
end
|
51
59
|
|
52
60
|
end
|
data/lib/tolk/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tolk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-
|
15
|
+
date: 2012-07-23 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: will_paginate
|
@@ -91,10 +91,7 @@ files:
|
|
91
91
|
- app/views/tolk/searches/show.html.erb
|
92
92
|
homepage: http://github.com/tolk/tolk
|
93
93
|
licenses: []
|
94
|
-
post_install_message:
|
95
|
-
from pre-1.3.\n##################################\n - A configuration file is now
|
96
|
-
available, run tolk:setup.\n - Mapping has been updated, use update_locale rake
|
97
|
-
task if necessary."
|
94
|
+
post_install_message:
|
98
95
|
rdoc_options: []
|
99
96
|
require_paths:
|
100
97
|
- lib
|