Skip to content

Non-Functional Requirements (NFRs)

This document defines all mandatory non-functional requirements that apply to every feature in App Suite for Teams.

Purpose

Non-functional requirements define quality attributes and constraints that must be satisfied by all features, regardless of their specific functionality. These requirements ensure consistency, maintainability, and quality across the entire application.

Mandatory NFRs

1. Internationalization (i18n)

Status: Mandatory for all user-visible strings

Requirement: All text displayed to users must be translatable into multiple languages.

What Must Be Translated

All user-visible strings including:

  • UI Text: Headings, labels, descriptions, instructions, body text
  • Buttons: Action labels ("Save", "Cancel", "Delete", "Edit", "Submit")
  • Form Elements:
    • Field labels ("Subject", "Recipients", "Message")
    • Placeholders ("Enter subject", "Search...")
    • Validation messages ("This field is required", "Invalid email")
  • Messages:
    • Error messages ("An error occurred. Please try again.")
    • Success messages ("Thread created successfully")
    • Warning messages ("Unsaved changes will be lost")
  • States:
    • Empty states ("No threads found", "Nothing to display")
    • Loading states ("Loading...", "Please wait")
  • Navigation:
    • Menu items
    • Breadcrumbs
    • Tab labels
  • Accessibility:
    • ARIA labels (aria-label, aria-describedby)
    • Screen reader text
  • Tooltips and Help:
    • Hover text
    • Help text
    • Contextual information

What Should NOT Be Translated

  • Variable names in code
  • Console logs (development only)
  • API responses (unless displayed to user)
  • Data-testid attributes
  • Code comments
  • Technical error codes (internal identifiers)
  • File paths
  • Configuration keys

Implementation

Technology: gettext with PO (Portable Object) files

Location: ui/i18n/*.po

Basic Usage:

<script setup>
import gt from 'gettext'
const buttonLabel = gt('Save')
</script>

<template>
  <h1>{{ gt('Thread Management') }}</h1>
  <button>{{ gt('Save') }}</button>
  <input :placeholder="gt('Enter subject')" />
</template>

Critical Pattern: Strings in Data Structures

IMPORTANT: Extraction tools cannot detect strings in variables or data structures. Wrap these with gt() at point of definition.

Example:

// ❌ WRONG - Not extracted
const folders = [{ id: 'inbox', name: 'Inbox' }]

// ✅ CORRECT
import gt from 'gettext'
const folders = [{ id: 'inbox', name: gt('Inbox') }]

Common locations: Store initialization, object literals with name:/label:/title: properties, array/Map/Set definitions, default function return values.

Advanced Features:

For most cases, use simple gt('text'). For specialized needs, gettext provides:

Pluralization: gt.ngettext('1 item', '%d items', count) - Handles singular/plural forms Context: gt.pgettext('app', 'Teams') - Disambiguates identical strings Positional parameters: gt('Hello %1$s, %2$d messages') - Supports different word orders in translations

See gettext documentation for full details.

ARIA Labels: Also wrap with gt():

<button :aria-label="gt('Delete thread')">
  <Icon icon="mdi:delete" aria-hidden="true" />
</button>

Workflow

  1. Wrap all user-visible strings with gt()
  2. Run pnpm msgmerge to extract strings to PO files
  3. Translators fill in PO files
  4. Quality Agent validates before MR

Validation

Before MR creation:

Testing

Mock gettext in unit tests: vi.mock('gettext', () => ({ default: vi.fn((str) => str }))

Verify no hardcoded English in E2E tests.

Resources


Future NFRs

Future NFR candidates: Performance, Accessibility (WCAG 2.1 AA), Security, Browser Compatibility, Responsive Design, Offline Support.

When adding NFRs: Document in this file, update agent instructions, communicate to team.


Summary

Current Mandatory NFR: Internationalization (i18n) - All user-visible strings must use gt()

Validation: Quality Agent validates before MR creation. Non-compliance blocks merge.