{"id":17733726,"url":"https://github.com/crunch09/form_translation","last_synced_at":"2025-03-31T18:28:30.618Z","repository":{"id":9215108,"uuid":"11027737","full_name":"Crunch09/form_translation","owner":"Crunch09","description":"language specific inputs in your forms","archived":false,"fork":false,"pushed_at":"2017-01-04T17:21:08.000Z","size":1526,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-18T11:26:41.127Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/Crunch09.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-28T14:03:45.000Z","updated_at":"2017-01-04T17:21:11.000Z","dependencies_parsed_at":"2022-09-22T14:26:18.416Z","dependency_job_id":null,"html_url":"https://github.com/Crunch09/form_translation","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crunch09%2Fform_translation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crunch09%2Fform_translation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crunch09%2Fform_translation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crunch09%2Fform_translation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Crunch09","download_url":"https://codeload.github.com/Crunch09/form_translation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246517210,"owners_count":20790379,"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-10-25T23:05:30.914Z","updated_at":"2025-03-31T18:28:30.591Z","avatar_url":"https://github.com/Crunch09.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FormTranslation\n[![Code Climate](https://codeclimate.com/github/Crunch09/form_translation.png)](https://codeclimate.com/github/Crunch09/form_translation)\n[![Build Status](https://travis-ci.org/Crunch09/form_translation.png?branch=master)](https://travis-ci.org/Crunch09/form_translation)\n\nIt uses `ActiveRecord::Store` to store language specific values and adds\ntabs to your forms for each language.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'form_translation', github: 'Crunch09/form_translation'\n```\n\nAnd then execute:\n\n```\n$ bundle\n$ rails g form_translation:install\n```\n\n## Usage\n\n* In your model include `FormTranslation::ForModel* and specify which attributes\nshould be translated.\n```ruby\nclass Article \u003c ActiveRecord::Base\n      include FormTranslation::ForModel\n\n      translate_me :subject, :body\nend\n```\n* Within your `simple_form`-Form specify where to put your translation-tabs\nwith a `languagify` block.\n\n```erb\n\u003c%= simple_form_for(@article) do |f| %\u003e\n      \u003cdiv class=\"form-inputs\"\u003e\n        \u003c%= f.input :date %\u003e\n      \u003c/div\u003e\n      \u003cdiv\u003e\n        \u003c%= f.languagify do |l| %\u003e\n          \u003c%= l.input :subject %\u003e\n          \u003c%= l.input :body %\u003e\n        \u003c% end %\u003e\n      \u003c/div\u003e\n      \u003cdiv class=\"form-actions\"\u003e\n        \u003c%= f.button :submit %\u003e\n      \u003c/div\u003e\n\u003c% end %\u003e\n```\n\nLastly, make sure to add the translated attributes to your permitted parameters\nso they can be stored. The convention for the attribute name is as follows:\n`language_shortname`_`attribute_name`\n\n```ruby\ndef article_params\n  params.require(:article).permit(:subject, :body, :de_subject, :de_body)\nend\n```\n\n## Contributing\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'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrunch09%2Fform_translation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrunch09%2Fform_translation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrunch09%2Fform_translation/lists"}