gui: Use localised time in duration (#9552)

https://github.com/syncthing/syncthing/pull/8291 inpired me to develop
this. I tested it with all the languages Syncthing currently supports,
and they all work.

The only issue is that when you change the language in the GUI, you have
to either refresh the page, or wait a few seconds for the page to
refresh by itself, before the duration is translated into the new
language.

### Screenshots


![2024-05-20_21-47-58](https://github.com/syncthing/syncthing/assets/220772/7e3b371e-3495-4e3e-853a-b5a41215e6c7)

### Documentation

The documentation for the translation widget is at
https://github.com/EvanHahn/HumanizeDuration.js/blob/main/README.md
This commit is contained in:
Ross Smith II
2024-06-05 06:05:51 -04:00
committed by GitHub
parent 5a304cf295
commit 23a900e096
5 changed files with 861 additions and 2 deletions
+1
View File
@@ -1050,6 +1050,7 @@
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="vendor/daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="vendor/fancytree/jquery.fancytree-all-deps.js"></script>
<script type="text/javascript" src="vendor/HumanizeDuration.js/humanize-duration.js"></script>
<!-- / vendor scripts -->
<!-- gui application code -->