]>
pere.pagekite.me Git - text-free-culture-lessig.git/blob - scripts/translated_emdash_converter.rb
3 REPLACE_WITH
= " – "
8 lines
.each_with_index
do |line
, i
|
10 when /^msgid/ then is_translation
= false
11 when /^msgstr/ then is_translation
= true
18 if line
=~
/^"—/
19 lines
[i-1
].sub!
(/ *"$/, "\"")
21 if line
=~
/—"$/
22 lines
[i+
1].sub!
(/^" */, "\"")
25 line
.gsub!
(/ *— */, REPLACE_WITH
)