{"id":24614442,"url":"https://github.com/tabuckner/doggo-translator-ts","last_synced_at":"2025-03-18T17:46:30.410Z","repository":{"id":35145248,"uuid":"212187146","full_name":"tabuckner/doggo-translator-ts","owner":"tabuckner","description":"A typescript doggo translator based on DoggoTranslatorCore","archived":false,"fork":false,"pushed_at":"2022-12-10T04:17:44.000Z","size":1189,"stargazers_count":0,"open_issues_count":24,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-02-26T13:24:24.889Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tabuckner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-01T19:54:05.000Z","updated_at":"2019-10-30T00:59:53.000Z","dependencies_parsed_at":"2023-01-15T14:45:23.337Z","dependency_job_id":null,"html_url":"https://github.com/tabuckner/doggo-translator-ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabuckner%2Fdoggo-translator-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabuckner%2Fdoggo-translator-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabuckner%2Fdoggo-translator-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabuckner%2Fdoggo-translator-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tabuckner","download_url":"https://codeload.github.com/tabuckner/doggo-translator-ts/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244168484,"owners_count":20409536,"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":"2025-01-24T21:16:51.724Z","updated_at":"2025-03-18T17:46:30.391Z","avatar_url":"https://github.com/tabuckner.png","language":"TypeScript","funding_links":["https://paypal.me/tabuckner"],"categories":[],"sub_categories":[],"readme":"# Doggo-Translator-TS\n![Travis (.com)](https://img.shields.io/travis/com/tabuckner/doggo-translator-ts?style=plastic)\n![Codecov](https://img.shields.io/codecov/c/github/tabuckner/doggo-translator-ts?style=plastic)\n![GitHub language count](https://img.shields.io/github/languages/count/tabuckner/doggo-translator-ts?style=plastic)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/tabuckner/doggo-translator-ts?style=plastic)\n![GitHub contributors](https://img.shields.io/github/contributors/tabuckner/doggo-translator-ts?style=plastic)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg)](https://paypal.me/tabuckner)\n\nA TypeScript library for translating words to 'Doggo' speak!\n\n### Usage\nYou can use the library defaults by creating an instance of the [DoggoTranslator](https://tabuckner.github.io/doggo-translator-ts/classes/doggotranslator.html) class, and using it's publicly available methods. [Read More](./examples/node/index.js)\n\nOptionally you can pass in a [DoggoTranslatorConfig](https://tabuckner.github.io/doggo-translator-ts/interfaces/doggotranslatorconfig.html) object to configure the instance when created.\n\n#### Basic Use Case\n```javascript\nconst library = require('../dist/doggo-translator-ts.umd');\nconst DoggoTranslator = library.DoggoTranslator;\n\nconst myTranslator = new DoggoTranslator();\nconsole.warn(myTranslator.translateSentence('Testing this, bark!'))\nconsole.warn(myTranslator.translateSentence('Hello friend! I hope you have a great day!'))\n```\n\n#### User Defined Translations\n```javascript\nconst library = require('../dist/doggo-translator-ts.umd');\nconst DoggoTranslator = library.DoggoTranslator;\nconst myTranslations ={\n  words: {\n    hey: 'hi',\n    friend: 'frenn',\n    run: 'floop'\n  },\n  suffixes: {\n    ing: 'in'\n  }\n}\n\nconst myTranslator = new DoggoTranslator({ userDefinedTranslations: myTranslations });\nconst text = 'Hey Friend! Do you want to go run around? I love running!';\nconst translated = myTranslator.translateSentence(text)\nconsole.warn(translated); // Hi frenn! Do you want to go floop around? I love runnin.\n```\n\n#### Browser\nTo use in Browser, check out the [this example](./examples/browser/index.html)\n\n#### Node\nTo use in Node, check out the [this example](./examples/node/index.js)\n\n\n### Features\n#### User Supplied Translation Definitions\nYou can pass a `TranslationMapInterface` compliant object to the `DoggoTranslatorConfig` when instantiating to supply new translations on the fly.\n\n#### Word Swaps\nEntire words can be swapped, as expected.\n\n#### Suffix Swaps\nOptionally you can supply 'suffixes' to be swapped at the end of words.\n\n### Importing library\nYou can import the generated bundle to use the whole library generated by this starter:\n\n```typescript\nimport myLib from 'mylib'\n```\n\nAdditionally, you can import the transpiled modules from `dist/lib` in case you have a modular library:\n\n```typescript\nimport something from 'mylib/dist/lib/something'\n```\n\n### Public API\n[TypeDoc Documentation](https://tabuckner.github.io/doggo-translator-ts/)\n\n[translateSentence](https://tabuckner.github.io/doggo-translator-ts/classes/doggotranslator.html#translatesentence)\n\n[getAllLanguageTokens](https://tabuckner.github.io/doggo-translator-ts/classes/doggotranslator.html#getalllanguagetokens)\n\n[setLanguage](https://tabuckner.github.io/doggo-translator-ts/classes/doggotranslator.html#setlanguage)\n\n\u003c!-- ### Excluding peerDependencies\n\nOn library development, one might want to set some peer dependencies, and thus remove those from the final bundle. You can see in [Rollup docs](https://rollupjs.org/#peer-dependencies) how to do that.\n\nGood news: the setup is here for you, you must only include the dependency name in `external` property within `rollup.config.js`. For example, if you want to exclude `lodash`, just write there `external: ['lodash']`.\n\n### Automatic releases\n\n_**Prerequisites**: you need to create/login accounts and add your project to:_\n - [npm](https://www.npmjs.com/)\n - [Travis CI](https://travis-ci.org)\n - [Coveralls](https://coveralls.io)\n\n_**Prerequisite for Windows**: Semantic-release uses\n**[node-gyp](https://github.com/nodejs/node-gyp)** so you will need to\ninstall\n[Microsoft's windows-build-tools](https://github.com/felixrieseberg/windows-build-tools)\nusing this command:_\n\n```bash\nnpm install --global --production windows-build-tools\n```\n\n#### Setup steps\n\nFollow the console instructions to install semantic release and run it (answer NO to \"Do you want a `.travis.yml` file with semantic-release setup?\").\n\n_Note: make sure you've setup `repository.url` in your `package.json` file_\n\n```bash\nnpm install -g semantic-release-cli\nsemantic-release-cli setup\n# IMPORTANT!! Answer NO to \"Do you want a `.travis.yml` file with semantic-release setup?\" question. It is already prepared for you :P\n```\n\nFrom now on, you'll need to use `npm run commit`, which is a convenient way to create conventional commits.\n\nAutomatic releases are possible thanks to [semantic release](https://github.com/semantic-release/semantic-release), which publishes your code automatically on [github](https://github.com/) and [npm](https://www.npmjs.com/), plus generates automatically a changelog. This setup is highly influenced by [Kent C. Dodds course on egghead.io](https://egghead.io/courses/how-to-write-an-open-source-javascript-library)\n\n### Git Hooks\n\nThere is already set a `precommit` hook for formatting your code with Prettier :nail_care:\n\nBy default, there are two disabled git hooks. They're set up when you run the `npm run semantic-release-prepare` script. They make sure:\n - You follow a [conventional commit message](https://github.com/conventional-changelog/conventional-changelog)\n - Your build is not going to fail in [Travis](https://travis-ci.org) (or your CI server), since it's runned locally before `git push`\n\nThis makes more sense in combination with [automatic releases](#automatic-releases) --\u003e\n\n\u003c!-- ### FAQ\n\n#### `Array.prototype.from`, `Promise`, `Map`... is undefined?\n\nTypeScript or Babel only provides down-emits on syntactical features (`class`, `let`, `async/await`...), but not on functional features (`Array.prototype.find`, `Set`, `Promise`...), . For that, you need Polyfills, such as [`core-js`](https://github.com/zloirock/core-js) or [`babel-polyfill`](https://babeljs.io/docs/usage/polyfill/) (which extends `core-js`).\n\nFor a library, `core-js` plays very nicely, since you can import just the polyfills you need:\n\n```javascript\nimport \"core-js/fn/array/find\"\nimport \"core-js/fn/string/includes\"\nimport \"core-js/fn/promise\"\n...\n``` --\u003e\n\n\u003c!-- #### What if I don't want git-hooks, automatic releases or semantic-release?\n\nThen you may want to:\n - Remove `commitmsg`, `postinstall` scripts from `package.json`. That will not use those git hooks to make sure you make a conventional commit\n - Remove `npm run semantic-release` from `.travis.yml`\n\n#### What if I don't want to use coveralls or report my coverage?\n\nRemove `npm run report-coverage` from `.travis.yml` --\u003e\n\n## License\nThis application is released under the [MIT license](https://github.com/Gabbersaurus/DoggoTranslatorCore/blob/master/LICENSE).\n\n## Inspired By\n[DoggoTranslator (core) :dog:](https://gabbersaurus.github.io/DoggoTranslator/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabuckner%2Fdoggo-translator-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftabuckner%2Fdoggo-translator-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabuckner%2Fdoggo-translator-ts/lists"}