Compare commits

...

4 Commits

Author SHA1 Message Date
gamonoid
86c572bdd1 Fix code style issues 2018-03-18 06:46:00 +01:00
gamonoid
a0db9da5f4 Fix unit tests 2018-03-18 06:46:00 +01:00
gamonoid
afc069afaa Translation updates and UI improvements 2018-03-18 06:46:00 +01:00
Patrick Geselbracht
a0d77cb944 Updates German translations (#97)
* Update of German translations up until line 1210

* Translates the rest of the German po file

* Changes last translator line at beginning of file

* Fixes two strings that sounded weird in context
2018-03-18 06:46:00 +01:00
39 changed files with 11668 additions and 14715 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -22,263 +22,259 @@ Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilin
ValidationRules = { ValidationRules = {
float: function (str) { float: function (str) {
var floatstr = /^[-+]?[0-9]+(\.[0-9]+)?$/; var floatstr = /^[-+]?[0-9]+(\.[0-9]+)?$/;
if (str != null && str.match(floatstr)) { if (str != null && str.match(floatstr)) {
return true; return true;
} else { } else {
return false; return false;
} }
}, },
number: function (str) { number: function (str) {
var numstr = /^[0-9]+$/; var numstr = /^[0-9]+$/;
if (str != null && str.match(numstr)) { if (str != null && str.match(numstr)) {
return true; return true;
} else { } else {
return false; return false;
} }
}, },
numberOrEmpty: function (str) { numberOrEmpty: function (str) {
if(str == ""){ if(str == ""){
return true; return true;
} }
var numstr = /^[0-9]+$/; var numstr = /^[0-9]+$/;
if (str != null && str.match(numstr)) { if (str != null && str.match(numstr)) {
return true; return true;
} else { } else {
return false; return false;
} }
}, },
email: function (str) { email: function (str) {
var emailPattern = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/; var emailPattern = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;
return str != null && emailPattern.test(str); return str != null && emailPattern.test(str);
}, },
emailOrEmpty: function (str) { emailOrEmpty: function (str) {
if(str == ""){ if(str == ""){
return true; return true;
} }
var emailPattern = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/; var emailPattern = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;
return str != null && emailPattern.test(str); return str != null && emailPattern.test(str);
}, },
username: function (str) { username: function (str) {
var username = /^[a-zA-Z0-9\.-]+$/; var username = /^[a-zA-Z0-9\.-]+$/;
return str != null && username.test(str); return str != null && username.test(str);
}, },
input: function (str) { input: function (str) {
if (str != null && str.length > 0) { if (str != null && str.length > 0) {
return true; return true;
} else { } else {
return false; return false;
} }
} }
}; };
function FormValidation(formId,validateAll,options) { function FormValidation(formId,validateAll,options) {
this.tempOptions = {}; this.tempOptions = {};
this.formId = formId; this.formId = formId;
this.formError = false; this.formError = false;
this.formObject = null; this.formObject = null;
this.errorMessages = ""; this.errorMessages = "";
this.popupDialog = null; this.popupDialog = null;
this.validateAll = validateAll; this.validateAll = validateAll;
this.errorMap = new Array(); this.errorMap = new Array();
this.settings = {"thirdPartyPopup":null,"LabelErrorClass":false, "ShowPopup":true}; this.settings = {"thirdPartyPopup":null,"LabelErrorClass":false, "ShowPopup":true};
this.settings = jQuery.extend(this.settings,options); this.settings = jQuery.extend(this.settings,options);
this.inputTypes = new Array( "text", "radio", "checkbox", "file", "password", "select-one","select-multi", "textarea","fileupload" ,"signature"); this.inputTypes = new Array( "text", "radio", "checkbox", "file", "password", "select-one","select-multi", "textarea","fileupload" ,"signature");
this.validator = ValidationRules; this.validator = ValidationRules;
} }
FormValidation.method('clearError' , function(formInput, overrideMessage) { FormValidation.method('clearError' , function(formInput, overrideMessage) {
var id = formInput.attr("id"); var id = formInput.attr("id");
$('#'+ this.formId +' #field_'+id).removeClass('error'); $('#'+ this.formId +' #field_'+id).removeClass('error');
$('#'+ this.formId +' #help_'+id).html(''); $('#'+ this.formId +' #help_'+id).html('');
}); });
FormValidation.method('addError' , function(formInput, overrideMessage) { FormValidation.method('addError' , function(formInput, overrideMessage) {
this.formError = true; this.formError = true;
if(formInput.attr("message") != null) { if(formInput.attr("message") != null) {
this.errorMessages += (formInput.attr("message") + "\n"); this.errorMessages += (formInput.attr("message") + "\n");
this.errorMap[formInput.attr("name")] = formInput.attr("message"); this.errorMap[formInput.attr("name")] = formInput.attr("message");
}else{ }else{
this.errorMap[formInput.attr("name")] = ""; this.errorMap[formInput.attr("name")] = "";
} }
var id = formInput.attr("id"); var id = formInput.attr("id");
var validation = formInput.attr("validation"); var validation = formInput.attr("validation");
var message = formInput.attr("validation"); var message = formInput.attr("validation");
$('#'+ this.formId +' #field_'+id).addClass('error'); $('#'+ this.formId +' #field_'+id).addClass('error');
if(message == undefined || message == null || message == ""){ if(message == undefined || message == null || message == ""){
$('#'+ this.formId +' #help_'+id).html(message); $('#'+ this.formId +' #help_err_'+id).html(message);
}else{ }else{
if(validation == undefined || validation == null || validation == ""){ if(validation == undefined || validation == null || validation == ""){
$('#'+ this.formId +' #help_'+id).html("Required"); $('#'+ this.formId +' #help_err_'+id).html("Required");
}else{ }else{
if(validation == "float" || validation == "number"){ if(validation == "float" || validation == "number"){
$('#'+ this.formId +' #help_'+id).html("Number required"); $('#'+ this.formId +' #help_err_'+id).html("Number required");
}else if(validation == "email"){ }else if(validation == "email"){
$('#'+ this.formId +' #help_'+id).html("Email required"); $('#'+ this.formId +' #help_err_'+id).html("Email required");
}else{ }else{
$('#'+ this.formId +' #help_'+id).html("Required"); $('#'+ this.formId +' #help_err_'+id).html("Required");
} }
} }
} }
}); });
FormValidation.method('showErrors' , function() { FormValidation.method('showErrors' , function() {
if(this.formError) { if(this.formError) {
if(this.settings['thirdPartyPopup'] != undefined && this.settings['thirdPartyPopup'] != null){ if(this.settings['thirdPartyPopup'] != undefined && this.settings['thirdPartyPopup'] != null){
this.settings['thirdPartyPopup'].alert(); this.settings['thirdPartyPopup'].alert();
}else{ }else{
if(this.settings['ShowPopup'] == true){ if(this.settings['ShowPopup'] == true){
if(this.tempOptions['popupTop'] != undefined && this.tempOptions['popupTop'] != null){ if(this.tempOptions['popupTop'] != undefined && this.tempOptions['popupTop'] != null){
this.alert("Errors Found",this.errorMessages,this.tempOptions['popupTop']); this.alert("Errors Found",this.errorMessages,this.tempOptions['popupTop']);
}else{ }else{
this.alert("Errors Found",this.errorMessages,-1); this.alert("Errors Found",this.errorMessages,-1);
} }
} }
} }
} }
}); });
FormValidation.method('checkValues' , function(options) { FormValidation.method('checkValues' , function(options) {
this.tempOptions = options; this.tempOptions = options;
var that = this; var that = this;
this.formError = false; this.formError = false;
this.errorMessages = ""; this.errorMessages = "";
this.formObject = new Object(); this.formObject = new Object();
var validate = function (inputObject) { var validate = function (inputObject) {
if(that.settings['LabelErrorClass'] != false){ if(that.settings['LabelErrorClass'] != false){
$("label[for='" + name + "']").removeClass(that.settings['LabelErrorClass']); $("label[for='" + name + "']").removeClass(that.settings['LabelErrorClass']);
} }
var id = inputObject.attr("id"); var id = inputObject.attr("id");
var name = inputObject.attr("name"); var name = inputObject.attr("name");
var type = inputObject.attr("type"); var type = inputObject.attr("type");
if(inputObject.hasClass('select2-focusser') || inputObject.hasClass('select2-input')){ if(inputObject.hasClass('select2-focusser') || inputObject.hasClass('select2-input')){
return true; return true;
} }
if(jQuery.inArray(type, that.inputTypes ) >= 0) { if(jQuery.inArray(type, that.inputTypes ) >= 0) {
if(inputObject.hasClass('uploadInput')){ if(inputObject.hasClass('uploadInput')){
inputValue = inputObject.attr("val"); inputValue = inputObject.attr("val");
//}else if(inputObject.hasClass('datetimeInput')){ //}else if(inputObject.hasClass('datetimeInput')){
//inputValue = inputObject.getDate()+":00"; //inputValue = inputObject.getDate()+":00";
}else{ }else{
//inputValue = (type == "radio" || type == "checkbox")?$("input[name='" + name + "']:checked").val():inputObject.val(); //inputValue = (type == "radio" || type == "checkbox")?$("input[name='" + name + "']:checked").val():inputObject.val();
inputValue = null; inputValue = null;
if(type == "radio" || type == "checkbox"){ if(type == "radio" || type == "checkbox"){
inputValue = $("input[name='" + name + "']:checked").val(); inputValue = $("input[name='" + name + "']:checked").val();
}else if(inputObject.hasClass('select2Field')){ }else if(inputObject.hasClass('select2Field')){
if($('#'+id).select2('data') != null && $('#'+id).select2('data') != undefined){ if($('#'+id).select2('data') != null && $('#'+id).select2('data') != undefined){
inputValue = $('#'+id).select2('data').id; inputValue = $('#'+id).select2('data').id;
}else{ }else{
inputValue = ""; inputValue = "";
} }
}else if(inputObject.hasClass('select2Multi')){ }else if(inputObject.hasClass('select2Multi')){
if($('#'+id).select2('data') != null && $('#'+id).select2('data') != undefined){ if($('#'+id).select2('data') != null && $('#'+id).select2('data') != undefined){
inputValueObjects = $('#'+id).select2('data'); inputValueObjects = $('#'+id).select2('data');
inputValue = []; inputValue = [];
for(var i=0;i<inputValueObjects.length;i++){ for(var i=0;i<inputValueObjects.length;i++){
inputValue.push(inputValueObjects[i].id); inputValue.push(inputValueObjects[i].id);
} }
inputValue = JSON.stringify(inputValue); inputValue = JSON.stringify(inputValue);
}else{ }else{
inputValue = ""; inputValue = "";
} }
}else if(inputObject.hasClass('signatureField')){ }else if(inputObject.hasClass('signatureField')){
if($('#'+id).data('signaturePad').isEmpty()){ if($('#'+id).data('signaturePad').isEmpty()){
inputValue = ''; inputValue = '';
}else{ }else{
inputValue = $('#'+id).data('signaturePad').toDataURL(); inputValue = $('#'+id).data('signaturePad').toDataURL();
} }
}else if(inputObject.hasClass('simplemde')){ }else if(inputObject.hasClass('simplemde')){
inputValue = $('#'+id).data('simplemde').value(); inputValue = $('#'+id).data('simplemde').value();
}else if(inputObject.hasClass('tinymce')){ }else if(inputObject.hasClass('tinymce')){
inputValue = tinyMCE.get(id).getContent({format : 'raw'}); inputValue = tinyMCE.get(id).getContent({format : 'raw'});
}else{ }else{
inputValue = inputObject.val(); inputValue = inputObject.val();
} }
} }
var validation = inputObject.attr('validation'); var validation = inputObject.attr('validation');
var valid = false; var valid = false;
if(validation != undefined && validation != null && that.validator[validation] != undefined && that.validator[validation] != null){ if(validation != undefined && validation != null && that.validator[validation] != undefined && that.validator[validation] != null){
valid = that.validator[validation](inputValue); valid = that.validator[validation](inputValue);
}else{ }else{
if(that.validateAll){ if(that.validateAll){
if(validation != undefined && validation != null && validation == "none"){ if(validation != undefined && validation != null && validation == "none"){
valid = true; valid = true;
}else{ }else{
valid = that.validator['input'](inputValue); valid = that.validator['input'](inputValue);
} }
}else{ }else{
valid = true; valid = true;
} }
$(that.formObject).attr(id,inputValue); $(that.formObject).attr(id,inputValue);
} }
if(!valid) { if(!valid) {
that.addError(inputObject, null); that.addError(inputObject, null);
}else{ }else{
that.clearError(inputObject, null); that.clearError(inputObject, null);
$(that.formObject).attr(id,inputValue); $(that.formObject).attr(id,inputValue);
} }
} }
}; };
var inputs = $('#'+ this.formId + " :input"); var inputs = $('#'+ this.formId + " :input");
inputs.each(function() { inputs.each(function() {
var that = $(this); var that = $(this);
validate(that); validate(that);
}); });
inputs = $('#'+ this.formId + " .uploadInput"); inputs = $('#'+ this.formId + " .uploadInput");
inputs.each(function() { inputs.each(function() {
var that = $(this); var that = $(this);
validate(that); validate(that);
}); });
this.showErrors(); this.showErrors();
this.tempOptions = {}; this.tempOptions = {};
return !this.formError; return !this.formError;
}); });
FormValidation.method('getFormParameters' , function() { FormValidation.method('getFormParameters' , function() {
return this.formObject; return this.formObject;
}); });
FormValidation.method('alert', function (title,text,top) { FormValidation.method('alert', function (title,text,top) {
alert(text); alert(text);
}); });

View File

@@ -715,3 +715,22 @@ table.dataTable{
.small-box{ .small-box{
box-shadow: 0 2px 5px 0 rgba(0,0,0,.12), 0 2px 10px 0 rgba(0,0,0,.09); box-shadow: 0 2px 5px 0 rgba(0,0,0,.12), 0 2px 10px 0 rgba(0,0,0,.09);
} }
.help-info{
font-size: 25px;
color: #367fa9;
padding-top: 4px;
cursor: pointer;
}
.hide {
display: none;
}
.ice-form-error {
font-size: 1em;
}
.ice-form-error-control {
padding-bottom: 1rem;
}

View File

@@ -1,10 +0,0 @@
msgid ""
msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: English\n"
"Language-Team: IceHrm\n"
"Last-Translator: Thilina Hasantha\n"
"MIME-Version: 1.0\n"
"Project-Id-Version: 18.0\n"
"Report-Msgid-Bugs-To: https://icehrm.com\n"

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +0,0 @@
msgid ""
msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: English\n"
"Language-Team: IceHrm\n"
"Last-Translator: Thilina Hasantha\n"
"MIME-Version: 1.0\n"
"Project-Id-Version: 18.0\n"
"Report-Msgid-Bugs-To: https://icehrm.com\n"

View File

@@ -1,13 +1,15 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: English\n"
"Language-Team: IceHrm\n"
"Last-Translator: Thilina Hasantha\n"
"MIME-Version: 1.0\n"
"Project-Id-Version: 18.0\n" "Project-Id-Version: 18.0\n"
"Report-Msgid-Bugs-To: https://icehrm.com\n" "Report-Msgid-Bugs-To: https://icehrm.com\n"
"Last-Translator: Thilina Hasantha\n"
"Language-Team: IceHrm\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2018-03-05T05:26:33+05:30\n"
"PO-Revision-Date: 2018-03-05T05:26:33+05:30\n"
"Language: English\n"
msgid "Save" msgid "Save"
msgstr "Save" msgstr "Save"
@@ -1566,9 +1568,6 @@ msgstr "Loans Taken"
msgid "Change Leave Status" msgid "Change Leave Status"
msgstr "Change Leave Status" msgstr "Change Leave Status"
msgid "Leave Status"
msgstr "Leave Status"
msgid "Status Change Note" msgid "Status Change Note"
msgstr "Status Change Note" msgstr "Status Change Note"
@@ -1598,5 +1597,3 @@ msgstr "Apply"
msgid "Back" msgid "Back"
msgstr "Back" msgstr "Back"

View File

@@ -1,13 +1,15 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: Spanish\n"
"Language-Team: IceHrm\n"
"Last-Translator: Thilina Hasantha\n"
"MIME-Version: 1.0\n"
"Project-Id-Version: 18.0\n" "Project-Id-Version: 18.0\n"
"Report-Msgid-Bugs-To: https://icehrm.com\n" "Report-Msgid-Bugs-To: https://icehrm.com\n"
"Last-Translator: Thilina Hasantha\n"
"Language-Team: IceHrm\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2018-03-05T05:26:33+05:30\n"
"PO-Revision-Date: 2018-03-05T05:26:33+05:30\n"
"Language: Spanish\n"
msgid "Save" msgid "Save"
msgstr "Salvar" msgstr "Salvar"
@@ -1566,9 +1568,6 @@ msgstr "Los préstamos contraídos"
msgid "Change Leave Status" msgid "Change Leave Status"
msgstr "Dejar cambiar de estado" msgstr "Dejar cambiar de estado"
msgid "Leave Status"
msgstr "Deja Estado"
msgid "Status Change Note" msgid "Status Change Note"
msgstr "Cambio de Estado Nota" msgstr "Cambio de Estado Nota"
@@ -1598,4 +1597,3 @@ msgstr "Aplicar"
msgid "Back" msgid "Back"
msgstr "Espalda" msgstr "Espalda"

View File

@@ -1,13 +1,15 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: French\n"
"Language-Team: IceHrm\n"
"Last-Translator: Thilina Hasantha\n"
"MIME-Version: 1.0\n"
"Project-Id-Version: 18.0\n" "Project-Id-Version: 18.0\n"
"Report-Msgid-Bugs-To: https://icehrm.com\n" "Report-Msgid-Bugs-To: https://icehrm.com\n"
"Last-Translator: Thilina Hasantha\n"
"Language-Team: IceHrm\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2018-03-05T05:26:33+05:30\n"
"PO-Revision-Date: 2018-03-05T05:26:33+05:30\n"
"Language: French\n"
msgid "Save" msgid "Save"
msgstr "Sauvegarder" msgstr "Sauvegarder"
@@ -1566,9 +1568,6 @@ msgstr "Prêts Pris"
msgid "Change Leave Status" msgid "Change Leave Status"
msgstr "Changer congé Status" msgstr "Changer congé Status"
msgid "Leave Status"
msgstr "Laissez Status"
msgid "Status Change Note" msgid "Status Change Note"
msgstr "Changement d'état Remarque" msgstr "Changement d'état Remarque"
@@ -1598,4 +1597,3 @@ msgstr "Appliquer"
msgid "Back" msgid "Back"
msgstr "Arrière" msgstr "Arrière"

1601
lang/hi.po

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,15 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: Italian\n"
"Language-Team: IceHrm\n"
"Last-Translator: Thilina Hasantha\n"
"MIME-Version: 1.0\n"
"Project-Id-Version: 18.0\n" "Project-Id-Version: 18.0\n"
"Report-Msgid-Bugs-To: https://icehrm.com\n" "Report-Msgid-Bugs-To: https://icehrm.com\n"
"Last-Translator: Thilina Hasantha\n"
"Language-Team: IceHrm\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2018-03-05T05:26:33+05:30\n"
"PO-Revision-Date: 2018-03-05T05:26:33+05:30\n"
"Language: Italian\n"
msgid "Save" msgid "Save"
msgstr "Salvare" msgstr "Salvare"
@@ -1566,9 +1568,6 @@ msgstr "Prestiti contratti"
msgid "Change Leave Status" msgid "Change Leave Status"
msgstr "Cambiare Leave Stato" msgstr "Cambiare Leave Stato"
msgid "Leave Status"
msgstr "Lasciare Stato"
msgid "Status Change Note" msgid "Status Change Note"
msgstr "Modifica stato Nota" msgstr "Modifica stato Nota"
@@ -1598,4 +1597,3 @@ msgstr "Applicare"
msgid "Back" msgid "Back"
msgstr "Indietro" msgstr "Indietro"

View File

@@ -1,13 +1,15 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: Japanese\n"
"Language-Team: IceHrm\n"
"Last-Translator: Thilina Hasantha\n"
"MIME-Version: 1.0\n"
"Project-Id-Version: 18.0\n" "Project-Id-Version: 18.0\n"
"Report-Msgid-Bugs-To: https://icehrm.com\n" "Report-Msgid-Bugs-To: https://icehrm.com\n"
"Last-Translator: Thilina Hasantha\n"
"Language-Team: IceHrm\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2018-03-05T05:26:33+05:30\n"
"PO-Revision-Date: 2018-03-05T05:26:33+05:30\n"
"Language: Japanese\n"
msgid "Save" msgid "Save"
msgstr "セーブ" msgstr "セーブ"
@@ -1566,9 +1568,6 @@ msgstr "借入"
msgid "Change Leave Status" msgid "Change Leave Status"
msgstr "脱退ステータスを変更" msgstr "脱退ステータスを変更"
msgid "Leave Status"
msgstr "ステータスを残します"
msgid "Status Change Note" msgid "Status Change Note"
msgstr "ステータス変更(注)" msgstr "ステータス変更(注)"
@@ -1598,4 +1597,3 @@ msgstr "適用します"
msgid "Back" msgid "Back"
msgstr "バック" msgstr "バック"

View File

@@ -1,13 +1,15 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: Polish\n"
"Language-Team: IceHrm\n"
"Last-Translator: Thilina Hasantha\n"
"MIME-Version: 1.0\n"
"Project-Id-Version: 18.0\n" "Project-Id-Version: 18.0\n"
"Report-Msgid-Bugs-To: https://icehrm.com\n" "Report-Msgid-Bugs-To: https://icehrm.com\n"
"Last-Translator: Thilina Hasantha\n"
"Language-Team: IceHrm\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2018-03-05T05:26:33+05:30\n"
"PO-Revision-Date: 2018-03-05T05:26:33+05:30\n"
"Language: Polish\n"
msgid "Save" msgid "Save"
msgstr "Zapisać" msgstr "Zapisać"
@@ -1566,9 +1568,6 @@ msgstr "Pożyczki zaciągnięte"
msgid "Change Leave Status" msgid "Change Leave Status"
msgstr "Pozostawić zmiany statusu" msgstr "Pozostawić zmiany statusu"
msgid "Leave Status"
msgstr "Zostaw status"
msgid "Status Change Note" msgid "Status Change Note"
msgstr "Zmiana stanu Uwaga" msgstr "Zmiana stanu Uwaga"
@@ -1598,4 +1597,3 @@ msgstr "Zastosować"
msgid "Back" msgid "Back"
msgstr "Plecy" msgstr "Plecy"

1601
lang/si.po

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,15 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Language: Chinese\n"
"Language-Team: IceHrm\n"
"Last-Translator: Thilina Hasantha\n"
"MIME-Version: 1.0\n"
"Project-Id-Version: 18.0\n" "Project-Id-Version: 18.0\n"
"Report-Msgid-Bugs-To: https://icehrm.com\n" "Report-Msgid-Bugs-To: https://icehrm.com\n"
"Last-Translator: Thilina Hasantha\n"
"Language-Team: IceHrm\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2018-03-05T05:26:33+05:30\n"
"PO-Revision-Date: 2018-03-05T05:26:33+05:30\n"
"Language: Chinese\n"
msgid "Save" msgid "Save"
msgstr "保存" msgstr "保存"
@@ -1566,9 +1568,6 @@ msgstr "采取贷款"
msgid "Change Leave Status" msgid "Change Leave Status"
msgstr "更改休假状态" msgstr "更改休假状态"
msgid "Leave Status"
msgstr "离开状态"
msgid "Status Change Note" msgid "Status Change Note"
msgstr "状态更改注" msgstr "状态更改注"
@@ -1598,4 +1597,3 @@ msgstr "应用"
msgid "Back" msgid "Back"
msgstr "背部" msgstr "背部"

View File

@@ -1,5 +1,6 @@
<?php <?php
$migrationList = []; $migrationList = [];
$migrationList[] = 'v20180305_210100_drop_si_hi_languages';
$migrationList[] = 'v20171126_200303_swift_mail'; $migrationList[] = 'v20171126_200303_swift_mail';
$migrationList[] = 'v20171003_200302_payroll_meta_export'; $migrationList[] = 'v20171003_200302_payroll_meta_export';
$migrationList[] = 'v20171003_200301_add_deduction_group_payroll'; $migrationList[] = 'v20171003_200301_add_deduction_group_payroll';

View File

@@ -0,0 +1,35 @@
<?php
namespace Classes\Migration;
use Metadata\Common\Model\SupportedLanguage;
class v20180305_210100_drop_si_hi_languages extends AbstractMigration{
public function up(){
$supportedLanguage = new SupportedLanguage();
$supportedLanguage->Load('name = ?', array('si'));
$supportedLanguage->Delete();
$supportedLanguage = new SupportedLanguage();
$supportedLanguage->Load('name = ?', array('hi'));
$supportedLanguage->Delete();
return true;
}
public function down(){
$supportedLanguage = new SupportedLanguage();
$supportedLanguage->name = 'si';
$supportedLanguage->description = 'Sinhala';
$supportedLanguage->Save();
$supportedLanguage = new SupportedLanguage();
$supportedLanguage->name = 'hi';
$supportedLanguage->description = 'Hindi';
$supportedLanguage->Save();
return true;
}
}

View File

@@ -22,6 +22,59 @@ class RoboFile extends \Robo\Tasks
$this->say("Hello, " . implode(', ', $world)); $this->say("Hello, " . implode(', ', $world));
} }
function languageList($client) {
$this->includeCientConfig($client);
$this->say("Supported Languages for ". $client);
$language = new \Metadata\Common\Model\SupportedLanguage();
$langs = $language->Find('1 = 1');
$this->say(print_r(array_column($langs, 'name'), true));
}
function languageExport($client) {
$this->includeCientConfig($client);
$language = new \Metadata\Common\Model\SupportedLanguage();
$languages = $language->Find('1 = 1 order by id');
$data = [];
$data[0] = [];
$data[0][] = 'Key';
foreach ($languages as $lang) {
$data[0][] = $lang->name;
$trans = \Classes\LanguageManager::getTranslations($lang->name);
$trans = json_decode($trans, true)['messages'][''];
$count = 1;
foreach ($trans as $enVal => $langVal) {
if (!isset($data[$count])) {
$data[$count] = [];
$data[$count][] = $enVal;
}
$data[$count][] = $langVal[0];
$count += 1;
}
}
$fp = fopen(CLIENT_BASE_PATH.'data/translations.csv', 'w');
foreach ($data as $fields) {
fprintf($fp, chr(0xEF).chr(0xBB).chr(0xBF));
fputcsv($fp, $fields);
}
fclose($fp);
$this->say('File saved');
}
function languageImport($client, $file) {
$this->includeCientConfig($client);
$language = new \Metadata\Common\Model\SupportedLanguage();
$languages = $language->Find('1 = 1 order by id');
foreach ($languages as $language) {
$str = $this->getUpdatedTranslationString($language->name, $file);
file_put_contents(
__DIR__.'/../lang/'.$language->name.'.po',
$str);
$this->say('Updated :'.realpath(__DIR__.'/../lang/'.$language->name.'.po'));
}
}
function migrate($client, $action){ function migrate($client, $action){
$this->includeCientConfig($client); $this->includeCientConfig($client);
$this->say("DB Migrating " . $action . " for ". $client); $this->say("DB Migrating " . $action . " for ". $client);
@@ -50,4 +103,44 @@ class RoboFile extends \Robo\Tasks
} }
$this->say("DB Migration Completed !!!"); $this->say("DB Migration Completed !!!");
} }
/**
* @param $lang
* @param $file
* @return mixed
*/
protected function getUpdatedTranslationString($lang, $file)
{
$handle = fopen(CLIENT_BASE_PATH . 'data/' . $file, "r");
$langColumn = null;
/* @var \Gettext\Translations $trans */
$trans = \Classes\LanguageManager::getTranslationsObject($lang);
while (($data = fgetcsv($handle)) !== FALSE) {
if ($langColumn === null) {
$currentColumn = 0;
foreach ($data as $language) {
if ($language === $lang) {
$langColumn = $currentColumn;
break;
}
$currentColumn++;
}
if ($langColumn === null) {
$this->say('Invalid Language');
exit();
}
} else {
/* @var \Gettext\Translation $tran */
$tran = $trans->find('', $data[0]);
if ($tran !== false) {
$tran->setTranslation($data[$langColumn]);
} else {
$trans->insert($data[0], $data[$langColumn]);
}
}
}
return $trans->toPoString();
}
} }

