air18n 0.1.14 → 0.1.15
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.
- data/lib/air18n/phrase_translation.rb +5 -3
- data/lib/air18n/version.rb +1 -1
- metadata +2 -2
|
@@ -132,7 +132,7 @@ module Air18n
|
|
|
132
132
|
def self.translator_activity_data_new user_id=0, opts={}
|
|
133
133
|
user_criterion = user_id > 0 ? "AND pt.user_id=#{user_id}" : "AND NOT pt.user_id=0"
|
|
134
134
|
since_criterion = "AND pt.created_at >= '#{opts[:since].to_formatted_s(:db)}}'" if opts[:since]
|
|
135
|
-
sql = "SELECT year(pt.created_at) year, month(pt.created_at) month, pt.user_id user_id, pt.locale locale, day(pt.created_at) day, p.id phrase_id, pt.source_word_count source_word_count, pt.source_hash source_hash, pt.is_verification FROM phrase_translations pt, phrases p WHERE pt.phrase_id=p.id #{user_criterion} #{since_criterion} GROUP BY year(pt.created_at), month(pt.created_at), pt.user_id, pt.locale, pt.phrase_id, pt.source_hash, pt.is_verification"
|
|
135
|
+
sql = "SELECT year(pt.created_at) year, month(pt.created_at) month, pt.user_id user_id, pt.locale locale, day(pt.created_at) day, p.id phrase_id, pt.source_word_count source_word_count, pt.key, pt.source_hash source_hash, pt.is_verification FROM phrase_translations pt, phrases p WHERE pt.phrase_id=p.id #{user_criterion} #{since_criterion} GROUP BY year(pt.created_at), month(pt.created_at), pt.user_id, pt.locale, pt.phrase_id, pt.source_hash, pt.is_verification"
|
|
136
136
|
res = self.connection.select_rows(sql)
|
|
137
137
|
phrases_per_user_locale_month_year =
|
|
138
138
|
Hash.new {|h, year| h[year] =
|
|
@@ -145,9 +145,9 @@ module Air18n
|
|
|
145
145
|
} } } } } }
|
|
146
146
|
|
|
147
147
|
res.each do |row|
|
|
148
|
-
year, month, user_id, locale, day, phrase_id, source_word_count, source_hash, is_verification = row
|
|
148
|
+
year, month, user_id, locale, day, phrase_id, source_word_count, key, source_hash, is_verification = row
|
|
149
149
|
is_verification = (is_verification == 1)
|
|
150
|
-
phrases_per_user_locale_month_year[year][month][user_id][locale][day][is_verification].merge!({source_hash => source_word_count})
|
|
150
|
+
phrases_per_user_locale_month_year[year][month][user_id][locale][day][is_verification].merge!({[key, source_hash] => source_word_count})
|
|
151
151
|
end
|
|
152
152
|
|
|
153
153
|
activities = []
|
|
@@ -224,9 +224,11 @@ module Air18n
|
|
|
224
224
|
{}.tap do |activity|
|
|
225
225
|
activity[:num_translations] = phrase_ids_word_counts_by_type[false].size
|
|
226
226
|
activity[:word_count_translations] = phrase_ids_word_counts_by_type[false].values.sum
|
|
227
|
+
activity[:translated_keys] = phrase_ids_word_counts_by_type[false].keys
|
|
227
228
|
|
|
228
229
|
activity[:num_verifications] = phrase_ids_word_counts_by_type[true].size
|
|
229
230
|
activity[:word_count_verifications] = phrase_ids_word_counts_by_type[true].values.sum
|
|
231
|
+
activity[:verified_keys] = phrase_ids_word_counts_by_type[true].keys
|
|
230
232
|
end
|
|
231
233
|
end
|
|
232
234
|
|
data/lib/air18n/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: air18n
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.15
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -13,7 +13,7 @@ authors:
|
|
|
13
13
|
autorequire:
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
|
-
date: 2012-09-
|
|
16
|
+
date: 2012-09-29 00:00:00.000000000 Z
|
|
17
17
|
dependencies:
|
|
18
18
|
- !ruby/object:Gem::Dependency
|
|
19
19
|
name: i18n
|