Skip to content

i18n: extract task-creation flow strings (Part of #145) - #155

Open
everysingletear wants to merge 8 commits into
donetick:developfrom
everysingletear:i18n/task-creation
Open

i18n: extract task-creation flow strings (Part of #145)#155
everysingletear wants to merge 8 commits into
donetick:developfrom
everysingletear:i18n/task-creation

Conversation

@everysingletear

Copy link
Copy Markdown
Contributor

Part of #145.

Extracts the hardcoded user-facing strings in the task-creation flow into
the existing i18next setup. This is a language-agnostic extraction PR: it only
adds English keys to public/locales/en/ and wraps the strings in t() — no
new language dictionaries, no behavior changes.

Components migrated

The full "add / create task" surface:

  • AddTaskModal (header, help section, subtasks, description)
  • AssigneePickerField
  • PriorityPickerField
  • LabelsPickerField
  • DueDatePickerField (Today/Tomorrow/Weekend, time-of-day presets)
  • RepeatPickerField (frequency, "repeat every", day-of-month)
  • NotificationPickerField (reminder counts — pluralized)
  • ProjectPickerField
  • AttachmentPickerField (file counts — pluralized)
  • SmartTaskTitleInput
  • SubTask
  • AdvancedOptionsSection (assignment strategies)

Notes

  • New keys live in the chores namespace (plus a few reused generics in
    common), following the existing feature-scoped namespace convention.
  • Count-based strings use i18next v4 plural suffixes (_one / _other) so
    other languages can supply their own plural forms.
  • Generic strings ("Save", "Cancel", "Delete", …) are reused from common
    rather than duplicated.
  • No RTL / layout changes. Build passes.

Testing

  • npm run build — green.
  • Task-creation flow exercised end-to-end; all strings resolve via t() with
    no visible change in English.

Wrap the assignee picker's user-facing strings in t():
- chores:assignee.label ("Assignee")
- chores:assignee.anyone ("Anyone")
- common:unknown ("Unknown" — shared user-name fallback)

Adds the English source keys only; no behavior change.
Wrap the reminder picker in t():
- chores:remind.* — label, title, on-due-date, and pluralized reminder
  count (count_one/count_other)
- relative-time split so translations control word order:
  chores:remind.unit.{minute,hour,day}_* (pluralized units) +
  chores:remind.{before,after} ("{{num}} {{unit}} ...", plain interpolation)
- common:apply / common:removeAll (shared buttons); common:cancel reused

Adds English source keys only; no behavior change.
Wrap the modal title, sentence label, placeholder, footer buttons and the
"task in a sentence" help block in t(). Help list items use plain t() with
the example keywords (P1, tomorrow, daily...) kept as literal <em> — they are
the parser's input tokens, not translatable copy. Adds common:create; reuses
common:cancel.

Partial: strings below the input section remain for a follow-up.
- Priority: reuse chores:priority for the label; add chores:noPriority.
  P1-P4 kept as literal codes.
- Labels: chores:labels.* incl. pluralized count (count_one/other) and
  the "Create label" action.
Wrap trigger/title, quick-date and quick-time labels, and Anytime/Specific
time in t() (chores:duePicker.*; reuse chores:dueDate). Replace the hardcoded
month/weekday abbreviation arrays with moment formatting so the calendar
localizes with the active language.
The @-mention "Anyone" option reuses chores:assignee.anyone. AddTaskModal
now has no remaining hardcoded copy (example keywords stay literal).
Project, Attachment (pluralized file count), SmartTaskTitleInput, SubTask,
AdvancedOptionsSection (assign-strategy options), and RepeatPickerField
(SectionLabel translates via key; frequency/occurrence/unit labels; day and
month names via moment).
@everysingletear

Copy link
Copy Markdown
Contributor Author

Apologies for leaving this sitting red — I've now audited it properly rather than just rebasing and hoping.

Six of the twelve files here were rewritten on develop since I branched: DueDatePickerField lost 522 lines to the project-management rework (#186), AddTaskModal gained 233 in the same change, and RepeatPickerField / NotificationPickerField went through the modal-and-button unification. SmartTaskTitleInput picked up the audio-input work. That's roughly 70% of this diff pointing at code that no longer exists — not something a rebase can resolve sensibly, since the strings have to be re-extracted against the new structure anyway.

The other six files are untouched, and they happen to be a coherent set on their own: the task-form field components. So rather than leave this conflicting indefinitely, I'd like to force-push it down to just those and retitle it "i18n: extract task form field strings"AdvancedOptionsSection, PriorityPickerField, AssigneePickerField, ProjectPickerField, AttachmentPickerField. (SubTask.jsx is clean on develop but sits in an open branch, so I'm leaving it out.)

That turns this into a small, conflict-free, reviewable PR. The rewritten half goes back into the queue behind the modal work, and I'll send it once that's settled.

Full audit of the whole fork — what's ready and what's blocked on which refactor — is in #145. Shout if you'd rather I just close this one instead.

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.

1 participant