transdifflation 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -42,7 +42,7 @@ namespace :transdifflation do
|
|
42
42
|
comparer = Transdifflation::Comparer.new
|
43
43
|
differences = comparer.get_rest_of_translation(hash_from_locale, hash_to_locale, from_locale, to_locale)
|
44
44
|
differences = { to_locale.to_s => differences } if !differences.empty?
|
45
|
-
|
45
|
+
differences
|
46
46
|
end
|
47
47
|
|
48
48
|
desc "What is not translated in our app"
|
data/lib/transdifflation.rb
CHANGED
@@ -4,8 +4,6 @@ require 'transdifflation/yaml_writer'
|
|
4
4
|
require 'transdifflation/exceptions'
|
5
5
|
require 'transdifflation/utilities'
|
6
6
|
|
7
|
-
require 'pry'
|
8
|
-
|
9
7
|
# The main module for the program
|
10
8
|
module Transdifflation
|
11
9
|
|
@@ -36,10 +34,11 @@ module Transdifflation
|
|
36
34
|
to_locale ||= I18n.locale
|
37
35
|
|
38
36
|
yml_gem_content = YAMLReader.read_YAML_from_gem(gem_name, path_to_yaml_in_gem)
|
37
|
+
|
39
38
|
puts "Loaded YAML content from gem '#{gem_name}', file '#{path_to_yaml_in_gem}'"
|
40
39
|
|
41
40
|
#build the file name in our host
|
42
|
-
filename_in_gem_SRC = File.basename( path_to_yaml_in_gem )
|
41
|
+
filename_in_gem_SRC = File.basename( path_to_yaml_in_gem )
|
43
42
|
host_target_filename = filename_in_gem_SRC.gsub(/-?#{from_locale}\./) do |match_s|
|
44
43
|
match_s.sub("#{from_locale}", "#{to_locale}")
|
45
44
|
end
|
@@ -248,8 +247,7 @@ module Transdifflation
|
|
248
247
|
if( added_diff_hash.length > 0 || removed_diff_hash.length > 0 )
|
249
248
|
diff_file = File.join(File.dirname(host_target_file), "#{File.basename(host_target_file)}.diff")
|
250
249
|
diff_file_stream = File.new(diff_file, "w+:UTF-8")
|
251
|
-
begin
|
252
|
-
|
250
|
+
begin
|
253
251
|
if (added_diff_hash.length > 0)
|
254
252
|
diff_file_stream.write("ADDED KEYS (Keys not found in your file, founded in source file) ********************\n")
|
255
253
|
diff_file_stream.write(YAMLWriter.to_yaml(added_diff_hash)) #we can't use YAML#dump due to issues wuth Utf8 chars
|