Sha256: df51526d72b8017b94b3a10cc24912e903b6d48d39d0ef146b6d87766cb4590e

Contents?: true

Size: 1.28 KB

Versions: 15

Compression:

Stored size: 1.28 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"],
       ["#{base_locale}_ransack", "#{args[:locale]}_ransack"]].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

15 entries across 15 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.15.2 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.16.4 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.14.1 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.15.1 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.16.3 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.16.2 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.16.1 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.16.0 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.15.0 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.15.0.beta.2 lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.15.0.beta lib/tasks/ffcrm/missing_translations.rake
fat_free_crm-0.14.0 lib/tasks/ffcrm/missing_translations.rake
reduced_fat_crm-0.15.0.beta lib/tasks/ffcrm/missing_translations.rake
reduced_fat_crm-0.14.0 lib/tasks/ffcrm/missing_translations.rake