Sha256: c52826cef9cc6b679e0c4135a347b438efd9c03f35c341d8156b8dc96cf32369
Contents?: true
Size: 689 Bytes
Versions: 8
Compression:
Stored size: 689 Bytes
Contents
# -*- encoding : utf-8 -*- class Phrase::Tool::Formats::Strings < Phrase::Tool::Formats::Base def self.directory_for_locale(locale) name = locale.code || locale.name "#{formatted(name)}.lproj" end def self.filename_for_locale(locale) "Localizable.strings" end def self.target_directory "./" end def self.extract_locale_name_from_file_path(file_path) file_path.scan(/\/([a-zA-Z\-_]*).lproj\//i).first.try(:first) end def self.locale_aware? true end def self.formatted(name) return name unless name.include?("-") parts = name.split("-") "#{parts.first}_#{parts.last.upcase}" end private_class_method :formatted end
Version data entries
8 entries across 8 versions & 1 rubygems