Skip to content

Add localization support to genpage skill#44

Merged
9 commits merged intomainfrom
feature/genpage-localization-support
Mar 19, 2026
Merged

Add localization support to genpage skill#44
9 commits merged intomainfrom
feature/genpage-localization-support

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Mar 5, 2026

Adds multi-language support so generated components include language detection, translations, RTL layout, and user format settings when the environment has multiple configured languages.

  • SKILL.md: detect languages via pac model list-languages in Step 2, include localization in Step 4 plan, reference localization rules in Step 7 code generation
  • genpage-rules-reference.md: add full Localization section with language detection boilerplate, translation dictionary + t() helper, RTL support for Arabic/Hebrew, usersettings formatting helpers, and LCID reference table

Adds multi-language support so generated components include language
detection, translations, RTL layout, and user format settings when the
environment has multiple configured languages.

- SKILL.md: detect languages via `pac model list-languages` in Step 2,
  include localization in Step 4 plan, reference localization rules in
  Step 7 code generation
- genpage-rules-reference.md: add full Localization section with language
  detection boilerplate, translation dictionary + t() helper, RTL support
  for Arabic/Hebrew, usersettings formatting helpers, and LCID reference
  table

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ghost ghost self-requested a review as a code owner March 5, 2026 19:19
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
akshay-viz and others added 4 commits March 5, 2026 13:59
- Use retrieveRow with current user ID instead of queryTable for
  usersettings fetch (matches AIBuilder's CoderAgent pattern)
- Add anti-pattern examples for currency/number formatting to prevent
  common LLM mistakes (hardcoded $, hardcoded currency codes)
- Add note to keep date/currency formats out of translations dictionary

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The server resolves LCIDs dynamically via CultureInfo, and the agent
gets real LCID data from pac model list-languages output. The static
table was redundant.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The t() convention is common in i18n libraries but not self-documenting
for readers unfamiliar with the pattern. Renamed to translate() across
SKILL.md and genpage-rules-reference.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 18, 2026 18:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds localization guidance to the genpage skill so generated pages can adapt to multi-language Dataverse environments (language detection, translations, RTL, and user-specific formatting).

Changes:

  • Extend /genpage workflow to detect configured languages via pac model list-languages and conditionally include localization in the generation plan.
  • Add a new “Localization” section to genpage-rules-reference.md covering language detection, translation dictionary usage, RTL guidance, and usersettings-based formatting helpers.
  • Bump plugins/model-apps plugin version to 1.0.2.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
plugins/model-apps/skills/genpage/SKILL.md Adds language detection step and instructs conditional localization requirements during planning and code generation.
plugins/model-apps/references/genpage-rules-reference.md Introduces a Localization rules section (translations/RTL/user formatting) for generated TSX.
plugins/model-apps/.claude-plugin/plugin.json Version bump reflecting new documentation capabilities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread plugins/model-apps/references/genpage-rules-reference.md Outdated
Comment thread plugins/model-apps/skills/genpage/SKILL.md
Comment thread plugins/model-apps/references/genpage-rules-reference.md
Comment thread plugins/model-apps/references/genpage-rules-reference.md Outdated
Comment thread plugins/model-apps/references/genpage-rules-reference.md Outdated
akshay-viz and others added 2 commits March 18, 2026 11:32
- Remove hardcoded "MM/dd/yyyy" and "/" fallbacks in formatDate; fall
  back to toLocaleDateString() when usersettings fields are incomplete
- Wrap fetchUserSettings in try-catch with console.error, matching the
  DataAPI rules that require error handling on all async dataApi calls
- Use void prefix on floating promise

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- formatCurrency: return plain number when currencysymbol is missing
  instead of falling back to hardcoded "$"
- formatNumber: fall back to toLocaleString() when decimalsymbol or
  numberseparator are missing instead of hardcoding "." and ","

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 18, 2026 18:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds conditional multi-language/localization guidance to the genpage skill so generated TSX components can support language detection, translations, RTL layout, and user formatting settings when the target environment is configured for multiple (or non-English) languages.

Changes:

  • Update genpage skill flow to detect configured languages via pac model list-languages and include localization in the plan/codegen steps when applicable.
  • Add a new “Localization” section to the genpage rules reference with patterns for language detection, translations, RTL support, and usersettings-based formatting.
  • Bump the model-apps plugin version.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
plugins/model-apps/skills/genpage/SKILL.md Adds Step 2 language detection and conditional localization instructions for planning and code generation.
plugins/model-apps/references/genpage-rules-reference.md Introduces a Localization rules section (detection, translation helper, RTL, usersettings formatting helpers).
plugins/model-apps/.claude-plugin/plugin.json Version bump to 1.0.2.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread plugins/model-apps/references/genpage-rules-reference.md
Comment thread plugins/model-apps/references/genpage-rules-reference.md
Comment thread plugins/model-apps/references/genpage-rules-reference.md Outdated
Comment thread plugins/model-apps/references/genpage-rules-reference.md
Dataverse usersettings.dateformatstring can use single-token formats
(M/d/yyyy, d.M.yy) not just double-token (MM/dd/yyyy). Use a single
regex pass to replace yyyy, yy, MM, M, dd, d tokens correctly, and
normalize all separator characters to the user's dateseparator.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ghost ghost enabled auto-merge (squash) March 18, 2026 20:27
@ghost ghost merged commit 9e4baf4 into main Mar 19, 2026
1 check passed
@ghost ghost deleted the feature/genpage-localization-support branch March 19, 2026 04:21
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants