{"_id":"@abradley2/elm-i18next-gen","_rev":"3-32d2ad5b81d28767e72faf406c28f236","name":"@abradley2/elm-i18next-gen","dist-tags":{"latest":"2.0.2"},"versions":{"1.0.0":{"name":"@abradley2/elm-i18next-gen","version":"1.0.0","description":"Generate type-safe translations for Elm","main":"index.js","bin":{"elm-i18next-gen":"node_modules/.bin/elm-codegen"},"repository":{"type":"git","url":"git+https://github.com/abradley2/elm-i18next-gen.git"},"author":{"name":"Tony Bradley"},"license":"MIT","bugs":{"url":"https://github.com/abradley2/elm-i18next-gen/issues"},"homepage":"https://github.com/abradley2/elm-i18next-gen#readme","dependencies":{"elm-codegen":"^0.2.0"},"gitHead":"8a5dcbf3e8584aca7434d361920af9a3e6dd7bd1","_id":"@abradley2/elm-i18next-gen@1.0.0","_nodeVersion":"17.2.0","_npmVersion":"8.1.4","dist":{"integrity":"sha512-HYp8wVzSDje7mZbCdWVO8rsV9IRgBjKpQ1eLL0I1V7E7Gi1VwHynw4e9d4TrpkGSP6Ryi7D2Po//CkAMG6u0jw==","shasum":"d4f826426254901afddd0626dd04165138dbee32","tarball":"https://registry.npmjs.org/@abradley2/elm-i18next-gen/-/elm-i18next-gen-1.0.0.tgz","fileCount":14,"unpackedSize":2380637,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIanGhbRyrzS8i8nS5sn60fFkOgc60tWKXidUlK30eKgIgZOh1BEOeS4om8l76BAHzq8YkhiH2lTFrbW11N5Y5xKk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2RBQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmojqw//V1vkDlNxPxPLV1z/3+0AzbXIoHLnUVpPKjgtEzks6RFCjVfw\r\neKFjgUfje4J+aNCM1g33+k++FeB6FteztgclOf10xhEi6oVJZsw3z9pts6Ck\r\nV+pil296bm/DvuXQzCrWTI7b5XJWxfrEExHUpcTw/KAciiycGLA9SRX2OHtn\r\nLb64ypWp/6IPSlZaZa4WGr7P2gTz5P0NboIn40P/bVqqDgrRG9Gl3FYakprB\r\n5Dt7uAn3ovO2ULxnjcR2GLoqR4c8FGIGzLJUZPZoy7Lg+u01W/YXaEU+WYw0\r\n323USe5l0XVuPUtSx+ZPZAjcksMUXo1NM/s6pQmaygThSjJZJ0m1v9QPr/Ux\r\n6d7ca1u8WiYO86grSNl+XAjD7bZpxMQCW2FNLrm4cq1ObQK6Tv9hOnD9x+M5\r\n60wTRw3a/fL15aOiMkMNH+VOvjtRGrI7E99UY1LWu1ivuFq/ad7BiEgLWkOn\r\no6lKzMa6gl9F+mYRdWetqZWlI3kvT81CT9YvkNzC69XPNY+BK8bcTO7cNYWF\r\nToNC+s7vflaTBaRfXea5kHJ67Xp0Kp2taSyVHxBHIKeaSVegMyrHFbzFuefy\r\nfaA/VhLXDkmdr7u4xsHL4LgZJ+NbXUncRKYLWUacDrQgGqB3xhEcu7OsV9oZ\r\nMF9Ymo6FaPYdBKoy8KkhSZokZL90+uMf6AI=\r\n=n6Bb\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"abradley2","email":"antbradley91@gmail.com"},"directories":{},"maintainers":[{"name":"abradley2","email":"antbradley91@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-i18next-gen_1.0.0_1675169872552_0.3949565103152377"},"_hasShrinkwrap":false},"2.0.0":{"name":"@abradley2/elm-i18next-gen","version":"2.0.0","description":"An elm-codegen library for creating type-safe helper methods for the excellent ChristophP/elm-i18next package.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"MIT","dependencies":{"elm-codegen":"^0.5.0","minimist":"^1.2.8"},"gitHead":"9b3adb51dc09f96f94c5c0622cc5711557c95582","_id":"@abradley2/elm-i18next-gen@2.0.0","_nodeVersion":"18.16.0","_npmVersion":"9.7.1","dist":{"integrity":"sha512-kpwOO9f0feivN73FcnR6ybiL1h7rHzYTre6ZXygZYTDvator4biDbZwTXKaI8COokolve15RRdXuEfAPdhprzQ==","shasum":"a727d1e4dbef2751ba202c25d9e246cc3cf2f214","tarball":"https://registry.npmjs.org/@abradley2/elm-i18next-gen/-/elm-i18next-gen-2.0.0.tgz","fileCount":41,"unpackedSize":3014507,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf0WWcvgyGEHVMniTpR57ZWOKDre7oV/2We1rBBAec3QIhAMFOJoGbrMLiuxCqF8CeLDK7RgSyvRgGXaE5oEAV7ML/"}]},"_npmUser":{"name":"abradley2","email":"antbradley91@gmail.com"},"directories":{},"maintainers":[{"name":"abradley2","email":"antbradley91@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-i18next-gen_2.0.0_1693399790692_0.6725588048456954"},"_hasShrinkwrap":false},"2.0.1":{"name":"@abradley2/elm-i18next-gen","version":"2.0.1","description":"An elm-codegen library for creating type-safe helper methods for the excellent ChristophP/elm-i18next package.","main":"index.js","bin":{"elm-i18next-gen":"index.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"MIT","dependencies":{"elm-codegen":"^0.5.0","minimist":"^1.2.8"},"gitHead":"0b76aa6bdf292b3d62e19c3b8143d8d78dc9d1b9","_id":"@abradley2/elm-i18next-gen@2.0.1","_shasum":"e7c0fcb8e5da72838ec305c4275fff545177a2d8","_from":".","_npmVersion":"2.15.12","_nodeVersion":"18.16.0","_npmUser":{"name":"abradley2","email":"antbradley91@gmail.com"},"dist":{"shasum":"e7c0fcb8e5da72838ec305c4275fff545177a2d8","tarball":"https://registry.npmjs.org/@abradley2/elm-i18next-gen/-/elm-i18next-gen-2.0.1.tgz","integrity":"sha512-D1YfjOzqGuYzuYUXebYp7bmCqZj3T2vJrNXGI0D/g0WH6b6BTSNxFytEYo7vMJrZz7qd7qDi8F+7VatxLBJMgQ==","fileCount":43,"unpackedSize":3033426,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHkeZ9tduloNxuPYDTQvrGkEMFc5Y2ncT4oIbXowwfSkAiAZg3t5K0OvgXg2T2CCVHgjcyF7cM13FX4rusHpSqI/jg=="}]},"directories":{},"maintainers":[{"name":"abradley2","email":"antbradley91@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-i18next-gen_2.0.1_1693400122732_0.5647777470162327"},"_hasShrinkwrap":false},"2.0.2":{"name":"@abradley2/elm-i18next-gen","version":"2.0.2","description":"An elm-codegen library for creating type-safe helper methods for the excellent ChristophP/elm-i18next package.","main":"index.js","bin":{"elm-i18next-gen":"index.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"MIT","dependencies":{"elm-codegen":"^0.5.0","minimist":"^1.2.8"},"gitHead":"2f0f17fff4a3602f96c7c413aa1541ae25218816","_id":"@abradley2/elm-i18next-gen@2.0.2","_nodeVersion":"18.16.0","_npmVersion":"9.7.1","dist":{"integrity":"sha512-RL1o/NW9i/ibZtjwaB/znEu6F4QqTS/FizYYXmLGlLhLkTDEF8fh8tlsiC/MG0Upx7TmmIN6bhwIkRSvbwJJuA==","shasum":"77bd271669782365ab47e218ab026db56cdf7d2a","tarball":"https://registry.npmjs.org/@abradley2/elm-i18next-gen/-/elm-i18next-gen-2.0.2.tgz","fileCount":41,"unpackedSize":3014549,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmgpwld0GrvwJoJeQhtEt3Am9Zs20gbAYY+VX3aufURQIgQm+5NxCIBj3ncu1JZYD5McoJ0mdMClfg356dhghf1jg="}]},"_npmUser":{"name":"abradley2","email":"antbradley91@gmail.com"},"directories":{},"maintainers":[{"name":"abradley2","email":"antbradley91@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-i18next-gen_2.0.2_1693400701122_0.9334993195854546"},"_hasShrinkwrap":false}},"time":{"created":"2023-01-31T12:57:52.455Z","1.0.0":"2023-01-31T12:57:52.777Z","modified":"2023-08-30T13:05:01.609Z","2.0.0":"2023-08-30T12:49:50.913Z","2.0.1":"2023-08-30T12:55:23.012Z","2.0.2":"2023-08-30T13:05:01.438Z"},"maintainers":[{"name":"abradley2","email":"antbradley91@gmail.com"}],"description":"An elm-codegen library for creating type-safe helper methods for the excellent ChristophP/elm-i18next package.","license":"MIT","readme":"# Elm I18Next Code Generation\n\nAn [elm-codegen](https://github.com/mdgriffith/elm-codegen) library for creating type-safe helper methods\nfor the excellent [ChristophP/elm-i18next](https://package.elm-lang.org/packages/ChristophP/elm-i18next/latest/)\npackage.\n\nIf you have a large Elm application in a business setting, you should strongly consider supporting internationalization\neven if you aren't considering adding extra languages to your app. Your project manager who would much rather change a line\nin a JSON file than put another 1-point ticket into your sprint will thank you for it.\n\n## Elm Codegen Usage\n\n\nIn your project that consumes the generated code, you should `elm install ChristophP/elm-i18next`. \nThis library generates code for usage with `ChristophP/elm-i18next`.\n\n```\nnpx @abradley2/elm-i18next-gen --output=generated --translations=relative/path/to/translations.json\n```\n\nThis will create a directory \"generated\" containing a `Language.elm` file and a `Translations.elm`\nfile, along with `Translations` sub modules based on the structure of your translations file.\n\nA translations file like should look something like this, \nconforming to the [I18Next V2 specification](https://www.i18next.com/misc/json-format#i18next-json-v2):\n```json\n{\n   \"general greeting\": \"Hello there\",\n   \"personal greeting\": \"Hello {{name}}\"\n}\n```\n\nThis will generate the following:\n\n```elm\ngeneralGreeting : List I18Next.Translations -> String\ngeneralGreeting translations =\n    I18Next.tf translations \"generalGreeting\"\n\n\npersonalGreeting : List I18Next.Translations -> { name : String } -> String\npersonalGreeting translations replacements =\n    I18Next.trf\n        translations\n        I18Next.Curly\n        \"personalGreeting\"\n        [ ( \"name\", replacements.name ) ]\n\n```\n\n-and a default implementation of `I18Next.Translations` in the sibling `Language.elm` module.\n\n```elm\ndefaultLanguage : I18Next.Translations\ndefaultLanguage =\n    I18Next.fromTree\n         [ ( \"\"\n           , I18Next.object \n                [ ( \"generalGreeting\", I18Next.string \"Hello there\" ) \n                , ( \"personalGreeting\", I18Next.string \"Hello {{name}}\" )\n                ]\n           )\n         ]\n```\n\nYou can also nest translations by page as the [I18Next V2 specification](https://www.i18next.com/misc/json-format#i18next-json-v2) allows.\n```\n{\n   \"home\": { ... },\n   \"login\": { ... }\n}\n```\n\nThis will create the sub-modules in the `Translations` directory.\n\n## Recommended Pattern\n\nIt is recommended that you only run this codegen for a single default language. Part of the output\nincludes a `defaultLanguage` export of the `I18Next.Translations` type. For all your translations\nthat are not part of your default language, use `I18Next.translationsDecoder` as you normally would.\n\n## Thanks\n\nThis library is largely based upon the work done by [Yoni Gibbs](https://github.com/yonigibbs) \non [elm-i8next-gen](https://github.com/yonigibbs/elm-i18next-gen)\n","readmeFilename":"README.md"}