From 6e82161334eaf6029dc8ed354ec37a1154edbb68 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sat, 15 Dec 2018 00:09:47 +0100 Subject: [PATCH] Finalizing the translation system. Needs some tests and a final translation generation. As well a handy translation mapper or editor would be likely. May source this out into another project? --- shared/css/modal-settings.scss | 147 +++++++++ shared/html/templates.html | 142 ++++++++- ...son => de_DE_google_translate.translation} | 6 +- shared/i18n/info.json | 8 +- shared/js/chat.ts | 3 + shared/js/i18n/localize.ts | 290 +++++++++++++++--- shared/js/main.ts | 25 +- shared/js/ui/modal/ModalSettings.ts | 175 ++++++++++- 8 files changed, 733 insertions(+), 63 deletions(-) rename shared/i18n/{test.json => de_DE_google_translate.translation} (99%) diff --git a/shared/css/modal-settings.scss b/shared/css/modal-settings.scss index f4b1df9b..8f5e1c8e 100644 --- a/shared/css/modal-settings.scss +++ b/shared/css/modal-settings.scss @@ -97,4 +97,151 @@ } } } +} + +.modal .settings-translations { + margin: 5px; + .setting-list { + user-select: none; + + display: flex; + flex-direction: column; + + .list { + display: flex; + flex-direction: column; + justify-content: start; + + overflow-y: auto; + + border: solid 1px lightgray; + padding: 2px; + background: #33333318; + + height: 50%; + min-height: 50%; + max-height: 50%; + + .entry { + display: flex; + flex-direction: row; + justify-content: stretch; + + .default { } + + .name { + flex-grow: 1; + flex-shrink: 1; + } + + &.translation:not(.default) { + padding-left: 15px; + } + + &.translation { + cursor: pointer; + } + + &.repository { + .name { + font-weight: bold; + } + } + + &.selected { + background: #0000FF77; + } + + + .button { + cursor: pointer; + + &:hover { + background-color: #00000010; + } + } + } + } + + .management { + width: 100%; + + display: flex; + flex-direction: row; + justify-content: stretch; + + margin-top: 5px; + float: right; + + .space { + flex-grow: 1; + } + } + + .restart-note { + width: 100%; + + display: flex; + flex-direction: row; + justify-content: space-between; + + margin-top: 5px; + + p { + margin: 0; + } + } + } +} + +/* The info modal for the translations */ +.entry-info-container { + display: flex; + flex-direction: column; + + .property { + display: flex; + flex-direction: row; + justify-content: stretch; + + .key { + width: 100px; + } + + .value { + display: flex; + flex-direction: row; + flex-grow: 1; + } + + &.property-repository { + p { + margin: 0; + } + + .button { + cursor: pointer; + + display: flex; + flex-direction: column; + justify-content: center; + + margin-right: 5px; + + &:hover { + background: #00000011; + } + } + } + + &.property-contributors { + .value { + display: flex; + flex-direction: column; + } + .contributor { + display: block; + } + } + } } \ No newline at end of file diff --git a/shared/html/templates.html b/shared/html/templates.html index 6a3cb57b..bbdc5fd2 100644 --- a/shared/html/templates.html +++ b/shared/html/templates.html @@ -13,16 +13,16 @@
-
+
-