mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 14:07:55 +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.
|
* Reset the form to add a new document.
|
||||||
*/
|
*/
|
||||||
$scope.resetForm = function() {
|
$scope.resetForm = function() {
|
||||||
|
var languages = {
|
||||||
|
en: 'eng',
|
||||||
|
fr: 'fra',
|
||||||
|
zh_CN: 'chi_sim'
|
||||||
|
};
|
||||||
|
var language = languages[$translate.use()];
|
||||||
|
|
||||||
$scope.document = {
|
$scope.document = {
|
||||||
tags: [],
|
tags: [],
|
||||||
relations: [],
|
relations: [],
|
||||||
language: 'fra'
|
language: language ? language : 'eng'
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.newFiles = [];
|
$scope.newFiles = [];
|
||||||
|
|
||||||
if ($scope.form) {
|
if ($scope.form) {
|
||||||
$scope.form.$setPristine();
|
$scope.form.$setPristine();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user