Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix i18next.t function, translate GroupEditor.js, update locale files #2762

Merged
merged 5 commits into from
Jul 10, 2017
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 79 additions & 16 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,18 @@ module.exports = function (grunt) {
concat: {
options: {
separator: ';\n\n',
banner: '/*! <%= package.version %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
banner: '/*! <%= package.version %> <%= grunt.template.today("dd-mm-yyyy") %> */\n',
process: function(src, filepath) {
return '// Source: ' + filepath + '\n' +
"try {"+src+"} catch(e) {}";
},
},
de_DE: {
src: ['node_modules/fullcalendar/dist/locale/de.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.de.js'],
src: [
'node_modules/fullcalendar/dist/locale/de.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.de.js',
'node_modules/admin-lte/plugins/select2/i18n/de.js'
],
dest: 'src/skin/locale/de_DE.js'
},
en_AU: {
Expand All @@ -187,63 +195,118 @@ module.exports = function (grunt) {
dest: 'src/skin/locale/en_US.js'
},
es_ES: {
src: ['node_modules/fullcalendar/dist/locale/es.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.es.js'],
src: [
'node_modules/fullcalendar/dist/locale/es.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.es.js',
'node_modules/admin-lte/plugins/select2/i18n/es.js'
],
dest: 'src/skin/locale/es_ES.js'
},
fr_FR: {
src: ['node_modules/fullcalendar/dist/locale/fr.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.fr.js'],
src: [
'node_modules/fullcalendar/dist/locale/fr.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.fr.js',
'node_modules/admin-lte/plugins/select2/i18n/fr.js'
],
dest: 'src/skin/locale/fr_FR.js'
},
hu_HU: {
src: ['node_modules/fullcalendar/dist/locale/hu.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.hu.js'],
src: [
'node_modules/fullcalendar/dist/locale/hu.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.hu.js',
'node_modules/admin-lte/plugins/select2/i18n/hu.js'
],
dest: 'src/skin/locale/hu_HU.js'
},
it_IT: {
src: ['node_modules/fullcalendar/dist/locale/it.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.it.js'],
src: [
'node_modules/fullcalendar/dist/locale/it.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.it.js',
'node_modules/admin-lte/plugins/select2/i18n/it.js'
],
dest: 'src/skin/locale/it_IT.js'
},
nb_NO: {
src: ['node_modules/fullcalendar/dist/locale/nb.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.nb.js'],
src: [
'node_modules/fullcalendar/dist/locale/nb.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.nb.js',
'node_modules/admin-lte/plugins/select2/i18n/nb.js'
],
dest: 'src/skin/locale/nb_NO.js'
},
nl_NL: {
src: ['node_modules/fullcalendar/dist/locale/nl.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.nl.js'],
src: [
'node_modules/fullcalendar/dist/locale/nl.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.nl.js',
'node_modules/admin-lte/plugins/select2/i18n/nl.js'
],
dest: 'src/skin/locale/nl_NL.js'
},
pl_PL: {
src: ['node_modules/fullcalendar/dist/locale/pl.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.pl.js'],
src: [
'node_modules/fullcalendar/dist/locale/pl.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.pl.js',
'node_modules/admin-lte/plugins/select2/i18n/pl.js'
],
dest: 'src/skin/locale/pl_PL.js'
},
pt_BR: {
src: ['node_modules/fullcalendar/dist/locale/pt-br.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.pt-BR.js'],
src: [
'node_modules/fullcalendar/dist/locale/pt-br.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.pt-BR.js',
'node_modules/admin-lte/plugins/select2/i18n/pt-BR.js'
],
dest: 'src/skin/locale/pt_BR.js'
},
ro_RO: {
src: ['node_modules/fullcalendar/dist/locale/ro.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.ro.js'],
src: [
'node_modules/fullcalendar/dist/locale/ro.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.ro.js',
'node_modules/admin-lte/plugins/select2/i18n/ro.js'
],
dest: 'src/skin/locale/ro_RO.js'
},
ru_RU: {
src: ['node_modules/fullcalendar/dist/locale/ru.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.ru.js'],
src: [
'node_modules/fullcalendar/dist/locale/ru.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.ru.js',
'node_modules/admin-lte/plugins/select2/i18n/ru.js'
],
dest: 'src/skin/locale/ru_RU.js'
},
sq_AL: {
src: ['node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.sq.js'],
dest: 'src/skin/locale/sq_AL.js'
},
sv_SE: {
src: ['node_modules/fullcalendar/dist/locale/sv.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.sv.js'],
src: [
'node_modules/fullcalendar/dist/locale/sv.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.sv.js'
],
dest: 'src/skin/locale/sv_SE.js'
},
vi_VN: {
src: ['node_modules/fullcalendar/dist/locale/vi.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.vi.js'],
src: [
'node_modules/fullcalendar/dist/locale/vi.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.vi.js',
'node_modules/admin-lte/plugins/select2/i18n/vi.js'
],
dest: 'src/skin/locale/vi_VN.js'
},
zh_CN: {
src: ['node_modules/fullcalendar/dist/locale/zh-cn.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js'],
src: [
'node_modules/fullcalendar/dist/locale/zh-cn.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js',
'node_modules/admin-lte/plugins/select2/i18n/zh-CN.js'
],
dest: 'src/skin/locale/zh_CN.js'
},
zh_TW: {
src: ['node_modules/fullcalendar/dist/locale/zh-tw.js', 'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.zh-TW.js'],
src: [
'node_modules/fullcalendar/dist/locale/zh-tw.js',
'node_modules/admin-lte/plugins/datepicker/locales/bootstrap-datepicker.zh-TW.js',
'node_modules/admin-lte/plugins/select2/i18n/zh-TW.js'
],
dest: 'src/skin/locale/zh_TW.js'
}
},
Expand Down
5 changes: 5 additions & 0 deletions src/ChurchCRM/dto/LocaleInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public function getLocale()
{
return $this->locale;
}

public function getShortLocale()
{
return substr($this->getLocale(), 0, 2);
}

public function getLanguageCode()
{
Expand Down
1 change: 1 addition & 0 deletions src/Include/Footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/fullcalendar/fullcalendar.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/daterangepicker/daterangepicker.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/timepicker/bootstrap-timepicker.js"></script>

Expand Down
1 change: 1 addition & 0 deletions src/Include/Header-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ function Header_body_scripts()
root: "<?= SystemURLs::getRootPath() ?>",
lang: "<?= $localeInfo->getLanguageCode() ?>",
locale: "<?= $localeInfo->getLocale() ?>",
shortLocale: "<?= $localeInfo->getShortLocale() ?>",
maxUploadSize: "<?= $systemService->getMaxUploadFileSize(true) ?>",
maxUploadSizeBytes: "<?= $systemService->getMaxUploadFileSize(false) ?>",
plugin: {
Expand Down
1 change: 1 addition & 0 deletions src/skin/js/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ $("document").ready(function(){
});

$(".multiSearch").select2({
language: window.CRM.shortLocale,
minimumInputLength: 2,
ajax: {
url: function (params){
Expand Down
4 changes: 2 additions & 2 deletions src/skin/js/GroupEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ $("document").ready(function()

dataT = $("#groupRoleTable").DataTable({
"language": {
"url": window.CRM.root + "/skin/locale/datatables/" + window.CRM.locale + ".json"
"url": window.CRM.plugin.dataTable.language.url
},
data: groupRoleData,
columns: [
Expand Down Expand Up @@ -287,4 +287,4 @@ function setGroupRoleOrder(groupID, roleID, groupRoleOrder)
}).done(function(data)
{
});
}
}