Skip to content

Commit cc322cb

Browse files
committed
fix(i18n): translate the sidereal frame caption, and read copy passed to a helper
1 parent 101f81c commit cc322cb

27 files changed

Lines changed: 150 additions & 30 deletions

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ The language comes from `lang` on the element, else the nearest ancestor carryin
530530

531531
English is the default and needs no catalogue. Load only the languages your site serves; one catalogue covers every Roxy component on the page.
532532

533-
A catalogue ships for every language the API serves: `de`, `es`, `fr`, `hi`, `pt`, `ru`, `tr`. Each covers `<roxy-natal-chart>`, `<roxy-transit-wheel>`, `<roxy-ephemeris-table>`, `<roxy-data>`, `<roxy-bodygraph>`, `<roxy-hd-type-card>`, `<roxy-hd-variables>`, `<roxy-reference-card>` and the shared labels every component inherits; the remaining components write English labels until their entries land. Every term is sourced from named astrology references in that language rather than translated word for word. **The values the API returns are never rewritten**: a planet, sign, aspect or house-system name renders exactly as the response carries it, so the words on the chart and the words in the response can never disagree. Ask for a language and the response carries the reader-facing name beside the English one, so the chart prints the translated name while the English one stays available to compare against in your own code.
533+
A catalogue ships for every language the API serves: `de`, `es`, `fr`, `hi`, `pt`, `ru`, `tr`. Coverage grows card by card, and a card is either translated or it is not, so a component reads its own labels in your language or writes them in English, never a mixture. Every term is sourced from named astrology references in that language rather than translated word for word. **The values the API returns are never rewritten**: a planet, sign, aspect or house-system name renders exactly as the response carries it, so the words on the chart and the words in the response can never disagree. Ask for a language and the response carries the reader-facing name beside the English one, so the chart prints the translated name while the English one stays available to compare against in your own code.
534534

535535
Dates, times and numbers need no catalogue at all. They follow the same page language and are written the way that language writes them, hour cycle included, so a German page reads `15. Jan. 1990, 14:30` and an Argentine one `15 de ene de 1990, 2:30 p. m.`.
536536

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ Two things are separate on purpose. The catalogue is the wording this library wr
820820

821821
Dates, times and numbers follow the page as well, in the conventions that language actually uses: a Spanish page reads `15 ene 1990`, an Argentine one `15 de ene de 1990`, a German one `15. Jan. 1990, 14:30`. The hour cycle comes from the language, not from us, so nobody gets a 12-hour clock on a page that writes 24. This needs no catalogue and no attribute: it follows the same `lang` your page already declares.
822822

823-
A catalogue ships for every language the API serves: `de`, `es`, `fr`, `hi`, `pt`, `ru`, `tr`. Each covers `<roxy-natal-chart>`, `<roxy-transit-wheel>`, `<roxy-ephemeris-table>`, `<roxy-data>`, `<roxy-bodygraph>`, `<roxy-hd-type-card>`, `<roxy-hd-variables>`, `<roxy-reference-card>` and the shared chrome every component inherits; the remaining components render English labels until their catalogue entries land. Every term in every catalogue is sourced from named astrology references in that language rather than translated word for word, because the words a practitioner reads are the product.
823+
A catalogue ships for every language the API serves: `de`, `es`, `fr`, `hi`, `pt`, `ru`, `tr`. Coverage grows card by card, and a card is either translated or it is not, so a component reads its own labels in your language or renders them in English, never a mixture. Every term in every catalogue is sourced from named astrology references in that language rather than translated word for word, because the words a practitioner reads are the product.
824824

825825
## Reliability
826826

