{"id":13880037,"url":"https://github.com/davidcelis/inflections","last_synced_at":"2025-04-06T05:16:47.969Z","repository":{"id":4014197,"uuid":"5113206","full_name":"davidcelis/inflections","owner":"davidcelis","description":":es: Sane and multilingual singularization/pluralization rules for ActiveSupport and Rails.","archived":false,"fork":false,"pushed_at":"2021-08-23T12:33:57.000Z","size":89,"stargazers_count":90,"open_issues_count":7,"forks_count":27,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T03:11:04.563Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://davidcel.is/inflections","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidcelis.png","metadata":{"files":{"readme":"README.markdown","changelog":"CHANGELOG.markdown","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-19T17:35:35.000Z","updated_at":"2024-11-19T15:53:12.000Z","dependencies_parsed_at":"2022-09-11T06:06:19.268Z","dependency_job_id":null,"html_url":"https://github.com/davidcelis/inflections","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Finflections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Finflections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Finflections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidcelis%2Finflections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidcelis","download_url":"https://codeload.github.com/davidcelis/inflections/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247436286,"owners_count":20938533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T08:02:44.546Z","updated_at":"2025-04-06T05:16:47.949Z","avatar_url":"https://github.com/davidcelis.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Inflections [![Build Status](https://secure.travis-ci.org/davidcelis/inflections.png)](http://travis-ci.org/davidcelis/inflections)\n\nInflections is a repository containing non-English singularization and pluralization rules for Rails, supporting the multilingual ActiveSupport::Inflector in Rails 4.\n\n## Languages Currently Supported\n\n* Spanish (es)\n* French (fr)\n* Kazakh (kk)\n* Norwegian Bokmål (nb)\n* Brazilian Portugues (pt-BR)\n* Turkish (tr)\n* Italian (it)\n\nIf you are fluent in a language not yet included in this gem, _please_ consider creating a list of inflections and submitting a pull request.\n\n## Installation\n\nAdd the following to your application's Gemfile:\n\n```ruby\ngem 'inflections'\n```\n\nAnd then execute:\n\n```bash\n$ bundle\n```\n\n## Usage\n\nTo inflect strings in a different locale:\n\n```ruby\n'persona'.pluralize(:es)\n# =\u003e \"personas\"\n'madame'.pluralize(:fr)\n# =\u003e \"mesdames\"\n```\n\nDefine your own additional rules as such:\n\n```ruby\nActiveSupport::Inflector.inflections(:en) do |inflect|\n  inflect.singular /(phase)s$/i, '\\1'\n  inflect.plural /(shel|kni)fe/, '\\1ves'\n  inflect.irregular 'foot', 'feet'\n  inflect.uncountable %w[money fish]\nend\n```\n\n# Rails \u003c 4.0.0\n\nIf you're not using ActiveSupport 4, the [multilingual Inflector](http://davidcel.is/posts/edge-rails-a-multilingual-inflector/) won't be supported. You should install inflections 3.2.x and you'll have to choose which locale you use by requiring a specific file:\n\n```ruby\ngem 'inflections', '~\u003e 3.2', require: 'inflections/es'\n```\n\nNote that this will override the default set of English rules that come with Rails. You should do this only if you plan on your constants and code itself not being in English.\n\n## Contributing\n\nPlease note that pull requests for already supported languages will only be accepted for rules that are in error or a potentially missed rule. If your change is an exception to an existing rule, that exception must occur _frequently_ and must involve words used more frequently than the regular plurals. If your change is an irregularity, it must be a word that is arguably _frequently_ encountered in applications that would use ActiveSupport. The default list of inflections is meant to be short.\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`) with tests\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcelis%2Finflections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidcelis%2Finflections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidcelis%2Finflections/lists"}