browsertrix/frontend
Emma Segal-Grossman 683e531cc0
Localize durations on frontend (#2196)
Partially addresses
https://github.com/webrecorder/browsertrix/issues/2171

- [x] Reimplement `pretty-ms`'s rounding logic to convert to a
`Intl.DurationFormat`-compatible object
- [x] Add `localize.duration` and `localize.humanizeDuration` methods
- [x] Replace `pretty-ms` usage with localized formatting
- [x] Add `Intl.DurationFormat` polyfill
- [x] Update localize tests
- [x] Fix broken tests (thank you @SuaYoo!)
- This looks to be possibly a bug somewhere in the web test runner's
code? Have yet to figure this one out
- Might be related to these:
https://github.com/web-dev-server/web-dev-server/issues/1
https://github.com/guybedford/es-module-lexer/issues/82 — both closed
with no comments or resolution 🙃 — `es-module-lexer` seems to be most
likely, given it's a native module & might be handling unicode sequences
incorrectly or not at all?
- [x] Clean up messy `index.d.ts` — probably split this out? The
definitions haven't yet made their way into `esnext`
https://github.com/microsoft/TypeScript/issues/60608

---------

Co-authored-by: emma-sg <emma-sg@users.noreply.github.com>
Co-authored-by: sua yoo <sua@suayoo.com>
2024-12-03 16:46:57 -05:00
..
.husky chore: Auto-commit extracted localization strings (#2089) 2024-09-30 10:48:13 -07:00
config/tailwind/plugins Add detailed permissions & permission summaries to user invite popup (#2003) 2024-08-20 20:34:29 -04:00
docs Docs: Add API Reference as top-level nav (#2180) 2024-11-27 17:00:54 -08:00
lib Localize durations on frontend (#2196) 2024-12-03 16:46:57 -05:00
patches
scripts [Chore] Webpack: Migrate from onBeforeSetupMiddleware to setupMiddlewares (#2080) 2024-10-02 19:35:32 -07:00
src Localize durations on frontend (#2196) 2024-12-03 16:46:57 -05:00
tests fix: Hide login link on login page (#2039) 2024-08-21 15:33:24 -07:00
xliff Localize durations on frontend (#2196) 2024-12-03 16:46:57 -05:00
.dockerignore
.editorconfig
.eslintrc.js Frontend hosted-docs (#2107) 2024-10-08 14:56:34 -07:00
.gitignore
.prettierignore Frontend hosted-docs (#2107) 2024-10-08 14:56:34 -07:00
.vscode
.yarnrc refactor: Implement brand colors (#2141) 2024-11-12 08:54:11 -08:00
00-browsertrix-nginx-init.sh
Dockerfile Localize durations on frontend (#2196) 2024-12-03 16:46:57 -05:00
frontend.conf.template Frontend hosted-docs (#2107) 2024-10-08 14:56:34 -07:00
index.d.ts
lit-localize.json feat: Localization workflow improvements (#2069) 2024-09-10 14:15:26 -07:00
minio.conf
package.json Localize durations on frontend (#2196) 2024-12-03 16:46:57 -05:00
playwright.config.ts Localize durations on frontend (#2196) 2024-12-03 16:46:57 -05:00
postcss.config.js Add detailed permissions & permission summaries to user invite popup (#2003) 2024-08-20 20:34:29 -04:00
prettier.config.js chore: Format XLIFF files (#2074) 2024-09-11 10:46:39 -07:00
README.md
sample.env.local feat: Merge workflow job types (#2068) 2024-09-25 10:37:18 -04:00
tailwind.config.js refactor: Implement brand colors (#2141) 2024-11-12 08:54:11 -08:00
tsconfig.eslint.json
tsconfig.json chore: Improve time to load org UI (#2044) 2024-08-26 10:45:10 -07:00
web-test-runner.config.mjs Localize durations on frontend (#2196) 2024-12-03 16:46:57 -05:00
webpack.config.js Localize durations on frontend (#2196) 2024-12-03 16:46:57 -05:00
webpack.dev.js [Chore] Webpack: Migrate from onBeforeSetupMiddleware to setupMiddlewares (#2080) 2024-10-02 19:35:32 -07:00
webpack.prod.js
yarn.lock Localize durations on frontend (#2196) 2024-12-03 16:46:57 -05:00