{"_id":"@domoinc/i18n","_rev":"40-59fceacb0a4c07c9a1653468a915065a","name":"@domoinc/i18n","dist-tags":{"latest":"2.1.3"},"versions":{"2.0.1":{"name":"@domoinc/i18n","version":"2.0.1","_id":"@domoinc/i18n@2.0.1","maintainers":[{"name":"morganjohn12","email":"morganjohn12@gmail.com"}],"dist":{"shasum":"a81b37da92e96f61fc6e21e65cc5f1a7dd35610a","tarball":"https://registry.npmjs.org/@domoinc/i18n/-/i18n-2.0.1.tgz","integrity":"sha512-H8+EhIBmtzfFXyPkblDJb01JHrjgKHUhzAmX8oj1ZZqEOL5MMxQhsbwtXibHYz6NH/CgokclA29HRw6YEznQiA==","signatures":[{"sig":"MEUCIAsYuRiIjKAXO9WoTuIUy0A9iTSYOxwQ80iMP5BOcz+mAiEA2VaDrpzZLzaYM/k1FnB/rI5vlVBOxdKP/sXwkezSAaM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/bundle.js","_from":".","_shasum":"a81b37da92e96f61fc6e21e65cc5f1a7dd35610a","gitHead":"b69e95975d6eff985b638ecd6f85bfd57262042b","scripts":{},"_npmUser":{"name":"morganjohn12","email":"morganjohn12@gmail.com"},"_npmVersion":"3.3.6","description":"Light-weight Internationalization library for client-side projects.","directories":{},"_nodeVersion":"5.0.0","dependencies":{},"devDependencies":{"grunt":"^0.4.2","request":"^2.40.0","shelljs":"^0.2.6","webpack":"^1.12.12","grunt-notify":"^0.3.0","grunt-prompt":"^1.1.0","grunt-markdox":"^1.2.1","grunt-release":"^0.13.0","grunt-webpack":"^1.0.11","grunt-autoshot":"^0.2.1","jshint-stylish":"^0.1.5","grunt-port-pick":"^1.5.0","load-grunt-tasks":"^3.4.0","grunt-jsbeautifier":"^0.2.7","webpack-dev-server":"^1.14.1","grunt-contrib-watch":"^0.5.3","grunt-contrib-concat":"^0.3.0","grunt-contrib-jshint":"^0.7.2","grunt-contrib-uglify":"^0.2.7","grunt-contrib-connect":"^0.7.1","grunt-conventional-changelog":"^5.0.0"}},"2.1.0":{"name":"@domoinc/i18n","version":"2.1.0","_id":"@domoinc/i18n@2.1.0","maintainers":[{"name":"aharris88","email":"aharris88@gmail.com"},{"name":"jaxry","email":"cabot696@gmail.com"},{"name":"jmstewart","email":"james.stewart42@gmail.com"},{"name":"jonathan-law","email":"jonathan.q.law@gmail.com"},{"name":"morganjohn12","email":"morganjohn12@gmail.com"},{"name":"nicksrandall","email":"nicksrandall@gmail.com"}],"dist":{"shasum":"20cdfa3ce5d76301d75017d21a841b65d3b64e50","tarball":"https://registry.npmjs.org/@domoinc/i18n/-/i18n-2.1.0.tgz","integrity":"sha512-/iuXep5KXoy33944iIQIwWWvQWzcL3mzgaXynREUKDIoyTmr6+5Ki6pDwpnLkS5DkLuTlkae7koOlA+5GcbTag==","signatures":[{"sig":"MEYCIQCDxkiNhBUEiGp+MppmpUNKb4VKJxUnrJOXbMWrlV5KXgIhAMDKZdnhFMNdHOdEyTxNnzXHuF//ytth0v4BsB6dETRO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/bundle.js","_from":".","_shasum":"20cdfa3ce5d76301d75017d21a841b65d3b64e50","gitHead":"1a0735a0f002abfb5612582b23bfa02b9a737fde","scripts":{},"_npmUser":{"name":"morganjohn12","email":"morganjohn12@gmail.com"},"_npmVersion":"3.3.6","description":"Light-weight Internationalization library for client-side projects.","directories":{},"_nodeVersion":"5.0.0","dependencies":{},"devDependencies":{"grunt":"^0.4.2","request":"^2.40.0","shelljs":"^0.2.6","webpack":"^1.12.12","grunt-notify":"^0.3.0","grunt-prompt":"^1.1.0","grunt-markdox":"^1.2.1","grunt-release":"^0.13.0","grunt-webpack":"^1.0.11","grunt-autoshot":"^0.2.1","jshint-stylish":"^0.1.5","grunt-port-pick":"^1.5.0","load-grunt-tasks":"^3.4.0","grunt-jsbeautifier":"^0.2.7","webpack-dev-server":"^1.14.1","grunt-contrib-watch":"^0.5.3","grunt-contrib-concat":"^0.3.0","grunt-contrib-jshint":"^0.7.2","grunt-contrib-uglify":"^0.2.7","grunt-contrib-connect":"^0.7.1","grunt-conventional-changelog":"^5.0.0"}},"2.1.1":{"name":"@domoinc/i18n","version":"2.1.1","license":"SEE LICENSE IN LICENSE","_id":"@domoinc/i18n@2.1.1","maintainers":[{"name":"aharris88","email":"aharris88@gmail.com"},{"name":"jaxry","email":"cabot696@gmail.com"},{"name":"jmstewart","email":"james.stewart42@gmail.com"},{"name":"jonathan-law","email":"jonathan.q.law@gmail.com"},{"name":"morganjohn12","email":"morganjohn12@gmail.com"},{"name":"nicksrandall","email":"nicksrandall@gmail.com"}],"dist":{"shasum":"bf5874402b1e980ee237945b1d94be34bc796272","tarball":"https://registry.npmjs.org/@domoinc/i18n/-/i18n-2.1.1.tgz","integrity":"sha512-YWazXsiPaoSMGNJboMf4sMApHRQ7IoFp73pzDLKPdMqHPDyYhPTGMQAqTryX0q48L0pk0kSfwU6e3aHVH5OPjw==","signatures":[{"sig":"MEYCIQCRn7KjdiQIjWSBSFHYTTfwcKKQnQy7fm5lj6srNEXqtQIhAKyMtk3qIHNOISnYqoyrGC6U5F5U5hYXU+Whvd0uC5Hm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/bundle.js","_from":".","_shasum":"bf5874402b1e980ee237945b1d94be34bc796272","gitHead":"04716557971efa205ef48e978a3f52b6d53fdf68","scripts":{},"_npmUser":{"name":"jmstewart","email":"james.stewart42@gmail.com"},"_npmVersion":"3.3.12","description":"Light-weight Internationalization library for client-side projects.","directories":{},"_nodeVersion":"5.4.1","dependencies":{},"devDependencies":{"grunt":"^0.4.2","request":"^2.40.0","shelljs":"^0.2.6","webpack":"^1.12.12","grunt-notify":"^0.3.0","grunt-prompt":"^1.1.0","grunt-markdox":"^1.2.1","grunt-release":"^0.13.0","grunt-webpack":"^1.0.11","grunt-autoshot":"^0.2.1","jshint-stylish":"^0.1.5","grunt-port-pick":"^1.5.0","load-grunt-tasks":"^3.4.0","grunt-jsbeautifier":"^0.2.7","webpack-dev-server":"^1.14.1","grunt-contrib-watch":"^0.5.3","grunt-contrib-concat":"^0.3.0","grunt-contrib-jshint":"^0.7.2","grunt-contrib-uglify":"^0.2.7","grunt-contrib-connect":"^0.7.1","grunt-conventional-changelog":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/i18n-2.1.1.tgz_1454374849899_0.5753359666559845","host":"packages-9-west.internal.npmjs.com"}},"2.1.2":{"name":"@domoinc/i18n","version":"2.1.2","license":"SEE LICENSE IN LICENSE","_id":"@domoinc/i18n@2.1.2","maintainers":[{"name":"aharris88","email":"aharris88@gmail.com"},{"name":"jaxry","email":"cabot696@gmail.com"},{"name":"jmstewart","email":"james.stewart42@gmail.com"},{"name":"jonathan-law","email":"jonathan.q.law@gmail.com"},{"name":"morganjohn12","email":"morganjohn12@gmail.com"},{"name":"nicksrandall","email":"nicksrandall@gmail.com"}],"dist":{"shasum":"a87c2f5f2f223e1c35bfb167b8a28839dfc8d48a","tarball":"https://registry.npmjs.org/@domoinc/i18n/-/i18n-2.1.2.tgz","integrity":"sha512-IRvvClsV33jrKUpr1Np5oO5nkmHRgn9L+XgRmJVdh+XQgPpC+v2PD91qzhcne1tQkjMGtURJ/MMHSj9ujPGXcw==","signatures":[{"sig":"MEQCIFTGHzWMUs817U3/6NJGBTIY9PmPDG8Klj4BlNZ/HFP7AiA2o4UEG7RXUfK+CF1zDTwOeT9Ur7mqpfCXbmKn76yz1w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"dist/bundle.js","_from":".","_shasum":"a87c2f5f2f223e1c35bfb167b8a28839dfc8d48a","gitHead":"8ee842950479fd3ab981b39b6a7a61a4eb5c032d","scripts":{},"_npmUser":{"name":"jmstewart","email":"james.stewart42@gmail.com"},"_npmVersion":"3.6.0","description":"Light-weight Internationalization library for client-side projects.","directories":{},"_nodeVersion":"5.6.0","dependencies":{},"devDependencies":{"grunt":"^0.4.2","request":"^2.40.0","shelljs":"^0.2.6","webpack":"^1.12.12","grunt-notify":"^0.3.0","grunt-prompt":"^1.1.0","grunt-markdox":"^1.2.1","grunt-release":"^0.13.0","grunt-webpack":"^1.0.11","grunt-autoshot":"^0.2.1","jshint-stylish":"^0.1.5","grunt-port-pick":"^1.5.0","load-grunt-tasks":"^3.4.0","grunt-jsbeautifier":"^0.2.7","webpack-dev-server":"^1.14.1","grunt-contrib-watch":"^0.5.3","grunt-contrib-concat":"^0.3.0","grunt-contrib-jshint":"^0.7.2","grunt-contrib-uglify":"^0.2.7","grunt-contrib-connect":"^0.7.1","grunt-conventional-changelog":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/i18n-2.1.2.tgz_1455742011546_0.3545023298356682","host":"packages-9-west.internal.npmjs.com"}},"2.1.3":{"name":"@domoinc/i18n","version":"2.1.3","license":"SEE LICENSE IN LICENSE","_id":"@domoinc/i18n@2.1.3","maintainers":[{"name":"aharris88","email":"aharris88@gmail.com"},{"name":"jaxry","email":"cabot696@gmail.com"},{"name":"jmstewart","email":"james.stewart42@gmail.com"},{"name":"jonathan-law","email":"jonathan.q.law@gmail.com"},{"name":"morganjohn12","email":"morganjohn12@gmail.com"},{"name":"nicksrandall","email":"nicksrandall@gmail.com"}],"dist":{"shasum":"e842969b60d827926d8d7be024eab5d953c2f872","tarball":"https://registry.npmjs.org/@domoinc/i18n/-/i18n-2.1.3.tgz","integrity":"sha512-2SkWLDMLNroDIQqK2+hl7q+0U1S+xN1KOU3TnkRpUKA5KlSGe1+aeqlvYEuqEK2A49n2ZXOy28huvRPQ+qm3Bg==","signatures":[{"sig":"MEUCIESQeuK83Bw+uxxmaQkj6JpVNnaqoLE7BW2JNb80ovZWAiEA6kkQs7oEuQuBSNeDAfJILNKyhnc2pLB8ZTIkpniLofE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzxIiCRA9TVsSAnZWagAAcBoP/RTQvPo4lCt6a+6UFUiY\nbHzJtVYL3Bu4uWVW7kH/ER5GYJjRVnPRsvmWCPlOzzv6Z5n14gswmOqmTf1d\naNriSvLnXaG9MndD41wpPiLJfGRgbm9nzdsYmGuoE1DTxqKhwn8IyMfL6df9\nRW92I2fPP9YasCndk07Ao1lP9AchkGC/esHrDiK7l4Ml953Sw2BEOd9Zuf/b\nI9w4wrhzW98wIWjl6kRpNfrXFRscTJGEZ7VM/7AmxKDAxeEL6KJxv/nU1peN\ncbGmlLqbgYCQ+Mrk7yKiWlYRfCSWgdCcdMcOwweV5sn35rkezTvowWB9l829\n5sXv9rGUe8h7LgBdIht5nIvdQ2TqGRqnBT5Pnkn9nIGqJiby4vaU2u0PwHNg\n32xJxrWHy+0OsOWdYu8O5LLZbAtq1tgdVl0YqlVPMNKpu/Url/AuDxqIQMAO\nZ7nVDSVFX4euQHPRUJvcDo5h/7VzdVRxOhC6l0DHMcxwISA8OAyLiO1cKzTt\nvw9A+EajFH//Qqg5JRI6mYDsfmJHhPSHX74qZWH6xF/tXWwN+N/3bEH+GJiu\nx44C8xBEVtd8Gag/YBdxyUVXTGK5xlR3pLnTYnXoVPdqwzhOVrAAnfWbqNi0\nINJD2tjaZMEfnvd1rQLfCUm4g9V1GN8zzAquQRdIo3p0C/yODnNIFCLcZPtS\no8pJ\r\n=5DaD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/bundle.js","_from":".","_shasum":"e842969b60d827926d8d7be024eab5d953c2f872","gitHead":"7ed2e21fe3a1c19a9c84a5a41fae0b691f92fb11","scripts":{},"_npmUser":{"name":"jmstewart","email":"james.stewart42@gmail.com"},"_npmVersion":"3.6.0","description":"Light-weight Internationalization library for client-side projects.","directories":{},"_nodeVersion":"5.6.0","dependencies":{},"devDependencies":{"grunt":"^0.4.2","request":"^2.40.0","shelljs":"^0.2.6","webpack":"^1.12.12","grunt-notify":"^0.3.0","grunt-prompt":"^1.1.0","grunt-markdox":"^1.2.1","grunt-release":"^0.13.0","grunt-webpack":"^1.0.11","grunt-autoshot":"^0.2.1","jshint-stylish":"^0.1.5","grunt-port-pick":"^1.5.0","load-grunt-tasks":"^3.4.0","grunt-jsbeautifier":"^0.2.7","webpack-dev-server":"^1.14.1","grunt-contrib-watch":"^0.5.3","grunt-contrib-concat":"^0.3.0","grunt-contrib-jshint":"^0.7.2","grunt-contrib-uglify":"^0.2.7","grunt-contrib-connect":"^0.7.1","grunt-conventional-changelog":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/i18n-2.1.3.tgz_1455742910766_0.8541875910013914","host":"packages-6-west.internal.npmjs.com"}}},"time":{"created":"2016-01-26T21:50:19.142Z","modified":"2026-02-27T17:24:20.360Z","2.0.1":"2016-01-26T21:50:19.142Z","2.1.0":"2016-01-26T21:51:53.439Z","2.1.1":"2016-02-02T01:00:50.556Z","2.1.2":"2016-02-17T20:46:53.795Z","2.1.3":"2016-02-17T21:01:55.429Z"},"license":"SEE LICENSE IN LICENSE","description":"Light-weight Internationalization library for client-side projects.","maintainers":[{"email":"trevor.tingey@domo.com","name":"ttingey"},{"email":"morganjohn12@gmail.com","name":"morganjohn12"},{"email":"jeff.smith@domo.com","name":"jeff.smith"},{"email":"cgrieb9@gmail.com","name":"congrieb"},{"email":"spencer@myweb-host.net","name":"th3uiguy"},{"email":"jason.hansen@domo.com","name":"domo_json"},{"email":"jon.tiritilli@domo.com","name":"jontiritilli-domo"}],"readme":"# i18n\nLight-weight Internationalization library for client-side projects.\n\n[documentation](https://git.empdev.domo.com/pages/AppTeam6/i18n/)\n\n## What is i18n?\ni18n is the short-hand for the word \"internationalization\". There are exactly 18 letters between the first and last letter of the word, hence i18n. Likewise, L10n is the short-hand for the word \"Localization\".\n\n>  `i18n` should always be referenced with a lowercase `i`because a capital `I` looks too much like a `1` (one). \n\n>  `L10n` should always be referenced with a capital `L`because a lowercase `l` looks too much like a `1` (one). \n\n>  The term 'internationalization' or 'i10n' refers to the master process while 'localization' refers to a specific implementation of internationalization. In other words, i18n is the recipe and L10n is the cookies. \n\n## Philosophy\nThis library has been developed with the following requirements in mind:\n\n* **IE9+ Browser Compatibility** - We've committed to support any major browser released after IE9.\n* **No Dependancies** - Everything is written in vanilla javascript with exception of dates (we're using moment.js).\n* **Don't Reinvent the Wheel** - We're using we'll documented, native JS methods such as `toLocaleString()` as much as possible.\n\n### Supported Use Cases\n\n* **Number Formatting** - ex. 1000 --> 1,000\n* **Currency Formatting** - ex. 1000.35 --> $1,000.35\n* **Percentage Formatting** - ex 0.35 --> 35%\n* **Summary Numbers** - ex 1242.4 > 1.242K\n* **String Translations** - ex. \"Hello World\" --> \"Hallo Welt\"\n* **Image Switching** \n\n### What about dates?\nI've not yet implemented a solution for dates. In accordance with the 'don't reinvent the wheel' philosophy, I figure that any time we're dealing with dates, we're probably going to be pulling in a date library to help. In my experience, nobody likes dealing with javascript dates directly . Most (good) date libraries have internationalization built in. For more info:\n\n* [Moment.js](http://momentjs.com/docs/#/i18n/)\n* [Date.js](https://github.com/abritinthebay/datejs)\n\n\n## Usage\nThe `i18n` object will be a global variable that you can use to help you localize your project. More documentation coming soon. \n\n### Methods\n```\n// L for language. This is the current language getter/setter. \ni18n.l('en-us')\n\n// C for currency. This is the current currency getter/setter. \ni18n.c('USD')\n\n// TODO: Gets language setting from server, its the most accurate place to get it. \ni18n.getLanguage()\n\n// TODO: Gets currency setting from server.\ni18n.getCurrency()\n\n// Truncates a string to a specified number of characters. \ni18n.trunc('string', 5, true)\n\n// Fetches the translation file and then executes a callback function.\ni18n.init(callback)\n\n// T for translate. This will return a specified translation.\ni18n.t('dot.notation')\n\n// Returns a summarized number like '152.3K'.\ni18n.summaryNumber(number)\n\n// Return the number and magnitude of number as an object.\ni18n.summaryNumberToObject(number)\n\n// Converts summary number back to actual number.\ni18n.reverseSummaryNumber('123K')\n```\n\n### Variables\n```\n// the current currency symbol\ni18n.$ = \"$\";\n\n/******************************************\nI STRONGLY SUGGEST YOU DON'T USE THESE:\n******************************************/\n// the current language code\ni18n.defaultLanguage\n\n// the current currency code\ni18n.defaultCurrency\n```\n\n### Shim `toLocaleString()`\nThe `toLocaleString()` is a very powerful method on the number prototype in JavaScript. The only bad thing is that it's not fully implemented in Safari. I've created a shim (that follows the documented spec perfectly) so that it will work on any browser. Please, read the docs and learn how to incorporate this into your projects. \n\n[MDN - toLocaleString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString)\n\n## Notes\n### What works\nBasically, everything except the translation piece. Getting the user's settings from product and/or server are also not ready yet so you'll have to hard code those values for now. \n### Needed Product Features\n1. Get locale settings exposed from product.\n2. A place to host language files. This probably won't happen until we get Mason v1.\n\n### TODO\n1. Finish the shim. \n2. Test, Test, and Retest.","readmeFilename":"README.md"}