{"id":27103314,"url":"https://github.com/abstractn/abs-translate","last_synced_at":"2025-04-06T16:52:52.943Z","repository":{"id":206865961,"uuid":"716804189","full_name":"Abstractn/abs-translate","owner":"Abstractn","description":"Simple Angular-like runtime translation system","archived":false,"fork":false,"pushed_at":"2024-05-22T09:12:23.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-07T06:34:25.127Z","etag":null,"topics":["frontend","i18n","internazionalization","translation"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Abstractn.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":"2023-11-09T22:58:02.000Z","updated_at":"2024-11-14T10:22:07.000Z","dependencies_parsed_at":"2023-11-16T13:24:33.705Z","dependency_job_id":"36a713ee-8f35-462f-a98a-969043316a4d","html_url":"https://github.com/Abstractn/abs-translate","commit_stats":null,"previous_names":["abstractn/abs-translate"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abstractn%2Fabs-translate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abstractn%2Fabs-translate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abstractn%2Fabs-translate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abstractn%2Fabs-translate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abstractn","download_url":"https://codeload.github.com/Abstractn/abs-translate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247517943,"owners_count":20951718,"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":["frontend","i18n","internazionalization","translation"],"created_at":"2025-04-06T16:52:52.359Z","updated_at":"2025-04-06T16:52:52.936Z","avatar_url":"https://github.com/Abstractn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Abs-Translate\n\n\n## Introduction:\n\nThis module offers a quick translation system using local dictionaries.\n\n\n## CDN:\n\nTypescript:\n```https://abstractn.github.io/lib/abs-translate.ts```\n\nJavascript (with export):\n```https://abstractn.github.io/lib/abs-translate.js```\n\nJavascript (without export):\n```https://abstractn.github.io/lib/abs-translate.nx.js```\n\nBrowser iclusion:\n```\u003cscript src=\"https://abstractn.github.io/lib/abs-translate.nx.js\"\u003e\u003c/script\u003e```\n\n\n## Dictionaries\n\nYou can have your dictionaries from dedicated JSON files or defined directly from code as objects.\nThis is what one would look like:\n```typescript\n@import { AbsTranslateLanguage } from 'abs-translate';\nconst myEnglishDictionary: AbsTranslateLanguage = {\n  languageId: 'english',\n  content: {\n    'example-text-1': 'Example text #1',\n    'example-text-2': 'Example text #2',\n  }\n}\nconst myItalianDictionary: AbsTranslateLanguage = {\n  languageId: 'italian',\n  content: {\n    'example-text-1': 'Testo di esempio #1',\n    'example-text-2': 'Testo di esempio #2',\n  }\n}\n```\nNote how the keys inside `content` (\"translation keys\") are the same for all languages.\nThese translation keys are going to be what the HTML page references instead of directly printing text.\n\n```html\n\u003cspan data-abs-translate=\"example-text-1\"\u003e\u003c/span\u003e\n\u003cspan data-abs-translate=\"example-text-2\"\u003e\u003c/span\u003e\n```\nNow you can have a custom language selector that calls `.setLanguage(languageId: string)` and all translatable nodes will automatically switch language without needing to reload the page.\n\u003e NOTE: this module has not been tested with pages containing high amount of content so this system may result in poor performance.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabstractn%2Fabs-translate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabstractn%2Fabs-translate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabstractn%2Fabs-translate/lists"}