mirror of
https://github.com/sismics/docs.git
synced 2024-11-25 15:17:57 +01:00
Closes #143: Select the default language for new documents from browser language
This commit is contained in:
parent
614c8a1d13
commit
cf9101d157
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user