{"_id":"@bzk9x/simple-translator","name":"@bzk9x/simple-translator","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bzk9x/simple-translator","version":"1.0.0","description":"A simple and flexible translation utility for both Node.js and browser environments","main":"translator.js","browser":"translator.browser.js","keywords":["translation","i18n","internationalization","language"],"author":{"name":"bzk9x"},"license":"MIT","dependencies":{"js-yaml":"^4.1.0"},"repository":{"type":"git","url":"git+https://github.com/your-username/simple-translator.git"},"_id":"@bzk9x/simple-translator@1.0.0","bugs":{"url":"https://github.com/your-username/simple-translator/issues"},"homepage":"https://github.com/your-username/simple-translator#readme","_nodeVersion":"20.17.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-WOYw/jswbNZiInx9eWzezuyYzPB/FpbsnEZwYGBZFqLqYEh/6AllzTe0gu++XXVWYmgoZXBTArL2NM9CRq9rlQ==","shasum":"099166e971a61aa6ade786f16e1b18f232b5d28d","tarball":"https://registry.npmjs.org/@bzk9x/simple-translator/-/simple-translator-1.0.0.tgz","fileCount":5,"unpackedSize":6239,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGSSg02PAmPiiloPU78XsvrRbR/z4ghkCb5udgdW+PUyAiEAqv7XDFLnR3+WAuXH4HRd/T4dafbNHi2bJ4qJGZq4ZxI="}]},"_npmUser":{"name":"bzk9x","email":"bzk9xx@gmail.com","actor":{"name":"bzk9x","email":"bzk9xx@gmail.com","type":"user"}},"directories":{},"maintainers":[{"name":"bzk9x","email":"bzk9xx@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/simple-translator_1.0.0_1751050918093_0.15844675926284668"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-27T19:01:58.010Z","1.0.0":"2025-06-27T19:01:58.264Z","modified":"2025-06-27T19:01:58.519Z"},"maintainers":[{"name":"bzk9x","email":"bzk9xx@gmail.com"}],"description":"A simple and flexible translation utility for both Node.js and browser environments","homepage":"https://github.com/your-username/simple-translator#readme","keywords":["translation","i18n","internationalization","language"],"repository":{"type":"git","url":"git+https://github.com/your-username/simple-translator.git"},"author":{"name":"bzk9x"},"bugs":{"url":"https://github.com/your-username/simple-translator/issues"},"license":"MIT","readme":"# Simple Translator\r\n\r\nA flexible translation utility that works in both Node.js and browser environments.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @bzk9x/simple-translator\r\n\r\n## Usage\r\n\r\n```js\r\nconst translator = require('@your-username/simple-translator');\r\n\r\n// Initialize with default language\r\ntranslator.init();\r\n\r\n// Or specify a language\r\ntranslator.init({ language: 'fr-FR' });\r\n\r\n// Translate text\r\nconst translated = translator.translate('Hello');\r\n```\r\n\r\n## Browser\r\n\r\n```html\r\n<script src=\"node_modules/@your-username/simple-translator/translator.browser.js\"></script>\r\n<script>\r\n  // Initialize with default language\r\n  TranslationUtil.init();\r\n\r\n  // Or specify a language\r\n  TranslationUtil.init({ language: 'fr-FR' });\r\n</script>\r\n```\r\n\r\n## Config\r\n\r\n```yaml\r\nbasePath: ./resources/langs  # Base directory for language files\r\nfiles:\r\n  languages: languages.json  # The mapping file for language codes\r\n  fallback: en_US.lang      # Default fallback language file\r\n```\r\n\r\n## Language files\r\n\r\n1. languages.json\r\n\r\n```json\r\n{\r\n  \"en-US\": \"en_US.lang\",\r\n  \"es-ES\": \"es_ES.lang\",\r\n  \"fr-FR\": \"fr_FR.lang\"\r\n}\r\n```\r\n\r\n2. Language files (e.g., en_US.lang):\r\n\r\n```lang\r\ngreeting=Hello\r\nwelcome_message=Welcome to our application\r\nfarewell=Goodbye\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License. See the LICENSE file for details.\r\n\r\n","readmeFilename":"README.md","_rev":"1-ba1927da348f2d1261725b2a908f779c"}