Strip newlines from Weblate source
This commit is contained in:
parent
1c67783cd1
commit
4ab759a52b
@ -34,7 +34,7 @@ module Weblate
|
|||||||
def add_entry(weblate_id, source_text)
|
def add_entry(weblate_id, source_text)
|
||||||
unless id_already_exists?(weblate_id) or source_text.nil? or source_text.empty?
|
unless id_already_exists?(weblate_id) or source_text.nil? or source_text.empty?
|
||||||
new_entry = <<-YAML
|
new_entry = <<-YAML
|
||||||
#{weblate_id}: |
|
#{weblate_id}: |-
|
||||||
#{source_text}
|
#{source_text}
|
||||||
|
|
||||||
YAML
|
YAML
|
||||||
@ -44,7 +44,7 @@ module Weblate
|
|||||||
end
|
end
|
||||||
|
|
||||||
def id_already_exists?(weblate_id)
|
def id_already_exists?(weblate_id)
|
||||||
File.readlines(weblate_source_location).grep(/^#{weblate_id}: \|$/).any?
|
File.readlines(weblate_source_location).grep(/^#{weblate_id}: \|-$/).any?
|
||||||
end
|
end
|
||||||
|
|
||||||
def refresh
|
def refresh
|
||||||
|
Reference in New Issue
Block a user