Skip to content

Commit

Permalink
Add method to list locales without pluralization files
Browse files Browse the repository at this point in the history
Add methods to check_locales and to thor locales to list locales that
have a locale file but no pluralization file
See svenfuchs#1011
  • Loading branch information
digitalfrost committed Aug 26, 2022
1 parent 418dd73 commit 4ad2add
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions locales.thor
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ class Locales < Thor
puts CheckLocales.orphan_pluralizations.join(', ')
end

desc 'orphan_locales', 'Returns locales that do not have a pluralizations file'
def orphan_locales
puts CheckLocales.orphan_locales.join(', ')
end

private

desc 'complete_locales', 'List complete locales'
Expand Down
6 changes: 6 additions & 0 deletions rails/test/lib/check_locales.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,11 @@ def self.list_pluralizations
def self.orphan_pluralizations
return self.list_pluralizations.difference(self.list_locales)
end

# Returns locales that do not have a pluralization file
def self.orphan_locales
return self.list_locales.difference(self.list_pluralizations)
end

end

0 comments on commit 4ad2add

Please sign in to comment.