---
phase: 08-simplified-permissions
plan: 05
subsystem: permissions-localization-export
tags: [localization, export, simplified-permissions, i18n]
dependency_graph:
  requires: [08-02, 08-03, 08-04]
  provides: [localized-simplified-ui, simplified-export-wiring]
  affects: [PermissionsView.xaml, PermissionsViewModel.cs, Strings.resx, Strings.fr.resx]
tech_stack:
  added: []
  patterns: [resx-localization, export-branching, xaml-run-binding]
key_files:
  created: []
  modified:
    - SharepointToolbox/Localization/Strings.resx
    - SharepointToolbox/Localization/Strings.fr.resx
    - SharepointToolbox/ViewModels/Tabs/PermissionsViewModel.cs
    - SharepointToolbox/Views/Tabs/PermissionsView.xaml
decisions:
  - "FR translations use XML entities for accented chars matching existing convention"
  - "Hardcoded user(s) in XAML summary cards wired to lbl.summary.users localization key"
metrics:
  duration_minutes: 2
  completed: "2026-04-07"
  tasks_completed: 2
  tasks_total: 2
---

# Phase 08 Plan 05: Localization Keys and Export Wiring Summary

EN/FR localization keys for simplified permissions UI plus export command branching on IsSimplifiedMode to call simplified WriteAsync overloads.

## What Was Done

### Task 1: Add EN and FR localization keys for simplified permissions

Added 6 localization keys to both `Strings.resx` (EN) and `Strings.fr.resx` (FR):

| Key | EN Value | FR Value |
|-----|----------|----------|
| `chk.simplified.mode` | Simplified mode | Mode simplifie |
| `grp.display.opts` | Display Options | Options d'affichage |
| `lbl.detail.level` | Detail level: | Niveau de detail : |
| `rad.detail.detailed` | Detailed (all rows) | Detaille (toutes les lignes) |
| `rad.detail.simple` | Simple (summary only) | Simple (resume uniquement) |
| `lbl.summary.users` | user(s) | utilisateur(s) |

Keys inserted in alphabetical order among existing entries. FR translations use XML entities for accented characters (matching existing convention in the file).

Also wired the hardcoded `" user(s)"` text in `PermissionsView.xaml` summary cards to use the `lbl.summary.users` localization key via a `Run` binding to `TranslationSource.Instance`.

**Commit:** `60ddcd7`

### Task 2: Wire export commands to use simplified overloads

Updated `ExportCsvAsync` and `ExportHtmlAsync` in `PermissionsViewModel.cs` to branch on `IsSimplifiedMode`:

- When `IsSimplifiedMode` is true and `SimplifiedResults.Count > 0`, calls `WriteAsync(SimplifiedResults.ToList(), ...)` (simplified overload)
- Otherwise, calls the existing `WriteAsync(Results, ...)` (standard overload)

No changes to constructor signatures, `RunOperationAsync`, or any other methods.

**Commit:** `f503e6c`

## Deviations from Plan

### Auto-fixed Issues

**1. [Rule 2 - Missing Localization] Wired hardcoded "user(s)" in XAML summary cards**
- **Found during:** Task 1
- **Issue:** PermissionsView.xaml had hardcoded `<Run Text=" user(s)" />` in summary card template
- **Fix:** Replaced with `<Run Text="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[lbl.summary.users], Mode=OneWay}" />`
- **Files modified:** SharepointToolbox/Views/Tabs/PermissionsView.xaml
- **Commit:** 60ddcd7

## Verification

- `dotnet build` succeeds with 0 errors, 0 warnings
- 6 keys present in both Strings.resx and Strings.fr.resx
- 2 export methods branch on IsSimplifiedMode
- XAML summary card uses localized lbl.summary.users key

## Self-Check: PASSED
