14 Commits

Author SHA1 Message Date
Nils Maier
dabf7f8a28 Prerolling and mime detection for some downloads
Only attempt this for a limited subset of downloads for now.
Related #45
2019-09-04 14:15:05 +02:00
Nils Maier
4d48a2c395 Implement locale switcher 2019-09-03 08:24:29 +02:00
Nils Maier
3cf30aaf08 Use _ version of language codes
Closes #50
2019-09-03 08:24:29 +02:00
Nils Maier
164aa99eca Initial Chrome support
Part of #35
2019-09-02 18:05:06 +02:00
Nils Maier
7a71ae5f37 Also split ui locales by _ 2019-09-02 00:24:11 +02:00
Nils Maier
a425a786ef Do not log "custom" 2019-08-29 08:14:22 +02:00
Nils Maier
fe61f6176c Load custom translations
Part of #14
2019-08-27 03:02:17 +02:00
Nils Maier
976c57c043 i18n: rely less on exceptions 2019-08-26 02:57:06 +02:00
Nils Maier
8235af22db Implement own locale loader
Why?
* Because i18n sucks multi-browser, especially on Chrome.
* What's more, this will allow overlaying "incomplete" locales with
  missing strings over the base locale and get a semi-translated one,
  which probably is better than nothing.
* Additionally we kinda need that implementation anyway for node-based
  tests.
* Also, while not currently implemented, it could allow (hot) reloading
  of locales, or loading external ones, which would help translators,
  or providing an option to the user to choose a locale.
* And finally, not calling i18n will avoid the "context switch" into
  browserland.

Some implementation details:
* Before code can use a locale, it has to be loaded. Sadly sync loading
  is not really supported. So `await locale` or `await localize`.
* Background force reloads locales right now, and caches them in
  localStorage. Windows will look into localStorage for that cache.
* The locale loader will not verify locales other than some rudimentary
  checks. It is assumed that shipped locales where verified before
  check-in.
2019-08-26 02:37:27 +02:00
Nils Maier
a89acad0c9 Proper types for localize and $ 2019-08-25 22:30:07 +02:00
Nils Maier
112d37deb0 Reduce load size of popup 2019-08-25 14:27:54 +02:00
Nils Maier
34ea21b3ea memoize getMessage correctly 2019-08-24 02:52:23 +02:00
Nils Maier
1513f0b022 Fix some typescript issues 2019-08-21 00:16:07 +02:00
Nils Maier
c1e0d7f531 Initial squashed commit 2019-08-20 16:41:37 +02:00