Skip to content

Comments

Fix localization JSON + linting workflow#43

Open
printminion-co wants to merge 2 commits intoionos-devfrom
mk/fix/i18n
Open

Fix localization JSON + linting workflow#43
printminion-co wants to merge 2 commits intoionos-devfrom
mk/fix/i18n

Conversation

@printminion-co
Copy link

@printminion-co printminion-co commented Feb 23, 2026

This pull request introduces automated linting for localization (l10n) JSON files and improves their consistency. The main changes include setting up a dedicated GitHub Actions workflow for linting, updating ESLint configuration to properly handle JSON files, and adding new npm scripts to make linting easier. Additionally, some minor formatting corrections were made to the localization files themselves.

Automation and Tooling Improvements:

  • Added a new GitHub Actions workflow (.github/workflows/lint-l10n.yml) to automatically lint l10n JSON files on pull requests, ensuring translation files remain valid and free of common errors.
  • Updated package.json to introduce lint:l10n and lint:l10n:fix npm scripts for easier manual linting and fixing of l10n JSON files.
  • Added eslint-plugin-jsonc as a development dependency in package.json to enable JSON-specific linting rules.

ESLint Configuration Enhancements:

  • Modified .eslintrc.js to add an override for l10n/*.json files, using jsonc-eslint-parser and the jsonc plugin. This enforces no trailing commas and disables noisy JS rules for these files.

Localization File Consistency:

  • Fixed minor formatting issues (such as misplaced commas and bracket placement) in several l10n/*.json files to comply with stricter linting rules. [1] [2] [3] [4] [5] [6] [7]

This commit introduces a new GitHub Actions workflow for linting
localization JSON files. The workflow checks for valid JSON syntax
in the l10n directory during pull requests, ensuring that all
localization files are correctly formatted before merging.

The linting process runs on a dedicated job and provides a summary
status to indicate any issues found.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…d save message

Updated translation strings across multiple language files to ensure consistency
in the message prompting users to save their passwords for security reasons.
This change enhances the user experience by providing clear and accurate
instructions in various languages.

Should be done in 48cc7ad

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
@printminion-co printminion-co changed the title IONOS(ionos-mail): ci: add localization JSON linting workflow Fix localization JSON + linting workflow Feb 23, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automated linting for Nextcloud Mail localization (l10n) JSON files to prevent invalid translation files, and normalizes affected translations to comply with the new rules.

Changes:

  • Added a dedicated GitHub Actions workflow to lint l10n/*.json on pull requests (with path-based skipping).
  • Extended ESLint config + dependencies to parse and lint l10n JSON via eslint-plugin-jsonc.
  • Fixed trailing-comma/formatting issues in several l10n/*.json files and added npm scripts to run/fix the linter locally.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Adds lint:l10n scripts and the eslint-plugin-jsonc devDependency.
package-lock.json Locks eslint-plugin-jsonc and its transitive dependencies; aligns lockfile metadata with package.json.
.eslintrc.js Adds an ESLint override to parse/lint l10n/*.json using jsonc-eslint-parser.
.github/workflows/lint-l10n.yml New PR workflow to lint localization JSON only when relevant files change.
l10n/sv.json Removes invalid trailing comma at end of translations map.
l10n/nl.json Removes invalid trailing comma at end of translations map.
l10n/it.json Removes invalid trailing comma at end of translations map.
l10n/fr.json Removes invalid trailing comma at end of translations map.
l10n/es.json Fixes trailing comma + formatting around pluralForm boundary.
l10n/en_GB.json Adds missing comma to keep JSON valid when followed by more entries.
l10n/de_DE.json Removes invalid trailing comma at end of translations map.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +14 to +24
files: ['l10n/*.json'],
parser: 'jsonc-eslint-parser',
plugins: ['jsonc'],
rules: {
// Catch trailing commas (the class of bug that broke translations in commit 48cc7ad)
'jsonc/comma-dangle': ['error', 'never'],
// Disable JS-style rules inherited from @nextcloud that produce noise on auto-generated files
'comma-spacing': 'off',
'eol-last': 'off',
'no-irregular-whitespace': 'off',
},
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The override uses jsonc-eslint-parser, which will successfully parse JSONC features like comments. Without an explicit rule, a PR could introduce // or /* */ comments in l10n/*.json and npm run lint:l10n would still pass even though the files would no longer be valid JSON for runtime consumers. Consider adding a JSONC rule (e.g. jsonc/no-comments: 'error', and/or otherwise enforcing strict JSON) in this override so the linter blocks commented translation files.

Copilot uses AI. Check for mistakes.
Comment on lines +16 to +21
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read

Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes and summary jobs only run lightweight steps (paths-filter / a single shell check). Other workflows in this repo run these kinds of jobs on ubuntu-latest-low (e.g. .github/workflows/lint-eslint.yml) to reduce CI resource usage; consider switching runs-on for these jobs to ubuntu-latest-low as well.

Copilot uses AI. Check for mistakes.
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