@walkinissue/angy 0.2.17 → 0.2.18

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/README.md CHANGED
@@ -8,6 +8,13 @@ Dev-only SvelteKit translation helper for in-app PO workflow.
8
8
  npm install @walkinissue/angy
9
9
  ```
10
10
 
11
+ ## Project links
12
+
13
+ - Repository: [github.com/walkingIssue/Angy](https://github.com/walkingIssue/Angy)
14
+ - Changelog: [CHANGELOG.md](./CHANGELOG.md)
15
+ - Roadmap: [docs/roadmap.md](./docs/roadmap.md)
16
+ - Wuchale runtime wiring: [docs/wuchale-runtime.md](./docs/wuchale-runtime.md)
17
+
11
18
  ## What it is
12
19
 
13
20
  - A QA widget for in-app translation work
@@ -15,6 +22,63 @@ npm install @walkinissue/angy
15
22
  - A suggestion pipeline for untranslated strings
16
23
  - A SvelteKit-friendly integration shape
17
24
 
25
+ ## Showcase
26
+
27
+ Angy is meant to keep translators and developers inside the app while they work.
28
+
29
+ Core loop:
30
+
31
+ - select visible copy directly in the UI
32
+ - inspect the matched PO key, references, flags, and nearby alternatives
33
+ - stage a translation into the working catalog
34
+ - request AI suggestions for untranslated strings
35
+ - rotate locales to visually QA layout and copy fit
36
+ - commit reviewed changes back to the working PO
37
+
38
+ Planned repo assets:
39
+
40
+ - screenshots in [`docs/images`](./docs/images)
41
+ - short workflow recordings once the capture set is ready
42
+
43
+ ## UX flow
44
+
45
+ ### 1. Capture text in the app
46
+
47
+ - select text on the page
48
+ - or hold `Alt` and click an interactive element
49
+ - Angy opens with the selected string prefilled
50
+
51
+ ### 2. Resolve the key
52
+
53
+ - Angy looks up the best PO match
54
+ - it shows the matched key, context, references, comments, and flags
55
+ - it also expands nearby alternatives so repeated copy can be resolved safely
56
+
57
+ ### 3. Stage and review
58
+
59
+ - edit the translation in place
60
+ - press `Enter` to stage quickly
61
+ - use `Tab` to move through unresolved candidates
62
+ - compare target candidates and existing working/base state through the status icons
63
+
64
+ ### 4. Suggest and commit
65
+
66
+ - ask for AI suggestions when a string is untranslated
67
+ - keep or edit the suggestion
68
+ - commit reviewed changes into the working catalog
69
+
70
+ ### 5. QA in the page
71
+
72
+ - use the QA locale toggle to rotate rendered locales
73
+ - compare source and target visually
74
+ - catch wrapping, spacing, and hierarchy regressions before leaving the page
75
+
76
+ ### 6. Promotion workflow
77
+
78
+ - if a project is using Angy for migration or catalog promotion work, the rotate action can promote the working catalog into the base catalog
79
+ - this is intentionally a specialized workflow, not the everyday translation path
80
+ - base vs working catalog design still needs a stricter product pass
81
+
18
82
  ## Packages used
19
83
 
20
84
  - `svelte`
@@ -60,17 +124,24 @@ npm install @walkinissue/angy
60
124
  - Server matches best key, expands related entries, and returns alternatives
61
125
  - User edits, stages, tabs through unresolved strings, and commits
62
126
  - Suggestions can be requested for untranslated strings
63
- - Commits are written to the working catalog
127
+ - Commits are written to a draft working catalog
128
+ - Entering `*-working` preview promotes that draft into the runtime working catalog
64
129
 
65
130
  ## Integration
66
131
 
67
132
  Use the plugin for shared config, then mount the component and define the route yourself.
68
133
 
134
+ The plugin is optional dev glue:
135
+
136
+ - injects route/locale defaults into the client
137
+ - coordinates watcher behavior during catalog writes
138
+ - does not replace the core library/runtime pieces
139
+
69
140
  ```ts
70
141
  // vite.config.ts
71
142
  import { defineConfig } from "vite";
72
143
  import { sveltekit } from "@sveltejs/kit/vite";
73
- import { angy } from "@walkingissue/angy/plugin";
144
+ import { angy } from "@walkinissue/angy/plugin";
74
145
 
