• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

agama-project / agama / 12072405397
68%

Build:
DEFAULT BRANCH: master
Ran 28 Nov 2024 04:23PM UTC
Jobs 2
Files 638
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Nov 2024 04:13PM UTC coverage: 71.049% (+0.08%) from 70.97%
12072405397

push

github

web-flow
Refactoring the web translations (#1777)

## Problem

- The web translations still use the original Cockpit mechanism for
creating and loading the translations
- That uses a server based logic which has quite some drawbacks
- We have to reimplement the very same logic in a Webpack plugin to make
it work also in the local development server (`npm run server`). And
unfortunately we cannot share the code because it is Rust vs.
Javascript...
- This will not work in the Agama online demo site with completely
static files (without any server side logic, everything needs to be on
the client side).
- For me the original logic was quite strange, why the server should
decide which translations should the client use? It should be completely
handled on the client side, there is no reason for the special server
logic. The server should just report the available translations and let
the client to pick and use the right one.
- The old implementation has also some ugly parts like requiring a
global Javascript variable...

## Solution

- Move the translation logic from the server to the client (browser)
- Use dynamic imports instead of HTTP redirection

## Implementation details

- Removed the `po.js` handler from the Agama HTTP server
- Removed the `po.js` handler from the Webpack development server
- Removed the original Gettext PO files from Git, replaced by already
converted JS files
- Removed the Cockpit Webpack plugin for converting PO files to JS,
replaced by a simple script with similar functionality. (As a bonus the
code was fixed to avoid adding unnecessary `null` values into the
output.)
- Added dynamic import for downloading the requested translations
- Some code cleanup (removing the global JS object)
- Moved the `jed` and `gettext-parser` NPM dependencies to the PO->JS
converter, that means those NPM packages are installed only when
converting the PO files to JS (basically only in the GitHub action which
merges the... (continued)

16936 of 23837 relevant lines covered (71.05%)

36.02 hits per line

Subprojects
ID Flag name Job ID Ran Files Coverage
2 rust 12072405397.2 28 Nov 2024 04:23PM UTC 124
24.59
GitHub Action Run
2 service 12013658788.2 25 Nov 2024 03:48PM UTC 514
89.28
GitHub Action Run
Source Files on build 12072405397
  • Tree
  • List 638
  • Changed 31
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #12072405397
  • f83484bd on github
  • Prev Build on master (#12072099358)
  • Next Build on master (#12082384586)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc