Skip to content

Commit 8083332

Browse files
committed
Save short release notes even if the exceeds the max len
1 parent 3a82fae commit 8083332

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ def reparse_alternates(target_locale, loc_data, is_source)
5858
source = d[0].split(/\u0004/).last
5959

6060
@alternates.each do | file |
61+
puts "Data: #{file[0].to_s} - key: #{key}"
6162
if (file[0].to_s == key)
63+
puts "Alternate: #{key}"
6264
data = file[1]
6365
msg = is_source ? source : d[1]
6466
update_key(target_locale, key, file, data, msg)
@@ -71,7 +73,7 @@ def update_key(target_locale, key, file, data, msg)
7173
if (data.key?(:max_size)) && (data[:max_size] != 0) && ((msg.to_s.length - 3) > data[:max_size]) then
7274
if (data.key?(:alternate_key)) then
7375
UI.message("#{target_locale} traslation for #{key} exceeds maximum lenght (#{msg.to_s.length}). Switching to the alternate translation.")
74-
@alternates[data[:alternate_key]] = {desc: data[:desc], max_size: data[:max_size] }
76+
@alternates[data[:alternate_key]] = {desc: data[:desc], max_size: 0 }
7577
else
7678
UI.message("Rejecting #{target_locale} traslation for #{key}: translation length: #{msg.to_s.length} - max allowed length: #{data[:max_size]}")
7779
end

0 commit comments

Comments
 (0)