{"id":23226384,"url":"https://github.com/typst-community/linguify","last_synced_at":"2025-04-05T17:34:18.895Z","repository":{"id":220028987,"uuid":"750572147","full_name":"typst-community/linguify","owner":"typst-community","description":"typst package to load strings for different languages easily.","archived":false,"fork":false,"pushed_at":"2025-03-05T21:54:08.000Z","size":1260,"stargazers_count":26,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-01T15:58:11.829Z","etag":null,"topics":["internationalization","localization","typst","typst-package"],"latest_commit_sha":null,"homepage":"https://typst.app/universe/package/linguify","language":"Typst","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/typst-community.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}},"created_at":"2024-01-30T22:22:44.000Z","updated_at":"2025-03-31T15:51:39.000Z","dependencies_parsed_at":"2024-01-31T00:08:12.879Z","dependency_job_id":"95123c21-22f9-42ef-8e1a-be8e0cffbff0","html_url":"https://github.com/typst-community/linguify","commit_stats":null,"previous_names":["jomaway/typst-linguify","typst-community/linguify"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typst-community%2Flinguify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typst-community%2Flinguify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typst-community%2Flinguify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typst-community%2Flinguify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typst-community","download_url":"https://codeload.github.com/typst-community/linguify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247376270,"owners_count":20929218,"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":["internationalization","localization","typst","typst-package"],"created_at":"2024-12-19T00:17:35.754Z","updated_at":"2025-04-05T17:34:18.872Z","avatar_url":"https://github.com/typst-community.png","language":"Typst","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Typst-linguify\n\nLoad strings for different languages easily. This can be useful if you create a package or template for multilingual usage.\n\n## Usage\n\nThe usage depends if you are using it inside a package or a template or in your own document.\n\n### For end users and own templates\n\nYou can use linguify global database.\n\nExample:\n```typst\n#import \"@preview/linguify:0.4.2\": *\n\n#let lang-data = toml(\"lang.toml\")\n#set-database(lang-data)\n\n#set text(lang: \"de\")\n\n#linguify(\"abstract\")  // Shows \"Zusammenfassung\" in the document.\n```\n\nThe `lang.toml` must look like this:\n\n```toml\n[conf]\ndefault-lang = \"en\"\n\n[lang.en]\ntitle = \"A simple linguify example\"\nabstract = \"Abstract\"\n\n[lang.de]\ntitle = \"Ein einfaches Linguify Beispiel\"\nabstract = \"Zusammenfassung\"\n```\n\n### Inside a package\n\nSo that multiple packages can use linguify simultaneously, they should contain their own database. A linguify database is just a dictionary with a certain structure. (See database structure.)\n\nRecommend is to store the database in a separate file like `lang.toml` and load it inside the document. And specify it in each `linguify()` function call.\n\nExample:\n```typ\n#import \"@preview/linguify:21\": *\n\n#let database = toml(\"lang.toml\")\n\n#linguify(\"key\", from: database, default: \"key\")\n```\n\n## Features\n\n- Use a `toml` or other file to load strings for different languages. You need to pass a typst dictionary which follows the structure of the shown toml file.\n- Specify a **default-lang**. If none is specified it will default to `en`\n- **Fallback** to the default-lang if a key is not found for a certain language.\n- [Fluent](https://projectfluent.org) support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypst-community%2Flinguify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypst-community%2Flinguify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypst-community%2Flinguify/lists"}