{"_id":"@braw/vue-intl-controller","_rev":"19-fd43a8f80075b21d584deb9df26a5146","name":"@braw/vue-intl-controller","dist-tags":{"latest":"4.0.0","rc":"4.0.0-rc.7"},"versions":{"1.0.0":{"name":"@braw/vue-intl-controller","version":"1.0.0","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue2"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs","types":"./dist/index.d.ts"},"./types/arguments":{"import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs","types":"./dist/types/arguments.d.ts"},"./events":{"import":"./dist/events/index.mjs","require":"./dist/events/index.cjs","types":"./dist/events/index.d.ts"},"./plugin":{"import":"./dist/plugin.mjs","require":"./dist/plugin.cjs","types":"./dist/plugin.d.ts"},"./controller":{"import":"./dist/controller.mjs","require":"./dist/controller.cjs","types":"./dist/controller.d.ts"},"./components":{"import":"./dist/components.mjs","require":"./dist/components.cjs","types":"./dist/components.d.ts"},"./sources/*":{"import":"./dist/sources/*.mjs","require":"./dist/sources/*.cjs","types":"./dist/sources/*.d.ts"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build && pnpm run test","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.7","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.12","del-cli":"^5.0.0","eslint":"^8.30.0","prettier":"^2.8.1","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^19.0.5","typescript":"^4.9.4","unbuild":"^1.0.2","vitest":"^0.26.2"},"dependencies":{"@braw/async-computed":"^4.0.1","@braw/extended-intl":"^1.0.0","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^2.7.14"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"gitHead":"b9e3d3ac2edb20de713ef573deb99f582f1ef85a","_id":"@braw/vue-intl-controller@1.0.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-nzep8b9xQPQgfkQPcgNZJvbR/DI4Ub5XQoDHGaYysbhRcwEPI/99WoU0OCNzx0EEnNkNhtq+K5hv8w2OPgyG7A==","shasum":"ec7ce224379d2d43f2a3b49cd21d1607ca1e44bc","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-1.0.0.tgz","fileCount":42,"unpackedSize":139038,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDq/UR9EVf102bvBf+czcUZTsyRhfHRnvAKPJd7lt5zBAiBMnRF6gfiLiX4YA8iOjhCfpDr9+X6Gi/omwm+dnXbdoQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtKMpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQ7A/+NzuRNW00Wefk+fNPrmcBottXOALjrfauPVJIryYVlbppUsH9\r\nFxh3JdoebduM+0eHP3BmbNqegjmKyqUbrOYoVIH5jGFNDs7/uzj1CkwHqBaW\r\nEixYFMk/zLq7BAMhNlKY6PhJZfMJgihy/eGYr8B395BVFjeaFVSbueV0ZojV\r\nn/DLgkhdYFWGGKe1IIwWobaSrgfbFXaRjeTTcbGjRv57EYbfeSAJrG8N7BSs\r\n5STyIQGXypPlBuuirymS0OgTSprNJum1b2bucozHitSc4x3wrU8x7ujLMEM7\r\nwNjVq7eaw5aZkRceaUZYWIlIu9ZXlOjbKZEWDhP389JUuOgZEmEMtzGpf5JQ\r\nf/UH9kf5mRY/ii9RkTCL8dBU0Zr4ZGCr2MGyj5dnR6tb4mbeq1pnCa9oDPvJ\r\n9PUPnHJIdsPJOOkhN2ylP36PihYOf20BlbntUkGBOWcn7/uc1teaULAHgnvA\r\nycsb6tkSxUzkN5/zdBU1vTVBO0vaGdM2Ecx8OPYDkrT6ZAJENgeoZtNydC6t\r\nnokEBSVnkZMfpf+HIFX/r9R+Ih7j1Ru/K32tEJ9Ag3XNZ307vNxFGGE7AED+\r\n33FrbE6BO+gt19ggJ+zByPqtvvDxwfAwq5Tayxogp04K6aSV3DS6lq9Yr5Wv\r\nCsEsKXcl0qzIIEETqYHqHcdHynwa5VZ96w4=\r\n=1u2P\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_1.0.0_1672782633567_0.5525132574511125"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"1.0.1":{"name":"@braw/vue-intl-controller","version":"1.0.1","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue2"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs","types":"./dist/index.d.ts"},"./types/arguments":{"import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs","types":"./dist/types/arguments.d.ts"},"./events":{"import":"./dist/events/index.mjs","require":"./dist/events/index.cjs","types":"./dist/events/index.d.ts"},"./plugin":{"import":"./dist/plugin.mjs","require":"./dist/plugin.cjs","types":"./dist/plugin.d.ts"},"./controller":{"import":"./dist/controller.mjs","require":"./dist/controller.cjs","types":"./dist/controller.d.ts"},"./components":{"import":"./dist/components.mjs","require":"./dist/components.cjs","types":"./dist/components.d.ts"},"./sources/*":{"import":"./dist/sources/*.mjs","require":"./dist/sources/*.cjs","types":"./dist/sources/*.d.ts"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build && pnpm run test","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.7","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.12","del-cli":"^5.0.0","eslint":"^8.30.0","prettier":"^2.8.1","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^19.0.5","typescript":"^4.9.4","unbuild":"^1.0.2","vitest":"^0.26.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^1.0.0","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^2.7.14"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"gitHead":"523675f055f95dd3e33146c3bd5921fe4835fb0a","_id":"@braw/vue-intl-controller@1.0.1","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-sMrR7V4Yf9HWYJY+HBprZwoDQz6VEGhnnE7L4avu6j0vV/YP4SKogG6ClovdJCN4cDxlPxrREGkXQgHblFtUTQ==","shasum":"a5403036cd7e2749249a58801af4778797b57343","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-1.0.1.tgz","fileCount":42,"unpackedSize":138475,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQC4o5Exsbwkp9LnGhrgLSccQRCfI9DhTiNjJhH9Vw18AQIfe7rYVMY2XJMO9db7wG0JjAXciXEUwslm4B9ajwPYrA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtMZZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQKg/+KZs3d5nzduHrkGed5T4mYCjoNcxWxh1k4BWr/RkhChWQiPCU\r\nSaHWAb7LfhP4jYwsG82C4vmyw2UrbCht5Uz0QyBNSQK5J8ji4hJ2iYfUJudL\r\ned40t53I7d8OHM07OQkFBJ463t0yABMbbOP4YvCXywyo1LulfFGl/qYZ7uPl\r\ndpRRJVgH3E6/dqh6zyMe+0R2LGuNseDbE99VwiDdtiphkyBcp1NHqa6hzjK9\r\nIVQUSFRB1Mocq5z8tIA5TX5c7RJwO+uOdhm7bOe8ANXHhL2GuB/Rgtb/8bXY\r\n4D+PRwE3eVgu5LkjBpi9U2wc9VPuJ8h8RgKrFvnFzmS3aVkpLWXzPIVgAVR+\r\n/B4M4okheAsFBINw+tbJhDm1/jLJGHf1dMwB9Rrl/zNASymmdasjtHCjZE+w\r\n6LNkNHdMn3SF5Ghge9nkwTKE4hYTEd5HJxsNqfuCdiHvtERtRiJOC5A+HOej\r\n5z1NrrnQCPOzTFVvGurCSlLDKbiDejIgL7gi7CKls1lsefsrgNZWkqn0nrUA\r\nSlrnvZbwDe2RFcUa018k+7meI2AxPE9HecOdwE8DNza53XIzkZC1tbAAlQil\r\nUjLVn4eEbVAMyUEo71aek4dG6QGzNkzDUv+rgGFtRw7t2hkpEj1dvjqhpgIF\r\nCnMe2IUZtCHh4l9HPSuKnsZgKhFzAEa+cYo=\r\n=lscL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_1.0.1_1672791641100_0.9543842991595426"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"1.1.0":{"name":"@braw/vue-intl-controller","version":"1.1.0","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue2"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs","types":"./dist/index.d.ts"},"./types/arguments":{"import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs","types":"./dist/types/arguments.d.ts"},"./events":{"import":"./dist/events/index.mjs","require":"./dist/events/index.cjs","types":"./dist/events/index.d.ts"},"./plugin":{"import":"./dist/plugin.mjs","require":"./dist/plugin.cjs","types":"./dist/plugin.d.ts"},"./controller":{"import":"./dist/controller.mjs","require":"./dist/controller.cjs","types":"./dist/controller.d.ts"},"./components":{"import":"./dist/components.mjs","require":"./dist/components.cjs","types":"./dist/components.d.ts"},"./sources/*":{"import":"./dist/sources/*.mjs","require":"./dist/sources/*.cjs","types":"./dist/sources/*.d.ts"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build && pnpm run test","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.7","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.12","del-cli":"^5.0.0","eslint":"^8.30.0","prettier":"^2.8.1","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^19.0.5","typescript":"^4.9.4","unbuild":"^1.0.2","vitest":"^0.26.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^1.0.0","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^2.7.14"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"gitHead":"ccb674ed7616b6f232edae383d102c005a64fe97","_id":"@braw/vue-intl-controller@1.1.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-wWyVyi7aul92wlHDjqL5TRWeM9u5xbL4iQnLlNjOSnsvtEE2ykSb2ouXAtIcTElkV9F6+TvqHkEaO+ki+u8EBg==","shasum":"9c4e6dd74b323c64a1e3d5e1fe7b7eb61e9847e9","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-1.1.0.tgz","fileCount":42,"unpackedSize":149957,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyWQyOETz4Zz5va0vxQfqxpxOSfccVTjkc/cTdl7OvzQIhALzusC19QuRSdFYQiY8COHlHg+61EaW7A1S5X9vuoOM1"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjt46wACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpP1A/9Hlj2/h2IHNAUod+oqcZwacRiGeAFiPmiJ7e/uJR6TvbkyF9e\r\n5Gg5Nk7VWgYTLjnXi3DC/5xy9epUiBAWlXvcJ5MDLE3WH2qkkS2RvPtwYhNo\r\nPwSqrLqpJNmU7yYwQ4gxoPthAM0mSOKulNGbCB1clgHnNS/ghiPCx7gQW8OH\r\nLrWHYfWt7IlJBEtasck8oA5qc7LwSPsOBzroq+0nBvtPUohKQQC4xHZP+tR5\r\nAqjrnEuCIfERtSdWGPf1XMC3TEluVxk9Lvr5KWTAiR+hQLue3zVX0NFuU40Y\r\nN+sn0x7XT/JwG1P50jfc9PRl6G96Ft2wZTA0yJCNtKGlo+wJFtHnXEOIgoMy\r\nEDxWnsMpOA/Ub+R+OOcNvu77unkyke3pnsWRYN5kjp7r+qOdbnLwd0XZ47ds\r\nARt91K3GehRrw7B5BNWg9VZ468IVT+XwhxggzF2XGUlDRP4OsfrVNBNv6gA2\r\nutIdiLlJbCoF9JOK/Hz00pKc3rWPQ2j4DCxuAcTD4WyPjM5/x5KZ4PTa+qQE\r\nNDOP1EbWAmionYwrjWzsVgNn8trpzEmt+UH/4gQyiiNr8u8APu3QdSOI/6jS\r\neBCYJjkC+/uFes9RzZzqweLm1kwASAi6JowpwDadW2faWhl/SxwSxky9nvJv\r\n/0iWW+dcru4AbstKHu+EWTGBNmn6l4h5Zq0=\r\n=QUVM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_1.1.0_1672974000673_0.4038779968789681"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"1.2.0":{"name":"@braw/vue-intl-controller","version":"1.2.0","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue2"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs","types":"./dist/index.d.ts"},"./types/arguments":{"import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs","types":"./dist/types/arguments.d.ts"},"./events":{"import":"./dist/events/index.mjs","require":"./dist/events/index.cjs","types":"./dist/events/index.d.ts"},"./plugin":{"import":"./dist/plugin.mjs","require":"./dist/plugin.cjs","types":"./dist/plugin.d.ts"},"./controller":{"import":"./dist/controller.mjs","require":"./dist/controller.cjs","types":"./dist/controller.d.ts"},"./components":{"import":"./dist/components.mjs","require":"./dist/components.cjs","types":"./dist/components.d.ts"},"./sources/*":{"import":"./dist/sources/*.mjs","require":"./dist/sources/*.cjs","types":"./dist/sources/*.d.ts"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build && pnpm run test","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.7","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.12","del-cli":"^5.0.0","eslint":"^8.30.0","prettier":"^2.8.1","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^19.0.5","typescript":"^4.9.4","unbuild":"^1.0.2","vitest":"^0.26.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^1.0.0","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^2.7.14"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"gitHead":"a0f34ed83348ae0ca886985d97e296b4f5aa5865","_id":"@braw/vue-intl-controller@1.2.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-C3HKdm4WRNqiBnVJQFyoDMkNc/JRkXpuQCdcTZ0BUQk26ZUEMAr0LrtRTbTayAJvgauYl15+rNwVQv0utxpRXA==","shasum":"419d4e55701591cc01aae5897f8eef1006742320","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-1.2.0.tgz","fileCount":42,"unpackedSize":150334,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHHZ07H+xF4WuSu2D2x3lmzbYVejpTxGGwGQI5LR1iQ9AiEAqqssFgH/QYlQmjwe78PHez9v3lbj8y6ozRWxJSLi04U="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuGaEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmof7Q//T3zDcYl+vmBm9FT/dMyXxiepBAeHhKzXhYTW+lk4ImtGkkXq\r\nqqrD2lzfFdn21bPcjYhpMYBs7/MsqTZoLbahwkzfb9mIzX2Ba7J29+otq4H1\r\nbbByheJ1B/WdxuL/SHSlNp/ws3KH2+wM9V+rWqFQpskFIShaeD9eEohO9fJ9\r\nAPLLPJ7G+JPCi79xwpWhMlkJC3BLL7dZNIB4VtNN3LEqXeL3wr/VTV+pdMVO\r\nrzbo6Oxp+VC5esbvKeJxp4GFeEG4RG2j9niSOr7p7PMDAw1IxIDIE1GeLab9\r\nHNTMxghJV/XdPnk634FKVMNaY11yci89tl7W7c4qzvHY5KarUTlP/vF1kbOj\r\njzb3oO+N0BxwP+woU70Px8vBd5PMi2gr6q9hEU7lxP4cIbuH5fx4jnTg50IQ\r\nF3WtQ8AhRpLzPm6PEAEwPnF5vh0RhQULhYM0QLc8SaNlw+iQALoDNzhI9BQq\r\nj0AatUIDZUVlVpfZR38rzeQI98SxLlFiY5F2x4bUsvA/QaumZEFalAeKpxvX\r\nuSF+aVDBceTWp3d8a0Qo52OU2hYSAOSzybwNaE4cIRDWloLBeHyKUZ1OQ+3P\r\nLASrQlwBJ6gsmfTuiShnxtn0+c7GzJSJ29DNNzaw6jKiXUhOAXWfgEGJ/odd\r\nPxmc4LWI/q6/FjUZNntLM9iqXuw9e5e8Brs=\r\n=VUYz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_1.2.0_1673029252654_0.5837460775925645"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"2.0.0":{"name":"@braw/vue-intl-controller","version":"2.0.0","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue2"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs","types":"./dist/index.d.ts"},"./types/arguments":{"import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs","types":"./dist/types/arguments.d.ts"},"./events":{"import":"./dist/events/index.mjs","require":"./dist/events/index.cjs","types":"./dist/events/index.d.ts"},"./plugin":{"import":"./dist/plugin.mjs","require":"./dist/plugin.cjs","types":"./dist/plugin.d.ts"},"./controller":{"import":"./dist/controller.mjs","require":"./dist/controller.cjs","types":"./dist/controller.d.ts"},"./components":{"import":"./dist/components.mjs","require":"./dist/components.cjs","types":"./dist/components.d.ts"},"./sources/*":{"import":"./dist/sources/*.mjs","require":"./dist/sources/*.cjs","types":"./dist/sources/*.d.ts"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build && pnpm run test","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.7","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.12","del-cli":"^5.0.0","eslint":"^8.30.0","prettier":"^2.8.1","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^19.0.5","typescript":"^4.9.4","unbuild":"^1.0.2","vitest":"^0.26.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^1.0.0","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^2.7.14"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"gitHead":"2bd50b3093a0db0480dedac7c2a6b2523c399dca","_id":"@braw/vue-intl-controller@2.0.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-p1LDKZ5qvxcNtkqmfIdBCiKeiE6+7CO9Ls+/+3ygap1yoeAd4YDYPRFP5y2/5XIryhpDeQCn0KzH8p7zm0+ebA==","shasum":"3ab5877dfb13bccd5c9e816bd29c7a66bcde2363","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-2.0.0.tgz","fileCount":42,"unpackedSize":154036,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCumRMys5iuN0IVZYdAy05tC64svy9KvrAeKTU9L+adcgIhAKUayHAId0AeXkSQREg2QLQFj+RF6pbnu9hA2FvVQj4V"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuGa/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpxRg//XrBstwMnabduNchpUQPsfA+YME4IV9QMniMGvu1KIhAJkrtx\r\nltRCy5bGnZzmNfjYpBriM6q5BThtlbul843SlYOD+rKbzJBUidsSqTk4VAXN\r\nfDKRVrI8nbOnlFDjX2vNB2R1tUqQjan9gDPcrBJ2OMb9TGVRAJCZNcL7DFvZ\r\nvAnnA5tpAF2d0sxTZp9x4wIzszgIUhneCt5uonwkTnaQhe6T05V4MiXihHAd\r\n5joCGHR3d34zCAMb8R3Fd5BnJAmpslmnPFz3iOIEJuREXk120eT5QgPxY/DW\r\nYryD9iyio3TPxz7UzpslhcSxJtt6Ay3FYgR3PWNgRiVuO9wu/jE3dxpYlWix\r\nDI+ugjYbcLOysAeLbXgSq9pgajq7O205EFCpsy0MwFti/ba0f5t3OQaH/tX+\r\nwHsD3ybk4LIDVkE5mKh0TTB+sp3jJyGBJICtZ2rZRf9QX0lQaxp9/zphj0uN\r\nVvKybFFW5TqDto+jDV2C3GHoz/UuB7aLDbS7QFXB2ssM9L0duPAdhLCS3MBS\r\n/BFy8g4df940a8tpZKCRVHAgX4FvXEWxgDqhNzk9SixNfloUxH9qIkGP7KiH\r\neK33AexMwjsqcojcx/RFgMO/NLxBIZQrAcaxIGETpebTtnBNoyuSmKk2Qr7/\r\nxOGDkIvlGb4WJpm0ualWkF/tp1mwnJTtz14=\r\n=WsRO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_2.0.0_1673029311044_0.04940114598358658"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"2.0.1":{"name":"@braw/vue-intl-controller","version":"2.0.1","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue2"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs","types":"./dist/index.d.ts"},"./types/arguments":{"import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs","types":"./dist/types/arguments.d.ts"},"./events":{"import":"./dist/events/index.mjs","require":"./dist/events/index.cjs","types":"./dist/events/index.d.ts"},"./plugin":{"import":"./dist/plugin.mjs","require":"./dist/plugin.cjs","types":"./dist/plugin.d.ts"},"./controller":{"import":"./dist/controller.mjs","require":"./dist/controller.cjs","types":"./dist/controller.d.ts"},"./components":{"import":"./dist/components.mjs","require":"./dist/components.cjs","types":"./dist/components.d.ts"},"./sources/*":{"import":"./dist/sources/*.mjs","require":"./dist/sources/*.cjs","types":"./dist/sources/*.d.ts"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build && pnpm run test","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.7","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.12","del-cli":"^5.0.0","eslint":"^8.30.0","prettier":"^2.8.1","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^19.0.5","typescript":"^4.9.4","unbuild":"^1.0.2","vitest":"^0.26.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^1.0.0","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^2.7.14"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"gitHead":"00c894afb9c55b35a02ac371fc78842596e7e65b","_id":"@braw/vue-intl-controller@2.0.1","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-qg+Rk7EYOSOesp39NJdP6SGKMyywRaujMmFJQ4JnRxTLmLLiIuEc35g4I+3HGxwqft9UxyW8zMaJmxvbimFZNg==","shasum":"9215edcfe47bc785c4f79cc7b99cfa51d1df2a12","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-2.0.1.tgz","fileCount":42,"unpackedSize":153608,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG9hvcMsLbi1u1ynhnbekMy0o5iFvTwpoDK95+lhu7R0AiA6yhXOK94M3GscBesUzTQDxZ/us485kiiRCTg02E0+Tg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJju2rNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdbQ//X/gYZ1WehErLycx8wzRsWevvIuVQJ+nhNT1SKhSS2+jAo9Bv\r\npmbo5WzIFZWdgWA7MKFBlB12/T1S+Sp6H/GMCxlKOV14xVfhzr/5RLjE5CZ6\r\ni1WslvDIdUWne4YZ0UbS8ntWSVQKvHW8sB0CQ26CjouNAAsnAvukRVSkQmem\r\np8tk28qr/ZZAxQLe++ZZKAHspBD21hV57kAPt6jNOUizoojcGtkFFLv/Em8l\r\nAtdsglT7PxJN0Da5/+ZAbh0DqQ5qQm+PW+9VgNeyPhMheXFvjcmDbxw7Ru6h\r\njhuAaCCXGKW4+eN29t/39smQS91NebCVEKJ6hZ+HmxoQ1llFIipmKCHJpaPB\r\nXaxzg3mchZ2a5P44yGsRIUkQ400GCfs8+L59aU43YJPCkLfwSG5oNh5IoQVo\r\n36wg2PCqafULDYXsiFd3yx72ljzioK9DjJAaI71Y/FDTSjMkZXzqua0tZm9Y\r\nWrj98ie5pwl01dOeBQ1oDhCl5gvjLkTUL53NxcBJQzvg8Wo8ucMEIHIyO8ui\r\nCPKslLbH8id51sUX2zpSbfwhOMDoegDfL4Uuz+UwFKO7ARE2PKToLm2fkjaw\r\nkp/7sNYNNVFSZWKZKjVZFGm57B1LITm/nif+XDkT9ZajvtMI0T7JIGOEEhEI\r\nyVzaZZLZNIJtBzBF9FHYnKmUMCIWc6Qb7Uo=\r\n=kzim\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_2.0.1_1673226957465_0.7467741697757031"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"2.1.0":{"name":"@braw/vue-intl-controller","version":"2.1.0","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue2"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs","require":"./dist/events/index.cjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs","require":"./dist/plugin.cjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs","require":"./dist/controller.cjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs","require":"./dist/components.cjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","require":"./dist/sources/*.cjs","import":"./dist/sources/*.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build && pnpm run test","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.7","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.12","del-cli":"^5.0.0","eslint":"^8.30.0","prettier":"^2.8.1","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^19.0.5","typescript":"^4.9.4","unbuild":"^1.0.2","vitest":"^0.26.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^1.0.0","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^2.7.14"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"gitHead":"4bd884f6d1611fed2a604cb3924ddee73da8cde8","_id":"@braw/vue-intl-controller@2.1.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-kjPWLl4HpJmukZATiE3hlLKefe43zlAb75/WpRHKw04j+xuaBGABHw4nmnkUzPr58arMGuPVGlXw36Tiom4clw==","shasum":"18895f5bc8b3935aeffe7944ce7c07362a6c7f32","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-2.1.0.tgz","fileCount":42,"unpackedSize":153919,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA6hP987kdctWq74HNWXLnxCg44t5s2fY5li5Sc0Ec2tAiAbu3obap4dWRHHlKmCtMHIkll5vS3tFswF8QFfOGPDTw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvLALACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrfJQ/9ES+Cyw6f7DvQ95HZVU/0cLVjxojmXw9UgTBbLvzNqhobVnht\r\nCFt1gWNDQn2r4168BwK1iNrNkOGyEjMzZjnbi7RFZrlrIDqq1/awiUWf5SdT\r\nXgj2RvidbURd4r6w+dgwIUaYnXN8Eh2tO0g3oGH9EwhqrATiyA9CSE6UpnoO\r\n/afF9zm+IXNfbCC64xTIjS2jhnJdQDla5QDtOjtjyvZ2qDLSvFrJqZAUnbLD\r\nH9Q+NMKZGGE1h5h339UWUlBxF6g8t14FF3iO24XFzjBkff+UDr0cijSEdrhQ\r\n1VdyAL18p562N4Ee+cgQJw8x4F5FlZTE6xy7sj8x0HN2lujAa0enHPkUlbGv\r\nGIdCCLPD3/ujwSHheSvAbd1968KTOuFaSA2Yyl4QVjQsRau7dRUfPdAFfMX4\r\nGOjCOLw6x80FUhy9npn7LJD6h8OEPcXFyMUYGwN0IBnba/Ey3sKXrPpLKYQt\r\nrTbrnUCMO+s2FTmj1z5nmvI5Dm6Uqt3oXmLYVethIXtl9zwQYr1Rvje+jCvW\r\nhr8hCRUol9nAbpuxVnDVnhfjdL1Fq2bOnF8+alMxAUMdyrFEzBgKbFBrd/o9\r\nTFd5FePYbA706x99gt0SSropfCNnFbVxYAywIk1YHBLSPdb17fYuCNismYPg\r\nEdrPMygp8E5tNAxeZb5siEUKCd9EnjwawUs=\r\n=716Y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_2.1.0_1673310219596_0.41431543881535293"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"2.2.0":{"name":"@braw/vue-intl-controller","version":"2.2.0","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue2"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs","require":"./dist/events/index.cjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs","require":"./dist/plugin.cjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs","require":"./dist/controller.cjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs","require":"./dist/components.cjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","require":"./dist/sources/*.cjs","import":"./dist/sources/*.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build && pnpm run test","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.7","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.12","del-cli":"^5.0.0","eslint":"^8.30.0","prettier":"^2.8.1","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^19.0.5","typescript":"^4.9.4","unbuild":"^1.0.2","vitest":"^0.26.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^1.0.0","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^2.7.14"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"gitHead":"7f49c62b6cf37db03c47215e382aba11b0671771","_id":"@braw/vue-intl-controller@2.2.0","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-weem5jvNPobbbj01QTkpe07fD3q+M7slIrpSUmBnv5GMs/OC9vNrYsRc/RQwPT6kbOCL1sApDkz56nuJE1/Dlw==","shasum":"8c94a9565676c07b65a05812799313e29d56ea30","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-2.2.0.tgz","fileCount":42,"unpackedSize":158293,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBiiZoXa1l6nyJ1JvW2DBY1HVMSfSJIJSMsJb63cvtYwAiEA70bqimOk/djK27q4+XnQ18Gbo0qIibUSq41yFfW1ZpE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwt8YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpvsg//b9YV1ajkhdXiRl/1zSat5Dq+2kelf/UQVD2XUCp80LYMQ6f4\r\nPmYgkEVgIhfgxIHr7ntc17ZArmmtAqwO9O1Rcq9UjuB+UBoukYP97WPhKoOb\r\n8MnYbrosqt/8xP5+ud+pf2KW8cHuruyOXMQ9w7PwpYwLfCT/dDWUCHnE/k0X\r\nXON0OVmeeTELii4u9yej8c1dlthhwT84tN+Fv+bDiZUB3Eeh/gOLBmbVdUJM\r\noSUVYEKWlg4CdFZq4+QTIsE6l1jPVCG8pPP7ShlhoDjnPXTClMl4WFpXmL63\r\n1x7SRksEtex7z9iEWxBpqzmMLNEloVCp6+zI+ibMAZJ0vgocP2WVW6b5cSc/\r\n7NBkMWABkZLWyZhU0z4gh9xLUv+Z+DmCQj8RtjhkErgAhSYqBFndCvZR5QLp\r\nr+rV9bS3lbrku9DeqK3WkD8aF6XBG+/l0Zq4MaqcihAN8WdbxAx3mkkkOQ9R\r\nw9pOwX4/sgC94odwaShvnolTEtTc6olTDPfu1WpTgfwwxAtO5hMqlTDe4ifq\r\n2sabii7FYd5zid0wRS8ZC8ZbT15ip07G8Rx2hR1AbEPpBaA7Cp620fpCU+2d\r\n1SmfWup7WKlNiyAdJ6+EXWoKtfPLWsIrwn574702/seYTLb6xCNtIjPeCp8P\r\naJZjdw71dy+BQNvc7EnUmMJldKO59Qg4n/4=\r\n=K7X+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_2.2.0_1673715479840_0.6852156421451767"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"3.0.0":{"name":"@braw/vue-intl-controller","version":"3.0.0","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue2"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs","require":"./dist/events/index.cjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs","require":"./dist/plugin.cjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs","require":"./dist/controller.cjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs","require":"./dist/components.cjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","require":"./dist/sources/*.cjs","import":"./dist/sources/*.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.12","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.18","del-cli":"^5.0.0","eslint":"^8.31.0","prettier":"^2.8.3","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^20.0.2","typescript":"^4.9.4","unbuild":"^1.1.1","vitest":"^0.27.1"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^1.0.1","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^2.7.14"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"gitHead":"ab6788eaac5e6402b179ed51ade83df7f45d4e15","_id":"@braw/vue-intl-controller@3.0.0","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-/MvlP1pcT0L+gV6BF6IY65aweZ2oPO2PjkXzrOHOokFieVkvVbMqnhbde6STpcQyNqvSMZWqhLLplnHC95ea4Q==","shasum":"8cc96cb56637fe1ad3c9b7d400bc30976ec258b4","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-3.0.0.tgz","fileCount":42,"unpackedSize":157713,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG7sUYykLp5q1Gu8INHe4kbqJEe6Je+XBZUjD4N8SBtwAiAVLii/LHHPe6vVFyiHc3iOkmv5Ba23QKa2TA0rwVCwcw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwuUuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQZQ//eG9Yujigkde8+e1TKRDjuhm2YlMKGVP6UzQC+XNuHExlHirb\r\nluTYNPfFumOdUP/eA6ylV3BgAqTRhg5e+8y4p7cJame4e0wtV/Y1IP/2odxn\r\n7vhQChQcO7z8B2s6GVgWCtzzvuTeAPyQRzqGcQ505keCeZGg+Kg4AWkJrh2B\r\nLtb5PJbJvHqLc02+puglNN6N94nL5L9AP/7iZGu8JmGRw2FzbfhXUe2DUBpu\r\nyIuav9AC4zGKDW2VI67aW2BD6xPFZem800ynJaw5T2FMu6hNUgS+5zMp4pf0\r\n+mL2d196aSMQZ45pdEj49ac7Qp15uZZpYz4WZBDbHI4C5h4vlThV7LhvTh9a\r\nCbuCu2eXYXx8jtMObYFq4aTOojsbj30aMY6StFLgF66y0J9XjwjLECCfoSE6\r\nhTmBAaRVuF9eXGpWiqYNPELRidrVfveJvw52wNm5WSGaJNbuA0X+nxi6FMvn\r\nrL+TdeCxgJuO+m9VAWDhZcbyBojQ1QuNe+uM6lvUjmohtJeAoweerva5mF9n\r\n0MevyxpyJ9ZkApaxKZGxjSJEQSvFGzMnKxkqI5ByA4sYlRFp0zvZpFjr8EeP\r\nEElcgQrxIbxp1YteWpkczRx/oJsP37NkBeAgJ9ANIW4lUmBSC5j5JL/H4zQi\r\nIUXhXKTj9rzrQ6gE6Mi1olCmxLWTZkbL++c=\r\n=CYvX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_3.0.0_1673717038573_0.8326094547765897"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"3.1.0":{"name":"@braw/vue-intl-controller","version":"3.1.0","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue2"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs","require":"./dist/events/index.cjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs","require":"./dist/plugin.cjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs","require":"./dist/controller.cjs"},"./translateFunction":{"types":"./dist/translateFunction.d.ts","import":"./dist/translateFunction.mjs","require":"./dist/translateFunction.cjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs","require":"./dist/components.cjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","require":"./dist/sources/*.cjs","import":"./dist/sources/*.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.12","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.18","del-cli":"^5.0.0","eslint":"^8.31.0","prettier":"^2.8.3","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^20.0.2","typescript":"^4.9.4","unbuild":"^1.1.1","vitest":"^0.27.1"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^1.0.1","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^2.7.14"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"gitHead":"6730c004c16430d0e859c8ad9a735a1d35e0df92","_id":"@braw/vue-intl-controller@3.1.0","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-leVogBRK8KmNd+OoKGoexDosdtjPa5y+YxcAtjjvTqS5+VBBEUeBT1f3ZUjaRZ/9hnW05rDaA1qbaFr7p9bBww==","shasum":"3eb7dbfeddbff79bb355ab7a364b44086735e71b","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-3.1.0.tgz","fileCount":45,"unpackedSize":159475,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWKIoYsK9fqoSasSL7EB3/GEy7hzxhGwOScX+0MSvbTgIgBse5VJ8N7xdpsYrqSgxu57Y5L8QkPyb2vjt9SZTWSZE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjw25RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2jg/+K7/un29nFkO7hTD53/XSfwQ0sb4uxwzQR3gK5UhPuV5c9haa\r\nB3TAjW+UfIQZmrccbXrYxOctB28y7va7CSAl77hPIjHnI1vMiFfhWvA9siSP\r\nNfB7PETei0dNpuKomvmt4jUN/xYeXk0OPdP11BZ39MrXU3whxKT0wIkMKC6v\r\nOoCMZuNfYHujv9O8Nn198WuMS3AHXzIqEvMYYH7/8Zji8rDcrDZ6fi37y3Hc\r\nCm4/OzEtgc5+2rOJOkR7zOElN2m9L2UYtab81mUa0whOBpIpwF39ekbhG2aY\r\n+hYQdvXATsB+TYy8W7mEuLQ2Jii68DkCzaFKmO0SWnFbeILs4KvH3JORn4AS\r\n/GtlO9NbSzZcD49qJOyASflKWPX54qzeKf2/reUtKXPBFEGmHMc45UTpTTd1\r\nRTw56HR/HG3iPiLE47a9nIbC3EhrlaQBccGd1LwBpQfBmTDw1MGr8ikEVEq6\r\nJixPrHMpLXWk9AY2Eaao5fFtyXupwylipnaevuXd58i/wBhnTj8bfoXTX0/C\r\nB/0tVRlTk9JOEUbF7yLdQmRa4SzcFZwWj8hUrFGfDqpdqHxBzGGTcQaXSqon\r\n1zhPpp04royALisboF1eYcUE097XiWOBDrNivv6lJrBeH6i23i5TT6pDXFKo\r\nJG6tJh4RRjq6AEklFBiQWZ0zhNBjrI6khvg=\r\n=pS5f\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_3.1.0_1673752145443_0.12779556517031643"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"3.2.0":{"name":"@braw/vue-intl-controller","version":"3.2.0","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue2"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs","require":"./dist/events/index.cjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs","require":"./dist/plugin.cjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs","require":"./dist/controller.cjs"},"./translateFunction":{"types":"./dist/translateFunction.d.ts","import":"./dist/translateFunction.mjs","require":"./dist/translateFunction.cjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs","require":"./dist/components.cjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","require":"./dist/sources/*.cjs","import":"./dist/sources/*.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.12","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.18","del-cli":"^5.0.0","eslint":"^8.31.0","prettier":"^2.8.3","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^20.0.2","typescript":"^4.9.4","unbuild":"^1.1.1","vitest":"^0.27.1"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^1.0.1","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^2.7.14"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"gitHead":"a16351e8fdaf25aec10457a351800daa0bcc544a","_id":"@braw/vue-intl-controller@3.2.0","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-S7qhtUFNsuLUOUACynwdFhoKGlwR0NF9LrxNJy+eYEGrh+13Y4iAmcyDAy0f4Ot/QHLTlCqqYDpPmzsUMCVZYg==","shasum":"f28d3b5100e1d259028b7c32a5a43566bb593244","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-3.2.0.tgz","fileCount":45,"unpackedSize":161952,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbvKL7zbSqGP2dP3tIVd6NZh/m8qI/GF4po2LbkJ7OGgIgMq/lEHhjCJByIi2g0YUymGmN4ZDqd/tFiRA5lFgKOiM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxOrTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoyUhAAlvhLqE4WNmPMnwRA+YNZ/foTn+Jpab51cNRO0nID4u/m7EtI\r\nAZrHKUngkmgjXzJMStzdsIxdeNa7bLOS0O4L3CWa+O/SN3Fd/Yf7OplphqFE\r\n5tqfbn0tWYPkv3wyZWDd5SAj+BbKVEjNLt4c6WLoMB9gB8bDqS2QtvaT+KaV\r\ntMnxqU+RbRappu52oBstPld1u8+/IS3jvY1l4HtsgrT93oIU3/2ZxZ/0ARWp\r\n73dJ4/2yofkoM7fbQurF0JpTMAs+CW8f6PRGagppeDE4TX1+ER9gzE8WB3Z9\r\nXEjXV2RrLEOnjbtgBU9aV36E+e8hq4ABfiDn13iU9iRQiGQW2Mh2o6kU79EK\r\nJskFjVkpHARuicKiCPDSCqQBFPF3/IM9M/p6hiQNQg53bmerHUgNFraIzq5j\r\nHe+W3J1AHHIr6wDQAFj23VO2tX9erRlndrtjfMDvTJbs4LmrXu6MLA0W53e4\r\nBb8REcTzqGklgWpH81+grOWf0f8J4yg8tjtaFgbmjyNfO0g8eIipYs0ii7KZ\r\nl9glLJmnyHl7n4XHJhR9YqYOE6+06hxXHnorR8B8fyDVLUk8r+nEgJPgdUEO\r\nldnvUzEaTWmJYewTLUVjmZb/FRmt/uj5LIm7Gu1kn2rvdfiVa5o6LU3D8Fj/\r\npYZDGhDrYvPVu9DBgsLIobwH2ROt99jVAHM=\r\n=Z4OA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_3.2.0_1673849554839_0.7401226942961314"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"4.0.0-rc.1":{"name":"@braw/vue-intl-controller","version":"4.0.0-rc.1","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue3"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs","require":"./dist/events/index.cjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs","require":"./dist/plugin.cjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs","require":"./dist/controller.cjs"},"./translateFunction":{"types":"./dist/translateFunction.d.ts","import":"./dist/translateFunction.mjs","require":"./dist/translateFunction.cjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs","require":"./dist/components.cjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","require":"./dist/sources/*.cjs","import":"./dist/sources/*.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.12","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.18","del-cli":"^5.0.0","eslint":"^8.31.0","happy-dom":"^8.1.5","prettier":"^2.8.3","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^20.0.2","typescript":"^4.9.4","unbuild":"^1.1.1","vitest":"^0.27.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^1.0.1","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^3.2.45"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"readme":"# vue-intl-controller\n\n> A plugin for Vue 2.7+ to dynamically control [`@braw/extended-intl`](https://npm.im/@braw/extended-intl).\n\n## ⚠ Caution!\n\nThis project was not thoughtfully tested, it is a port of [code](https://github.com/modrinth/knossos/pull/738) to support internationalisation of [Modrinth](https://modrinth.com/) front-end. It is published early because its author could not figure out monorepos...\n\nThat is also the reason why this project targets Vue 2.7 even though Vue 3 is out for quite some time and is recommended to use. It will support Vue 3 in future, it already uses a lot of Vue 3 features that were ported in 2.7.\n\n## Summary\n\n[`@braw/extended-intl`](https://npm.im/@braw/extended-intl), being a wrapper for [`@formatjs/intl`](https://formatjs.io/docs/intl), allows to easily implement access to localisation using ICU MessageFormat messages.\n\nHowever, using it in Vue in dynamic manner is not an easy task if you want to preserve most of its functionality and more. That's why this package was created, it allows to reactively control `Intl` instance, as well supplies it to all Vue components, including helpful methods like `$t` or `$fmt`.\n\nIt is created with extensibility in mind, so you can extend upon it and add support for it in other frameworks, like Nuxt (module for Nuxt is being worked on). On your disposal events, asynchronous loading mechanism and even some of the internals exposed.\n\nAs a consumer, you also get to use runtime functions allowing you to rename `$t` and `$fmt` helpers through setup functions. There's also `<IntlFormatted>` component, which allows to use components while formatting the messages.\n\nWritten in TypeScript, ambient type extension is possible for better type checking to the point where entire arguments used in messages can be type checked!\n\n## Installation and usage\n\n### Installation\n\nInstall using your package manager:\n\n**npm**\n\n```sh\nnpm i @braw/vue-intl-controller\n```\n\n**pnpm**\n\n```sh\npnpm i @braw/vue-intl-controller\n```\n\n**yarn**\n\n```sh\nyarn add @braw/vue-intl-controller\n```\n\n### Usage\n\nIn your Vue app entry point import `createPlugin` function.\n\n```ts\nimport { createPlugin } from '@braw/vue-intl-controller/plugin'\n```\n\nCreate a plugin instance (you can do that inline, without variable):\n\n```ts\nconst plugin = createPlugin({\n  // Options for the controller instance.\n  controllerOpts: {\n    // All locale codes must be valid BCP 47 codes.\n\n    // Code for the default locale. Must be one of the defined locales' code.\n    defaultLocale: 'en-US',\n\n    // Code for the currently used locale. Must also be defined in locales.\n    locale: 'en-US',\n\n    // All defined locales.\n    locales: [\n      {\n        // BCP 47 code for the locale.\n        code: 'en-US',\n\n        // Any meta information that is available even if locale is not loaded.\n        // Must be JSON encode-able.\n        meta: {\n          displayName: 'American English',\n        },\n      },\n    ],\n  },\n\n  // Whether you want to automatically install <IntlFormatted> component\n  globalComponent: true,\n\n  // Whether to inject $t, $fmt and $i18n properties globally\n  globalMixin: true,\n\n  // Additional injection sites like Vuex store or Nuxt app\n  injectInto: [],\n})\n```\n\nThose are example options, in fact you can completely skip most of them, because they're already like that by default (except for `meta` for `en-US` locale).\n\nIf you need, you can already access the properties using:\n\n```ts\nconst { $fmt, $i18n, $t } = plugin.toProperties()\n```\n\nInstall plugin into your Vue instance using `Vue.use`:\n\n```ts\nVue.use(plugin)\n```\n\nYou can now all of the controller features.\n\n```vue\n<script setup>\nimport { defineMessages } from '@formatjs/intl'\n\nconst messages = defineMessages({\n  greeting: {\n    id: 'greeting',\n    defaultMessage: 'Hello, {name}!',\n  },\n})\n</script>\n\n<template>\n  <IntlFormatted :message-id=\"messages.greeting\">\n    <template #~name>\n      <strong>World</strong>\n    </template>\n  </IntlFormatted>\n</template>\n```\n\n## Messages loading\n\n`IntlController` uses event-based approach to handling loading of messages. Whenever locale change is confirmed and inbound, the controller fires a `LocaleLoadEvent`. It is asynchronous, so your listener function may return a promise and it will prompt controller to wait before calling any other listeners.\n\n> **Note**\n> There is approach to add messages that does not involve events, keep reading to learn more.\n\nIf you created plugin, you can access controller using `getOrCreateController` function. As name implies, the controller is initialised lazily, whenever you try to install the plugin to Vue or call any of the getters like `toProperties` or `getOrCreateController`.\n\n```ts\nconst controller = plugin.getOrCreateController()\n```\n\nYou can then load messages rudimentary way:\n\n```ts\nconst messages = {\n  'en-US': {\n    greeting: 'Hello, {name}!',\n  },\n  de: {\n    greeting: 'Hallo {name}!',\n  },\n  uk: {\n    greeting: 'Привіт, {name}!',\n  },\n}\n\ncontroller.addEventListener('localeload', (e) => {\n  if (e.locale in messages) e.addMessages(messages[e.locale])\n})\n```\n\nOr you can use `import` functions. And if you use webpack, you can even split those imports in chunks to avoid sending unneeded data to client:\n\n```ts\nconst messagesMap = {\n  'en-US': () =>\n    import(\n      /* webpackChunkName: \"locale-en-US\", webpackMode: \"lazy\" */ './i18n/en-US.json'\n    ),\n  uk: () =>\n    import(\n      /* webpackChunkName: \"locale-uk\", webpackMode: \"lazy\" */ './i18n/uk.json'\n    ),\n}\n\ncontroller.addEventListener('localeload', async (e) => {\n  if (e.locale in messagesMap) {\n    const messagesImport = await messagesMap[e.locale]()\n    e.addMessages(messagesImport.default)\n  }\n})\n```\n\n### More to events\n\nThere are two more events that you may want to know about:\n\n- `error` is called when any error occurs in controller's event target. If there are no listeners to that event then all listener errors are logged to console.\n- `localechange` is called when locale is about to change. It can be cancelled, then locale will remain as it is now and the initiator of locale change will receive an error.\n\nEvent listeners can have a priority, in case you need to load messages or data in certain order, it is specified in an object passed as third argument to `addEventListener`. They also can be called only once, and regardless of whether the event has been cancelled or not.\n\n```ts\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.locale === 'en-x-placeholder') e.cancel()\n  },\n  { priority: 100 },\n)\n\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.canceled) {\n      console.warning(`locale change to ${e.locale} has been cancelled!`)\n    } else {\n      console.log(`locale is now going to change to ${e.locale}`)\n    }\n  },\n  {\n    priority: -99999, // like super super unimportant\n    always: true,\n  },\n)\n\ncontroller.addEventListener(\n  'error',\n  (e) => {\n    console.error('controller event target error', e.error)\n  },\n  { once: true },\n)\n```\n\n## Controller\n\nThe controller is an object returned by `createController` function. It is not the class, but an object that combines all the reactive partials together. This object is typed as `IntlController<T>` and all of the properties and methods are thoughtfully documented. Most important ones are highlighted below.\n\n### Imperative management\n\nYou can imperatively create locales instead of declaring them:\n\n```ts\nconst britishEnglish = controller.addLocale('en-GB')\nbritishEnglish.meta = {\n  displayName: 'British English',\n}\n```\n\nAs well as imperatively remove those locales:\n\n```ts\nconst removedLocale = controller.removeLocale('en-GB')\nconsole.assert(britishEnglish === removedLocale)\n```\n\nTo add messages to the locales use `addMessages`, it accepts both code and descriptor. Under the hood it assigns messages, so you can also remove messages with it by providing `undefined` as a value for some key.\n\n```ts\nconst pirateEnglish = controller.addLocale('en-x-pirate')\ncontroller.addMessages(pirateEnglish, {\n  removeMe: undefined,\n  greeting: 'Ahoy, {name}!',\n})\n```\n\n### Properties\n\nMany getter properties are provided at your convenience to access the current state of the controller via `ready`, `automatic`, `locale`, `defaultLocale`, `preferredLocale`. Active `IntlShape` is exposed through `intl` property.\n\nMessages and resources for the current and default locale are accessible as well via `messages`, `defaultMessages`, `resources` and `defaultResources`\n\n`formats` matches the `$fmt` property returned by the plugin.\n\nIf you need to accept locale properties use `intlLocale`, it returns [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) object for the active locale. This can be used to check if language is English, for example:\n\n```ts\n// The following will match en-US, en-GB, en-CA, en-x-pirate, etc.\n\nif (controller.intlLocale.language === 'en') {\n  console.log('Uses English')\n}\n```\n\n## Automation\n\nBrowsers tell sites which languages user prefers. For this purpose automation API was added to the controller. It works by defining multiple sources which tell the currently used locale.\n\nBy default there are no sources, but the package is shipped with two sources that you can set up client and server side:\n\nOn server:\n\n```ts\nimport { useAcceptLanguageHeader } from '@braw/vue-intl-controller/source/header'\n\nconst headerSource = useAcceptLanguageHeader(req.headers['Accept-Language'])\n\ncontroller.addSource(headerSource)\n```\n\nOn client:\n\n```ts\nimport { useNavigatorLanguage } from '@braw/vue-intl-controller/source/navigator'\n\ncontroller.addSource(useNavigatorLanguage())\n```\n\nTo create a custom source implement `PreferredLocalesSource` interface, it is an object or a class that has `prefers` property which is either an array of strings or `null` or Vue's reference to these, if your preferences update dynamically. It can also contain `install` and `uninstall` methods, these are called when source is first initialised or when it's imperatively removed.\n\n<details>\n<summary>Example of custom source</summary>\n\n```ts\nimport { ref } from 'vue'\n\nfunction createCustomSource(locales: string[]) {\n  const prefers = ref(null as string[] | null)\n\n  function install() {\n    prefers.value = locales\n  }\n\n  function uninstall() {\n    prefers.value = null\n  }\n\n  return {\n    prefers,\n    install,\n    uninstall,\n  }\n}\n```\n\n</details>\n\n## Strict type checking with TypeScript\n\n> **Warning** This is an experimental feature.\n\nYou can declare your messages by creating an ambient declaration file where you need to import `@braw/vue-intl-controller`, so that you can extend global namespace `VueIntlController` containing the following declarations:\n\n- `interface` `MessageValueTypes`\n\n  A map of all usable objects within translation functions and components.\n\n  You can use it if you have something like `CompactNumber` object from `@braw/extended-intl`.\n\n- `interface` `CustomMessages`\n\n  A map of custom messages mapped to arguments within those messages.\n\n  Declaring this map will enable strict type-checking across all usage of Vue Intl Controller functions. Partial message declaration is not supported yet, alas.\n\n- `interface` `LocaleMeta`\n\n  A map of all meta properties for the locales, these are always accessible through locale descriptors.\n\n- `interface` `LocaleResources`\n\n  A map of locale resources provided by the load event listeners.\n\n<details>\n<summary>Example</summary>\n\nCreate a file called along the lines of `i18n.d.ts`, and inside of it write:\n\n```ts\n// Makes sure TypeScript knows what we extend:\nimport '@braw/vue-intl-controller'\n\n// Helper types:\nimport type {\n  SelectArgument,\n  ValueArgument,\n} from '@braw/vue-intl-controller/types/arguments'\n\n// Example piece of 'your' code:\nimport type { ExampleObject } from '~/utils/convertibleObject.ts'\n\ndeclare global {\n  namespace VueIntlController {\n    interface MessageValueTypes {\n      // key doesn't matter as long as it does not collide with other key;\n      // the interface used here solely for extensibility since you cannot\n      // extend type or particular interface keys\n      __example__object: ExampleObject\n    }\n\n    interface CustomMessages {\n      // {type, select, greeting {Hello} goodbye {Goodbye} other {Ey}}, {name}\n      'general.message': {\n        /** Type of the message. */\n        type: SelectArgument<'greeting' | 'goodbye' | 'other'>\n\n        /** Name of the addressed person. */\n        name: ValueArgument\n      }\n    }\n\n    interface LocaleMeta {\n      /** Name of the locale translated to the locale's name. */\n      displayName: string\n\n      /** Name of the locale written in English. */\n      englishName: string\n\n      /** Percentage of translation coverage across all documents and files. */\n      translatedPercentage: number\n    }\n\n    interface LocaleResources {\n      /** Markdown markup containing explanation of our payout terms. */\n      payoutExplanation: string\n\n      /** Markdown markup containing our terms of service. */\n      termsOfService: string\n\n      /** Markdown markup containing our privacy policy. */\n      privacyPolicy: string\n\n      /** A map of translated language names. */\n      languageNames: Record<string, string>\n    }\n  }\n}\n```\n\n</details>\n","readmeFilename":"README.md","gitHead":"335c7b8d2d9fafa9f8a8bd6a346bb2c6f7c2db9c","_id":"@braw/vue-intl-controller@4.0.0-rc.1","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-M0s+yDXGp7UN/khLzEWaA5BF4rSfManiX2aB6MlNiD4bq5wnzgq3VIfgLLcZaDnH8BdyCN1nsrtUoKw9IUUhFA==","shasum":"59830a64eaad7a0fc7f9bd54e634cac2513e2993","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-4.0.0-rc.1.tgz","fileCount":46,"unpackedSize":155003,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMNSSGRk2wmWwe31QUQ4qv/yr4dOhCpWFBliB8dVYEuAIgarYFV7tRhY9K6AaVRKXid/6/7OAIu58QcXrNE8KvjeU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjzDimACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdaQ//Q6BfKpKDBqNxCqN00U5T/jWelNdrtAIT283N62BJEbOOtJb+\r\ng6GH/qTV5H5dK2hN3qElxaFCz+2cubelqid5P3Y3cOctm6jD15HyTr6oRVSw\r\nOv7L7Dc3fjU5k1e8pioDm3rfS605xVRi55ME30g0K7qTbxrp9F1PdiaKZfur\r\ni4Ch8Z7yOICYy3oFJEJGog15gBtNrWt3CTVxTzSmkJpVgzgPkalpSraUzL66\r\nxd2nvXekOZRFts1Fn0MI99f280hNfRTSjNuvtHBxL+z99kbkU6TWjaHCb41G\r\nIMj/aHtzwoh/MdT4Z4yJU8Sl0JUZ2LXet3AuKCRuxTQRl9uHCdCWgpFFcBvI\r\n5+bwwKSQRbT9qlH0PBz6Hxp+lmRmDoVo0/p+Q4MeyFtxhx6iApG0qmjiVf9W\r\nUeGoMc+zNXXkoZt5WJwODBxm+3KSQICnn/PfiWZPTZwnI+CdM8mbf8hHtpTj\r\nCWwbwkvfha2JmBBMN7BZZJ5dcWeumY7v39URsmZ6zrzO0/YskzYjVA/XXCbq\r\nJCXC4JVP1iI7PnsJrmEpEsgOq1eRl5MM/nA8TGFgLjiyWOejNmFdTgOsY3XS\r\nrYT5kCCjKfzj2SC/wcuT6zqSgLTgYmvLzX3rt/ryGEKpbXwSA+lwRcQ9Mh9J\r\n0Hp45p+rLDUC22yVofhllNsq6A4kfUMmVy0=\r\n=OAgx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_4.0.0-rc.1_1674328230621_0.24872564099768502"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"4.0.0-rc.2":{"name":"@braw/vue-intl-controller","version":"4.0.0-rc.2","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue3"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs","require":"./dist/events/index.cjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs","require":"./dist/plugin.cjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs","require":"./dist/controller.cjs"},"./translateFunction":{"types":"./dist/translateFunction.d.ts","import":"./dist/translateFunction.mjs","require":"./dist/translateFunction.cjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs","require":"./dist/components.cjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","require":"./dist/sources/*.cjs","import":"./dist/sources/*.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.12","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.18","del-cli":"^5.0.0","eslint":"^8.31.0","happy-dom":"^8.1.5","prettier":"^2.8.3","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^20.0.2","typescript":"^4.9.4","unbuild":"^1.1.1","vitest":"^0.27.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^2.0.0","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^3.2.45"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"readme":"# vue-intl-controller\n\n> A plugin for Vue 2.7+ to dynamically control [`@braw/extended-intl`](https://npm.im/@braw/extended-intl).\n\n## ⚠ Caution!\n\nThis project was not thoughtfully tested, it is a port of [code](https://github.com/modrinth/knossos/pull/738) to support internationalisation of [Modrinth](https://modrinth.com/) front-end. It is published early because its author could not figure out monorepos...\n\nThat is also the reason why this project targets Vue 2.7 even though Vue 3 is out for quite some time and is recommended to use. It will support Vue 3 in future, it already uses a lot of Vue 3 features that were ported in 2.7.\n\n## Summary\n\n[`@braw/extended-intl`](https://npm.im/@braw/extended-intl), being a wrapper for [`@formatjs/intl`](https://formatjs.io/docs/intl), allows to easily implement access to localisation using ICU MessageFormat messages.\n\nHowever, using it in Vue in dynamic manner is not an easy task if you want to preserve most of its functionality and more. That's why this package was created, it allows to reactively control `Intl` instance, as well supplies it to all Vue components, including helpful methods like `$t` or `$fmt`.\n\nIt is created with extensibility in mind, so you can extend upon it and add support for it in other frameworks, like Nuxt (module for Nuxt is being worked on). On your disposal events, asynchronous loading mechanism and even some of the internals exposed.\n\nAs a consumer, you also get to use runtime functions allowing you to rename `$t` and `$fmt` helpers through setup functions. There's also `<IntlFormatted>` component, which allows to use components while formatting the messages.\n\nWritten in TypeScript, ambient type extension is possible for better type checking to the point where entire arguments used in messages can be type checked!\n\n## Installation and usage\n\n### Installation\n\nInstall using your package manager:\n\n**npm**\n\n```sh\nnpm i @braw/vue-intl-controller\n```\n\n**pnpm**\n\n```sh\npnpm i @braw/vue-intl-controller\n```\n\n**yarn**\n\n```sh\nyarn add @braw/vue-intl-controller\n```\n\n### Usage\n\nIn your Vue app entry point import `createPlugin` function.\n\n```ts\nimport { createPlugin } from '@braw/vue-intl-controller/plugin'\n```\n\nCreate a plugin instance (you can do that inline, without variable):\n\n```ts\nconst plugin = createPlugin({\n  // Options for the controller instance.\n  controllerOpts: {\n    // All locale codes must be valid BCP 47 codes.\n\n    // Code for the default locale. Must be one of the defined locales' code.\n    defaultLocale: 'en-US',\n\n    // Code for the currently used locale. Must also be defined in locales.\n    locale: 'en-US',\n\n    // All defined locales.\n    locales: [\n      {\n        // BCP 47 code for the locale.\n        code: 'en-US',\n\n        // Any meta information that is available even if locale is not loaded.\n        // Must be JSON encode-able.\n        meta: {\n          displayName: 'American English',\n        },\n      },\n    ],\n  },\n\n  // Whether you want to automatically install <IntlFormatted> component\n  globalComponent: true,\n\n  // Whether to inject $t, $fmt and $i18n properties globally\n  globalMixin: true,\n\n  // Additional injection sites like Vuex store or Nuxt app\n  injectInto: [],\n})\n```\n\nThose are example options, in fact you can completely skip most of them, because they're already like that by default (except for `meta` for `en-US` locale).\n\nIf you need, you can already access the properties using:\n\n```ts\nconst { $fmt, $i18n, $t } = plugin.toProperties()\n```\n\nInstall plugin into your Vue instance using `Vue.use`:\n\n```ts\nVue.use(plugin)\n```\n\nYou can now all of the controller features.\n\n```vue\n<script setup>\nimport { defineMessages } from '@formatjs/intl'\n\nconst messages = defineMessages({\n  greeting: {\n    id: 'greeting',\n    defaultMessage: 'Hello, {name}!',\n  },\n})\n</script>\n\n<template>\n  <IntlFormatted :message-id=\"messages.greeting\">\n    <template #~name>\n      <strong>World</strong>\n    </template>\n  </IntlFormatted>\n</template>\n```\n\n## Messages loading\n\n`IntlController` uses event-based approach to handling loading of messages. Whenever locale change is confirmed and inbound, the controller fires a `LocaleLoadEvent`. It is asynchronous, so your listener function may return a promise and it will prompt controller to wait before calling any other listeners.\n\n> **Note**\n> There is approach to add messages that does not involve events, keep reading to learn more.\n\nIf you created plugin, you can access controller using `getOrCreateController` function. As name implies, the controller is initialised lazily, whenever you try to install the plugin to Vue or call any of the getters like `toProperties` or `getOrCreateController`.\n\n```ts\nconst controller = plugin.getOrCreateController()\n```\n\nYou can then load messages rudimentary way:\n\n```ts\nconst messages = {\n  'en-US': {\n    greeting: 'Hello, {name}!',\n  },\n  de: {\n    greeting: 'Hallo {name}!',\n  },\n  uk: {\n    greeting: 'Привіт, {name}!',\n  },\n}\n\ncontroller.addEventListener('localeload', (e) => {\n  if (e.locale in messages) e.addMessages(messages[e.locale])\n})\n```\n\nOr you can use `import` functions. And if you use webpack, you can even split those imports in chunks to avoid sending unneeded data to client:\n\n```ts\nconst messagesMap = {\n  'en-US': () =>\n    import(\n      /* webpackChunkName: \"locale-en-US\", webpackMode: \"lazy\" */ './i18n/en-US.json'\n    ),\n  uk: () =>\n    import(\n      /* webpackChunkName: \"locale-uk\", webpackMode: \"lazy\" */ './i18n/uk.json'\n    ),\n}\n\ncontroller.addEventListener('localeload', async (e) => {\n  if (e.locale in messagesMap) {\n    const messagesImport = await messagesMap[e.locale]()\n    e.addMessages(messagesImport.default)\n  }\n})\n```\n\n### More to events\n\nThere are two more events that you may want to know about:\n\n- `error` is called when any error occurs in controller's event target. If there are no listeners to that event then all listener errors are logged to console.\n- `localechange` is called when locale is about to change. It can be cancelled, then locale will remain as it is now and the initiator of locale change will receive an error.\n\nEvent listeners can have a priority, in case you need to load messages or data in certain order, it is specified in an object passed as third argument to `addEventListener`. They also can be called only once, and regardless of whether the event has been cancelled or not.\n\n```ts\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.locale === 'en-x-placeholder') e.cancel()\n  },\n  { priority: 100 },\n)\n\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.canceled) {\n      console.warning(`locale change to ${e.locale} has been cancelled!`)\n    } else {\n      console.log(`locale is now going to change to ${e.locale}`)\n    }\n  },\n  {\n    priority: -99999, // like super super unimportant\n    always: true,\n  },\n)\n\ncontroller.addEventListener(\n  'error',\n  (e) => {\n    console.error('controller event target error', e.error)\n  },\n  { once: true },\n)\n```\n\n## Controller\n\nThe controller is an object returned by `createController` function. It is not the class, but an object that combines all the reactive partials together. This object is typed as `IntlController<T>` and all of the properties and methods are thoughtfully documented. Most important ones are highlighted below.\n\n### Imperative management\n\nYou can imperatively create locales instead of declaring them:\n\n```ts\nconst britishEnglish = controller.addLocale('en-GB')\nbritishEnglish.meta = {\n  displayName: 'British English',\n}\n```\n\nAs well as imperatively remove those locales:\n\n```ts\nconst removedLocale = controller.removeLocale('en-GB')\nconsole.assert(britishEnglish === removedLocale)\n```\n\nTo add messages to the locales use `addMessages`, it accepts both code and descriptor. Under the hood it assigns messages, so you can also remove messages with it by providing `undefined` as a value for some key.\n\n```ts\nconst pirateEnglish = controller.addLocale('en-x-pirate')\ncontroller.addMessages(pirateEnglish, {\n  removeMe: undefined,\n  greeting: 'Ahoy, {name}!',\n})\n```\n\n### Properties\n\nMany getter properties are provided at your convenience to access the current state of the controller via `ready`, `automatic`, `locale`, `defaultLocale`, `preferredLocale`. Active `IntlShape` is exposed through `intl` property.\n\nMessages and resources for the current and default locale are accessible as well via `messages`, `defaultMessages`, `resources` and `defaultResources`\n\n`formats` matches the `$fmt` property returned by the plugin.\n\nIf you need to accept locale properties use `intlLocale`, it returns [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) object for the active locale. This can be used to check if language is English, for example:\n\n```ts\n// The following will match en-US, en-GB, en-CA, en-x-pirate, etc.\n\nif (controller.intlLocale.language === 'en') {\n  console.log('Uses English')\n}\n```\n\n## Automation\n\nBrowsers tell sites which languages user prefers. For this purpose automation API was added to the controller. It works by defining multiple sources which tell the currently used locale.\n\nBy default there are no sources, but the package is shipped with two sources that you can set up client and server side:\n\nOn server:\n\n```ts\nimport { useAcceptLanguageHeader } from '@braw/vue-intl-controller/source/header'\n\nconst headerSource = useAcceptLanguageHeader(req.headers['Accept-Language'])\n\ncontroller.addSource(headerSource)\n```\n\nOn client:\n\n```ts\nimport { useNavigatorLanguage } from '@braw/vue-intl-controller/source/navigator'\n\ncontroller.addSource(useNavigatorLanguage())\n```\n\nTo create a custom source implement `PreferredLocalesSource` interface, it is an object or a class that has `prefers` property which is either an array of strings or `null` or Vue's reference to these, if your preferences update dynamically. It can also contain `install` and `uninstall` methods, these are called when source is first initialised or when it's imperatively removed.\n\n<details>\n<summary>Example of custom source</summary>\n\n```ts\nimport { ref } from 'vue'\n\nfunction createCustomSource(locales: string[]) {\n  const prefers = ref(null as string[] | null)\n\n  function install() {\n    prefers.value = locales\n  }\n\n  function uninstall() {\n    prefers.value = null\n  }\n\n  return {\n    prefers,\n    install,\n    uninstall,\n  }\n}\n```\n\n</details>\n\n## Strict type checking with TypeScript\n\n> **Warning** This is an experimental feature.\n\nYou can declare your messages by creating an ambient declaration file where you need to import `@braw/vue-intl-controller`, so that you can extend global namespace `VueIntlController` containing the following declarations:\n\n- `interface` `MessageValueTypes`\n\n  A map of all usable objects within translation functions and components.\n\n  You can use it if you have something like `CompactNumber` object from `@braw/extended-intl`.\n\n- `interface` `CustomMessages`\n\n  A map of custom messages mapped to arguments within those messages.\n\n  Declaring this map will enable strict type-checking across all usage of Vue Intl Controller functions. Partial message declaration is not supported yet, alas.\n\n- `interface` `LocaleMeta`\n\n  A map of all meta properties for the locales, these are always accessible through locale descriptors.\n\n- `interface` `LocaleResources`\n\n  A map of locale resources provided by the load event listeners.\n\n<details>\n<summary>Example</summary>\n\nCreate a file called along the lines of `i18n.d.ts`, and inside of it write:\n\n```ts\n// Makes sure TypeScript knows what we extend:\nimport '@braw/vue-intl-controller'\n\n// Helper types:\nimport type {\n  SelectArgument,\n  ValueArgument,\n} from '@braw/vue-intl-controller/types/arguments'\n\n// Example piece of 'your' code:\nimport type { ExampleObject } from '~/utils/convertibleObject.ts'\n\ndeclare global {\n  namespace VueIntlController {\n    interface MessageValueTypes {\n      // key doesn't matter as long as it does not collide with other key;\n      // the interface used here solely for extensibility since you cannot\n      // extend type or particular interface keys\n      __example__object: ExampleObject\n    }\n\n    interface CustomMessages {\n      // {type, select, greeting {Hello} goodbye {Goodbye} other {Ey}}, {name}\n      'general.message': {\n        /** Type of the message. */\n        type: SelectArgument<'greeting' | 'goodbye' | 'other'>\n\n        /** Name of the addressed person. */\n        name: ValueArgument\n      }\n    }\n\n    interface LocaleMeta {\n      /** Name of the locale translated to the locale's name. */\n      displayName: string\n\n      /** Name of the locale written in English. */\n      englishName: string\n\n      /** Percentage of translation coverage across all documents and files. */\n      translatedPercentage: number\n    }\n\n    interface LocaleResources {\n      /** Markdown markup containing explanation of our payout terms. */\n      payoutExplanation: string\n\n      /** Markdown markup containing our terms of service. */\n      termsOfService: string\n\n      /** Markdown markup containing our privacy policy. */\n      privacyPolicy: string\n\n      /** A map of translated language names. */\n      languageNames: Record<string, string>\n    }\n  }\n}\n```\n\n</details>\n","readmeFilename":"README.md","gitHead":"160d6692be5279bc463e4d549dc380aa8abc6432","_id":"@braw/vue-intl-controller@4.0.0-rc.2","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-dz7zvUqMXngqC9AmHr+h8CAhA2DmbfnjspZSY5okawEgs/dN0TfCrnqcrZNHKsuwvzDKt2hwuBuPrI1VSVFBFQ==","shasum":"403e6a288c9d10f5c3f83d0529ebb22ea888a7f1","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-4.0.0-rc.2.tgz","fileCount":46,"unpackedSize":155003,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBIy2fG7Nj8c8773PEBGyAnvrG1dUvbTGVGio+bv4biTAiB9gmJuHJ9nFoNpARO84QMirCUxvXOl99SkezfVp+RumA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0SJxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpb9RAAkPDjD95N4vmCogGQOadMqJ9R6J/3kcKZ9MOiBJIDYs1UD1ld\r\nRBf46NPbqtOWI3h0xNJIobN6nVJXJlwgAaQrinyN+RM9YR7tt6N/OlTg5I3E\r\n1htLtVzr0PHISckUf34o6tCXKPaASst66ZNbpsN0QWN668t0liMcQq6bN5nt\r\n3vXg7DC3C6Mi0OQ2mwEunU3XypXCOODijcnNk6n/OR2MNnJMRWn6Kx5COgA3\r\nahW4bQ/P8geQniOIdktVyDawfpi7LANhMXoKyYVKCv+vmhF3ancznfFzT6fi\r\nTA3115DVDazm8gyw74PTSsVAJVY2dqrPyL/Qj+XnhpUzGZIm0w5ZNNgOSlbY\r\nc94I/idJDRPvk65tYr/Fj/ZSbNujiMZCpUHvveRr7aLdfSCjWN1uUD42fKe6\r\n8rt9/m3AkitH5FCOruVwXv0iqwi07Mx1YbaNt29/K9BoYfPEfNyozeabj9mE\r\nAgVm2myvX3eQE8tJQEen5eouNVZCkYvztafWekdysobPxGRT8DklJ9JH2RhH\r\nVs8ey4QdqSZpLv3vHLYglIBkrRxaYSzA33R85gaXIRTl3KqFPN974I8W+lqG\r\nMrUhZT9f2IC0frYuse55sHMiLm/qBE4bdO+sMeoI8sVia3u7MlUdpLNBRXKN\r\n3OwKw9yMrI0lDzcCjA3HJrwl2r2M8fy8UJg=\r\n=rE4w\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_4.0.0-rc.2_1674650225052_0.39286150735415326"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"4.0.0-rc.3":{"name":"@braw/vue-intl-controller","version":"4.0.0-rc.3","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue3"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs","require":"./dist/events/index.cjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs","require":"./dist/plugin.cjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs","require":"./dist/controller.cjs"},"./translateFunction":{"types":"./dist/translateFunction.d.ts","import":"./dist/translateFunction.mjs","require":"./dist/translateFunction.cjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs","require":"./dist/components.cjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","require":"./dist/sources/*.cjs","import":"./dist/sources/*.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.12","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.18","del-cli":"^5.0.0","eslint":"^8.31.0","happy-dom":"^8.1.5","prettier":"^2.8.3","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^20.0.2","typescript":"^4.9.4","unbuild":"^1.1.1","vitest":"^0.27.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^2.0.0","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^3.2.45"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"readme":"# vue-intl-controller\n\n> A plugin for Vue 2.7+ to dynamically control [`@braw/extended-intl`](https://npm.im/@braw/extended-intl).\n\n## ⚠ Caution!\n\nThis project was not thoughtfully tested, it is a port of [code](https://github.com/modrinth/knossos/pull/738) to support internationalisation of [Modrinth](https://modrinth.com/) front-end. It is published early for development reasons.\n\n## Summary\n\n[`@braw/extended-intl`](https://npm.im/@braw/extended-intl), being a wrapper for [`@formatjs/intl`](https://formatjs.io/docs/intl), allows to easily implement access to localisation using ICU MessageFormat messages.\n\nHowever, using it in Vue in dynamic manner is not an easy task if you want to preserve most of its functionality and more. This package was created to solve that.\n\nIt is created with extensibility in mind, so you can extend upon it and add support for it in other frameworks, like Nuxt (module for Nuxt is being worked on). On your disposal events, asynchronous loading mechanism and even some of the internals exposed.\n\nAs a consumer, there's a mixing that adds helpers like `$t`, `$fmt` and `$i18n` to your components (can be turned off), as well as `useI18n()` composable. There's also `<IntlFormatted>` component, which allows to use components while formatting the messages.\n\nWritten in TypeScript, ambient type extension is possible for better type checking to the point where entire arguments used in messages can be type checked!\n\n## Installation and usage\n\n### Installation\n\nInstall using your package manager of choice:\n\n**npm**\n\n```sh\nnpm i @braw/vue-intl-controller\n```\n\n**pnpm**\n\n```sh\npnpm i @braw/vue-intl-controller\n```\n\n**yarn**\n\n```sh\nyarn add @braw/vue-intl-controller\n```\n\n### Usage\n\nIn your Vue app entry point import `createPlugin` function.\n\n```ts\nimport { createPlugin } from '@braw/vue-intl-controller/plugin'\n```\n\nCreate a plugin instance (you can do that inline, without variable):\n\n```ts\nconst plugin = createPlugin({\n  // Options for the controller instance.\n  controllerOpts: {\n    // All locale tags must be valid BCP 47 language tags.\n\n    // Tag for the default locale. Must be one of the defined locales' tags.\n    defaultLocale: 'en-US',\n\n    // Tag for the currently used locale. Must also be defined in locales.\n    locale: 'en-US',\n\n    // All defined locales.\n    locales: [\n      {\n        // BCP 47 tag for the locale.\n        tag: 'en-US',\n\n        // Any meta information that is available even if locale is not loaded.\n        // Must be JSON encode-able.\n        meta: {\n          displayName: 'American English',\n        },\n      },\n    ],\n  },\n\n  // Whether you want to automatically install <IntlFormatted> component.\n  globalComponent: true,\n\n  // Whether to inject $t, $fmt and $i18n properties on components' creation.\n  globalMixin: true,\n\n  // Additional injection sites like Vuex store or Nuxt app.\n  injectInto: [],\n})\n```\n\nThose are example options, in fact you can completely skip most of them, because they're already like that by default (except for `meta` of `en-US` locale).\n\nIf you need, you can access properties by injecting them into a temporary object:\n\n```ts\nconst { $fmt, $i18n, $t } = Object.defineProperties({}, plugin.getInjections())\n```\n\nInstall plugin into your Vue app:\n\n```ts\n// ...\nconst app = createApp(App)\n\napp.use(plugin)\n```\n\nYou can now use all of the plugin's features:\n\n```vue\n<script setup>\nimport { useI18n } from '@braw/vue-intl-controller'\nimport { defineMessages } from '@formatjs/intl'\n\nconst messages = defineMessages({\n  today: {\n    id: 'today',\n    defaultMessage: 'Today is {date}'\n  }\n  motd: {\n    id: 'motd',\n    defaultMessage: 'Message of the day',\n  },\n  greeting: {\n    id: 'greeting',\n    defaultMessage: 'Hello, {name}!',\n  },\n})\n\nconst { formatMessage: translate, formats: fmt } = $(useI18n())\n</script>\n\n<template>\n  <h2>\n    {{\n      translate(messages.today, {\n        date: fmt.date(Date.now(), {\n          dateStyle: 'long',\n          timeStyle: 'medium',\n        }),\n      })\n    }}\n  </h2>\n  <h3>{{ translate(messages.motd) }}</h3>\n\n  <IntlFormatted :message-id=\"messages.greeting\">\n    <template #~name>\n      <strong>World</strong>\n    </template>\n  </IntlFormatted>\n</template>\n```\n\n## Messages loading\n\n`IntlController` uses event-based approach to handling loading of messages. Whenever locale change is accepted, the controller fires a `LocaleLoadEvent`. It is asynchronous, so your listener function may return a promise and it will prompt controller to wait before calling any other listeners.\n\n> **Note**\n> There is approach to add messages that does not involve events, keep reading to learn more.\n\nIf you created plugin, you can access controller using `getOrCreateController` function. As name implies, the controller is initialised lazily, whenever you try to install the plugin to Vue or call any of the getters like `getInjections` or `getOrCreateController`.\n\n```ts\nconst controller = plugin.getOrCreateController()\n```\n\nYou can then load messages rudimentary way:\n\n```ts\nconst messages = {\n  'en-US': {\n    greeting: 'Hello, {name}!',\n  },\n  de: {\n    greeting: 'Hallo {name}!',\n  },\n  uk: {\n    greeting: 'Привіт, {name}!',\n  },\n}\n\ncontroller.addEventListener('localeload', (e) => {\n  if (e.locale in messages) e.addMessages(messages[e.locale])\n})\n```\n\nOr you can use `import` functions. And if you use webpack, you can even split those imports in chunks to avoid sending unneeded data to client:\n\n```ts\nconst messagesMap = {\n  'en-US': () =>\n    import(\n      /* webpackChunkName: \"locale-en-US\", webpackMode: \"lazy\" */ './i18n/en-US.json'\n    ),\n  uk: () =>\n    import(\n      /* webpackChunkName: \"locale-uk\", webpackMode: \"lazy\" */ './i18n/uk.json'\n    ),\n}\n\ncontroller.addEventListener('localeload', async (e) => {\n  if (e.locale in messagesMap) {\n    const messagesImport = await messagesMap[e.locale]()\n    e.addMessages(messagesImport.default)\n  }\n})\n```\n\n### More to events\n\nThere are two more events that you may want to know about:\n\n- `error` is called when any error occurs in controller's event target. If there are no listeners to that event then all listener errors are logged to console.\n- `localechange` is called when locale is about to change. It can be cancelled, then locale will remain as it is and the initiator of locale change will receive an error.\n- `afterlocalechange` is called after the locale has been applied.\n\nEvent listeners can have a priority, in case you need to load messages or data in certain order, it is specified in an object passed as third argument to `addEventListener`. They also can be called only once, and regardless of whether the event has been cancelled or not.\n\n```ts\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.locale === 'en-x-placeholder') e.cancel()\n  },\n  { priority: 100 },\n)\n\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.canceled) {\n      console.warning(`locale change to ${e.locale} has been cancelled!`)\n    } else {\n      console.log(`locale is now going to change to ${e.locale}`)\n    }\n  },\n  {\n    priority: -99999, // like super super unimportant\n    always: true,\n  },\n)\n\ncontroller.addEventListener(\n  'error',\n  (e) => {\n    console.error('controller event target error', e.error)\n  },\n  { once: true },\n)\n```\n\n## Controller\n\nThe controller is an object returned by `createController` function. It is not the class, but an object that combines all the reactive partials together. This object is typed as `IntlController<T>` and all of the properties and methods are thoroughly documented. Most important ones are highlighted below.\n\n### Imperative management\n\nYou can imperatively create locales instead of declaring them:\n\n```ts\nconst britishEnglish = controller.addLocale('en-GB')\nbritishEnglish.meta = {\n  displayName: 'British English',\n}\n```\n\nAs well as imperatively remove those locales:\n\n```ts\nconst removedLocale = controller.removeLocale('en-GB')\nconsole.assert(britishEnglish === removedLocale)\n```\n\nTo add messages to the locales use `addMessages`, it accepts both locale tag and descriptor. Under the hood it assigns messages, so you can also remove messages with it by providing `undefined` as a value for any key.\n\n```ts\nconst pirateEnglish = controller.addLocale('en-x-pirate')\ncontroller.addMessages(pirateEnglish, {\n  removeMe: undefined,\n  greeting: 'Ahoy, {name}!',\n})\n```\n\n### Properties\n\nMany getter properties are provided at your convenience to access the current state of the controller via `ready`, `automatic`, `locale`, `defaultLocale`, `preferredLocale`. Active `IntlShape` is exposed through `intl` property.\n\nMessages and resources for the current and default locale are accessible as well via `messages`, `defaultMessages`, `resources` and `defaultResources`\n\n`formats` matches the `$fmt` property returned by the plugin.\n\nIf you need to accept locale properties use `intlLocale`, it returns [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) object for the active locale. This can be used to check if language is English, for example:\n\n```ts\n// The following will match en-US, en-GB, en-CA, en-x-pirate, etc.\n\nif (controller.intlLocale.language === 'en') {\n  console.log('Uses English')\n}\n```\n\n## Automation\n\nBrowsers tell sites which languages user prefers. For this purpose automation API was added to the controller. It works by defining multiple sources which tell the currently used locale.\n\nBy default there are no sources, but the package is shipped with two sources that you can set up client and server side:\n\nOn server:\n\n```ts\nimport { useAcceptLanguageHeader } from '@braw/vue-intl-controller/source/header'\n\nconst headerSource = useAcceptLanguageHeader(req.headers['Accept-Language'])\n\ncontroller.addSource(headerSource)\n```\n\nOn client:\n\n```ts\nimport { useNavigatorLanguage } from '@braw/vue-intl-controller/source/navigator'\n\ncontroller.addSource(useNavigatorLanguage())\n```\n\nTo create a custom source implement `PreferredLocalesSource` interface, it is an object or a class that has `prefers` property which is either an array of strings or `null` or Vue's reference to these, if your preferences update dynamically. It can also contain `install` and `uninstall` methods, these are called when source is first initialised or when it's imperatively removed.\n\n<details>\n<summary>Example of custom source</summary>\n\n```ts\nimport { ref } from 'vue'\n\nfunction createCustomSource(locales: string[]) {\n  const prefers = ref(null as string[] | null)\n\n  function install() {\n    prefers.value = locales\n  }\n\n  function uninstall() {\n    prefers.value = null\n  }\n\n  return {\n    prefers,\n    install,\n    uninstall,\n  }\n}\n```\n\n</details>\n\n## Strict type checking with TypeScript\n\n> **Warning** This is an experimental feature.\n\nYou can declare your messages by creating an ambient declaration file where you need to import `@braw/vue-intl-controller`, so that you can extend global namespace `VueIntlController` containing the following declarations:\n\n- `interface` `MessageValueTypes`\n\n  A map of all usable objects within translation functions and components.\n\n  You can use it if you have something like `CompactNumber` object from `@braw/extended-intl`.\n\n- `interface` `CustomMessages`\n\n  A map of custom messages mapped to arguments within those messages.\n\n  Declaring this map will enable strict type-checking across all usage of Vue Intl Controller functions. Partial message declaration is not supported yet, alas.\n\n- `interface` `LocaleMeta`\n\n  A map of all meta properties for the locales, these are always accessible through locale descriptors.\n\n- `interface` `LocaleResources`\n\n  A map of locale resources provided by the load event listeners.\n\n<details>\n<summary>Example</summary>\n\nCreate a file called along the lines of `i18n.d.ts`, and inside of it write:\n\n```ts\n// Makes sure TypeScript knows what we extend:\nimport '@braw/vue-intl-controller'\n\n// Helper types:\nimport type {\n  SelectArgument,\n  ValueArgument,\n} from '@braw/vue-intl-controller/types/arguments'\n\n// Example piece of 'your' code:\nimport type { ExampleObject } from '~/utils/convertibleObject.ts'\n\ndeclare global {\n  namespace VueIntlController {\n    interface MessageValueTypes {\n      // key doesn't matter as long as it does not collide with other key;\n      // the interface used here solely for extensibility since you cannot\n      // extend type or particular interface keys\n      __example__object: ExampleObject\n    }\n\n    interface CustomMessages {\n      // {type, select, greeting {Hello} goodbye {Goodbye} other {Ey}}, {name}\n      'general.message': {\n        /** Type of the message. */\n        type: SelectArgument<'greeting' | 'goodbye' | 'other'>\n\n        /** Name of the addressed person. */\n        name: ValueArgument\n      }\n    }\n\n    interface LocaleMeta {\n      /** Name of the locale translated to the locale's name. */\n      displayName: string\n\n      /** Name of the locale written in English. */\n      englishName: string\n\n      /** Percentage of translation coverage across all documents and files. */\n      translatedPercentage: number\n    }\n\n    interface LocaleResources {\n      /** Markdown markup containing explanation of our payout terms. */\n      payoutExplanation: string\n\n      /** Markdown markup containing our terms of service. */\n      termsOfService: string\n\n      /** Markdown markup containing our privacy policy. */\n      privacyPolicy: string\n\n      /** A map of translated language names. */\n      languageNames: Record<string, string>\n    }\n  }\n}\n```\n\n</details>\n","readmeFilename":"README.md","gitHead":"97a72e244d1299392a5bc04964a35db583f890b3","_id":"@braw/vue-intl-controller@4.0.0-rc.3","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-2uBS63DVccYwpDoSu3BlHGDCNdmf+jS7r7MPgGxym2ynQof6H0aaalhdIwsZcRgMCgbfMd4T27749Ese1fTA3Q==","shasum":"7e99e596916c23df92d93b38dbcf5d2c9244f16e","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-4.0.0-rc.3.tgz","fileCount":46,"unpackedSize":155252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsMJwvmljgKsx7I031mp4HiVCEumu86cvBBMvpmrFW5AIhAJv4vl/kwJ68/gYgLTPlDA/mKWhJ9uJ5MN19a1omsXBh"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0YP6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpncw/+NZ0NpFijCMG0nFAj1HFrRTCTxDBpJLQ48LC9rjfYRkaP6Q20\r\n+FqAyJXHLKVgXnTA4PapzgL2kIaWzYUSDs0VuL740BfkUy84w0GJ/rqTB4z9\r\nHDuWwWU17T1xlXBRQngooJ80gDHMpazoGebmS9yE1Y14P01XvN1MH4rrnuDv\r\n8wc98yflWpvRkKtdEsWsEXTmzjKeDmHcgtOidAwIingMWjSxnIkF4Ti9Ycf7\r\nE9W1I43GtNv2TfGzh4CPgoEgmBeLhEODua6wQnY2p4N9xepEaZ8/IHPn92uT\r\nMWr6V7DHCceFOj16TJc+lq3+I+YUBnN59J05kHZy2KTSWOrnHjuBWl8Gct6K\r\njO99FM1/zoc8WZW/cAzBweOk+jB6iwJFBy58n78Iv+F9px/U4kZ9+5EvsyjR\r\n0zFMSNAFyK1a6Mme9/l+yQo2VfynaeACTXy+NpexVF1g/v4z7c6QlxDHqo1N\r\nazk0mg7DT4SGR1SAaWjq9d3PsUlNvHDRNfuBTozF5lf1Y72NNooU3KpLCyLR\r\nrDqwd9nJs1oDnm2RkOJA1G0DdhapTaEeGY20Qb7xU8areTpgAzARIusHvMQl\r\naUu0QnqDZuzrLdjZyZ0R7tEq7SPRoJOK9zZpSI0MBkJgUxI2Po+8fdqlHbiF\r\nT9dpHibX+znkXjaan9lbidLp4Tfx6ZWGmhw=\r\n=RNWG\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_4.0.0-rc.3_1674675193857_0.502495338864861"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"4.0.0-rc.4":{"name":"@braw/vue-intl-controller","version":"4.0.0-rc.4","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue3"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs","require":"./dist/events/index.cjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs","require":"./dist/plugin.cjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs","require":"./dist/controller.cjs"},"./translateFunction":{"types":"./dist/translateFunction.d.ts","import":"./dist/translateFunction.mjs","require":"./dist/translateFunction.cjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs","require":"./dist/components.cjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","require":"./dist/sources/*.cjs","import":"./dist/sources/*.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build","test":"vitest run","lint":"eslint src"},"devDependencies":{"@babel/core":"^7.20.12","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.18","del-cli":"^5.0.0","eslint":"^8.31.0","happy-dom":"^8.1.5","prettier":"^2.8.3","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^20.0.2","typescript":"^4.9.4","unbuild":"^1.1.1","vitest":"^0.27.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@braw/extended-intl":"^2.0.0","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^3.2.45"},"peerDependencies":{"@formatjs/icu-messageformat-parser":"^2.1.14"},"publishConfig":{"access":"public"},"readme":"# vue-intl-controller\n\n> A plugin for Vue 2.7+ to dynamically control [`@braw/extended-intl`](https://npm.im/@braw/extended-intl).\n\n## ⚠ Caution!\n\nThis project was not thoughtfully tested, it is a port of [code](https://github.com/modrinth/knossos/pull/738) to support internationalisation of [Modrinth](https://modrinth.com/) front-end. It is published early for development reasons.\n\n## Summary\n\n[`@braw/extended-intl`](https://npm.im/@braw/extended-intl), being a wrapper for [`@formatjs/intl`](https://formatjs.io/docs/intl), allows to easily implement access to localisation using ICU MessageFormat messages.\n\nHowever, using it in Vue in dynamic manner is not an easy task if you want to preserve most of its functionality and more. This package was created to solve that.\n\nIt is created with extensibility in mind, so you can extend upon it and add support for it in other frameworks, like Nuxt (module for Nuxt is being worked on). On your disposal events, asynchronous loading mechanism and even some of the internals exposed.\n\nAs a consumer, there's a mixing that adds helpers like `$t`, `$fmt` and `$i18n` to your components (can be turned off), as well as `useI18n()` composable. There's also `<IntlFormatted>` component, which allows to use components while formatting the messages.\n\nWritten in TypeScript, ambient type extension is possible for better type checking to the point where entire arguments used in messages can be type checked!\n\n## Installation and usage\n\n### Installation\n\nInstall using your package manager of choice:\n\n**npm**\n\n```sh\nnpm i @braw/vue-intl-controller\n```\n\n**pnpm**\n\n```sh\npnpm i @braw/vue-intl-controller\n```\n\n**yarn**\n\n```sh\nyarn add @braw/vue-intl-controller\n```\n\n### Usage\n\nIn your Vue app entry point import `createPlugin` function.\n\n```ts\nimport { createPlugin } from '@braw/vue-intl-controller/plugin'\n```\n\nCreate a plugin instance (you can do that inline, without variable):\n\n```ts\nconst plugin = createPlugin({\n  // Options for the controller instance.\n  controllerOpts: {\n    // All locale tags must be valid BCP 47 language tags.\n\n    // Tag for the default locale. Must be one of the defined locales' tags.\n    defaultLocale: 'en-US',\n\n    // Tag for the currently used locale. Must also be defined in locales.\n    locale: 'en-US',\n\n    // All defined locales.\n    locales: [\n      {\n        // BCP 47 tag for the locale.\n        tag: 'en-US',\n\n        // Any meta information that is available even if locale is not loaded.\n        // Must be JSON encode-able.\n        meta: {\n          displayName: 'American English',\n        },\n      },\n    ],\n  },\n\n  // Whether you want to automatically install <IntlFormatted> component.\n  globalComponent: true,\n\n  // Whether to inject $t, $fmt and $i18n properties on components' creation.\n  globalMixin: true,\n\n  // Additional injection sites like Vuex store or Nuxt app.\n  injectInto: [],\n})\n```\n\nThose are example options, in fact you can completely skip most of them, because they're already like that by default (except for `meta` of `en-US` locale).\n\nIf you need, you can access properties by injecting them into a temporary object:\n\n```ts\nconst { $fmt, $i18n, $t } = Object.defineProperties({}, plugin.getInjections())\n```\n\nInstall plugin into your Vue app:\n\n```ts\n// ...\nconst app = createApp(App)\n\napp.use(plugin)\n```\n\nYou can now use all of the plugin's features:\n\n```vue\n<script setup>\nimport { useI18n } from '@braw/vue-intl-controller'\nimport { defineMessages } from '@formatjs/intl'\n\nconst messages = defineMessages({\n  today: {\n    id: 'today',\n    defaultMessage: 'Today is {date}'\n  }\n  motd: {\n    id: 'motd',\n    defaultMessage: 'Message of the day',\n  },\n  greeting: {\n    id: 'greeting',\n    defaultMessage: 'Hello, {name}!',\n  },\n})\n\nconst { formatMessage: translate, formats: fmt } = $(useI18n())\n</script>\n\n<template>\n  <h2>\n    {{\n      translate(messages.today, {\n        date: fmt.date(Date.now(), {\n          dateStyle: 'long',\n          timeStyle: 'medium',\n        }),\n      })\n    }}\n  </h2>\n  <h3>{{ translate(messages.motd) }}</h3>\n\n  <IntlFormatted :message-id=\"messages.greeting\">\n    <template #~name>\n      <strong>World</strong>\n    </template>\n  </IntlFormatted>\n</template>\n```\n\n## Messages loading\n\n`IntlController` uses event-based approach to handling loading of messages. Whenever locale change is accepted, the controller fires a `LocaleLoadEvent`. It is asynchronous, so your listener function may return a promise and it will prompt controller to wait before calling any other listeners.\n\n> **Note**\n> There is approach to add messages that does not involve events, keep reading to learn more.\n\nIf you created plugin, you can access controller using `getOrCreateController` function. As name implies, the controller is initialised lazily, whenever you try to install the plugin to Vue or call any of the getters like `getInjections` or `getOrCreateController`.\n\n```ts\nconst controller = plugin.getOrCreateController()\n```\n\nYou can then load messages rudimentary way:\n\n```ts\nconst messages = {\n  'en-US': {\n    greeting: 'Hello, {name}!',\n  },\n  de: {\n    greeting: 'Hallo {name}!',\n  },\n  uk: {\n    greeting: 'Привіт, {name}!',\n  },\n}\n\ncontroller.addEventListener('localeload', (e) => {\n  if (e.locale in messages) e.addMessages(messages[e.locale])\n})\n```\n\nOr you can use `import` functions. And if you use webpack, you can even split those imports in chunks to avoid sending unneeded data to client:\n\n```ts\nconst messagesMap = {\n  'en-US': () =>\n    import(\n      /* webpackChunkName: \"locale-en-US\", webpackMode: \"lazy\" */ './i18n/en-US.json'\n    ),\n  uk: () =>\n    import(\n      /* webpackChunkName: \"locale-uk\", webpackMode: \"lazy\" */ './i18n/uk.json'\n    ),\n}\n\ncontroller.addEventListener('localeload', async (e) => {\n  if (e.locale in messagesMap) {\n    const messagesImport = await messagesMap[e.locale]()\n    e.addMessages(messagesImport.default)\n  }\n})\n```\n\n### More to events\n\nThere are two more events that you may want to know about:\n\n- `error` is called when any error occurs in controller's event target. If there are no listeners to that event then all listener errors are logged to console.\n- `localechange` is called when locale is about to change. It can be cancelled, then locale will remain as it is and the initiator of locale change will receive an error.\n- `afterlocalechange` is called after the locale has been applied.\n\nEvent listeners can have a priority, in case you need to load messages or data in certain order, it is specified in an object passed as third argument to `addEventListener`. They also can be called only once, and regardless of whether the event has been cancelled or not.\n\n```ts\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.locale === 'en-x-placeholder') e.cancel()\n  },\n  { priority: 100 },\n)\n\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.canceled) {\n      console.warning(`locale change to ${e.locale} has been cancelled!`)\n    } else {\n      console.log(`locale is now going to change to ${e.locale}`)\n    }\n  },\n  {\n    priority: -99999, // like super super unimportant\n    always: true,\n  },\n)\n\ncontroller.addEventListener(\n  'error',\n  (e) => {\n    console.error('controller event target error', e.error)\n  },\n  { once: true },\n)\n```\n\n## Controller\n\nThe controller is an object returned by `createController` function. It is not the class, but an object that combines all the reactive partials together. This object is typed as `IntlController<T>` and all of the properties and methods are thoroughly documented. Most important ones are highlighted below.\n\n### Imperative management\n\nYou can imperatively create locales instead of declaring them:\n\n```ts\nconst britishEnglish = controller.addLocale('en-GB')\nbritishEnglish.meta = {\n  displayName: 'British English',\n}\n```\n\nAs well as imperatively remove those locales:\n\n```ts\nconst removedLocale = controller.removeLocale('en-GB')\nconsole.assert(britishEnglish === removedLocale)\n```\n\nTo add messages to the locales use `addMessages`, it accepts both locale tag and descriptor. Under the hood it assigns messages, so you can also remove messages with it by providing `undefined` as a value for any key.\n\n```ts\nconst pirateEnglish = controller.addLocale('en-x-pirate')\ncontroller.addMessages(pirateEnglish, {\n  removeMe: undefined,\n  greeting: 'Ahoy, {name}!',\n})\n```\n\n### Properties\n\nMany getter properties are provided at your convenience to access the current state of the controller via `ready`, `automatic`, `locale`, `defaultLocale`, `preferredLocale`. Active `IntlShape` is exposed through `intl` property.\n\nMessages and resources for the current and default locale are accessible as well via `messages`, `defaultMessages`, `resources` and `defaultResources`\n\n`formats` matches the `$fmt` property returned by the plugin.\n\nIf you need to accept locale properties use `intlLocale`, it returns [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) object for the active locale. This can be used to check if language is English, for example:\n\n```ts\n// The following will match en-US, en-GB, en-CA, en-x-pirate, etc.\n\nif (controller.intlLocale.language === 'en') {\n  console.log('Uses English')\n}\n```\n\n## Automation\n\nBrowsers tell sites which languages user prefers. For this purpose automation API was added to the controller. It works by defining multiple sources which tell the currently used locale.\n\nBy default there are no sources, but the package is shipped with two sources that you can set up client and server side:\n\nOn server:\n\n```ts\nimport { useAcceptLanguageHeader } from '@braw/vue-intl-controller/source/header'\n\nconst headerSource = useAcceptLanguageHeader(req.headers['Accept-Language'])\n\ncontroller.addSource(headerSource)\n```\n\nOn client:\n\n```ts\nimport { useNavigatorLanguage } from '@braw/vue-intl-controller/source/navigator'\n\ncontroller.addSource(useNavigatorLanguage())\n```\n\nTo create a custom source implement `PreferredLocalesSource` interface, it is an object or a class that has `prefers` property which is either an array of strings or `null` or Vue's reference to these, if your preferences update dynamically. It can also contain `install` and `uninstall` methods, these are called when source is first initialised or when it's imperatively removed.\n\n<details>\n<summary>Example of custom source</summary>\n\n```ts\nimport { ref } from 'vue'\n\nfunction createCustomSource(locales: string[]) {\n  const prefers = ref(null as string[] | null)\n\n  function install() {\n    prefers.value = locales\n  }\n\n  function uninstall() {\n    prefers.value = null\n  }\n\n  return {\n    prefers,\n    install,\n    uninstall,\n  }\n}\n```\n\n</details>\n\n## Strict type checking with TypeScript\n\n> **Warning** This is an experimental feature.\n\nYou can declare your messages by creating an ambient declaration file where you need to import `@braw/vue-intl-controller`, so that you can extend global namespace `VueIntlController` containing the following declarations:\n\n- `interface` `MessageValueTypes`\n\n  A map of all usable objects within translation functions and components.\n\n  You can use it if you have something like `CompactNumber` object from `@braw/extended-intl`.\n\n- `interface` `CustomMessages`\n\n  A map of custom messages mapped to arguments within those messages.\n\n  Declaring this map will enable strict type-checking across all usage of Vue Intl Controller functions. Partial message declaration is not supported yet, alas.\n\n- `interface` `LocaleMeta`\n\n  A map of all meta properties for the locales, these are always accessible through locale descriptors.\n\n- `interface` `LocaleResources`\n\n  A map of locale resources provided by the load event listeners.\n\n<details>\n<summary>Example</summary>\n\nCreate a file called along the lines of `i18n.d.ts`, and inside of it write:\n\n```ts\n// Makes sure TypeScript knows what we extend:\nimport '@braw/vue-intl-controller'\n\n// Helper types:\nimport type {\n  SelectArgument,\n  ValueArgument,\n} from '@braw/vue-intl-controller/types/arguments'\n\n// Example piece of 'your' code:\nimport type { ExampleObject } from '~/utils/convertibleObject.ts'\n\ndeclare global {\n  namespace VueIntlController {\n    interface MessageValueTypes {\n      // key doesn't matter as long as it does not collide with other key;\n      // the interface used here solely for extensibility since you cannot\n      // extend type or particular interface keys\n      __example__object: ExampleObject\n    }\n\n    interface CustomMessages {\n      // {type, select, greeting {Hello} goodbye {Goodbye} other {Ey}}, {name}\n      'general.message': {\n        /** Type of the message. */\n        type: SelectArgument<'greeting' | 'goodbye' | 'other'>\n\n        /** Name of the addressed person. */\n        name: ValueArgument\n      }\n    }\n\n    interface LocaleMeta {\n      /** Name of the locale translated to the locale's name. */\n      displayName: string\n\n      /** Name of the locale written in English. */\n      englishName: string\n\n      /** Percentage of translation coverage across all documents and files. */\n      translatedPercentage: number\n    }\n\n    interface LocaleResources {\n      /** Markdown markup containing explanation of our payout terms. */\n      payoutExplanation: string\n\n      /** Markdown markup containing our terms of service. */\n      termsOfService: string\n\n      /** Markdown markup containing our privacy policy. */\n      privacyPolicy: string\n\n      /** A map of translated language names. */\n      languageNames: Record<string, string>\n    }\n  }\n}\n```\n\n</details>\n","readmeFilename":"README.md","gitHead":"4e998263164110ccb7565d1b5c834c16620e494e","_id":"@braw/vue-intl-controller@4.0.0-rc.4","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-UKg0PzBO3kAC6tKorGyxeR7Mn3QvQ85YgJ2ZSbLNNFtoTlg/sSyiPtHzaz5YlQokJ/AdqDg9sCUqdMQgWxfXHw==","shasum":"a43aeafea7ba8ae4225682d79176e2cdf65bb516","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-4.0.0-rc.4.tgz","fileCount":46,"unpackedSize":155253,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+QZenSxBW5y2o7eIxOElxB8Dw/sPeCkoKMhNyBPidswIhANvMCWHluoOUIWXUADAkCuVs/3vnAXSVk3z1YubRYFAh"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0yi5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoqLRAAm5dHTBupgyIJ2Dz4pmt9yL9+CXzu475mDIDPB91tCm/f4Qbl\r\ncdmIR1d7EkRVrErZiWkKT9ReYOWQON9wtCSabtaGHD1Rb5nzUIRV2oggVkAu\r\nyEQVp4TJqNOL4kipLur6f9QkSarV9OWQfVavb0anRO+qY59sHcHIdfvjF/2O\r\nxL1W2X1DL4FE7a4aUZkqMtjDCJzZOWfewTBzlzX5qHCOg0LlPQRaJCGfdfN2\r\nk7ciUrtsb3gjNj+i6rv4NCUSbukxCv5lGliRM9tfwBHQoZ0Q8BxP4i4NY2I9\r\nRxandtbc9j8jAnGpRhN/oEgFigkGLkSuNr81GiuV64vOv4LPbUjhhHQ9zYvP\r\nBE+nRkM2vAeusegdMITWeCzSd4nQyZPyaEzbJ8s1zV8d4zatkkWMsma0OCVI\r\n5BfePl28lTvpKbM4Q8SmJUFt9jrDVZi/hFftIeErWzTvsUENSiKWNB5h1CW7\r\nkeqgJ+AgD7vBuxFfw6R9UZGW3BMXoKdiIyboZ0jFGuixwVp8/7Gzl5fhWJxM\r\nWmTAsNSgMcgCuOM2XukF4g9QV4YLLDofb/9uV9E6he7Q7fiMW2+/7fCMFJCG\r\nWG2RgqNyh0oVZXMxid9gpbnkIAe1kOfUes235NHtuKsx4UCocXV0A66DRWZr\r\nBxVRbFWBTQ1hAvtqmVZNPvIH01Cc0+XXX7U=\r\n=vJFp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_4.0.0-rc.4_1674782904944_0.3306984616217383"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"4.0.0-rc.5":{"name":"@braw/vue-intl-controller","version":"4.0.0-rc.5","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue3"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs","require":"./dist/events/index.cjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs","require":"./dist/plugin.cjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs","require":"./dist/controller.cjs"},"./translateFunction":{"types":"./dist/translateFunction.d.ts","import":"./dist/translateFunction.mjs","require":"./dist/translateFunction.cjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs","require":"./dist/components.cjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","require":"./dist/sources/*.cjs","import":"./dist/sources/*.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build","test":"vitest run","lint":"eslint src","bt":"pnpm build && pnpm test"},"devDependencies":{"@babel/core":"^7.20.12","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.18","del-cli":"^5.0.0","eslint":"^8.31.0","happy-dom":"^8.1.5","prettier":"^2.8.3","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^20.0.2","typescript":"^4.9.4","unbuild":"^1.1.1","vitest":"^0.27.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@formatjs/icu-messageformat-parser":"^2.1.14","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^3.2.45"},"publishConfig":{"access":"public"},"readme":"# vue-intl-controller\n\n> A plugin for Vue 3 to dynamically control [`@formatjs/intl`](https://npm.im/@formatjs/intl).\n\n## Summary\n\n[`@formatjs/intl`](https://npm.im/@formatjs/intl) allows to easily implement localisation using ICU MessageFormat messages.\n\nHowever, using it in Vue in dynamic manner is not an easy task if you want to preserve most of its functionality and more. This package was created to solve this.\n\nIt is created with extensibility in mind, so you can extend upon it and add support for it in other frameworks, like Nuxt (module for Nuxt is being worked on). On your disposal events, asynchronous loading mechanism and even some of the internals exposed.\n\nAs a consumer, there's a mixing that adds helpers like `$t`, `$fmt` and `$i18n` to your components (can be turned off), as well as `useI18n()` composable. There's also `<IntlFormatted>` component, which allows to use components while formatting the messages.\n\nWritten in TypeScript, ambient type extension is possible for better type checking to the point where entire arguments used in messages can be type checked!\n\n## Installation and usage\n\n### Installation\n\nInstall using your package manager of choice:\n\n**npm**\n\n```sh\nnpm i @braw/vue-intl-controller\n```\n\n**pnpm**\n\n```sh\npnpm i @braw/vue-intl-controller\n```\n\n**yarn**\n\n```sh\nyarn add @braw/vue-intl-controller\n```\n\n### Usage\n\nIn your Vue app entry point import `createPlugin` function.\n\n```ts\nimport { createPlugin } from '@braw/vue-intl-controller/plugin'\n```\n\nCreate a plugin instance (you can do that inline, without variable):\n\n```ts\nconst plugin = createPlugin({\n  // Options for the controller instance.\n  controllerOpts: {\n    // All locale tags must be valid BCP 47 language tags.\n\n    // Tag for the default locale. Must be one of the defined locales' tags.\n    defaultLocale: 'en-US',\n\n    // Tag for the currently used locale. Must also be defined in locales.\n    locale: 'en-US',\n\n    // All defined locales.\n    locales: [\n      {\n        // BCP 47 tag for the locale.\n        tag: 'en-US',\n\n        // Any meta information that is available even if locale is not loaded.\n        // Must be JSON encode-able.\n        meta: {\n          displayName: 'American English',\n        },\n      },\n    ],\n  },\n\n  // Whether you want to automatically install <IntlFormatted> component.\n  globalComponent: true,\n\n  // Whether to inject $t, $fmt and $i18n properties on components' creation.\n  globalMixin: true,\n\n  // Additional injection sites like Vuex store or Nuxt app.\n  injectInto: [],\n})\n```\n\nThose are example options, in fact you can completely skip most of them, because they're already like that by default (except for `meta` of `en-US` locale).\n\nIf you need, you can access properties by injecting them into a temporary object:\n\n```ts\nconst { $fmt, $i18n, $t } = Object.defineProperties({}, plugin.getInjections())\n```\n\nInstall plugin into your Vue app:\n\n```ts\n// ...\nconst app = createApp(App)\n\napp.use(plugin)\n```\n\nYou can now use all of the plugin's features:\n\n```vue\n<script setup>\nimport { useI18n } from '@braw/vue-intl-controller'\nimport { defineMessages } from '@formatjs/intl'\n\nconst messages = defineMessages({\n  today: {\n    id: 'today',\n    defaultMessage: 'Today is {date}'\n  }\n  motd: {\n    id: 'motd',\n    defaultMessage: 'Message of the day',\n  },\n  greeting: {\n    id: 'greeting',\n    defaultMessage: 'Hello, {name}!',\n  },\n})\n\nconst { formatMessage: translate, formats: fmt } = $(useI18n())\n</script>\n\n<template>\n  <h2>\n    {{\n      translate(messages.today, {\n        date: fmt.date(Date.now(), {\n          dateStyle: 'long',\n          timeStyle: 'medium',\n        }),\n      })\n    }}\n  </h2>\n  <h3>{{ translate(messages.motd) }}</h3>\n\n  <IntlFormatted :message-id=\"messages.greeting\">\n    <template #~name>\n      <strong>World</strong>\n    </template>\n  </IntlFormatted>\n</template>\n```\n\n## Messages loading\n\n`IntlController` uses event-based approach to handling loading of messages. Whenever locale change is accepted, the controller fires a `LocaleLoadEvent`. It is asynchronous, so your listener function may return a promise and it will prompt controller to wait before calling any other listeners.\n\n> **Note**\n> There is approach to add messages that does not involve events, keep reading to learn more.\n\nIf you created plugin, you can access controller using `getOrCreateController` function. As name implies, the controller is initialised lazily, whenever you try to install the plugin to Vue or call any of the getters like `getInjections` or `getOrCreateController`.\n\n```ts\nconst controller = plugin.getOrCreateController()\n```\n\nYou can then load messages rudimentary way:\n\n```ts\nconst messages = {\n  'en-US': {\n    greeting: 'Hello, {name}!',\n  },\n  de: {\n    greeting: 'Hallo {name}!',\n  },\n  uk: {\n    greeting: 'Привіт, {name}!',\n  },\n}\n\ncontroller.addEventListener('localeload', (e) => {\n  if (e.locale in messages) e.addMessages(messages[e.locale])\n})\n```\n\nOr you can use `import` functions. And if you use webpack, you can even split those imports in chunks to avoid sending unneeded data to client:\n\n```ts\nconst messagesMap = {\n  'en-US': () =>\n    import(\n      /* webpackChunkName: \"locale-en-US\", webpackMode: \"lazy\" */ './i18n/en-US.json'\n    ),\n  uk: () =>\n    import(\n      /* webpackChunkName: \"locale-uk\", webpackMode: \"lazy\" */ './i18n/uk.json'\n    ),\n}\n\ncontroller.addEventListener('localeload', async (e) => {\n  if (e.locale in messagesMap) {\n    const messagesImport = await messagesMap[e.locale]()\n    e.addMessages(messagesImport.default)\n  }\n})\n```\n\n### More to events\n\nThere are two more events that you may want to know about:\n\n- `error` is called when any error occurs in controller's event target. If there are no listeners to that event then all listener errors are logged to console.\n- `localechange` is called when locale is about to change. It can be cancelled, then locale will remain as it is and the initiator of locale change will receive an error.\n- `afterlocalechange` is called after the locale has been applied.\n\nEvent listeners can have a priority, in case you need to load messages or data in certain order, it is specified in an object passed as third argument to `addEventListener`. They also can be called only once, and regardless of whether the event has been cancelled or not.\n\n```ts\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.locale === 'en-x-placeholder') e.cancel()\n  },\n  { priority: 100 },\n)\n\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.canceled) {\n      console.warning(`locale change to ${e.locale} has been cancelled!`)\n    } else {\n      console.log(`locale is now going to change to ${e.locale}`)\n    }\n  },\n  {\n    priority: -99999, // like super super unimportant\n    always: true,\n  },\n)\n\ncontroller.addEventListener(\n  'error',\n  (e) => {\n    console.error('controller event target error', e.error)\n  },\n  { once: true },\n)\n```\n\n## Controller\n\nThe controller is an object returned by `createController` function. It is not the class, but an object that combines all the reactive partials together. This object is typed as `IntlController<T>` and all of the properties and methods are thoroughly documented. Most important ones are highlighted below.\n\n### Imperative management\n\nYou can imperatively create locales instead of declaring them:\n\n```ts\nconst britishEnglish = controller.addLocale('en-GB')\nbritishEnglish.meta = {\n  displayName: 'British English',\n}\n```\n\nAs well as imperatively remove those locales:\n\n```ts\nconst removedLocale = controller.removeLocale('en-GB')\nconsole.assert(britishEnglish === removedLocale)\n```\n\nTo add messages to the locales use `addMessages`, it accepts both locale tag and descriptor. Under the hood it assigns messages, so you can also remove messages with it by providing `undefined` as a value for any key.\n\n```ts\nconst pirateEnglish = controller.addLocale('en-x-pirate')\ncontroller.addMessages(pirateEnglish, {\n  removeMe: undefined,\n  greeting: 'Ahoy, {name}!',\n})\n```\n\n### Properties\n\nMany getter properties are provided at your convenience to access the current state of the controller via `ready`, `automatic`, `locale`, `defaultLocale`, `preferredLocale`. Active `IntlShape` is exposed through `intl` property.\n\nMessages and resources for the current and default locale are accessible as well via `messages`, `defaultMessages`, `resources` and `defaultResources`\n\n`formats` matches the `$fmt` property returned by the plugin.\n\nIf you need to accept locale properties use `intlLocale`, it returns [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) object for the active locale. This can be used to check if language is English, for example:\n\n```ts\n// The following will match en-US, en-GB, en-CA, en-x-pirate, etc.\n\nif (controller.intlLocale.language === 'en') {\n  console.log('Uses English')\n}\n```\n\n## Automation\n\nBrowsers tell sites which languages user prefers. For this purpose automation API was added to the controller. It works by defining multiple sources which tell the currently used locale.\n\nBy default there are no sources, but the package is shipped with two sources that you can set up client and server side:\n\nOn server:\n\n```ts\nimport { useAcceptLanguageHeader } from '@braw/vue-intl-controller/source/header'\n\nconst headerSource = useAcceptLanguageHeader(req.headers['Accept-Language'])\n\ncontroller.addSource(headerSource)\n```\n\nOn client:\n\n```ts\nimport { useNavigatorLanguage } from '@braw/vue-intl-controller/source/navigator'\n\ncontroller.addSource(useNavigatorLanguage())\n```\n\nTo create a custom source implement `PreferredLocalesSource` interface, it is an object or a class that has `prefers` property which is either an array of strings or `null` or Vue's reference to these, if your preferences update dynamically. It can also contain `install` and `uninstall` methods, these are called when source is first initialised or when it's imperatively removed.\n\n<details>\n<summary>Example of custom source</summary>\n\n```ts\nimport { ref } from 'vue'\n\nfunction createCustomSource(locales: string[]) {\n  const prefers = ref(null as string[] | null)\n\n  function install() {\n    prefers.value = locales\n  }\n\n  function uninstall() {\n    prefers.value = null\n  }\n\n  return {\n    prefers,\n    install,\n    uninstall,\n  }\n}\n```\n\n</details>\n\n## Strict type checking with TypeScript\n\n> **Warning** This is an experimental feature.\n\nYou can declare your messages by creating an ambient declaration file where you need to import `@braw/vue-intl-controller`, so that you can extend global namespace `VueIntlController` containing the following declarations:\n\n- `interface` `MessageValueTypes`\n\n  A map of all usable objects within translation functions and components.\n\n- `interface` `CustomMessages`\n\n  A map of custom messages mapped to arguments within those messages.\n\n  Declaring this map will enable strict type-checking across all usage of Vue Intl Controller functions. Partial message declaration is not supported yet, alas.\n\n- `interface` `LocaleMeta`\n\n  A map of all meta properties for the locales, these are always accessible through locale descriptors.\n\n- `interface` `LocaleResources`\n\n  A map of locale resources provided by the load event listeners.\n\n<details>\n<summary>Example</summary>\n\nCreate a file called along the lines of `i18n.d.ts`, and inside of it write:\n\n```ts\n// Makes sure TypeScript knows what we extend:\nimport '@braw/vue-intl-controller'\n\n// Helper types:\nimport type {\n  SelectArgument,\n  ValueArgument,\n} from '@braw/vue-intl-controller/types/arguments'\n\n// Example piece of 'your' code:\nimport type { ExampleObject } from '~/utils/convertibleObject.ts'\n\ndeclare global {\n  namespace VueIntlController {\n    interface MessageValueTypes {\n      // key doesn't matter as long as it does not collide with other key;\n      // the interface used here solely for extensibility since you cannot\n      // extend type or particular interface keys\n      __example__object: ExampleObject\n    }\n\n    interface CustomMessages {\n      // {type, select, greeting {Hello} goodbye {Goodbye} other {Ey}}, {name}\n      'general.message': {\n        /** Type of the message. */\n        type: SelectArgument<'greeting' | 'goodbye' | 'other'>\n\n        /** Name of the addressed person. */\n        name: ValueArgument\n      }\n    }\n\n    interface LocaleMeta {\n      /** Name of the locale translated to the locale's name. */\n      displayName: string\n\n      /** Name of the locale written in English. */\n      englishName: string\n\n      /** Percentage of translation coverage across all documents and files. */\n      translatedPercentage: number\n    }\n\n    interface LocaleResources {\n      /** Markdown markup containing explanation of our payout terms. */\n      payoutExplanation: string\n\n      /** Markdown markup containing our terms of service. */\n      termsOfService: string\n\n      /** Markdown markup containing our privacy policy. */\n      privacyPolicy: string\n\n      /** A map of translated language names. */\n      languageNames: Record<string, string>\n    }\n  }\n}\n```\n\n</details>\n","readmeFilename":"README.md","gitHead":"7c08e0ed0a76a22eebdb5f579c84a565f27fefa8","_id":"@braw/vue-intl-controller@4.0.0-rc.5","_nodeVersion":"18.14.0","_npmVersion":"9.3.1","dist":{"integrity":"sha512-UTqufenRIV6cuqHRCSKIDjUJCQxQjGZfpqnAoSI+SRRRGpRpi04fG85SBq+FgT2T+Anuso37VHTWFqeNeIn8Cg==","shasum":"a61a822788a40a956d8d3028f2e9ed426b1fbd8e","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-4.0.0-rc.5.tgz","fileCount":46,"unpackedSize":156137,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzyO5q4H/lsDOjgOLFQyxzjLxrqec83rF9NVFJXmPx5gIgAu4NkowzwdrA8A8E4dmAh/EBhYqvofYI+nRRbwbRdk4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9I8/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohJg/+KUS55cj1XBiZKDWs5x2xRW7LVr/XRq8EpoDBNDahqeDjs3tO\r\nmBCAag8UzwRACR44h0wDNsoJ3pifWGQGZaLKbLO9eMvNjWD2dEWHQ8IWUT0C\r\nJIwnPvMf8hm8KWsZFwJxGc7olJ1qTXU2h6qoRFhf0LL0nabsupNeCYSXYr4+\r\nwfziX9YlPppiLiBMZCD3G8SpfiaJ6TZMgN8fuEpib+kvvKl6W90fDGauxAjd\r\nOoUxtg6xCRzk9TTNddEBwQfuKdkN/Kgb5c20gpGTtEYiYAKrRK6b/NwLQj6V\r\n+uc8i87EgRc6EJVW/tsbjC7AymQih4QFsCg1dXAFR+nmlX2lhKKR3HrUb65/\r\ntUvxK4+0QKY5aGVDA1uixPvY3H+UjvTO5x9TRTWa/LMTFEuYKV4KFblpsTdk\r\nsEmvmvF8Kg9yV5Qu2crU9oTnY3o2Z5tVqHdI9KNy72UdLJjAhPAW+D0/leho\r\nFSo1KFliT4DDDoAn2lZkDpZSynHwPS4FhtlDUQ1/4UoMSO59a6+evCPbUwez\r\nleoK+Pgrk5TkjorfOhAOa4GaXZrIw4qYylA7mz6MnYqSQ0k70N3E/IzAEtvf\r\niQosrdbAgq65jbzArsHdvX0Pu1SySP6ZuZAM+Lkapnybeg6VlXaKV3V8/Oi/\r\nYXmOXUhHZKeweOZ9Xu8l8U6+r4BuYd+jbxA=\r\n=Tq3f\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_4.0.0-rc.5_1676971839015_0.38935460939305866"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"4.0.0-rc.6":{"name":"@braw/vue-intl-controller","version":"4.0.0-rc.6","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue3"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs","require":"./dist/types/arguments.cjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs","require":"./dist/events/index.cjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs","require":"./dist/plugin.cjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs","require":"./dist/controller.cjs"},"./translateFunction":{"types":"./dist/translateFunction.d.ts","import":"./dist/translateFunction.mjs","require":"./dist/translateFunction.cjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs","require":"./dist/components.cjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","require":"./dist/sources/*.cjs","import":"./dist/sources/*.mjs"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build","test":"vitest run","lint":"eslint src","bt":"pnpm build && pnpm test"},"devDependencies":{"@babel/core":"^7.20.12","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/preset-env":"^7.20.2","@babel/preset-typescript":"^7.18.6","@nuxtjs/eslint-config-typescript":"^12.0.0","@rollup/plugin-babel":"^6.0.3","@types/node":"^18.11.18","del-cli":"^5.0.0","eslint":"^8.31.0","happy-dom":"^8.1.5","prettier":"^2.8.3","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^20.0.2","typescript":"^4.9.4","unbuild":"^1.1.1","vitest":"^0.27.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@formatjs/icu-messageformat-parser":"^2.1.14","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^3.2.45"},"publishConfig":{"access":"public"},"readme":"# vue-intl-controller\n\n> A plugin for Vue 3 to dynamically control [`@formatjs/intl`](https://npm.im/@formatjs/intl).\n\n## Summary\n\n[`@formatjs/intl`](https://npm.im/@formatjs/intl) allows to easily implement localisation using ICU MessageFormat messages.\n\nHowever, using it in Vue in dynamic manner is not an easy task if you want to preserve most of its functionality and more. This package was created to solve this.\n\nIt is created with extensibility in mind, so you can extend upon it and add support for it in other frameworks, like Nuxt (module for Nuxt is being worked on). On your disposal events, asynchronous loading mechanism and even some of the internals exposed.\n\nAs a consumer, there's a mixing that adds helpers like `$t`, `$fmt` and `$i18n` to your components (can be turned off), as well as `useI18n()` composable. There's also `<IntlFormatted>` component, which allows to use components while formatting the messages.\n\nWritten in TypeScript, ambient type extension is possible for better type checking to the point where entire arguments used in messages can be type checked!\n\n## Installation and usage\n\n### Installation\n\nInstall using your package manager of choice:\n\n**npm**\n\n```sh\nnpm i @braw/vue-intl-controller\n```\n\n**pnpm**\n\n```sh\npnpm i @braw/vue-intl-controller\n```\n\n**yarn**\n\n```sh\nyarn add @braw/vue-intl-controller\n```\n\n### Usage\n\nIn your Vue app entry point import `createPlugin` function.\n\n```ts\nimport { createPlugin } from '@braw/vue-intl-controller/plugin'\n```\n\nCreate a plugin instance (you can do that inline, without variable):\n\n```ts\nconst plugin = createPlugin({\n  // Options for the controller instance.\n  controllerOpts: {\n    // All locale tags must be valid BCP 47 language tags.\n\n    // Tag for the default locale. Must be one of the defined locales' tags.\n    defaultLocale: 'en-US',\n\n    // Tag for the currently used locale. Must also be defined in locales.\n    locale: 'en-US',\n\n    // All defined locales.\n    locales: [\n      {\n        // BCP 47 tag for the locale.\n        tag: 'en-US',\n\n        // Any meta information that is available even if locale is not loaded.\n        // Must be JSON encode-able.\n        meta: {\n          displayName: 'American English',\n        },\n      },\n    ],\n  },\n\n  // Whether to inject $t, $fmt and $i18n properties on components' creation.\n  globalMixin: true,\n\n  // Additional injection sites like Vuex store or Nuxt app.\n  injectInto: [],\n})\n```\n\nThose are example options, in fact you can completely skip most of them, because they're already like that by default (except for `meta` of `en-US` locale).\n\nIf you need, you can access properties by injecting them into a temporary object:\n\n```ts\nconst { $fmt, $i18n, $t } = Object.defineProperties({}, plugin.getInjections())\n```\n\nInstall plugin into your Vue app:\n\n```ts\n// ...\nconst app = createApp(App)\n\napp.use(plugin)\n```\n\nYou can now use all of the plugin's features:\n\n```vue\n<script setup>\nimport { useI18n } from '@braw/vue-intl-controller'\nimport { defineMessages } from '@formatjs/intl'\nimport { IntlFormatted } from '@braw/vue-intl-controller/components'\n\nconst messages = defineMessages({\n  today: {\n    id: 'today',\n    defaultMessage: 'Today is {date}'\n  }\n  motd: {\n    id: 'motd',\n    defaultMessage: 'Message of the day',\n  },\n  greeting: {\n    id: 'greeting',\n    defaultMessage: 'Hello, {name}!',\n  },\n})\n\nconst { formatMessage: translate, formats: fmt } = $(useI18n())\n</script>\n\n<template>\n  <h2>\n    {{\n      translate(messages.today, {\n        date: fmt.date(Date.now(), {\n          dateStyle: 'long',\n          timeStyle: 'medium',\n        }),\n      })\n    }}\n  </h2>\n  <h3>{{ translate(messages.motd) }}</h3>\n\n  <IntlFormatted :message-id=\"messages.greeting\">\n    <template #~name>\n      <strong>World</strong>\n    </template>\n  </IntlFormatted>\n</template>\n```\n\n## Messages loading\n\n`IntlController` uses event-based approach to handling loading of messages. Whenever locale change is accepted, the controller fires a `LocaleLoadEvent`. It is asynchronous, so your listener function may return a promise and it will prompt controller to wait before calling any other listeners.\n\n> **Note**\n> There is approach to add messages that does not involve events, keep reading to learn more.\n\nIf you created plugin, you can access controller using `getOrCreateController` function. As name implies, the controller is initialised lazily, whenever you try to install the plugin to Vue or call any of the getters like `getInjections` or `getOrCreateController`.\n\n```ts\nconst controller = plugin.getOrCreateController()\n```\n\nYou can then load messages rudimentary way:\n\n```ts\nconst messages = {\n  'en-US': {\n    greeting: 'Hello, {name}!',\n  },\n  de: {\n    greeting: 'Hallo {name}!',\n  },\n  uk: {\n    greeting: 'Привіт, {name}!',\n  },\n}\n\ncontroller.addEventListener('localeload', (e) => {\n  if (e.locale in messages) e.addMessages(messages[e.locale])\n})\n```\n\nOr you can use `import` functions. And if you use webpack, you can even split those imports in chunks to avoid sending unneeded data to client:\n\n```ts\nconst messagesMap = {\n  'en-US': () =>\n    import(\n      /* webpackChunkName: \"locale-en-US\", webpackMode: \"lazy\" */ './i18n/en-US.json'\n    ),\n  uk: () =>\n    import(\n      /* webpackChunkName: \"locale-uk\", webpackMode: \"lazy\" */ './i18n/uk.json'\n    ),\n}\n\ncontroller.addEventListener('localeload', async (e) => {\n  if (e.locale in messagesMap) {\n    const messagesImport = await messagesMap[e.locale]()\n    e.addMessages(messagesImport.default)\n  }\n})\n```\n\n### More to events\n\nThere are two more events that you may want to know about:\n\n- `error` is called when any error occurs in controller's event target. If there are no listeners to that event then all listener errors are logged to console.\n- `localechange` is called when locale is about to change. It can be cancelled, then locale will remain as it is and the initiator of locale change will receive an error.\n- `afterlocalechange` is called after the locale has been applied.\n\nEvent listeners can have a priority, in case you need to load messages or data in certain order, it is specified in an object passed as third argument to `addEventListener`. They also can be called only once, and regardless of whether the event has been cancelled or not.\n\n```ts\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.locale === 'en-x-placeholder') e.cancel()\n  },\n  { priority: 100 },\n)\n\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.canceled) {\n      console.warning(`locale change to ${e.locale} has been cancelled!`)\n    } else {\n      console.log(`locale is now going to change to ${e.locale}`)\n    }\n  },\n  {\n    priority: -99999, // like super super unimportant\n    always: true,\n  },\n)\n\ncontroller.addEventListener(\n  'error',\n  (e) => {\n    console.error('controller event target error', e.error)\n  },\n  { once: true },\n)\n```\n\n## Controller\n\nThe controller is an object returned by `createController` function. It is not the class, but an object that combines all the reactive partials together. This object is typed as `IntlController<T>` and all of the properties and methods are thoroughly documented. Most important ones are highlighted below.\n\n### Imperative management\n\nYou can imperatively create locales instead of declaring them:\n\n```ts\nconst britishEnglish = controller.addLocale('en-GB')\nbritishEnglish.meta = {\n  displayName: 'British English',\n}\n```\n\nAs well as imperatively remove those locales:\n\n```ts\nconst removedLocale = controller.removeLocale('en-GB')\nconsole.assert(britishEnglish === removedLocale)\n```\n\nTo add messages to the locales use `addMessages`, it accepts both locale tag and descriptor. Under the hood it assigns messages, so you can also remove messages with it by providing `undefined` as a value for any key.\n\n```ts\nconst pirateEnglish = controller.addLocale('en-x-pirate')\ncontroller.addMessages(pirateEnglish, {\n  removeMe: undefined,\n  greeting: 'Ahoy, {name}!',\n})\n```\n\n### Properties\n\nMany getter properties are provided at your convenience to access the current state of the controller via `ready`, `automatic`, `locale`, `defaultLocale`, `preferredLocale`. Active `IntlShape` is exposed through `intl` property.\n\nMessages and resources for the current and default locale are accessible as well via `messages`, `defaultMessages`, `resources` and `defaultResources`\n\n`formats` matches the `$fmt` property returned by the plugin.\n\nIf you need to accept locale properties use `intlLocale`, it returns [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) object for the active locale. This can be used to check if language is English, for example:\n\n```ts\n// The following will match en-US, en-GB, en-CA, en-x-pirate, etc.\n\nif (controller.intlLocale.language === 'en') {\n  console.log('Uses English')\n}\n```\n\n## Automation\n\nBrowsers tell sites which languages user prefers. For this purpose automation API was added to the controller. It works by defining multiple sources which tell the currently used locale.\n\nBy default there are no sources, but the package is shipped with two sources that you can set up client and server side:\n\nOn server:\n\n```ts\nimport { useAcceptLanguageHeader } from '@braw/vue-intl-controller/source/header'\n\nconst headerSource = useAcceptLanguageHeader(req.headers['Accept-Language'])\n\ncontroller.addSource(headerSource)\n```\n\nOn client:\n\n```ts\nimport { useNavigatorLanguage } from '@braw/vue-intl-controller/source/navigator'\n\ncontroller.addSource(useNavigatorLanguage())\n```\n\nTo create a custom source implement `PreferredLocalesSource` interface, it is an object or a class that has `prefers` property which is either an array of strings or `null` or Vue's reference to these, if your preferences update dynamically. It can also contain `install` and `uninstall` methods, these are called when source is first initialised or when it's imperatively removed.\n\n<details>\n<summary>Example of custom source</summary>\n\n```ts\nimport { ref } from 'vue'\n\nfunction createCustomSource(locales: string[]) {\n  const prefers = ref(null as string[] | null)\n\n  function install() {\n    prefers.value = locales\n  }\n\n  function uninstall() {\n    prefers.value = null\n  }\n\n  return {\n    prefers,\n    install,\n    uninstall,\n  }\n}\n```\n\n</details>\n\n## Strict type checking with TypeScript\n\n> **Warning** This is an experimental feature.\n\nYou can declare your messages by creating an ambient declaration file where you need to import `@braw/vue-intl-controller`, so that you can extend global namespace `VueIntlController` containing the following declarations:\n\n- `interface` `MessageValueTypes`\n\n  A map of all usable objects within translation functions and components.\n\n- `interface` `CustomMessages`\n\n  A map of custom messages mapped to arguments within those messages.\n\n  Declaring this map will enable strict type-checking across all usage of Vue Intl Controller functions. Partial message declaration is not supported yet, alas.\n\n- `interface` `LocaleMeta`\n\n  A map of all meta properties for the locales, these are always accessible through locale descriptors.\n\n- `interface` `LocaleResources`\n\n  A map of locale resources provided by the load event listeners.\n\n<details>\n<summary>Example</summary>\n\nCreate a file called along the lines of `i18n.d.ts`, and inside of it write:\n\n```ts\n// Makes sure TypeScript knows what we extend:\nimport '@braw/vue-intl-controller'\n\n// Helper types:\nimport type {\n  SelectArgument,\n  ValueArgument,\n} from '@braw/vue-intl-controller/types/arguments'\n\n// Example piece of 'your' code:\nimport type { ExampleObject } from '~/utils/convertibleObject.ts'\n\ndeclare global {\n  namespace VueIntlController {\n    interface MessageValueTypes {\n      // key doesn't matter as long as it does not collide with other key;\n      // the interface used here solely for extensibility since you cannot\n      // extend type or particular interface keys\n      __example__object: ExampleObject\n    }\n\n    interface CustomMessages {\n      // {type, select, greeting {Hello} goodbye {Goodbye} other {Ey}}, {name}\n      'general.message': {\n        /** Type of the message. */\n        type: SelectArgument<'greeting' | 'goodbye' | 'other'>\n\n        /** Name of the addressed person. */\n        name: ValueArgument\n      }\n    }\n\n    interface LocaleMeta {\n      /** Name of the locale translated to the locale's name. */\n      displayName: string\n\n      /** Name of the locale written in English. */\n      englishName: string\n\n      /** Percentage of translation coverage across all documents and files. */\n      translatedPercentage: number\n    }\n\n    interface LocaleResources {\n      /** Markdown markup containing explanation of our payout terms. */\n      payoutExplanation: string\n\n      /** Markdown markup containing our terms of service. */\n      termsOfService: string\n\n      /** Markdown markup containing our privacy policy. */\n      privacyPolicy: string\n\n      /** A map of translated language names. */\n      languageNames: Record<string, string>\n    }\n  }\n}\n```\n\n</details>\n","readmeFilename":"README.md","gitHead":"9a156f65c210063d47e950ded280c65682e5634b","_id":"@braw/vue-intl-controller@4.0.0-rc.6","_nodeVersion":"18.14.0","_npmVersion":"9.3.1","dist":{"integrity":"sha512-kVC+JQhvzmDRyoHNyXOz7fZd8CAaqj3/ZUjL0OKTLQDZGRuKHEhNfTGGXP91qept96UlS+9UzY2QvWwLlclHuA==","shasum":"72c759734b14fd473d8768104fd7021f6a0db38a","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-4.0.0-rc.6.tgz","fileCount":44,"unpackedSize":158981,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCS46cM3Jlj3RbN8ogHvktjxDSE3MUjyKAF4AkKALr2XAIhAJoctHknRTP97xv6RA/2qSp4q0fca/mCZ0m7dAp5CGTP"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9m8nACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpFARAAhxSlKcH77mMq51Ual5j9ESW9jI9fmC4xvCBhmM9Uh+fR9V54\r\n17PWdK7OPRGYNjFY0wnqFbIhkynuSRc2Rcjdkl1Uth0CL8+BziDGe/5D8cUq\r\nZ2YIGH5VJbwSEUP+r9MVyPXEfKxDq9UXkgFDTIlwvQeZ7NG3Oqr6jlVWf0vL\r\nn1mfxo7k3oE2V5whZ9NnzB8HzHg8hZOIgD1bS0ktiTbEbmBzWNg5/VvQnHqj\r\nxtBkchITTB13eiFN3a9wE9oBKJw0OhAtKvoUpZWL5+i3tLPiRiNhg5QrtbCv\r\nNh5TuVubeuef+UuNnuTUPKuG7JlSY726n8rmXrCluf6IiN9uiBEOwWTQ6UB5\r\nzSSo7bYuaKGJXY9kdKeE4I+q5thLmluBdL1rSu8OOsmv4u5ZISESioSMBT0a\r\n3wV0LPYHvq0QZDymXJfW7I8lC+MMkH784VlXY/tMf1v/0/5E8M+qV+cGOG6D\r\n8AZUUNETohgG3HlDA0xDEnM93Q51cicx/disLeiCIb6SO/ahj/Lm16TXSvwL\r\niN7noG3u4IbCtJgVcd1OggvDAp5TOlLV4S17TACy1Fcq7kqqntu86678wN6S\r\n2Hyg4D4BcWcxP/LdB/BZqaimPdVzqaSWQD2cag4sn877cqeSJvKxwKci0BSd\r\n6B0xwYHAsXpzBVYOyYKgSuIFMHvrZOendWA=\r\n=OTpK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_4.0.0-rc.6_1677094695314_0.26846826970058624"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"4.0.0-rc.7":{"name":"@braw/vue-intl-controller","version":"4.0.0-rc.7","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue3"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs"},"./translateFunction":{"types":"./dist/translateFunction.d.ts","import":"./dist/translateFunction.mjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","import":"./dist/sources/*.mjs"}},"module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build","test":"vitest run","lint":"eslint src","bt":"pnpm build && pnpm test"},"devDependencies":{"@nuxtjs/eslint-config-typescript":"^12.0.0","@types/node":"^18.11.18","del-cli":"^5.0.0","eslint":"^8.31.0","happy-dom":"^8.1.5","prettier":"^2.8.3","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^20.0.2","typescript":"^4.9.4","unbuild":"^1.1.1","vitest":"^0.27.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@formatjs/icu-messageformat-parser":"^2.1.14","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^3.2.45"},"publishConfig":{"access":"public"},"readme":"# vue-intl-controller\n\n> A plugin for Vue 3 to dynamically control [`@formatjs/intl`](https://npm.im/@formatjs/intl).\n\n[![Supports: ESM only](https://img.shields.io/static/v1?label=Format&message=ESM%20only&color=blue&style=flat-square)](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)\n\n## Summary\n\n[`@formatjs/intl`](https://npm.im/@formatjs/intl) allows to easily implement localisation using ICU MessageFormat messages.\n\nHowever, using it in Vue in dynamic manner is not an easy task if you want to preserve most of its functionality and more. This package was created to solve this.\n\nIt is created with extensibility in mind, so you can extend upon it and add support for it in other frameworks, like Nuxt (module for Nuxt is being worked on). On your disposal events, asynchronous loading mechanism and even some of the internals exposed.\n\nAs a consumer, there's a mixing that adds helpers like `$t`, `$fmt` and `$i18n` to your components (can be turned off), as well as `useI18n()` composable. There's also `<IntlFormatted>` component, which allows to use components while formatting the messages.\n\nWritten in TypeScript, ambient type extension is possible for better type checking to the point where entire arguments used in messages can be type checked!\n\n## Installation and usage\n\n### Installation\n\nInstall using your package manager of choice:\n\n**npm**\n\n```sh\nnpm i @braw/vue-intl-controller\n```\n\n**pnpm**\n\n```sh\npnpm i @braw/vue-intl-controller\n```\n\n**yarn**\n\n```sh\nyarn add @braw/vue-intl-controller\n```\n\n### Usage\n\nIn your Vue app entry point import `createPlugin` function.\n\n```ts\nimport { createPlugin } from '@braw/vue-intl-controller/plugin'\n```\n\nCreate a plugin instance (you can do that inline, without variable):\n\n```ts\nconst plugin = createPlugin({\n  // Options for the controller instance.\n  controllerOpts: {\n    // All locale tags must be valid BCP 47 language tags.\n\n    // Tag for the default locale. Must be one of the defined locales' tags.\n    defaultLocale: 'en-US',\n\n    // Tag for the currently used locale. Must also be defined in locales.\n    locale: 'en-US',\n\n    // All defined locales.\n    locales: [\n      {\n        // BCP 47 tag for the locale.\n        tag: 'en-US',\n\n        // Any meta information that is available even if locale is not loaded.\n        // Must be JSON encode-able.\n        meta: {\n          displayName: 'American English',\n        },\n      },\n    ],\n  },\n\n  // Whether to inject $t, $fmt and $i18n properties on components' creation.\n  globalMixin: true,\n\n  // Additional injection sites like Vuex store or Nuxt app.\n  injectInto: [],\n})\n```\n\nThose are example options, in fact you can completely skip most of them, because they're already like that by default (except for `meta` of `en-US` locale).\n\nIf you need, you can access properties by injecting them into a temporary object:\n\n```ts\nconst { $fmt, $i18n, $t } = Object.defineProperties({}, plugin.getInjections())\n```\n\nInstall plugin into your Vue app:\n\n```ts\n// ...\nconst app = createApp(App)\n\napp.use(plugin)\n```\n\nYou can now use all of the plugin's features:\n\n```vue\n<script setup>\nimport { useI18n } from '@braw/vue-intl-controller'\nimport { defineMessages } from '@formatjs/intl'\nimport { IntlFormatted } from '@braw/vue-intl-controller/components'\n\nconst messages = defineMessages({\n  today: {\n    id: 'today',\n    defaultMessage: 'Today is {date}'\n  }\n  motd: {\n    id: 'motd',\n    defaultMessage: 'Message of the day',\n  },\n  greeting: {\n    id: 'greeting',\n    defaultMessage: 'Hello, {name}!',\n  },\n})\n\nconst { formatMessage: translate, formats: fmt } = $(useI18n())\n</script>\n\n<template>\n  <h2>\n    {{\n      translate(messages.today, {\n        date: fmt.date(Date.now(), {\n          dateStyle: 'long',\n          timeStyle: 'medium',\n        }),\n      })\n    }}\n  </h2>\n  <h3>{{ translate(messages.motd) }}</h3>\n\n  <IntlFormatted :message-id=\"messages.greeting\">\n    <template #~name>\n      <strong>World</strong>\n    </template>\n  </IntlFormatted>\n</template>\n```\n\n## Messages loading\n\n`IntlController` uses event-based approach to handling loading of messages. Whenever locale change is accepted, the controller fires a `LocaleLoadEvent`. It is asynchronous, so your listener function may return a promise and it will prompt controller to wait before calling any other listeners.\n\n> **Note**\n> There is approach to add messages that does not involve events, keep reading to learn more.\n\nIf you created plugin, you can access controller using `getOrCreateController` function. As name implies, the controller is initialised lazily, whenever you try to install the plugin to Vue or call any of the getters like `getInjections` or `getOrCreateController`.\n\n```ts\nconst controller = plugin.getOrCreateController()\n```\n\nYou can then load messages rudimentary way:\n\n```ts\nconst messages = {\n  'en-US': {\n    greeting: 'Hello, {name}!',\n  },\n  de: {\n    greeting: 'Hallo {name}!',\n  },\n  uk: {\n    greeting: 'Привіт, {name}!',\n  },\n}\n\ncontroller.addEventListener('localeload', (e) => {\n  if (e.locale in messages) e.addMessages(messages[e.locale])\n})\n```\n\nOr you can use `import` functions. And if you use webpack, you can even split those imports in chunks to avoid sending unneeded data to client:\n\n```ts\nconst messagesMap = {\n  'en-US': () =>\n    import(\n      /* webpackChunkName: \"locale-en-US\", webpackMode: \"lazy\" */ './i18n/en-US.json'\n    ),\n  uk: () =>\n    import(\n      /* webpackChunkName: \"locale-uk\", webpackMode: \"lazy\" */ './i18n/uk.json'\n    ),\n}\n\ncontroller.addEventListener('localeload', async (e) => {\n  if (e.locale in messagesMap) {\n    const messagesImport = await messagesMap[e.locale]()\n    e.addMessages(messagesImport.default)\n  }\n})\n```\n\n### More to events\n\nThere are two more events that you may want to know about:\n\n- `error` is called when any error occurs in controller's event target. If there are no listeners to that event then all listener errors are logged to console.\n- `localechange` is called when locale is about to change. It can be cancelled, then locale will remain as it is and the initiator of locale change will receive an error.\n- `afterlocalechange` is called after the locale has been applied.\n\nEvent listeners can have a priority, in case you need to load messages or data in certain order, it is specified in an object passed as third argument to `addEventListener`. They also can be called only once, and regardless of whether the event has been cancelled or not.\n\n```ts\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.locale === 'en-x-placeholder') e.cancel()\n  },\n  { priority: 100 },\n)\n\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.canceled) {\n      console.warning(`locale change to ${e.locale} has been cancelled!`)\n    } else {\n      console.log(`locale is now going to change to ${e.locale}`)\n    }\n  },\n  {\n    priority: -99999, // like super super unimportant\n    always: true,\n  },\n)\n\ncontroller.addEventListener(\n  'error',\n  (e) => {\n    console.error('controller event target error', e.error)\n  },\n  { once: true },\n)\n```\n\n## Controller\n\nThe controller is an object returned by `createController` function. It is not the class, but an object that combines all the reactive partials together. This object is typed as `IntlController<T>` and all of the properties and methods are thoroughly documented. Most important ones are highlighted below.\n\n### Imperative management\n\nYou can imperatively create locales instead of declaring them:\n\n```ts\nconst britishEnglish = controller.addLocale('en-GB')\nbritishEnglish.meta = {\n  displayName: 'British English',\n}\n```\n\nAs well as imperatively remove those locales:\n\n```ts\nconst removedLocale = controller.removeLocale('en-GB')\nconsole.assert(britishEnglish === removedLocale)\n```\n\nTo add messages to the locales use `addMessages`, it accepts both locale tag and descriptor. Under the hood it assigns messages, so you can also remove messages with it by providing `undefined` as a value for any key.\n\n```ts\nconst pirateEnglish = controller.addLocale('en-x-pirate')\ncontroller.addMessages(pirateEnglish, {\n  removeMe: undefined,\n  greeting: 'Ahoy, {name}!',\n})\n```\n\n### Properties\n\nMany getter properties are provided at your convenience to access the current state of the controller via `ready`, `automatic`, `locale`, `defaultLocale`, `preferredLocale`. Active `IntlShape` is exposed through `intl` property.\n\nMessages and resources for the current and default locale are accessible as well via `messages`, `defaultMessages`, `resources` and `defaultResources`\n\n`formats` matches the `$fmt` property returned by the plugin.\n\nIf you need to accept locale properties use `intlLocale`, it returns [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) object for the active locale. This can be used to check if language is English, for example:\n\n```ts\n// The following will match en-US, en-GB, en-CA, en-x-pirate, etc.\n\nif (controller.intlLocale.language === 'en') {\n  console.log('Uses English')\n}\n```\n\n## Automation\n\nBrowsers tell sites which languages user prefers. For this purpose automation API was added to the controller. It works by defining multiple sources which tell the currently used locale.\n\nBy default there are no sources, but the package is shipped with two sources that you can set up client and server side:\n\nOn server:\n\n```ts\nimport { useAcceptLanguageHeader } from '@braw/vue-intl-controller/source/header'\n\nconst headerSource = useAcceptLanguageHeader(req.headers['Accept-Language'])\n\ncontroller.addSource(headerSource)\n```\n\nOn client:\n\n```ts\nimport { useNavigatorLanguage } from '@braw/vue-intl-controller/source/navigator'\n\ncontroller.addSource(useNavigatorLanguage())\n```\n\nTo create a custom source implement `PreferredLocalesSource` interface, it is an object or a class that has `prefers` property which is either an array of strings or `null` or Vue's reference to these, if your preferences update dynamically. It can also contain `install` and `uninstall` methods, these are called when source is first initialised or when it's imperatively removed.\n\n<details>\n<summary>Example of custom source</summary>\n\n```ts\nimport { ref } from 'vue'\n\nfunction createCustomSource(locales: string[]) {\n  const prefers = ref(null as string[] | null)\n\n  function install() {\n    prefers.value = locales\n  }\n\n  function uninstall() {\n    prefers.value = null\n  }\n\n  return {\n    prefers,\n    install,\n    uninstall,\n  }\n}\n```\n\n</details>\n\n## Strict type checking with TypeScript\n\n> **Warning** This is an experimental feature.\n\nYou can declare your messages by creating an ambient declaration file where you need to import `@braw/vue-intl-controller`, so that you can extend global namespace `VueIntlController` containing the following declarations:\n\n- `interface` `MessageValueTypes`\n\n  A map of all usable objects within translation functions and components.\n\n- `interface` `CustomMessages`\n\n  A map of custom messages mapped to arguments within those messages.\n\n  Declaring this map will enable strict type-checking across all usage of Vue Intl Controller functions. Partial message declaration is not supported yet, alas.\n\n- `interface` `LocaleMeta`\n\n  A map of all meta properties for the locales, these are always accessible through locale descriptors.\n\n- `interface` `LocaleResources`\n\n  A map of locale resources provided by the load event listeners.\n\n<details>\n<summary>Example</summary>\n\nCreate a file called along the lines of `i18n.d.ts`, and inside of it write:\n\n```ts\n// Makes sure TypeScript knows what we extend:\nimport '@braw/vue-intl-controller'\n\n// Helper types:\nimport type {\n  SelectArgument,\n  ValueArgument,\n} from '@braw/vue-intl-controller/types/arguments'\n\n// Example piece of 'your' code:\nimport type { ExampleObject } from '~/utils/convertibleObject.ts'\n\ndeclare global {\n  namespace VueIntlController {\n    interface MessageValueTypes {\n      // key doesn't matter as long as it does not collide with other key;\n      // the interface used here solely for extensibility since you cannot\n      // extend type or particular interface keys\n      __example__object: ExampleObject\n    }\n\n    interface CustomMessages {\n      // {type, select, greeting {Hello} goodbye {Goodbye} other {Ey}}, {name}\n      'general.message': {\n        /** Type of the message. */\n        type: SelectArgument<'greeting' | 'goodbye' | 'other'>\n\n        /** Name of the addressed person. */\n        name: ValueArgument\n      }\n    }\n\n    interface LocaleMeta {\n      /** Name of the locale translated to the locale's name. */\n      displayName: string\n\n      /** Name of the locale written in English. */\n      englishName: string\n\n      /** Percentage of translation coverage across all documents and files. */\n      translatedPercentage: number\n    }\n\n    interface LocaleResources {\n      /** Markdown markup containing explanation of our payout terms. */\n      payoutExplanation: string\n\n      /** Markdown markup containing our terms of service. */\n      termsOfService: string\n\n      /** Markdown markup containing our privacy policy. */\n      privacyPolicy: string\n\n      /** A map of translated language names. */\n      languageNames: Record<string, string>\n    }\n  }\n}\n```\n\n</details>\n","readmeFilename":"README.md","gitHead":"648c068709782e4cf6debf139d6bca2fe9b40bda","_id":"@braw/vue-intl-controller@4.0.0-rc.7","_nodeVersion":"18.14.1","_npmVersion":"9.3.1","dist":{"integrity":"sha512-DrUDldiQR9ii7ZdwIivf3+7olNEt1cJFUML7qPK08BOo9XM5B3xibIdt7Zf0XaYPyvMzRzHV9fpabybcVXV0Zg==","shasum":"e6bd77416e549cd2a6ea54c6ce9c93b95c5723bc","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-4.0.0-rc.7.tgz","fileCount":31,"unpackedSize":98548,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFEEz/6uUWXH4k7tgL2U9/rD6jhsaEe2jbhi9WuQ5fflAiBnNrqduj0MYa5xPdqbr/yKNhxv7svqUMO1/d9lw0C2ww=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/buRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoW/g//f7zGl3HjWjrk5uKTqW7NFfbyzCFgsENy6bP7eGtQrgdsp8PE\r\ni/FqgqjDWBTfJPhJLt2maN22F0io3OwWjVUOVwXj3HVb92v8A2PzlXIfrZqV\r\n2dHZGZmvwJSDAqQxh7p67S1R7BSeKfSP+fNUiJjsbbv616utXIUeTrgUe/S0\r\ngRbcyzvMra1FGL+K9oA85ikoHefYoJJ1fYruc0bkdq6jCs5PEJ0LY85Vhy3o\r\n5zxeVvyfbL09c3VGwHF4nIoItcWm+7nwxwxs6P8ulRka5ZarkjfDL+Ccgl5A\r\noaE0ykzTpVbcpoYubtK/NEh73Bg2c9KzLryTNIwCgW6k0FNuHCIKGoinyBSb\r\nGetx1XSZEnRAKGqHYBc1YbJXbnDDWXR5R8RgLIGuwESMtbKxcO8QDTu+wdyT\r\nBnvxwkyLHkVp1Ppn4iKyIN4P/3lT7sOg01rqCeOgUXts05PWOyjKMB6y30Px\r\nIqNTduQ9s8nacVR0Sla70tBIPTvIAGtstxoxWCEmgWPIgcoJWSGC0geVF7no\r\ny3aRK4+KVt3C/kwyga+DOQWIbFSmPGvplHb7X8VKkoN4QwWtnCXV7efvyCNi\r\nQr1x7HBTLMBe1VE4AVQ6y8stjpXuskSbSIt2vhloZSDLVXmfX9y4kUp38eCK\r\nv+XN44v07f6ZmrQfYU4jzDsNFKCxICMHxlo=\r\n=Kf2V\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_4.0.0-rc.7_1677573009463_0.6392169525669273"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"},"4.0.0":{"name":"@braw/vue-intl-controller","version":"4.0.0","description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue3"],"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs"},"./types/arguments":{"types":"./dist/types/arguments.d.ts","import":"./dist/types/arguments.mjs"},"./events":{"types":"./dist/events/index.d.ts","import":"./dist/events/index.mjs"},"./plugin":{"types":"./dist/plugin.d.ts","import":"./dist/plugin.mjs"},"./controller":{"types":"./dist/controller.d.ts","import":"./dist/controller.mjs"},"./translateFunction":{"types":"./dist/translateFunction.d.ts","import":"./dist/translateFunction.mjs"},"./components":{"types":"./dist/components.d.ts","import":"./dist/components.mjs"},"./sources/*":{"types":"./dist/sources/*.d.ts","import":"./dist/sources/*.mjs"}},"module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build:raw":"del-cli dist && tsc --noEmit false","build":"unbuild","dev":"vitest dev","prepack":"pnpm run build","test":"vitest run","lint":"eslint src","bt":"pnpm build && pnpm test","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:preview":"vitepress preview docs"},"devDependencies":{"@nuxtjs/eslint-config-typescript":"^12.0.0","@types/node":"^18.11.18","del-cli":"^5.0.0","eslint":"^8.31.0","happy-dom":"^8.1.5","prettier":"^2.8.3","prettier-plugin-jsdoc":"^0.4.2","semantic-release":"^20.0.2","typescript":"^4.9.4","unbuild":"^1.1.1","vitepress":"1.0.0-alpha.47","vitest":"^0.27.2"},"dependencies":{"@braw/async-computed":"^5.0.1","@formatjs/icu-messageformat-parser":"^2.1.14","@formatjs/intl":"^2.6.3","@formatjs/intl-localematcher":"^0.2.32","intl-messageformat":"^10.2.5","vue":"^3.2.45"},"publishConfig":{"access":"public"},"gitHead":"36f24fdb2f3ded6e5ac39f0fea1425eba5b1dd17","_id":"@braw/vue-intl-controller@4.0.0","_nodeVersion":"18.14.1","_npmVersion":"9.3.1","dist":{"integrity":"sha512-yMfdrmCsTLH9FFTb9R2UCJxL7msRJe8urbV3MzVSrL+HNqj/FftF08Wo3Gl0BU1yhewMpDHkgqXQjlkDgxV87w==","shasum":"1f8cae698d9c867f98de28419ecf79e81219cfc7","tarball":"https://registry.npmjs.org/@braw/vue-intl-controller/-/vue-intl-controller-4.0.0.tgz","fileCount":31,"unpackedSize":98704,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKJOPKh3Wn8WsrXwTcNfYTySc5Lz00UGTplww1cg7/EAIhAPy5W3QHbRknTCDICCgkgGSSIRPfXm098UgRtkYyHPpw"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/gjkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrs9A//Tef/Jiy/fuJK0hgUL3OphUaZ/dYVDV8LXIn2LLk49MloHvwW\r\nXEEQZ3Hjbp/qGHDRsbnmiLmP2J7AvjzEvN5cBSv54WYcvYUFjdXAVdZVTscp\r\n6cCdlt6r+PJU/em4bUZkHbOtjK0SSq4d6mkBHMCWut/ZdcXLiiGN8xT/3HVu\r\n5ZRJyrEZg9a1Wcyv05530fodLTR8oR9DCKOWGTlza2ThatQPXyNKze9vwgtT\r\n0L+aAWccaXeR7jJgBhksgcQpjZJAdrwjNE6WdRhXM4+QUGI/V4nupzTaMh0V\r\n9KaifkKa+tLjKqjYCvcuY7oYWRMGTn4fk3Oq5xqWQJ2NJk6no7tQovZZI3eQ\r\nZbRETRh+jhGYNNgmpT/LvaMe9AwN/U1+o8VA+CURfkFCAyjpj2zF/nccnVHU\r\nmT5SOIG2ij/VNsJ7r7IKBhIAHHa5wAlX/2CVAUd+TUgXj4GUEAn7MnxeQs4N\r\nGImWjZxZb/Mi47Rvg2tPnBhvFTs9ljoKJa/wE4/9FWVtH3+mAUg+c2vfNL/R\r\nBmClZNTc1oXkFJNTf12UmNV1Ew57xWBrN++ZNLMbSCvIf/4wO2kFoWG8JtHQ\r\nMAIO2Rh6ga/cgWlg1DuJcVGpl+XlE9eRBvTEg5iHkxaVSrZJHQqYterOSs/e\r\ncgrtvMpApKUyZwVYwnb1gZiCOr1YS9jAar8=\r\n=82gx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"},"directories":{},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-intl-controller_4.0.0_1677592804639_0.7836576403769373"},"_hasShrinkwrap":false,"deprecated":"This package has been renamed to @vintl/vintl"}},"time":{"created":"2023-01-03T21:50:33.488Z","1.0.0":"2023-01-03T21:50:33.807Z","modified":"2023-03-01T14:53:29.148Z","1.0.1":"2023-01-04T00:20:41.257Z","1.1.0":"2023-01-06T03:00:00.895Z","1.2.0":"2023-01-06T18:20:52.819Z","2.0.0":"2023-01-06T18:21:51.269Z","2.0.1":"2023-01-09T01:15:57.690Z","2.1.0":"2023-01-10T00:23:39.761Z","2.2.0":"2023-01-14T16:58:00.059Z","3.0.0":"2023-01-14T17:23:58.746Z","3.1.0":"2023-01-15T03:09:05.647Z","3.2.0":"2023-01-16T06:12:35.015Z","4.0.0-rc.1":"2023-01-21T19:10:30.801Z","4.0.0-rc.2":"2023-01-25T12:37:05.252Z","4.0.0-rc.3":"2023-01-25T19:33:14.053Z","4.0.0-rc.4":"2023-01-27T01:28:25.146Z","4.0.0-rc.5":"2023-02-21T09:30:39.184Z","4.0.0-rc.6":"2023-02-22T19:38:15.453Z","4.0.0-rc.7":"2023-02-28T08:30:09.702Z","4.0.0":"2023-02-28T14:00:04.785Z"},"maintainers":[{"name":"brawaru","email":"dafri.nochiterov8+npm@gmail.com"}],"description":"Integrate @formatjs/intl into your Vue apps for easier internationalisation","keywords":["i18n","vue3"],"license":"MIT","readme":"# vue-intl-controller\n\n> A plugin for Vue 3 to dynamically control [`@formatjs/intl`](https://npm.im/@formatjs/intl).\n\n[![Supports: ESM only](https://img.shields.io/static/v1?label=Format&message=ESM%20only&color=blue&style=flat-square)](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)\n\n## Summary\n\n[`@formatjs/intl`](https://npm.im/@formatjs/intl) allows to easily implement localisation using ICU MessageFormat messages.\n\nHowever, using it in Vue in dynamic manner is not an easy task if you want to preserve most of its functionality and more. This package was created to solve this.\n\nIt is created with extensibility in mind, so you can extend upon it and add support for it in other frameworks, like Nuxt (module for Nuxt is being worked on). On your disposal events, asynchronous loading mechanism and even some of the internals exposed.\n\nAs a consumer, there's a mixing that adds helpers like `$t`, `$fmt` and `$i18n` to your components (can be turned off), as well as `useI18n()` composable. There's also `<IntlFormatted>` component, which allows to use components while formatting the messages.\n\nWritten in TypeScript, ambient type extension is possible for better type checking to the point where entire arguments used in messages can be type checked!\n\n## Installation and usage\n\n### Installation\n\nInstall using your package manager of choice:\n\n**npm**\n\n```sh\nnpm i @braw/vue-intl-controller\n```\n\n**pnpm**\n\n```sh\npnpm i @braw/vue-intl-controller\n```\n\n**yarn**\n\n```sh\nyarn add @braw/vue-intl-controller\n```\n\n### Usage\n\nIn your Vue app entry point import `createPlugin` function.\n\n```ts\nimport { createPlugin } from '@braw/vue-intl-controller/plugin'\n```\n\nCreate a plugin instance (you can do that inline, without variable):\n\n```ts\nconst plugin = createPlugin({\n  // Options for the controller instance.\n  controllerOpts: {\n    // All locale tags must be valid BCP 47 language tags.\n\n    // Tag for the default locale. Must be one of the defined locales' tags.\n    defaultLocale: 'en-US',\n\n    // Tag for the currently used locale. Must also be defined in locales.\n    locale: 'en-US',\n\n    // All defined locales.\n    locales: [\n      {\n        // BCP 47 tag for the locale.\n        tag: 'en-US',\n\n        // Any meta information that is available even if locale is not loaded.\n        // Must be JSON encode-able.\n        meta: {\n          displayName: 'American English',\n        },\n      },\n    ],\n  },\n\n  // Whether to inject $t, $fmt and $i18n properties on components' creation.\n  globalMixin: true,\n\n  // Additional injection sites like Vuex store or Nuxt app.\n  injectInto: [],\n})\n```\n\nThose are example options, in fact you can completely skip most of them, because they're already like that by default (except for `meta` of `en-US` locale).\n\nIf you need, you can access properties by injecting them into a temporary object:\n\n```ts\nconst { $fmt, $i18n, $t } = Object.defineProperties({}, plugin.getInjections())\n```\n\nInstall plugin into your Vue app:\n\n```ts\n// ...\nconst app = createApp(App)\n\napp.use(plugin)\n```\n\nYou can now use all of the plugin's features:\n\n```vue\n<script setup>\nimport { useI18n } from '@braw/vue-intl-controller'\nimport { defineMessages } from '@formatjs/intl'\nimport { IntlFormatted } from '@braw/vue-intl-controller/components'\n\nconst messages = defineMessages({\n  today: {\n    id: 'today',\n    defaultMessage: 'Today is {date}'\n  }\n  motd: {\n    id: 'motd',\n    defaultMessage: 'Message of the day',\n  },\n  greeting: {\n    id: 'greeting',\n    defaultMessage: 'Hello, {name}!',\n  },\n})\n\nconst { formatMessage: translate, formats: fmt } = $(useI18n())\n</script>\n\n<template>\n  <h2>\n    {{\n      translate(messages.today, {\n        date: fmt.date(Date.now(), {\n          dateStyle: 'long',\n          timeStyle: 'medium',\n        }),\n      })\n    }}\n  </h2>\n  <h3>{{ translate(messages.motd) }}</h3>\n\n  <IntlFormatted :message-id=\"messages.greeting\">\n    <template #~name>\n      <strong>World</strong>\n    </template>\n  </IntlFormatted>\n</template>\n```\n\n## Messages loading\n\n`IntlController` uses event-based approach to handling loading of messages. Whenever locale change is accepted, the controller fires a `LocaleLoadEvent`. It is asynchronous, so your listener function may return a promise and it will prompt controller to wait before calling any other listeners.\n\n> **Note**\n> There is approach to add messages that does not involve events, keep reading to learn more.\n\nIf you created plugin, you can access controller using `getOrCreateController` function. As name implies, the controller is initialised lazily, whenever you try to install the plugin to Vue or call any of the getters like `getInjections` or `getOrCreateController`.\n\n```ts\nconst controller = plugin.getOrCreateController()\n```\n\nYou can then load messages rudimentary way:\n\n```ts\nconst messages = {\n  'en-US': {\n    greeting: 'Hello, {name}!',\n  },\n  de: {\n    greeting: 'Hallo {name}!',\n  },\n  uk: {\n    greeting: 'Привіт, {name}!',\n  },\n}\n\ncontroller.addEventListener('localeload', (e) => {\n  if (e.locale in messages) e.addMessages(messages[e.locale])\n})\n```\n\nOr you can use `import` functions. And if you use webpack, you can even split those imports in chunks to avoid sending unneeded data to client:\n\n```ts\nconst messagesMap = {\n  'en-US': () =>\n    import(\n      /* webpackChunkName: \"locale-en-US\", webpackMode: \"lazy\" */ './i18n/en-US.json'\n    ),\n  uk: () =>\n    import(\n      /* webpackChunkName: \"locale-uk\", webpackMode: \"lazy\" */ './i18n/uk.json'\n    ),\n}\n\ncontroller.addEventListener('localeload', async (e) => {\n  if (e.locale in messagesMap) {\n    const messagesImport = await messagesMap[e.locale]()\n    e.addMessages(messagesImport.default)\n  }\n})\n```\n\n### More to events\n\nThere are two more events that you may want to know about:\n\n- `error` is called when any error occurs in controller's event target. If there are no listeners to that event then all listener errors are logged to console.\n- `localechange` is called when locale is about to change. It can be cancelled, then locale will remain as it is and the initiator of locale change will receive an error.\n- `afterlocalechange` is called after the locale has been applied.\n\nEvent listeners can have a priority, in case you need to load messages or data in certain order, it is specified in an object passed as third argument to `addEventListener`. They also can be called only once, and regardless of whether the event has been cancelled or not.\n\n```ts\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.locale === 'en-x-placeholder') e.cancel()\n  },\n  { priority: 100 },\n)\n\ncontroller.addEventListener(\n  'localechange',\n  (e) => {\n    if (e.canceled) {\n      console.warning(`locale change to ${e.locale} has been cancelled!`)\n    } else {\n      console.log(`locale is now going to change to ${e.locale}`)\n    }\n  },\n  {\n    priority: -99999, // like super super unimportant\n    always: true,\n  },\n)\n\ncontroller.addEventListener(\n  'error',\n  (e) => {\n    console.error('controller event target error', e.error)\n  },\n  { once: true },\n)\n```\n\n## Controller\n\nThe controller is an object returned by `createController` function. It is not the class, but an object that combines all the reactive partials together. This object is typed as `IntlController<T>` and all of the properties and methods are thoroughly documented. Most important ones are highlighted below.\n\n### Imperative management\n\nYou can imperatively create locales instead of declaring them:\n\n```ts\nconst britishEnglish = controller.addLocale('en-GB')\nbritishEnglish.meta = {\n  displayName: 'British English',\n}\n```\n\nAs well as imperatively remove those locales:\n\n```ts\nconst removedLocale = controller.removeLocale('en-GB')\nconsole.assert(britishEnglish === removedLocale)\n```\n\nTo add messages to the locales use `addMessages`, it accepts both locale tag and descriptor. Under the hood it assigns messages, so you can also remove messages with it by providing `undefined` as a value for any key.\n\n```ts\nconst pirateEnglish = controller.addLocale('en-x-pirate')\ncontroller.addMessages(pirateEnglish, {\n  removeMe: undefined,\n  greeting: 'Ahoy, {name}!',\n})\n```\n\n### Properties\n\nMany getter properties are provided at your convenience to access the current state of the controller via `ready`, `automatic`, `locale`, `defaultLocale`, `preferredLocale`. Active `IntlShape` is exposed through `intl` property.\n\nMessages and resources for the current and default locale are accessible as well via `messages`, `defaultMessages`, `resources` and `defaultResources`\n\n`formats` matches the `$fmt` property returned by the plugin.\n\nIf you need to accept locale properties use `intlLocale`, it returns [`Intl.Locale`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) object for the active locale. This can be used to check if language is English, for example:\n\n```ts\n// The following will match en-US, en-GB, en-CA, en-x-pirate, etc.\n\nif (controller.intlLocale.language === 'en') {\n  console.log('Uses English')\n}\n```\n\n## Automation\n\nBrowsers tell sites which languages user prefers. For this purpose automation API was added to the controller. It works by defining multiple sources which tell the currently used locale.\n\nBy default there are no sources, but the package is shipped with two sources that you can set up client and server side:\n\nOn server:\n\n```ts\nimport { useAcceptLanguageHeader } from '@braw/vue-intl-controller/source/header'\n\nconst headerSource = useAcceptLanguageHeader(req.headers['Accept-Language'])\n\ncontroller.addSource(headerSource)\n```\n\nOn client:\n\n```ts\nimport { useNavigatorLanguage } from '@braw/vue-intl-controller/source/navigator'\n\ncontroller.addSource(useNavigatorLanguage())\n```\n\nTo create a custom source implement `PreferredLocalesSource` interface, it is an object or a class that has `prefers` property which is either an array of strings or `null` or Vue's reference to these, if your preferences update dynamically. It can also contain `install` and `uninstall` methods, these are called when source is first initialised or when it's imperatively removed.\n\n<details>\n<summary>Example of custom source</summary>\n\n```ts\nimport { ref } from 'vue'\n\nfunction createCustomSource(locales: string[]) {\n  const prefers = ref(null as string[] | null)\n\n  function install() {\n    prefers.value = locales\n  }\n\n  function uninstall() {\n    prefers.value = null\n  }\n\n  return {\n    prefers,\n    install,\n    uninstall,\n  }\n}\n```\n\n</details>\n\n## Strict type checking with TypeScript\n\n> **Warning** This is an experimental feature.\n\nYou can declare your messages by creating an ambient declaration file where you need to import `@braw/vue-intl-controller`, so that you can extend global namespace `VueIntlController` containing the following declarations:\n\n- `interface` `MessageValueTypes`\n\n  A map of all usable objects within translation functions and components.\n\n- `interface` `CustomMessages`\n\n  A map of custom messages mapped to arguments within those messages.\n\n  Declaring this map will enable strict type-checking across all usage of Vue Intl Controller functions. Partial message declaration is not supported yet, alas.\n\n- `interface` `LocaleMeta`\n\n  A map of all meta properties for the locales, these are always accessible through locale descriptors.\n\n- `interface` `LocaleResources`\n\n  A map of locale resources provided by the load event listeners.\n\n<details>\n<summary>Example</summary>\n\nCreate a file called along the lines of `i18n.d.ts`, and inside of it write:\n\n```ts\n// Makes sure TypeScript knows what we extend:\nimport '@braw/vue-intl-controller'\n\n// Helper types:\nimport type {\n  SelectArgument,\n  ValueArgument,\n} from '@braw/vue-intl-controller/types/arguments'\n\n// Example piece of 'your' code:\nimport type { ExampleObject } from '~/utils/convertibleObject.ts'\n\ndeclare global {\n  namespace VueIntlController {\n    interface MessageValueTypes {\n      // key doesn't matter as long as it does not collide with other key;\n      // the interface used here solely for extensibility since you cannot\n      // extend type or particular interface keys\n      __example__object: ExampleObject\n    }\n\n    interface CustomMessages {\n      // {type, select, greeting {Hello} goodbye {Goodbye} other {Ey}}, {name}\n      'general.message': {\n        /** Type of the message. */\n        type: SelectArgument<'greeting' | 'goodbye' | 'other'>\n\n        /** Name of the addressed person. */\n        name: ValueArgument\n      }\n    }\n\n    interface LocaleMeta {\n      /** Name of the locale translated to the locale's name. */\n      displayName: string\n\n      /** Name of the locale written in English. */\n      englishName: string\n\n      /** Percentage of translation coverage across all documents and files. */\n      translatedPercentage: number\n    }\n\n    interface LocaleResources {\n      /** Markdown markup containing explanation of our payout terms. */\n      payoutExplanation: string\n\n      /** Markdown markup containing our terms of service. */\n      termsOfService: string\n\n      /** Markdown markup containing our privacy policy. */\n      privacyPolicy: string\n\n      /** A map of translated language names. */\n      languageNames: Record<string, string>\n    }\n  }\n}\n```\n\n</details>\n","readmeFilename":"README.md"}