Remove '?' and '.' characters from source key names

This commit is contained in:
Jonah 2019-11-25 16:01:29 -06:00
parent 7b11a7bb01
commit 46ba805cdd
No known key found for this signature in database
GPG Key ID: 53ADD8CEA3D016F6
2 changed files with 1184 additions and 1709 deletions

View File

@ -1,14 +1,14 @@
# Copyright 2019 Signal # Copyright 2019 Signal
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction, # associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute, # including without limitation the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is # sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: # furnished to do so, subject to the following conditions:
# #
# The above copyright notice and this permission notice shall be included in all copies or # The above copyright notice and this permission notice shall be included in all copies or
# substantial portions of the Software. # substantial portions of the Software.
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
@ -21,7 +21,7 @@ module Weblate
def self.get(source_text) def self.get(source_text)
source_text.nil? or source_text.empty? ? source_text source_text.nil? or source_text.empty? ? source_text
: source_text.strip[0..150] : source_text.strip[0..150]
.gsub(/([^\w\d\s\.\?\!]|\n)/, '') .gsub(/([^\w\d\s\!]|\n)/, '')
.tr(' ', '_') << "_KEY" .tr(' ', '_') << "_KEY"
end end
end end

File diff suppressed because it is too large Load Diff