Skip to content

Commit 6de2b6e

Browse files
committed
Update robot instructions to raise awareness of platform registrartion mode and clear instructions for generating translated strings
1 parent 3e39f51 commit 6de2b6e

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.github/copilot-instructions.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This repository contains the **Better Together Community Engine** (an isolated R
1212
- **Use `ENV.fetch`** rather than `ENV[]`.
1313
- **Always add policy/authorization checks** on links/buttons to controller actions.
1414
- **i18n & Mobility**: every user-facing string must be translatable; include missing keys.
15+
- Provide translations for all available locales (e.g., en, es, fr) when adding new strings.
1516

1617
## Technology Stack
1718

@@ -46,6 +47,11 @@ This repository contains the **Better Together Community Engine** (an isolated R
4647

4748
## Coding Guidelines
4849

50+
## Test Environment Setup
51+
- Configure the host Platform in a before block for controller/request/feature tests.
52+
- Create/set a Platform as host (with community) before requests.
53+
- Toggle requires_invitation and provide invitation_code when needed.
54+
4955
- **Ruby/Rails**
5056
- 2-space indent, snake_case methods, Rails conventions
5157
- Service objects in `app/services/`
@@ -57,13 +63,15 @@ This repository contains the **Better Together Community Engine** (an isolated R
5763
- Bootstrap utility classes; respect prefers-reduced-motion & other a11y prefs
5864
- Avoid inline JS; use Stimulus
5965
- External links in `.trix-content` get FA external-link icon unless internal/mailto/tel/pdf
66+
- All user-facing copy must use t("...") and include keys across all locales (add to config/locales/en.yml, es.yml, fr.yml).
6067
- **Hotwire**
6168
- Use Turbo Streams for CRUD updates
6269
- Stimulus controllers in `app/javascript/controllers/`
6370
- No direct DOM manipulation without Stimulus targets/actions
6471
- **Background Jobs**
6572
- Sidekiq jobs under appropriate queues (`:default`, `:mailers`, `:metrics`, etc.)
6673
- Idempotent job design; handle retries
74+
- When generating emails/notifications, localize both subject and body for all locales.
6775
- **Search**
6876
- Update `as_indexed_json` to include translated/plain-text fields as needed
6977
- **Encryption & Privacy**

AGENTS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,19 @@ Instructions for GitHub Copilot and other automated contributors working in this
3939
- Fallback: `npx -y @mermaid-js/mermaid-cli -i docs/your_diagram.mmd -o docs/your_diagram.png`.
4040
- PRs that add/modify models, associations, or flows must include corresponding docs and diagrams.
4141
- When notifications, policies, or routes change, ensure affected docs and diagrams are updated to match behavior.
42+
43+
## Platform Registration Mode
44+
- Invitation-required: Platforms support `requires_invitation` (see `BetterTogether::Platform#settings`). When enabled, users must supply a valid invitation code to register. This is the default for hosted deployments.
45+
- Where to change: Host Dashboard → Platforms → Edit → “Requires Invitation”.
46+
- Effects:
47+
- Devise registration page prompts for an invitation code when none is present.
48+
- Accepted invitations prefill email, apply community/platform roles, and are marked accepted on successful sign‑up.
49+
50+
## Translations & Locales
51+
- All user‑facing text must use I18n — do not hard‑code strings in views, controllers, models, or JS.
52+
- When adding new text, add translation keys for all available locales in this repo (e.g., `config/locales/en.yml`, `es.yml`, `fr.yml`).
53+
- Include translations for:
54+
- Flash messages, validation errors, button/label text, email subjects/bodies, and Action Cable payloads.
55+
- Any UI strings rendered from background jobs or notifiers.
56+
- Prefer existing keys where possible; group new keys under appropriate namespaces.
57+
- If a locale is missing a translation at review time, translate the English copy rather than leaving it undefined.

0 commit comments

Comments
 (0)