Sha256: 26d97ab7d99c9a6635bf573da2897c37a627af7c23ea3794c70f620cb4a73c5f
Contents?: true
Size: 547 Bytes
Versions: 30
Compression:
Stored size: 547 Bytes
Contents
class File def self.lproj_part(filename) filename.split('/').each do |part| return part if part =~ /^.*\.lproj$/ end nil end def self.omit_lproj(filename) File.join(filename.split('/').delete_if { |p| p.match(/^.*\.lproj$/) }) end def self.localized(filename, language) if lproj_part(filename) File.join(filename.split('/').map { |p| p.match(/^.*\.lproj$/) ? "#{language}.lproj" : p }) else File.join(File.dirname(filename), "#{language}.lproj", File.basename(filename)) end end end
Version data entries
30 entries across 30 versions & 1 rubygems