{"id":27118596,"url":"https://github.com/doga/lume_langdata","last_synced_at":"2026-04-28T00:31:07.415Z","repository":{"id":64943747,"uuid":"579754610","full_name":"doga/lume_langdata","owner":"doga","description":"A Lume plugin for developing multi-language websites.","archived":false,"fork":false,"pushed_at":"2024-01-08T09:34:18.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-25T06:56:17.960Z","etag":null,"topics":["deno","i18n","l10n","lume","webdevelopment"],"latest_commit_sha":null,"homepage":"https://deno.land/x/lume_langdata","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doga.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-18T20:06:22.000Z","updated_at":"2024-06-04T12:29:05.000Z","dependencies_parsed_at":"2024-01-08T09:50:56.049Z","dependency_job_id":null,"html_url":"https://github.com/doga/lume_langdata","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/doga/lume_langdata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doga%2Flume_langdata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doga%2Flume_langdata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doga%2Flume_langdata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doga%2Flume_langdata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doga","download_url":"https://codeload.github.com/doga/lume_langdata/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doga%2Flume_langdata/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32361477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["deno","i18n","l10n","lume","webdevelopment"],"created_at":"2025-04-07T07:58:57.538Z","updated_at":"2026-04-28T00:31:07.400Z","avatar_url":"https://github.com/doga.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lume_langdata\n\nA [Lume](https://lume.land) plugin for developing multi-language websites.\nLume is a static-site generator for the [Deno](https://deno.land) JavaScript/TypeScript runtime.\n\nlume_langdata automates the creation of language-related [shared data for Lume projects](https://lume.land/docs/creating-pages/shared-data/#the-_data-directories).\n\n## Adding `lume_langdata` to your Lume project\n\n✅ You can [simply use mdrb](https://deno.land/x/lume_langdata/add_to_lume_project.md) and skip the rest of this section. Or else read on.\n\nCall lume_langdata from your [Lume project's configuration file](https://lume.land/docs/configuration/config-file/):\n\n```ts\n// _config.ts\n\nimport lume from 'lume/mod.ts';\nimport lume_langdata from 'lume_langdata';\n\nexport default\nlume({\n  location: new URL('https://site.example'),\n  src     : './src',\n  dest    : './build',\n})\n.use(lume_langdata());\n```\n\nIn your lume project's `deno.json` file, don't forget to define the `lume_langdata` import, and also the compiler option that `lume_langdata` depends on:\n\n```json\n{\n  \"imports\": {\n    \"lume/\"         : \"https://deno.land/x/lume@v2.0.2/\",\n    \"lume_langdata\"  : \"https://deno.land/x/lume_langdata@v2.0.6/mod.ts\",\n  },\n  \"compilerOptions\": {\n    \"types\": [\n      \"lume/types.ts\"\n    ]\n  }\n}\n```\n\n`lume_langdata@v1.x.x` versions are compatible with `lume@v2.x.x`.\n\n## Lume project directory structure\n\nlume_langdata assumes that your [Lume project's source directory](https://lume.land/docs/configuration/config-file/#src) contains one directory for each language. The directory name must be a [ISO 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). lume_langdata will ignore directories with a non-conforming name. Note that the names of the language directories must be lower-cased.\n\nFor example, if your source directory contains the following directories and files:\n\n- `en`\n- `tr`\n- `assets`\n- `index.html`\n\nthen lume_langdata will ignore the `assets` directory and the `index.html` file.\n\n## Which shared data is generated?\n\nGiven the source directory structure shown above, lume_langdata will generate the following data files. Note that the generated data files will modify your source directory.\n\n### List of site languages\n\nIn this example, a file named `languages.json` will be generated in the source directory, containing:\n\n```json\n[\"en\",\"tr\"]\n```\n\nso that the source directory will then look as follows:\n\n- `languages.json`\n- `en`\n- `tr`\n- `assets`\n- `index.html`\n\nThe main use case for `languages.json` is redirecting the user to his/her preferred language. For example, `index.html` could contain JavaScript code such as:\n\n```js\nfetch('/languages.json')\n.then((response) =\u003e response.json())\n.then((siteLanguages) =\u003e {\n  let lang = siteLanguages[0];\n\n  // Fine-tune lang here ...\n\n  window.location.assign(`/${lang}/`);\n}\n```\n\n### Shared data for each language directory\n\nlume_langdata will generate the following files:\n\n- `en/_data/lang.yaml`\n- `tr/_data/lang.yaml`\n\nFor example, `en/_data/lang.yaml` will contain:\n\n```yaml\ncode: en\n```\n\nThe main use case for this shared data is the localization of [Lume layouts](https://lume.land/docs/getting-started/create-a-layout/):\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"{{ lang.code }}\"\u003e\n  \u003c!-- ... --\u003e\n\u003c/html\u003e\n```\n\n## Other relevant Lume add-ons\n\nIf you are developing multi-language sites, the following Lume plugin is a nice complement to the lume_langdata plugin:\n\n- [lume_navbardata](https://deno.land/x/lume_navbardata)\n\n## Demo\n\n[This website project](https://github.com/doga/qworum-website) uses Lume and lume_langdata.\n\n## License\n\nlume_langdata is released under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoga%2Flume_langdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoga%2Flume_langdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoga%2Flume_langdata/lists"}