{"id":17775497,"url":"https://github.com/mjonuschat/trasto","last_synced_at":"2025-07-22T04:35:16.667Z","repository":{"id":4422323,"uuid":"5560132","full_name":"mjonuschat/trasto","owner":"mjonuschat","description":"Translatable columns for Rails 3, directly stored in a postgres hstore in the model table.","archived":false,"fork":false,"pushed_at":"2020-12-23T04:12:19.000Z","size":43,"stargazers_count":8,"open_issues_count":5,"forks_count":4,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-07-13T06:41:32.276Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mjonuschat.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":"2012-08-26T13:22:41.000Z","updated_at":"2024-01-10T12:25:55.000Z","dependencies_parsed_at":"2022-09-18T22:22:52.978Z","dependency_job_id":null,"html_url":"https://github.com/mjonuschat/trasto","commit_stats":null,"previous_names":["yabawock/trasto"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mjonuschat/trasto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjonuschat%2Ftrasto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjonuschat%2Ftrasto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjonuschat%2Ftrasto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjonuschat%2Ftrasto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjonuschat","download_url":"https://codeload.github.com/mjonuschat/trasto/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjonuschat%2Ftrasto/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266428466,"owners_count":23927003,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-26T21:57:42.061Z","updated_at":"2025-07-22T04:35:16.645Z","avatar_url":"https://github.com/mjonuschat.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trasto\n\n[![Build Status](https://secure.travis-ci.org/mjonuschat/trasto.png)](https://travis-ci.org/mjonuschat/trasto)\n\nTranslatable columns for Rails 4, directly stored in a postgres hstore in the model table.\n\nInspired by Barsoom's [traco](https://github.com/barsoom/traco/).\n\nTo store translations outside the model, see Sven Fuchs' [globalize3](https://github.com/svenfuchs/globalize3).\n\n## Usage\n\nSay you want `Post#title` and `Post#body` to support both English and Swedish values.\n\nWrite a migration to get hstore database columns with i18n suffixes, e.g. `title_i18n` and `body_i18n`, like:\n\n```ruby\nclass CreatePosts \u003c ActiveRecord::Migration\n  def change\n    create_table :posts do |t|\n      t.hstore :title_i18n\n      t.hstore :body_i18n\n\n      t.timestamps\n    end\n  end\nend\n```\n\nDon't create `title` or `body` columns without the `_i18n` suffix, Trasto will define a method with that name.\n\nDeclare these columns in the model:\n\n```ruby\nclass Post \u003c ActiveRecord::Base\n  translates :title, :body\nend\n```\n\nYou can still use your accessors for `title_i18n` and `title_i18=` in forms, validations and other code, but you also get:\n\n`#title`:  Shows the title in the current locale. If blank, falls back to default locale, then to any locale.\n\n`#title=`: Assigns the title to the column for the current locale, if present.\n\n`.locales_for_column(:title)`: Returns an array like `[:de, :en]` sorted with default locale first and then all currently available locals sorted alphabetically.\n\n## Installation\n\nAdd this to your `Gemfile`:\n\n```ruby\n  gem 'trasto'\n```\n\nYou might need to enable the hstore extension for your database. Create a migration containing the necessary instruction:\n\n```ruby\nclass EnableHstore \u003c ActiveRecord::Migration\n  def change\n    enable_extension 'hstore'\n  end\nend\n```\n\n## Running the tests\n\n```\n    bundle exec appraisal install\n    bundle exec appraisal rake\n```\n\nTo run only one appraisal/gemfile:\n\n```\nbundle exec appraisal 4.2 rake\n```\n\n## Credits and license\n\nBy [Morton Jonuschat](https://github.com/yabawock) under the MIT license:\n\n\u003e  Copyright (c) 2012-2015 Morton Jonuschat\n\u003e\n\u003e  Permission is hereby granted, free of charge, to any person obtaining a copy\n\u003e  of this software and associated documentation files (the \"Software\"), to deal\n\u003e  in the Software without restriction, including without limitation the rights\n\u003e  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\u003e  copies of the Software, and to permit persons to whom the Software is\n\u003e  furnished to do so, subject to the following conditions:\n\u003e\n\u003e  The above copyright notice and this permission notice shall be included in\n\u003e  all copies or substantial portions of the Software.\n\u003e\n\u003e  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\u003e  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\u003e  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\u003e  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\u003e  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\u003e  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\u003e  THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjonuschat%2Ftrasto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjonuschat%2Ftrasto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjonuschat%2Ftrasto/lists"}