View File

@@ -9,40 +9,45 @@ use Utils\LogManager;
class LanguageManager class LanguageManager
{ {
private static $me = null; private static $me = [];
/* @var \Gettext\Translator $translator */ /* @var \Gettext\Translator $translator */
private $translator = null; private $translator = null;
/* @var \Gettext\Translations $translations */
private $translations = null; private $translations = null;
private function __construct() private function __construct()
{ {
} }
private static function getInstance() private static function getInstance($lang = null)
{ {
if (empty(self::$me)) { if ($lang === null) {
self::$me = new LanguageManager(); $lang = self::getCurrentLang();
self::$me->loadLanguage(); }
if (empty(self::$me[$lang])) {
self::$me[$lang] = new LanguageManager();
self::$me[$lang]->initialize($lang);
} }
return self::$me; return self::$me[$lang];
} }
private function loadLanguage() private function initialize($lang)
{
$this->loadLanguage($lang);
}
public function loadLanguage($lang)
{ {
$lang = $this->getCurrentLang();
$this->translations = Translations::fromPoFile(APP_BASE_PATH.'lang/'.$lang.'.po'); $this->translations = Translations::fromPoFile(APP_BASE_PATH.'lang/'.$lang.'.po');
if (file_exists(APP_BASE_PATH.'lang/'.$lang.'-ext.po')) {
$this->translations->addFromPoFile(APP_BASE_PATH.'lang/'.$lang.'-ext.po');
}
$t = new Translator(); $t = new Translator();
$t->loadTranslations($this->translations); $t->loadTranslations($this->translations);
$t->register(); $t->register();
$this->translator = $t; $this->translator = $t;
} }
private function getCurrentLang() private static function getCurrentLang()
{ {
$user = BaseService::getInstance()->getCurrentUser(); $user = BaseService::getInstance()->getCurrentUser();
if (empty($user) || empty($user->lang) || $user->lang == "NULL") { if (empty($user) || empty($user->lang) || $user->lang == "NULL") {
@@ -56,16 +61,21 @@ class LanguageManager
if (empty($lang) || !file_exists(APP_BASE_PATH.'lang/'.$lang.'.po')) { if (empty($lang) || !file_exists(APP_BASE_PATH.'lang/'.$lang.'.po')) {
$lang = 'en'; $lang = 'en';
} }
LogManager::getInstance()->info("Current Language:".$lang);
return $lang; return $lang;
} }
public static function getTranslations() public static function getTranslations($lang = null)
{ {
$me = self::getInstance(); $me = self::getInstance($lang);
return Json::toString($me->translations); return Json::toString($me->translations);
} }
public static function getTranslationsObject($lang = null)
{
$me = self::getInstance($lang);
return $me->translations;
}
public static function tran($text) public static function tran($text)
{ {
$me = self::getInstance(); $me = self::getInstance();

View File

@@ -7,6 +7,8 @@
</div> </div>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -9,6 +9,8 @@
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -8,6 +8,8 @@
</div> </div>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -10,6 +10,8 @@
</div> </div>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -7,6 +7,8 @@
<button id="_id__remove" onclick="$('#_id_').attr('val','');return false;" class="btn btn-mini btn-inverse" type="button" style="margin-left:30px;margin-top:3px;"><t>Remove</t></button> <button id="_id__remove" onclick="$('#_id_').attr('val','');return false;" class="btn btn-mini btn-inverse" type="button" style="margin-left:30px;margin-top:3px;"><t>Remove</t></button>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -4,6 +4,8 @@
<input class="control-label" id="_id_"/> <input class="control-label" id="_id_"/>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_"></span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -4,6 +4,8 @@
<label id="_id_" name="_id_" style="text-align: left;" class="control-label" _validation_></label> <label id="_id_" name="_id_" style="text-align: left;" class="control-label" _validation_></label>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_"></span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -6,6 +6,8 @@
</select> </select>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -6,6 +6,8 @@
</select> </select>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -6,6 +6,8 @@
</select> </select>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -4,6 +4,8 @@
<canvas class="form-control signatureField" type="signature" id="_id_" name="_id_" _validation_ style="height:120px;"></canvas> <canvas class="form-control signatureField" type="signature" id="_id_" name="_id_" _validation_ style="height:120px;"></canvas>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -4,6 +4,8 @@
<textarea class="form-control simplemde" type="textarea" rows="4" id="_id_" name="_id_" _validation_></textarea> <textarea class="form-control simplemde" type="textarea" rows="4" id="_id_" name="_id_" _validation_></textarea>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -1,9 +1,11 @@
<div class="row" id="field__id_"> <div class="row" id="field__id_">
<label class="col-sm-3 control-label" for="_id_">_label_</label> <label class="col-sm-3 control-label" for="_id_">_label_</label>
<div class="controls col-sm-6"> <div class="controls col-sm-6">
<input class="form-control" type="text" id="_id_" name="_id_" value="" _validation_/> <input class="form-control" type="text" id="_id_" name="_id_" value="" _validation_ _placeholder_/>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -1,9 +1,11 @@
<div class="row" id="field__id_"> <div class="row" id="field__id_">
<label class="control-label col-sm-3" for="_id_">_label_</label> <label class="control-label col-sm-3" for="_id_">_label_</label>
<div class="controls col-sm-6"> <div class="controls col-sm-6">
<textarea class="form-control" type="textarea" rows="4" id="_id_" name="_id_" _validation_></textarea> <textarea class="form-control" type="textarea" rows="4" id="_id_" name="_id_" _validation_ _placeholder_></textarea>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -10,6 +10,8 @@
</div> </div>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -4,6 +4,8 @@
<textarea class="form-control tinymce" type="textarea" rows="4" id="_id_" name="_id_" _validation_></textarea> <textarea class="form-control tinymce" type="textarea" rows="4" id="_id_" name="_id_" _validation_></textarea>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
<span class="help-inline control-label" id="help__id_">_helpline_</span> <div id="help__id_" class="fa fa-info-circle help-info _hidden_class_help_"
onclick="modJs.showMessage('Tip','_helpline_')"></div>
<span id="help_err__id_"></span>
</div> </div>
</div> </div>

View File

@@ -2,8 +2,8 @@
<form class="form-horizontal" id="_id_" role="form"> <form class="form-horizontal" id="_id_" role="form">
<div class="box-body"> <div class="box-body">
<div class="control-group"> <div class="control-group">
<div class="controls"> <div class="controls ice-form-error-control">
<span class="label label-warning" id="_id__error" style="display:none;"></span> <span class="ice-form-error label label-danger" id="_id__error" style="display:none;"></span>
</div> </div>
</div> </div>
_fields_ _fields_

View File

@@ -1,8 +1,12 @@
<?php <?php
class PHPUnit_Framework_TestCase extends \PHPUnit\Framework\TestCase{ if (!class_exists('PHPUnit_Framework_TestCase')) {
class PHPUnit_Framework_TestCase extends \PHPUnit\Framework\TestCase
{
}
} }
class TestTemplate extends PHPUnit_Framework_TestCase class TestTemplate extends PHPUnit_Framework_TestCase
{ {

View File

@@ -1,21 +0,0 @@
<?php
/**
* Created by PhpStorm.
* User: Thilina
* Date: 9/6/17
* Time: 7:22 AM
*/
namespace Test\Unit;
use Classes\BaseService;
class BaseServiceUnit extends \TestTemplate
{
public function testGet()
{
$baseService = BaseService::getInstance();
// create a user
//$user =
}
}

View File

@@ -2,6 +2,7 @@
namespace Test\Unit; namespace Test\Unit;
use Classes\LanguageManager; use Classes\LanguageManager;
use Gettext\Translations;
class LanguageManagerUnit extends \TestTemplate class LanguageManagerUnit extends \TestTemplate
{ {
@@ -20,4 +21,22 @@ class LanguageManagerUnit extends \TestTemplate
$this->assertEquals('User Logged In now', LanguageManager::translateTnrText('User <t>Logged In</t> now')); $this->assertEquals('User Logged In now', LanguageManager::translateTnrText('User <t>Logged In</t> now'));
fwrite(STDOUT, __METHOD__ . " End\n"); fwrite(STDOUT, __METHOD__ . " End\n");
} }
public function testGetTranslations() {
$enCount = $this->getTranslationCount('en');
$this->assertEquals($enCount, $this->getTranslationCount('de'));
$this->assertEquals($enCount, $this->getTranslationCount('es'));
$this->assertEquals($enCount, $this->getTranslationCount('fr'));
$this->assertEquals($enCount, $this->getTranslationCount('it'));
$this->assertEquals($enCount, $this->getTranslationCount('ja'));
$this->assertEquals($enCount, $this->getTranslationCount('pl'));
$this->assertEquals($enCount, $this->getTranslationCount('zh'));
}
private function getTranslationCount($lang) {
$trans = json_decode(LanguageManager::getTranslations($lang), true);
$count = count(array_keys($trans['messages']['']));
}
} }