Skip to content

Commit

Permalink
Merge pull request svenfuchs#1017 from digitalfrost/170822
Browse files Browse the repository at this point in the history
Remove orphan pluralizations
  • Loading branch information
pama authored Aug 23, 2022
2 parents 5044f85 + d619ef3 commit 418dd73
Show file tree
Hide file tree
Showing 54 changed files with 62 additions and 824 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ The cy locale was removed in commit 84f6c6b9b7a3e50df2b1fb1ccf7add329f7eab4f sin
We would welcome contributions to add it back to the project.
The locale is mostly complete for the missing translations please refer to [#1006](https://github.com/svenfuchs/rails-i18n/issues/1006)

**Removed pluralizations:**

ak, am, bh, bm, bo, br, by, cy, dz, ff, ga, gd, guw, gv, ig, ii, iu, jv, kab, kde, kea, ksh, kw, lag, ln, mo, mt, my, naq, nso, root, sah, se, ses, sg, sh, shi, sma, smi, smj, smn, sms, ti, to, tzm, wa, yo, zh

The above pluralization rules were removed because they did not have corresponding locale files.


Currently, most locales are incomplete. Typically they lack the following keys:

Expand Down
32 changes: 6 additions & 26 deletions locales.thor
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require File.dirname(__FILE__) + '/rails/test/lib/key_structure.rb'
require File.dirname(__FILE__) + '/rails/test/lib/normalize.rb'
require File.dirname(__FILE__) + '/rails/test/lib/check_locales.rb'
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/lib') unless $LOAD_PATH.include?(File.dirname(__FILE__) + '/lib')

class Locales < Thor
Expand Down Expand Up @@ -75,12 +76,12 @@ class Locales < Thor

desc 'list', 'List locale names.'
def list
puts self.list_locales.join(', ')
puts CheckLocales.list_locales.join(', ')
end

desc 'count_all', 'Returns the number of available locales'
def count_all
puts self.list_locales.count
puts CheckLocales.count
end

desc 'complete', 'List complete locales'
Expand All @@ -103,34 +104,13 @@ class Locales < Thor
puts self.incomplete_locales.count
end

desc 'orphaned_pluralizations', 'Returns pluralizations that do nothave a locale file'
def orphaned_pluralizations
orphans = self.list_pluralizations.difference(self.list_locales)
puts orphans.join(', ')
desc 'orphan_pluralizations', 'Returns pluralizations that do not have a locale file'
def orphan_pluralizations
puts CheckLocales.orphan_pluralizations.join(', ')
end

private

desc 'list_locales', 'List all locales'
def list_locales
path_to_locales = 'rails/locale'
Dir.chdir(path_to_locales)
locale_files = Dir.glob('**/*.yml')
locales = locale_files.map{ |f| File.basename(f, '.yml') }
Dir.chdir('../..') # rewind
return locales.sort
end

desc 'list_pluralizations', 'List all pluralizations'
def list_pluralizations
path_to_pluralizations = 'rails/pluralization'
Dir.chdir(path_to_pluralizations)
pluralization_files = Dir.glob('*.rb')
pluralizations = pluralization_files.map{ |f| File.basename(f, '.rb') }
Dir.chdir('../..') # rewind
return pluralizations.sort
end

desc 'complete_locales', 'List complete locales'
def complete_locales
locales = []
Expand Down
3 changes: 0 additions & 3 deletions rails/pluralization/ak.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/am.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/bh.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/bm.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/bo.rb

This file was deleted.

31 changes: 0 additions & 31 deletions rails/pluralization/br.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/by.rb

This file was deleted.

24 changes: 0 additions & 24 deletions rails/pluralization/cy.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/dz.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/ff.rb

This file was deleted.

27 changes: 0 additions & 27 deletions rails/pluralization/ga.rb

This file was deleted.

25 changes: 0 additions & 25 deletions rails/pluralization/gd.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/guw.rb

This file was deleted.

22 changes: 0 additions & 22 deletions rails/pluralization/gv.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/ig.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/ii.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/iu.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/jv.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/kab.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/kde.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/kea.rb

This file was deleted.

23 changes: 0 additions & 23 deletions rails/pluralization/ksh.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/kw.rb

This file was deleted.

24 changes: 0 additions & 24 deletions rails/pluralization/lag.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/ln.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/mo.rb

This file was deleted.

28 changes: 0 additions & 28 deletions rails/pluralization/mt.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/my.rb

This file was deleted.

3 changes: 0 additions & 3 deletions rails/pluralization/naq.rb

This file was deleted.

Loading

0 comments on commit 418dd73

Please sign in to comment.