75
146
  export default defineConfig({
76
147
  plugins: [angy(), sveltekit()]
@@ -79,7 +150,7 @@ export default defineConfig({
79
150
 
80
151
  ```ts
81
152
  // angy.config.ts
82
- import { defineAngyConfig } from "@walkingissue/angy/server";
153
+ import { defineAngyConfig } from "@walkinissue/angy/server";
83
154
 
84
155
  export default defineAngyConfig({
85
156
  basePoPath: "./src/locales/en.po",
@@ -96,29 +167,31 @@ export default defineAngyConfig({
96
167
  <!-- src/routes/+layout.svelte -->
97
168
  <script lang="ts">
98
169
  import { dev } from "$app/environment";
99
- import { Angy } from "@walkingissue/angy";
170
+ import { Angy } from "@walkinissue/angy";
100
171
  </script>
101
172
 
102
173
  {#if dev}
103
174
  <Angy />
104
175
  {/if}
105
176
 
106
- <slot />
177
+ {@render children?.()}
107
178
  ```
108
179
 
109
180
  ```ts
110
181
  // src/routes/api/translations/+server.ts
111
- export { handler as POST } from "@walkingissue/angy/server";
182
+ export { handler as POST } from "@walkinissue/angy/server";
112
183
  ```
113
184
 
114
185
  ## Catalog model
115
186
 
116
187
  - `en.po` is the base catalog
117
188
  - `en-working.po` is the mutable working catalog
189
+ - `en-working.angy-draft.po` is the draft write target during editing
118
190
  - Base catalog is the source of truth for valid keys
119
191
  - Working catalog is the source of truth for current translation state
120
192
  - Lookup reads working state first
121
- - Commit validates against base, then writes to working
193
+ - Commit validates against base, then writes to the draft working catalog
194
+ - Working preview promotes draft into runtime working
122
195
 
123
196
  ## Discovery algorithm
124
197
 
@@ -183,6 +256,37 @@ export { handler as POST } from "@walkingissue/angy/server";
183
256
  - The `Angy` `endpoint` prop is optional
184
257
  - Use the prop only if you want to override `routePath` per instance
185
258
 
259
+ ## Wuchale Runtime
260
+
261
+ Angy does not replace Wuchale's runtime setup. The host app still needs to:
262
+
263
+ - import the generated client loader
264
+ - preload server catalogs
265
+ - await `loadLocales(...)`
266
+ - wrap requests with `runWithLocale(...)`
267
+
268
+ If that wiring is missing, locale rotation can appear broken and Wuchale may warn:
269
+
270
+ ```text
271
+ Catalog for 'main.main' not found.
272
+ Either 'runWithLocale' was not called or the environment has a problem.
273
+ ```
274
+
275
+ See [docs/wuchale-runtime.md](./docs/wuchale-runtime.md) for a working pattern, including the localStorage-and-cookie sync used in the smoke test.
276
+
277
+ ## Frequent issues
278
+
279
+ - Locale toggle changes in Angy, but the page does not rerender
280
+ - Wuchale is usually not fully bootstrapped in the host app yet. Check the generated loader imports, awaited `loadLocales(...)`, and server locale wiring first.
281
+ - Working locale is visible in the QA rotation, but edit/commit controls are disabled
282
+ - This is intentional. `*-working` is preview-only so Angy does not write while the working catalog is the actively rendered runtime source.
283
+ - Rotation shows a warning modal
284
+ - This is a preview of the working-vs-base differences that rotation will promote into base. It is not the same thing as a catalog integrity failure.
285
+ - Angy refuses to operate with a catalog integrity error
286
+ - The working catalog no longer matches the base key set, or it is missing translations that base already has. Regenerate or replace the working catalog before continuing.
287
+ - Commit succeeded, but the helper still looks unsure
288
+ - Angy now keeps local drafts until the server truth matches the committed value. If Wuchale/Vite reloads at a bad moment, your staged edits stay cached instead of being silently discarded.
289
+
186
290
  ## Custom suggestion provider
187
291
 
188
292
  Use `suggestionProvider` if you want your own AI pipeline.
@@ -204,7 +308,7 @@ Return:
204
308
  Example:
205
309
 
206
310
  ```ts
207
- import { defineAngyConfig, type SuggestionProvider } from "@walkingissue/angy/server";
311
+ import { defineAngyConfig, type SuggestionProvider } from "@walkinissue/angy/server";
208
312
 
209
313
  const suggestionProvider: SuggestionProvider = async ({ items }) => {
210
314
  return items.map((item) => ({
@@ -227,9 +331,9 @@ export default defineAngyConfig({
227
331
 
228
332
  ## Exports
229
333
 
230
- - `Angy` from `@walkingissue/angy`
231
- - `handler` and `defineAngyConfig` from `@walkingissue/angy/server`
232
- - `angy` from `@walkingissue/angy/plugin`
334
+ - `Angy` from `@walkinissue/angy`
335
+ - `handler` and `defineAngyConfig` from `@walkinissue/angy/server`
336
+ - `angy` from `@walkinissue/angy/plugin`
233
337
 
234
338
  ## Notes
235
339
 
@@ -243,4 +347,9 @@ export default defineAngyConfig({
243
347
  - Handle server paths for single config and single app
244
348
  - Support multiple catalogs
245
349
  - Support multiple translations from a single source locale
350
+ - Add a compact focus mode so the helper can hide dead detail, keep a smaller matched-key summary, and only show the active alternative by default
351
+ - Revisit how commit feedback is surfaced so successful or failed commits stay visible without making the helper flow awkward
352
+ - Improve cross-page reference browsing, likely through a popup/details surface instead of always-visible reference noise
353
+ - Make working-locale rotation trustworthy and visually explicit so users can tell when the app is actually rendering the working catalog
354
+ - Harden the base-vs-working catalog design and decide how much of promotion/rotation should be exposed in the default UX
246
355
  - This seems trivially implemented with the current setup