From cf9101d157e3b806dbbcd8cbe66d75988f47289b Mon Sep 17 00:00:00 2001 From: Benjamin Gamard Date: Sun, 5 Nov 2017 22:28:23 +0100 Subject: [PATCH] Closes #143: Select the default language for new documents from browser language --- .../src/app/docs/controller/document/DocumentEdit.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentEdit.js b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentEdit.js index f10bdf75..a7ec2e48 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentEdit.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentEdit.js @@ -48,12 +48,21 @@ angular.module('docs').controller('DocumentEdit', function($rootScope, $scope, $ * Reset the form to add a new document. */ $scope.resetForm = function() { + var languages = { + en: 'eng', + fr: 'fra', + zh_CN: 'chi_sim' + }; + var language = languages[$translate.use()]; + $scope.document = { tags: [], relations: [], - language: 'fra' + language: language ? language : 'eng' }; + $scope.newFiles = []; + if ($scope.form) { $scope.form.$setPristine(); }