packages/ui/src/components/arudha-padas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class RoxyArudhaPadas extends RoxyDataElement<ArudhaResponse> {
148148
return html`<div class="wrap" part="card" aria-label="Arudha padas">
149149
<header class="head" part="header">
150150
<h2 class="title">Arudha padas</h2>
151-
${renderFrameCaption(this.effectiveLang(), d.frame)}
151+
${renderFrameCaption(this.effectiveLang(), d.frame, this.translator)}
152152
</header>
153153
<div class="leads" part="details">
154154
<div class="lead"><span>Lagna</span><strong>${d.lagnaRashi ?? ''}</strong></div>

packages/ui/src/components/ashtakavarga-grid.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export class RoxyAshtakavargaGrid extends RoxyDataElement<AshtakavargaResponse>
234234
? html`<p class="subtitle">${signs.length} signs</p>`
235235
: nothing
236236
}
237-
${renderFrameCaption(this.effectiveLang(), d.frame)}
237+
${renderFrameCaption(this.effectiveLang(), d.frame, this.translator)}
238238
</div>
239239
240240
${renderTablist({

packages/ui/src/components/bhav-chalit-table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class RoxyBhavChalitTable extends RoxyDataElement<BhavChalitResponse> {
148148
house between the Rashi chart and the unequal Sripati cusps.`
149149
}
150150
</p>
151-
${renderFrameCaption(this.effectiveLang(), d.frame)}
151+
${renderFrameCaption(this.effectiveLang(), d.frame, this.translator)}
152152
</header>
153153
154154
${

packages/ui/src/components/bhava-bala-table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export class RoxyBhavaBalaTable extends RoxyDataElement<BhavaBalaResponse> {
158158
d.houseSystem ? html` on the ${d.houseSystem} frame` : nothing
159159
}
160160
</p>
161-
${renderFrameCaption(this.effectiveLang(), d.frame)}
161+
${renderFrameCaption(this.effectiveLang(), d.frame, this.translator)}
162162
</header>
163163
164164
<div class="rows" part="table" role="list">

packages/ui/src/components/chara-karakas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export class RoxyCharaKarakas extends RoxyDataElement<CharaKarakaResponse> {
175175
<span class="scheme-chip">${d.scheme ?? ''}</span>
176176
${d.scheme ? (SCHEMES[d.scheme] ?? '') : ''}
177177
</p>
178-
${renderFrameCaption(this.effectiveLang(), d.frame)}
178+
${renderFrameCaption(this.effectiveLang(), d.frame, this.translator)}
179179
</header>
180180
<div class="leads" part="details">
181181
<div class="lead"><span>Atmakaraka</span><strong>${d.atmakaraka ?? ''}</strong></div>

packages/ui/src/components/divisional-chart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class RoxyDivisionalChart extends RoxyDataElement<DivisionalChartResponse
107107
? html`<p class="significance">${division.significance}</p>`
108108
: nothing
109109
}
110-
${renderFrameCaption(this.effectiveLang(), d.frame)}
110+
${renderFrameCaption(this.effectiveLang(), d.frame, this.translator)}
111111
</div>
112112
${renderKundliStyleTablist(this.chartStyle, this.setStyle)}
113113
</div>

packages/ui/src/components/dosha-card.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class RoxyDoshaCard extends RoxyDataElement<DoshaData> {
171171
<span class=${`badge ${present ? 'present' : 'absent'}`}>
172172
${present ? 'Present' : 'Absent'}
173173
</span>
174-
${renderFrameCaption(this.effectiveLang(), d.frame)}
174+
${renderFrameCaption(this.effectiveLang(), d.frame, this.translator)}
175175
</header>
176176
${
177177
'type' in d && d.type

packages/ui/src/components/guna-milan.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ export class RoxyGunaMilan extends RoxyDataElement<CompatibilityResponse> {
373373
</div>`
374374
: nothing
375375
}
376-
${renderFrameCaption(this.effectiveLang(), d.frame)}
376+
${renderFrameCaption(this.effectiveLang(), d.frame, this.translator)}
377377
</article>`;
378378
}
379379
}

0 commit comments

Comments
 (0)