diff --git a/gui/admin.html b/gui/admin.html index 3c95f31..308ef65 100644 --- a/gui/admin.html +++ b/gui/admin.html @@ -56,6 +56,9 @@
+ +
+
@@ -77,15 +80,16 @@ + - + diff --git a/gui/assets/css/main.css b/gui/assets/css/main.css index cd9cdab..56e058d 100644 --- a/gui/assets/css/main.css +++ b/gui/assets/css/main.css @@ -198,4 +198,19 @@ input:focus { background-color: #0e181e; } +.language-list-title-container { + text-align:center; + background: rgba(0,0,0,0.02); + border-top: 1px solid #e6e6e6; + padding: 10px 24px; + vertical-align:bottom; +} + +.droplist_language_selector { + font-family:CoreSansNR35Light; + font-size:14px; + border:0; + outline:none; +} + /* EOF */ diff --git a/gui/index.html b/gui/index.html index d2316be..b948db1 100644 --- a/gui/index.html +++ b/gui/index.html @@ -60,6 +60,10 @@
+ +
+ +
@@ -81,6 +85,7 @@ + @@ -89,6 +94,7 @@ + diff --git a/gui/source/admin_view.js b/gui/source/admin_view.js index 25db3c7..27184e4 100644 --- a/gui/source/admin_view.js +++ b/gui/source/admin_view.js @@ -18,6 +18,8 @@ var mainApp = new Vue({ displayingDialogue: '', status : 'listview', alreadyVisited: [], + //reference to the language file + guiMessages, } }, diff --git a/gui/source/components/all_dialogues_components.js b/gui/source/components/all_dialogues_components.js index d462695..d118e83 100644 --- a/gui/source/components/all_dialogues_components.js +++ b/gui/source/components/all_dialogues_components.js @@ -15,7 +15,9 @@ Vue.component("all-dialogues", { allDialogueMetadata: [], dragging: false, showModal: false, - userName : '' + userName : '', + // Reference to the language item + guiMessages } }, // computed : { @@ -237,7 +239,7 @@ Vue.component("all-dialogues", {

- {{ allDialogueMetadata.length }} Data Items, {{ alreadyVisited.length }} Visited + {{ allDialogueMetadata.length }} {{ guiMessages.selected.admin.dataItems }}, {{ alreadyVisited.length }} {{ guiMessages.selected.admin.visited }}

@@ -258,8 +260,8 @@ Vue.component("all-dialogues", {

- - + +
@@ -279,7 +281,7 @@ Vue.component("all-dialogues", {
- Delete + {{ guiMessages.selected.lida.button_delete }}
@@ -290,10 +292,10 @@ Vue.component("all-dialogues", {
- Visited + {{ guiMessages.selected.admin.visited }}
-
{{dat.num_turns}} Turns
+
{{dat.num_turns}} {{ guiMessages.selected.lida.turns }}
@@ -303,7 +305,7 @@ Vue.component("all-dialogues", { diff --git a/gui/source/components/annotation_app_components.js b/gui/source/components/annotation_app_components.js index dfabd83..e229b59 100644 --- a/gui/source/components/annotation_app_components.js +++ b/gui/source/components/annotation_app_components.js @@ -260,6 +260,7 @@ Vue.component('dialogue-menu',{ data () { return { editingTitle: false, + guiMessages, } }, @@ -297,7 +298,7 @@ Vue.component('dialogue-menu',{ template: `
- +
@@ -316,8 +317,8 @@ Vue.component('dialogue-menu',{
- All Changes Saved - Unsaved Changes + {{guiMessages.selected.annotation_app.allSaved}} + {{guiMessages.selected.annotation_app.unsaved}}
` @@ -360,7 +361,11 @@ Vue.component('dialogue-turn',{ // primaryElementClass is the class used to select the correct input field // to correctly set the focus when turns are changed with arrow keys or enter props : ["turn","currentId","myId", "primaryElementClass"], - + data: function (){ + return { + guiMessages + } + }, methods :{ turn_updated_string : function(event){ annotationAppEventBus.$emit("turn_updated_string", event ) @@ -404,10 +409,10 @@ Vue.component('dialogue-turn',{
- Turn Id: {{myId}} + {{guiMessages.selected.annotation_app.turnId}}: {{myId}}
- +
@@ -424,7 +429,7 @@ Vue.component('dialogue-turn',{
- Turn Id: {{myId}} + {{guiMessages.selected.annotation_app.turnId}}: {{myId}}
@@ -497,7 +502,8 @@ Vue.component('input-box',{ props : ["message"], data: function (){ return { - input : this.message + input : this.message, + guiMessages } }, methods:{ @@ -518,10 +524,10 @@ Vue.component('input-box',{ `
    -
  • +
  • -
  • -
  • +
  • +
diff --git a/gui/source/components/language_components.js b/gui/source/components/language_components.js new file mode 100644 index 0000000..ebcbe48 --- /dev/null +++ b/gui/source/components/language_components.js @@ -0,0 +1,51 @@ +/************************************ +* Language Options +*************************************/ + +guiMessages.selected = guiMessages.en; + +var languageSection = new Vue({ + el:"#language-selector", + + data:{ + gui_languages: [ + { name:"English", code:"en" }, + { name:"Italian", code:"it"} + ], + currentLanguage: "en", + guiMessages, + }, + + mounted() { + this.detectLanguage(); + }, + + methods: { + + detectLanguage() { + var browserLanguage = navigator.language.substr(0,2); + if (guiMessages[browserLanguage] == undefined) + guiMessages.selected = guiMessages.en; + else + guiMessages.selected = guiMessages[browserLanguage]; + this.currentLanguage = browserLanguage; + }, + + updateGui(event) { + console.log('---- CHANGING GUI LANGUAGE ----'); + guiMessages.selected = guiMessages[this.currentLanguage]; + } + }, + + template: + + ` +
+ + +
+ + ` +}) \ No newline at end of file diff --git a/gui/source/components/main_admin_components.js b/gui/source/components/main_admin_components.js index 5c64624..90e7578 100644 --- a/gui/source/components/main_admin_components.js +++ b/gui/source/components/main_admin_components.js @@ -2,12 +2,10 @@ * All Dialgoues View "aka MAIN LIDA VIEW" *************************************/ - - Vue.component("main-admin", { props: [ - "alreadyVisited" + "alreadyVisited", ], data () { @@ -26,7 +24,10 @@ Vue.component("main-admin", { showAgreement: false, // A list of dialogue IDs for which annotator names should be displayed - showAnnotatorNamesForIds: [] + showAnnotatorNamesForIds: [], + + //Reference to the language data + guiMessages, } }, @@ -157,10 +158,9 @@ Vue.component("main-admin", { document.body.appendChild(link) link.click(); }); - } + }, }, - template: `

- {{ allDialogueMetadata.length }} Data Items, {{ alreadyVisited.length }} Visited: + {{ allDialogueMetadata.length }} {{ guiMessages.selected.admin.dataItems }}, {{ alreadyVisited.length }} {{ guiMessages.selected.admin.visited }}

@@ -181,8 +181,8 @@ Vue.component("main-admin", {

- - + +
@@ -208,19 +208,19 @@ Vue.component("main-admin", {
- Visited + {{ guiMessages.selected.admin.visited }}
- Annotators: {{ dat[1] }} + {{ guiMessages.selected.admin.annotators }}: {{ dat[1] }}
- Annotators: {{ dat[1].length }} + {{ guiMessages.selected.admin.annotators }}: {{ dat[1].length }}
@@ -240,7 +240,7 @@ Vue.component("main-admin", {
diff --git a/gui/source/components/modal_components.js b/gui/source/components/modal_components.js index d6213c0..ea2ff7b 100644 --- a/gui/source/components/modal_components.js +++ b/gui/source/components/modal_components.js @@ -2,6 +2,11 @@ * MODAL COMPONENT *************************************/ Vue.component('modal', { + data() { + return { + guiMessages + } + }, template: ` @@ -11,7 +16,7 @@ Vue.component('modal', { @@ -19,39 +24,15 @@ Vue.component('modal', {