{"id":16193469,"url":"https://github.com/pyramation/graphile-i18n","last_synced_at":"2025-04-07T15:18:40.049Z","repository":{"id":57253239,"uuid":"458693361","full_name":"pyramation/graphile-i18n","owner":"pyramation","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-14T00:03:01.000Z","size":14,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T02:03:51.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/pyramation.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-02-13T02:52:59.000Z","updated_at":"2022-02-13T02:54:29.000Z","dependencies_parsed_at":"2022-08-31T22:20:25.082Z","dependency_job_id":null,"html_url":"https://github.com/pyramation/graphile-i18n","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Fgraphile-i18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Fgraphile-i18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Fgraphile-i18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Fgraphile-i18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyramation","download_url":"https://codeload.github.com/pyramation/graphile-i18n/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675598,"owners_count":20977378,"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-10T08:14:57.466Z","updated_at":"2025-04-07T15:18:40.031Z","avatar_url":"https://github.com/pyramation.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graphile-i18n [![Build Status](https://travis-ci.com/pyramation/graphile-i18n.svg?branch=master)](https://travis-ci.com/pyramation/graphile-i18n)\n\n```sh\nnpm install graphile-i18n \n```\n\nThis [PostGraphile](http://postgraphile.org/) schema plugin was built to enable i18n language translation tables.\n\n## Usage\n\n1. Create a language translation table\n2. Add smart comments\n3. Register plugin with postgraphile\n\n## language table\n\nAdd language table with `lang_code` field and a smart comment for `i18n`:\n\n```sql\nCREATE TABLE app_public.projects (\n    id serial PRIMARY KEY,\n    name citext,\n    description citext\n);\nCOMMENT ON TABLE app_public.projects IS E'@i18n project_language_variations';\n\nCREATE TABLE app_public.project_language_variations (\n    id serial PRIMARY KEY,\n    project_id int NOT NULL REFERENCES app_public.projects(id),\n    lang_code citext,\n    name citext,\n    description citext,\n    UNIQUE(project_id, lang_code)\n);\n```\n\n## Register Plugin\n\n```js\napp.use(\n  postgraphile(connectionStr, schemas, {\n    appendPlugins: [\n      LangPlugin\n    ],\n    graphileBuildOptions: {\n      langPluginDefaultLanguages: ['en']\n    }\n  })\n);\n```\n\n## testing\n\n```\ncreatedb test_database\npsql test_database \u003c sql/roles.sql\npsql test_database \u003c sql/test.sql \nyarn test\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyramation%2Fgraphile-i18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyramation%2Fgraphile-i18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyramation%2Fgraphile-i18n/lists"}