diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/LanguageController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/LanguageController.java index 0abc43925..11e46900c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/LanguageController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/LanguageController.java @@ -8,6 +8,7 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; @@ -27,11 +28,11 @@ public class LanguageController { public ResponseEntity getLanguage(@PathVariable String lang) throws IOException { String fileName = this.environment.getProperty("language.path") + lang + ".json"; - InputStream is = getClass().getClassLoader().getResource(fileName).openStream(); + InputStream is = new FileInputStream(fileName); HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders.setContentLength(is.available()); - responseHeaders.setContentType(MediaType.APPLICATION_OCTET_STREAM); + responseHeaders.setContentType(MediaType.APPLICATION_JSON); responseHeaders.set("Content-Disposition", "attachment;filename=" + fileName); responseHeaders.set("Access-Control-Expose-Headers", "Content-Disposition"); responseHeaders.get("Access-Control-Expose-Headers").add("Content-Type"); diff --git a/dmp-frontend/src/app/ui/navbar/navbar.component.html b/dmp-frontend/src/app/ui/navbar/navbar.component.html index e4c998706..76412ed28 100644 --- a/dmp-frontend/src/app/ui/navbar/navbar.component.html +++ b/dmp-frontend/src/app/ui/navbar/navbar.component.html @@ -42,7 +42,7 @@ diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.html b/dmp-frontend/src/app/ui/user-profile/user-profile.component.html index 057c922a6..71e4d086e 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.html +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.html @@ -91,7 +91,7 @@ - {{ language.label }} + {{ language.label | translate }} diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 5ff1929e7..a9c709c60 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -126,6 +126,11 @@ "XML": "XML", "JSON": "JSON", "DOC": "Document" + }, + "LANGUAGES": { + "ENGLISH": "English", + "GREEK": "Greek", + "SPANISH": "Spanish" } }, "COOKIE": { diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index 769819426..f8df10b16 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -126,6 +126,11 @@ "XML": "XML", "JSON": "JSON", "DOC": "Document" + }, + "LANGUAGES": { + "ENGLISH": "Inglés", + "GREEK": "Griego", + "SPANISH": "Espanol" } }, "COOKIE": { diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index eb902d685..8004fbc3d 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -5,6 +5,11 @@ }, "ACTIONS": { "LOG-IN": "Είσοδος" + }, + "LANGUAGES": { + "ENGLISH": "Αγγλικά", + "GREEK": "Ελληνικά", + "SPANISH": "Ισπανικά" } }, "USER-PROFILE": { diff --git a/dmp-frontend/src/assets/resources/language.json b/dmp-frontend/src/assets/resources/language.json index f174bcbb0..e337c2308 100644 --- a/dmp-frontend/src/assets/resources/language.json +++ b/dmp-frontend/src/assets/resources/language.json @@ -1,14 +1,14 @@ [ { - "label": "English", + "label": "GENERAL.LANGUAGES.ENGLISH", "value": "en" }, { - "label": "Greek", + "label": "GENERAL.LANGUAGES.GREEK", "value": "gr" }, { - "label": "Spanish", + "label": "GENERAL.LANGUAGES.SPANISH", "value": "es" } ]