{"id":16277078,"url":"https://github.com/eliocamp/translated","last_synced_at":"2025-04-08T17:20:00.258Z","repository":{"id":84292434,"uuid":"299422478","full_name":"eliocamp/translated","owner":"eliocamp","description":"POC for multilingual package documentation","archived":false,"fork":false,"pushed_at":"2023-08-10T14:07:49.000Z","size":8,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T13:40:36.860Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eliocamp.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-09-28T20:20:14.000Z","updated_at":"2023-08-10T14:07:13.000Z","dependencies_parsed_at":"2023-03-04T22:30:55.133Z","dependency_job_id":null,"html_url":"https://github.com/eliocamp/translated","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"be1884d311069086b8fe32bd2fc268345bcbf699"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliocamp%2Ftranslated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliocamp%2Ftranslated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliocamp%2Ftranslated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliocamp%2Ftranslated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eliocamp","download_url":"https://codeload.github.com/eliocamp/translated/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247888568,"owners_count":21013002,"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-10T18:52:31.162Z","updated_at":"2025-04-08T17:20:00.233Z","avatar_url":"https://github.com/eliocamp.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# translated\n\nThe goal of translated is to serve as a minimal demonstration of a package with multilingual documentation. \n\n## Installation\n\nYou can install the development version of translated from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"remotes\")\nremotes::install_github(\"eliocamp/translated\")\n```\n\n## Example\n\nThe package has just one dummy function, `translate_me()`, which has documentation in English and Spanish. \n\n```{r example}\nlibrary(translated)\n```\n\nType `?translate_me` in the console for the default (English) documentation. \n\nType `es?translate_me` for the Spanish documentation.\n\n## How it works\n\n### R scaffolding\n\nEach function is documented normally with one .Rd per language. \nThe .Rd for the default language is documented as usual, but the others have `\\alias{function-lang}` and  `\\keyword{internal}`. \nThe former makes it so that `lang?function` opens up the correct page (TODO: understand why) and the latter to hide the translation in the help index. \n\n### Tooling\n\nThe idea is to document functions normally using [roxygen2](https://roxygen2.r-lib.org/index.html) in the default language and add a translation [roclet](https://roxygen2.r-lib.org/reference/roclet.html) that handles everything else. \n\nThis roclet would search for a .yaml file for each documented object which would hold the translated strings. \nEach section has its own yaml field with the `original` text, the `translated` text and a `needs_update` field to indicate if the original string was changed and the translation needs to be updated. \nFor example:\n\n```yaml\ntitle:\n  original: Title of documentation\n  translated: 'Título de la documentación'\n  needs_update: no\n```\n\nThe roclet would then create a new .Rd file for each of these files. \n\nIf the yaml file doesn't exist (e.g. it's a new function that doesn't have any translation), the roclet would create the yaml with empty `translated` strings. \n\nIf the string in the original documentation is different from the string in the `original` field, then the roclet would update the field and the `needs_update` field.\n\n# Missing pieces\n\n1. The translation roclet doesn't work well and is missing parts. \n2. Documentation pages are not linked to their translations.\n3. Documentation pages don't have a way of informing if they are outdated. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliocamp%2Ftranslated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliocamp%2Ftranslated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliocamp%2Ftranslated/lists"}