@prettifystudio/lyngo-cli 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/lyngo +8 -3
- package/package.json +1 -1
package/bin/lyngo
CHANGED
|
@@ -786,9 +786,14 @@ async function localizeHook(opts) {
|
|
|
786
786
|
async function check(file) {
|
|
787
787
|
if (!file) fail('usage: lyngo check <file>');
|
|
788
788
|
const r = await call('check', { path: file, content: fs.readFileSync(file, 'utf8') });
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
789
|
+
// On a path-key project each string has its own key; else the text is the key.
|
|
790
|
+
const lines = r.key_style === 'path'
|
|
791
|
+
? Object.entries(r.keys || {}).map(([k, text]) => `${k} => ${JSON.stringify(text)}`)
|
|
792
|
+
: (r.user_facing_strings || []).map((text) => JSON.stringify(text));
|
|
793
|
+
const count = r.count ?? lines.length;
|
|
794
|
+
console.log(`${file}: ${count} user-facing string${count === 1 ? '' : 's'}`);
|
|
795
|
+
for (const line of lines.slice(0, 30)) console.log(' ' + line);
|
|
796
|
+
if (r.changed === false && r.note) console.log(r.note);
|
|
792
797
|
}
|
|
793
798
|
|
|
794
799
|
async function status() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prettifystudio/lyngo-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Localization for Laravel applications, from the terminal: Lyngo wraps user-facing text with your framework's i18n call, reuses your project's keys, translates and verifies the catalogs. Blade, Livewire, PHP, and Inertia with React, Vue or Svelte.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"lyngo": "bin/lyngo"
|