Add localization support to genpage skill#44
Conversation
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>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- 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>
There was a problem hiding this comment.
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
/genpageworkflow to detect configured languages viapac model list-languagesand conditionally include localization in the generation plan. - Add a new “Localization” section to
genpage-rules-reference.mdcovering language detection, translation dictionary usage, RTL guidance, andusersettings-based formatting helpers. - Bump
plugins/model-appsplugin version to1.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.
- 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>
There was a problem hiding this comment.
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-languagesand 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.
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>
Adds multi-language support so generated components include language detection, translations, RTL layout, and user format settings when the environment has multiple configured languages.
pac model list-languagesin Step 2, include localization in Step 4 plan, reference localization rules in Step 7 code generation