{"id":22202166,"url":"https://github.com/rumkin/i18now","last_synced_at":"2025-06-15T16:35:45.273Z","repository":{"id":57270485,"uuid":"58467072","full_name":"rumkin/i18now","owner":"rumkin","description":"Simple internationalisation library with custom parsers support","archived":false,"fork":false,"pushed_at":"2016-05-12T14:47:48.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T00:59:18.842Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rumkin.png","metadata":{"files":{"readme":"readme.md","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}},"created_at":"2016-05-10T14:13:53.000Z","updated_at":"2016-05-10T14:14:42.000Z","dependencies_parsed_at":"2022-09-08T23:11:52.529Z","dependency_job_id":null,"html_url":"https://github.com/rumkin/i18now","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rumkin/i18now","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fi18now","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fi18now/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fi18now/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fi18now/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rumkin","download_url":"https://codeload.github.com/rumkin/i18now/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fi18now/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260009211,"owners_count":22945423,"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-12-02T16:12:37.473Z","updated_at":"2025-06-15T16:35:45.247Z","avatar_url":"https://github.com/rumkin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# i18now\n\nInternationalization library based on Proxy object with subtemplates\nand variable templates substitutions:\n\n**100%** Code coverage.\n\n# Installation\n\n```bash\nnpm i i18now\n```\n\n## Usage\n\nCreate dictionary\n\n```javascript\nvar t = i18now({\n    dict: {\n        // Regular message\n        hello: 'Hello',\n        // Template with substitution and subtemplate\n        greeting: '{{# hello }} {{ name }}!',\n        // Template with variable templates\n        gender: '{{## gender }}',\n        m: 'male',\n        f: 'female',\n    },\n    cache: true\n});\n\nt.greeting({name: 'User'}); // =\u003e \"Hello User\"\nt.gender({gender: 'm'}); // =\u003e \"male\"\nt.gender({gender: 'f'}); // =\u003e \"female\"\n```\n\nMultiple dictionaries usage see in [repository](https://github.com/rumkin/i18now)\nexamples directory.\n\n### Constructor options\n\n* dict – `object`. Dictionary object where key is message ID and value is message template.\n* cache – `boolean`. Enable compilation result caching.\n* compiler `Compiler`. Message templates compiler.\n\n## Custom templates compiler\n\ni18now allow to use custom compiler. It should accepts string and return\nfunction which accepts two arguments: locals and options. Options contains\n`templates` property and actually it's a dict itself.\n\nCall of abstract compiler will look like so:\n\n```\ncompiler.compile(str)(locals, {templates});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frumkin%2Fi18now","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frumkin%2Fi18now","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frumkin%2Fi18now/lists"}