Sha256: 92df6b69d2c3ae33e5639c776fd13c8d11a8391ee6b9ab891e8944e203378b6a

Contents?: true

Size: 1.21 KB

Versions: 4

Compression:

Stored size: 1.21 KB

Contents

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------

require 'missing_translation_detector'

namespace :ffcrm do
  namespace :missing_translations do
    desc 'Detects missing translations for a locale - Takes a locale and compares with "en-US".'
    task :detect, [:locale] => [:environment] do |t, args|
      base_locale = 'en-US'

      [[base_locale, args[:locale]],
       ["#{base_locale}_fat_free_crm", "#{args[:locale]}_fat_free_crm"]].each do |locale_file_names|
        detector = MissingTranslationDetector.new locale_file_names.first,
                                                  locale_file_names.last
        detector.detect

        if detector.missing_translations?
          puts
          puts "Detected missing translations within \"config/locales/#{locale_file_names.last}.yml\":"
          puts

          detector.missing_translations.each do |missing|
            puts "#{missing.key_path.join(' => ')}: #{missing.value}"
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fat_free_crm-0.12.3 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.12.2 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.12.1 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.12.0 lib/tasks/ffcrm/missing_translations.rake