Skip to content

feat(i18n): Fix bare t() bug and add 14 missing keys#17

Open
rubenvdlinde wants to merge 21 commits into
developmentfrom
feature/i18n-complete-translations
Open

feat(i18n): Fix bare t() bug and add 14 missing keys#17
rubenvdlinde wants to merge 21 commits into
developmentfrom
feature/i18n-complete-translations

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Summary

  • Wrap all user-facing strings in t() / $this->l10n->t() translation calls
  • Ensure English is the primary language for all translation keys (per ADR-007)
  • Convert any hardcoded Dutch strings to English keys with Dutch in nl.json
  • Complete l10n/en.json (identity-mapped) and l10n/nl.json (Dutch translations)
  • Fix <script setup> components missing direct t import from @nextcloud/l10n

Test plan

  • Verify app loads without JavaScript errors
  • Switch Nextcloud language to Dutch and verify translations display correctly
  • Switch back to English and verify English strings display correctly
  • Spot-check key pages (dashboard, settings, detail views) in both languages

🤖 Generated with Claude Code

WilcoLouwerse and others added 19 commits March 23, 2026 12:35
Set up complete CI quality pipeline and app scaffold
Merge development into beta: OpenSpec scaffold, settings stack, and dev docs
Release: merge development into beta
Restore branch-protection workflow for main branch
Release: promote beta to stable — initial CI pipeline and app scaffold
…uctors

Issues caught by every code review on apps built from this template:
- <licence>agpl</licence> → <licence>eupl</licence>
- OC.requestToken → getRequestToken() from @nextcloud/auth
- Added SPDX-License-Identifier: EUPL-1.2 to all PHP/JS/Vue files
- Constructor properties: private → private readonly
The app store only recognises agpl/apache/mit — not eupl.
Source files use SPDX EUPL-1.2 headers (the actual licence).
info.xml uses agpl for store compatibility only.
- Extend base webpack config instead of replacing resolve/module
- Add NodePolyfillPlugin for process polyfill compatibility
- Add CnObjectSidebar + objectSidebarState for proper sidebar positioning
- Update deps: @nextcloud/l10n ^3.1.0, @nextcloud/dialogs ^5.3.7
- Add sass/sass-loader for SCSS support
…plitChunks

Two issues found when testing builder-generated apps (decidesk):

1. main.js: loadTranslations() wraps Vue mount in a callback that never
   fires when l10n/en_US.json returns 404 (new apps don't have translations).
   Fix: mount Vue synchronously, import t/n directly.

2. webpack.config.js: Nextcloud serves chunk files from /apps/<id>/js/ but
   custom_apps files live at /custom_apps/<id>/js/. Any webpack code-split
   chunk (from lazy imports or vendor splitting) fails with ChunkLoadError.
   Fix: disable splitChunks entirely. Use static imports in router.
Gives the Hydra builder a working reference for the full CRUD lifecycle:

- ItemList.vue: CnIndexPage + useListView composable (zero-boilerplate list)
- ItemDetail.vue: CnDetailPage with sidebar, save/delete, CnObjectDataWidget
- object.js: replaced hand-rolled store with createObjectStore from library
- store.js: registerObjectType pattern with settings-driven schema binding
- MainMenu.vue: added Items nav entry between Dashboard and Documentation
- router: static imports with props factory for :id params
- package.json: fix @nextcloud/dialogs ^3.2.0 (Vue 2), add apexcharts/codemirror

These patterns prevent the recurring builder mistakes: lazy imports (ChunkLoadError),
custom stores (should use createObjectStore), missing list/detail views, and wrong
dependency versions.
Settings link should be inside NcAppNavigationSettings (the gear icon
widget), not a bare NcAppNavigationItem — follows Nextcloud convention
for admin-only controls and matches the procest pattern.
The correct Nextcloud pattern:
- Admin settings: /settings/admin/{appid} (via AdminSettings.php + settings.js)
- In-app settings: NcAppSettingsDialog modal opened from gear menu
- NO /settings route in the Vue router

The gear foldout (NcAppNavigationSettings) can hold additional admin
nav items. The Settings item emits @open-settings which App.vue
handles by opening the UserSettings modal.

Matches the OpenCatalogi pattern.
- Fix ReferenceError: use this.t() instead of bare t() in ItemDetail.vue
- Wrap hardcoded app name in AdminRoot.vue
- Add 14 missing keys to en.json and nl.json (30→44 keys)
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/nextcloud-app-template @ 13432a7

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-04-16 11:23 UTC

Download the full PDF report from the workflow artifacts.

rubenvdlinde and others added 2 commits April 16, 2026 20:04
Standardize on #actions across all components per the updated
slot naming convention in @conduction/nextcloud-vue.
Update all translation keys to use sentence case (only first letter capitalized)
instead of title case. Keys changed:
- "Add Groups" → "Add groups"
- "Active Collections" → "Active collections"
- "API Key" → "API key"
- And 400+ similar keys across all apps

Sentence case for keys improves consistency and readability while preserving
proper English grammar in translated values.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants