mirror of
https://github.com/wekan/wekan.git
synced 2025-04-20 12:07:11 -04:00
Switch tap:i18n to custom TAPi18n implementation
This commit is contained in:
parent
40265144af
commit
60af7766bf
157 changed files with 1991 additions and 5190 deletions
|
@ -41,10 +41,11 @@ kadira:dochead
|
|||
mquandalle:autofocus
|
||||
ongoworks:speakingurl
|
||||
raix:handlebar-helpers
|
||||
http@2.0.0
|
||||
http@2.0.0! # force new http package
|
||||
|
||||
# UI components
|
||||
blaze
|
||||
ostrio:i18n
|
||||
reactive-var@1.0.11
|
||||
fortawesome:fontawesome
|
||||
mousetrap:mousetrap
|
||||
|
@ -59,9 +60,7 @@ email@2.1.1
|
|||
horka:swipebox
|
||||
dynamic-import@0.7.1
|
||||
rzymek:fullcalendar
|
||||
momentjs:moment@2.22.2
|
||||
browser-policy-framing@1.1.0
|
||||
mquandalle:moment
|
||||
msavin:usercache
|
||||
# Keep stylus in 1.1.0, because building v2 takes extra 52 minutes.
|
||||
coagmano:stylus@1.1.0!
|
||||
|
@ -124,8 +123,13 @@ pascoual:pdfkit
|
|||
lmieulet:meteor-coverage
|
||||
meteortesting:mocha
|
||||
aldeed:simple-schema
|
||||
accounts-password@2.0.0
|
||||
accounts-password
|
||||
matb33:collection-hooks
|
||||
simple:json-routes
|
||||
kadira:flow-router
|
||||
spacebars
|
||||
communitypackages:picker
|
||||
useraccounts:core
|
||||
useraccounts:unstyled
|
||||
useraccounts:flow-routing
|
||||
service-configuration
|
||||
|
|
|
@ -20,8 +20,7 @@ browser-policy-common@1.0.11
|
|||
browser-policy-framing@1.1.0
|
||||
caching-compiler@1.2.2
|
||||
caching-html-compiler@1.2.1
|
||||
callback-hook@1.3.1
|
||||
cfs:http-methods@0.0.32
|
||||
callback-hook@1.4.0
|
||||
check@1.3.1
|
||||
coagmano:stylus@1.1.0
|
||||
coffeescript@2.4.1
|
||||
|
@ -77,7 +76,6 @@ meteorhacks:aggregate@1.3.0
|
|||
meteorhacks:collection-utils@1.2.0
|
||||
meteorhacks:picker@1.0.3
|
||||
meteorhacks:subs-manager@1.6.4
|
||||
meteorspark:util@0.2.0
|
||||
meteortesting:browser-tests@0.2.0
|
||||
meteortesting:mocha@0.6.0
|
||||
minifier-css@1.5.4
|
||||
|
@ -100,15 +98,14 @@ mquandalle:collection-mutations@0.1.0
|
|||
mquandalle:jade@0.4.9
|
||||
mquandalle:jade-compiler@0.4.5
|
||||
mquandalle:jquery-textcomplete@0.8.0_1
|
||||
mquandalle:jquery-ui-drag-drop-sort@0.2.0
|
||||
mquandalle:moment@1.0.1
|
||||
mquandalle:mousetrap-bindglobal@0.0.1
|
||||
mrt:just-i18n@0.3.0
|
||||
msavin:usercache@1.8.0
|
||||
npm-mongo@3.9.1
|
||||
observe-sequence@1.0.19
|
||||
ongoworks:speakingurl@1.1.0
|
||||
ordered-dict@1.1.0
|
||||
ostrio:cstorage@2.2.2
|
||||
ostrio:i18n@3.1.0
|
||||
pascoual:pdfkit@1.0.7
|
||||
peerlibrary:assert@0.3.0
|
||||
peerlibrary:base-component@0.17.1
|
||||
|
@ -186,9 +183,8 @@ simple:json-routes@2.1.0
|
|||
socket-stream-client@0.4.0
|
||||
spacebars@1.2.0
|
||||
spacebars-compiler@1.3.0
|
||||
standard-minifier-css@1.7.3
|
||||
standard-minifier-js@2.6.1
|
||||
tap:i18n@1.8.2
|
||||
standard-minifier-css@1.7.4
|
||||
standard-minifier-js@2.8.0
|
||||
templates:tabs@2.3.0
|
||||
templating@1.4.1
|
||||
templating-compiler@1.4.1
|
||||
|
@ -199,7 +195,10 @@ twbs:bootstrap@3.3.6
|
|||
ui@1.0.13
|
||||
underscore@1.0.10
|
||||
url@1.3.2
|
||||
webapp@1.11.1
|
||||
useraccounts:core@1.16.2
|
||||
useraccounts:flow-routing@1.15.0
|
||||
useraccounts:unstyled@1.14.2
|
||||
webapp@1.13.0
|
||||
webapp-hashing@1.1.0
|
||||
wekan-markdown@1.0.9
|
||||
zimme:active-route@2.3.2
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import DOMPurify from 'dompurify';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
const activitiesPerPage = 500;
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
const subManager = new SubsManager();
|
||||
const { calculateIndex } = Utils;
|
||||
const swimlaneWhileSortingHeight = 150;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
/*
|
||||
const DOWNCLS = 'fa-sort-down';
|
||||
const UPCLS = 'fa-sort-up';
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
const subManager = new SubsManager();
|
||||
|
||||
Template.boardListHeaderBar.events({
|
||||
|
@ -33,7 +35,6 @@ BlazeComponent.extendComponent({
|
|||
}
|
||||
if (userLanguage) {
|
||||
TAPi18n.setLanguage(userLanguage);
|
||||
T9n.setLanguage(userLanguage);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import moment from 'moment';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import { DatePicker } from '/client/lib/datepicker';
|
||||
import Cards from '/models/cards';
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import moment from 'moment';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import { DatePicker } from '/client/lib/datepicker';
|
||||
|
||||
Template.dateBadge.helpers({
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import moment from 'moment';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import { DatePicker } from '/client/lib/datepicker';
|
||||
import Cards from '/models/cards';
|
||||
import Boards from '/models/boards';
|
||||
|
@ -7,7 +9,6 @@ import Users from '/models/users';
|
|||
import Lists from '/models/lists';
|
||||
import CardComments from '/models/cardComments';
|
||||
import { ALLOWED_COLORS } from '/config/const';
|
||||
import moment from 'moment';
|
||||
import { UserAvatar } from '../users/userAvatar';
|
||||
|
||||
const subManager = new SubsManager();
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
template() {
|
||||
return 'editCardSpentTime';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
import Cards from '/models/cards';
|
||||
import Boards from '/models/boards';
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
// Template.cards.events({
|
||||
// 'click .member': Popup.open('cardMember')
|
||||
// });
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
require('/client/lib/jquery-ui.js')
|
||||
|
||||
const { calculateIndex } = Utils;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
import { Spinner } from '/client/lib/spinner';
|
||||
|
||||
const subManager = new SubsManager();
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
let listsColors;
|
||||
Meteor.startup(() => {
|
||||
listsColors = Lists.simpleSchema()._schema.color.allowedValues;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
import { CardSearchPagedComponent } from '../../lib/cardSearch';
|
||||
import Boards from '../../../models/boards';
|
||||
import { Query, QueryErrors } from '../../../config/query-classes';
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
BlazeLayout.setRoot('body');
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
const i18nTagToT9n = i18nTag => {
|
||||
// t9n/i18n tags are same now, see: https://github.com/softwarerero/meteor-accounts-t9n/pull/129
|
||||
// but we keep this conversion function here, to be aware that that they are different system.
|
||||
return i18nTag;
|
||||
};
|
||||
BlazeLayout.setRoot('body');
|
||||
|
||||
let alreadyCheck = 1;
|
||||
let isCheckDone = false;
|
||||
|
@ -60,11 +56,6 @@ Template.userFormsLayout.onRendered(() => {
|
|||
AccountsTemplates.state.form.keys,
|
||||
validator,
|
||||
);
|
||||
|
||||
const i18nTag = navigator.language;
|
||||
if (i18nTag) {
|
||||
T9n.setLanguage(i18nTagToT9n(i18nTag));
|
||||
}
|
||||
EscapeActions.executeAll();
|
||||
});
|
||||
|
||||
|
@ -89,11 +80,11 @@ Template.userFormsLayout.helpers({
|
|||
getLegalNoticeWithWritTraduction(){
|
||||
let spanLegalNoticeElt = $("#legalNoticeSpan");
|
||||
if(spanLegalNoticeElt != null && spanLegalNoticeElt != undefined){
|
||||
spanLegalNoticeElt.html(TAPi18n.__('acceptance_of_our_legalNotice', {}, T9n.getLanguage() || 'en'));
|
||||
spanLegalNoticeElt.html(TAPi18n.__('acceptance_of_our_legalNotice', {}));
|
||||
}
|
||||
let atLinkLegalNoticeElt = $("#legalNoticeAtLink");
|
||||
if(atLinkLegalNoticeElt != null && atLinkLegalNoticeElt != undefined){
|
||||
atLinkLegalNoticeElt.html(TAPi18n.__('legalNotice', {}, T9n.getLanguage() || 'en'));
|
||||
atLinkLegalNoticeElt.html(TAPi18n.__('legalNotice', {}));
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
@ -111,112 +102,27 @@ Template.userFormsLayout.helpers({
|
|||
},
|
||||
|
||||
languages() {
|
||||
return _.map(TAPi18n.getLanguages(), (lang, code) => {
|
||||
const tag = code;
|
||||
let name = lang.name;
|
||||
if (lang.name === 'br') {
|
||||
name = 'Brezhoneg';
|
||||
} else if (lang.name === 'ar-EG') {
|
||||
// ar-EG = Arabic (Egypt), simply Masri (مَصرى, [ˈmɑsˤɾi], Egyptian, Masr refers to Cairo)
|
||||
name = 'مَصرى';
|
||||
} else if (lang.name === 'de-CH') {
|
||||
name = 'Deutsch (Schweiz)';
|
||||
} else if (lang.name === 'de-AT') {
|
||||
name = 'Deutsch (Österreich)';
|
||||
} else if (lang.name === 'en-DE') {
|
||||
name = 'English (Germany)';
|
||||
} else if (lang.name === 'et-EE') {
|
||||
name = 'eesti keel (Eesti)';
|
||||
} else if (lang.name === 'fa-IR') {
|
||||
// fa-IR = Persian (Iran)
|
||||
name = 'فارسی/پارسی (ایران)';
|
||||
} else if (lang.name === 'fr-BE') {
|
||||
name = 'Français (Belgique)';
|
||||
} else if (lang.name === 'fr-CA') {
|
||||
name = 'Français (Canada)';
|
||||
} else if (lang.name === 'fr-CH') {
|
||||
name = 'Français (Schweiz)';
|
||||
} else if (lang.name === 'gu-IN') {
|
||||
// gu-IN = Gurajati (India)
|
||||
name = 'ગુજરાતી';
|
||||
} else if (lang.name === 'hi-IN') {
|
||||
// hi-IN = Hindi (India)
|
||||
name = 'हिंदी (भारत)';
|
||||
} else if (lang.name === 'ig') {
|
||||
name = 'Igbo';
|
||||
} else if (lang.name === 'lv') {
|
||||
name = 'Latviešu';
|
||||
} else if (lang.name === 'latviešu valoda') {
|
||||
name = 'Latviešu';
|
||||
} else if (lang.name === 'ms-MY') {
|
||||
// ms-MY = Malay (Malaysia)
|
||||
name = 'بهاس ملايو';
|
||||
} else if (lang.name === 'en-IT') {
|
||||
name = 'English (Italy)';
|
||||
} else if (lang.name === 'el-GR') {
|
||||
// el-GR = Greek (Greece)
|
||||
name = 'Ελληνικά (Ελλάδα)';
|
||||
} else if (lang.name === 'Español') {
|
||||
name = 'español';
|
||||
} else if (lang.name === 'es_419') {
|
||||
name = 'español de América Latina';
|
||||
} else if (lang.name === 'es-419') {
|
||||
name = 'español de América Latina';
|
||||
} else if (lang.name === 'Español de América Latina') {
|
||||
name = 'español de América Latina';
|
||||
} else if (lang.name === 'es-LA') {
|
||||
name = 'español de América Latina';
|
||||
} else if (lang.name === 'Español de Argentina') {
|
||||
name = 'español de Argentina';
|
||||
} else if (lang.name === 'Español de Chile') {
|
||||
name = 'español de Chile';
|
||||
} else if (lang.name === 'Español de Colombia') {
|
||||
name = 'español de Colombia';
|
||||
} else if (lang.name === 'Español de México') {
|
||||
name = 'español de México';
|
||||
} else if (lang.name === 'es-PY') {
|
||||
name = 'español de Paraguayo';
|
||||
} else if (lang.name === 'Español de Paraguayo') {
|
||||
name = 'español de Paraguayo';
|
||||
} else if (lang.name === 'Español de Perú') {
|
||||
name = 'español de Perú';
|
||||
} else if (lang.name === 'Español de Puerto Rico') {
|
||||
name = 'español de Puerto Rico';
|
||||
} else if (lang.name === 'gl-ES') {
|
||||
name = 'Galego (España)';
|
||||
} else if (lang.name === 'oc') {
|
||||
name = 'Occitan';
|
||||
} else if (lang.name === 'ru-UA') {
|
||||
name = 'Русский (Украина)';
|
||||
} else if (lang.name === 'st') {
|
||||
name = 'Sãotomense';
|
||||
} else if (lang.name === 'uk-UA') {
|
||||
name = 'українська (Україна)';
|
||||
} else if (lang.name === '繁体中文(台湾)') {
|
||||
// Traditional Chinese (Taiwan)
|
||||
name = '繁體中文(台灣)';
|
||||
}
|
||||
return { tag, name };
|
||||
}).sort(function(a, b) {
|
||||
if (a.name === b.name) {
|
||||
return 0;
|
||||
} else {
|
||||
return a.name > b.name ? 1 : -1;
|
||||
}
|
||||
});
|
||||
return TAPi18n.getSupportedLanguages()
|
||||
.map(({ isoCode, name }) => ({ tag: isoCode, name }))
|
||||
.sort((a, b) => {
|
||||
if (a.name === b.name) {
|
||||
return 0;
|
||||
} else {
|
||||
return a.name > b.name ? 1 : -1;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
isCurrentLanguage() {
|
||||
const t9nTag = i18nTagToT9n(this.tag);
|
||||
const curLang = T9n.getLanguage() || 'en';
|
||||
return t9nTag === curLang;
|
||||
const curLang = TAPi18n.getLanguage();
|
||||
return this.tag === curLang;
|
||||
},
|
||||
});
|
||||
|
||||
Template.userFormsLayout.events({
|
||||
'change .js-userform-set-language'(event) {
|
||||
const i18nTag = $(event.currentTarget).val();
|
||||
T9n.setLanguage(i18nTagToT9n(i18nTag));
|
||||
const tag = $(event.currentTarget).val();
|
||||
TAPi18n.setLanguage(tag);
|
||||
event.preventDefault();
|
||||
},
|
||||
'click #at-btn'(event, templateInstance) {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.subscribe('allRules');
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
import { AttachmentStorage } from '/models/attachments';
|
||||
import { CardSearchPagedComponent } from '/client/lib/cardSearch';
|
||||
import SessionData from '/models/usersessiondata';
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
this.info = new ReactiveVar({});
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
import { ALLOWED_WAIT_SPINNERS } from '/config/const';
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
Sidebar = null;
|
||||
|
||||
const defaultView = 'home';
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
//archivedRequested = false;
|
||||
const subManager = new SubsManager();
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
customFields() {
|
||||
return CustomFields.find({
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
Template.headerUserBar.events({
|
||||
'click .js-open-header-member-menu': Popup.open('memberMenu'),
|
||||
'click .js-change-avatar': Popup.open('changeAvatar'),
|
||||
|
@ -256,101 +258,15 @@ Template.changePasswordPopup.onRendered(function() {
|
|||
|
||||
Template.changeLanguagePopup.helpers({
|
||||
languages() {
|
||||
return _.map(TAPi18n.getLanguages(), (lang, code) => {
|
||||
// Same code in /client/components/main/layouts.js
|
||||
// TODO : Make code reusable
|
||||
const tag = code;
|
||||
let name = lang.name;
|
||||
if (lang.name === 'br') {
|
||||
name = 'Brezhoneg';
|
||||
} else if (lang.name === 'ar-EG') {
|
||||
// ar-EG = Arabic (Egypt), simply Masri (مَصرى, [ˈmɑsˤɾi], Egyptian, Masr refers to Cairo)
|
||||
name = 'مَصرى';
|
||||
} else if (lang.name === 'de-CH') {
|
||||
name = 'Deutsch (Schweiz)';
|
||||
} else if (lang.name === 'de-AT') {
|
||||
name = 'Deutsch (Österreich)';
|
||||
} else if (lang.name === 'en-DE') {
|
||||
name = 'English (Germany)';
|
||||
} else if (lang.name === 'et-EE') {
|
||||
name = 'eesti keel (Eesti)';
|
||||
} else if (lang.name === 'fa-IR') {
|
||||
// fa-IR = Persian (Iran)
|
||||
name = 'فارسی/پارسی (ایران)';
|
||||
} else if (lang.name === 'fr-BE') {
|
||||
name = 'Français (Belgique)';
|
||||
} else if (lang.name === 'fr-CA') {
|
||||
name = 'Français (Canada)';
|
||||
} else if (lang.name === 'fr-CH') {
|
||||
name = 'Français (Schweiz)';
|
||||
} else if (lang.name === 'gu-IN') {
|
||||
// gu-IN = Gurajati (India)
|
||||
name = 'ગુજરાતી';
|
||||
} else if (lang.name === 'hi-IN') {
|
||||
// hi-IN = Hindi (India)
|
||||
name = 'हिंदी (भारत)';
|
||||
} else if (lang.name === 'ig') {
|
||||
name = 'Igbo';
|
||||
} else if (lang.name === 'lv') {
|
||||
name = 'Latviešu';
|
||||
} else if (lang.name === 'latviešu valoda') {
|
||||
name = 'Latviešu';
|
||||
} else if (lang.name === 'ms-MY') {
|
||||
// ms-MY = Malay (Malaysia)
|
||||
name = 'بهاس ملايو';
|
||||
} else if (lang.name === 'en-IT') {
|
||||
name = 'English (Italy)';
|
||||
} else if (lang.name === 'el-GR') {
|
||||
// el-GR = Greek (Greece)
|
||||
name = 'Ελληνικά (Ελλάδα)';
|
||||
} else if (lang.name === 'Español') {
|
||||
name = 'español';
|
||||
} else if (lang.name === 'es_419') {
|
||||
name = 'español de América Latina';
|
||||
} else if (lang.name === 'es-419') {
|
||||
name = 'español de América Latina';
|
||||
} else if (lang.name === 'Español de América Latina') {
|
||||
name = 'español de América Latina';
|
||||
} else if (lang.name === 'es-LA') {
|
||||
name = 'español de América Latina';
|
||||
} else if (lang.name === 'Español de Argentina') {
|
||||
name = 'español de Argentina';
|
||||
} else if (lang.name === 'Español de Chile') {
|
||||
name = 'español de Chile';
|
||||
} else if (lang.name === 'Español de Colombia') {
|
||||
name = 'español de Colombia';
|
||||
} else if (lang.name === 'Español de México') {
|
||||
name = 'español de México';
|
||||
} else if (lang.name === 'es-PY') {
|
||||
name = 'español de Paraguayo';
|
||||
} else if (lang.name === 'Español de Paraguayo') {
|
||||
name = 'español de Paraguayo';
|
||||
} else if (lang.name === 'Español de Perú') {
|
||||
name = 'español de Perú';
|
||||
} else if (lang.name === 'Español de Puerto Rico') {
|
||||
name = 'español de Puerto Rico';
|
||||
} else if (lang.name === 'gl-ES') {
|
||||
name = 'Galego (España)';
|
||||
} else if (lang.name === 'oc') {
|
||||
name = 'Occitan';
|
||||
} else if (lang.name === 'ru-UA') {
|
||||
name = 'Русский (Украина)';
|
||||
} else if (lang.name === 'st') {
|
||||
name = 'Sãotomense';
|
||||
} else if (lang.name === 'uk-UA') {
|
||||
name = 'українська (Україна)';
|
||||
} else if (lang.name === '繁体中文(台湾)') {
|
||||
// Traditional Chinese (Taiwan)
|
||||
name = '繁體中文(台灣)';
|
||||
}
|
||||
return { tag, name };
|
||||
}).sort(function(a, b) {
|
||||
if (a.name === b.name) {
|
||||
return 0;
|
||||
} else {
|
||||
return a.name > b.name ? 1 : -1;
|
||||
}
|
||||
});
|
||||
return TAPi18n.getSupportedLanguages()
|
||||
.map(({ isoCode, name }) => ({ tag: isoCode, name }))
|
||||
.sort((a, b) => {
|
||||
if (a.name === b.name) {
|
||||
return 0;
|
||||
} else {
|
||||
return a.name > b.name ? 1 : -1;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
isCurrentLanguage() {
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
import { Blaze } from 'meteor/blaze';
|
||||
import { Session } from 'meteor/session';
|
||||
import moment from 'moment';
|
||||
|
||||
Blaze.registerHelper('currentBoard', () => {
|
||||
const ret = Utils.getCurrentBoard();
|
||||
return ret;
|
||||
|
@ -30,3 +34,9 @@ Blaze.registerHelper('isShowDesktopDragHandles', () =>
|
|||
Blaze.registerHelper('isMiniScreenOrShowDesktopDragHandles', () =>
|
||||
Utils.isMiniScreenOrShowDesktopDragHandles(),
|
||||
);
|
||||
|
||||
Blaze.registerHelper('moment', (...args) => {
|
||||
args.pop(); // hash
|
||||
const [date, format] = args;
|
||||
return moment(date).format(format);
|
||||
});
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
import Cards from '../../models/cards';
|
||||
import SessionData from '../../models/usersessiondata';
|
||||
import {QueryDebug} from "../../config/query-classes";
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
import moment from 'moment';
|
||||
|
||||
// Helper function to replace HH with H for 24 hours format, because H allows also single-digit hours
|
||||
function adjustedTimeFormat() {
|
||||
return moment
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import moment from 'moment';
|
||||
|
||||
// Filtered view manager
|
||||
// We define local filter objects for each different type of field (SetFilter,
|
||||
// RangeFilter, dateFilter, etc.). We then define a global `Filter` object whose
|
||||
|
@ -721,7 +723,7 @@ Filter = {
|
|||
isFilterActive = true;
|
||||
selectors.push(this.advanced._getMongoSelector());
|
||||
}
|
||||
|
||||
|
||||
if(isFilterActive) {
|
||||
return {
|
||||
$or: selectors,
|
||||
|
|
|
@ -1,27 +1,21 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
// We save the user language preference in the user profile, and use that to set
|
||||
// the language reactively. If the user is not connected we use the language
|
||||
// information provided by the browser, and default to english.
|
||||
|
||||
Meteor.startup(() => {
|
||||
TAPi18n.conf.i18n_files_route = Meteor._relativeToSiteRootUrl('/tap-i18n');
|
||||
const currentUser = Meteor.user();
|
||||
let language;
|
||||
if (currentUser) {
|
||||
language = currentUser.profile && currentUser.profile.language;
|
||||
}
|
||||
|
||||
if (!language) {
|
||||
if (navigator.languages) {
|
||||
language = navigator.languages[0];
|
||||
} else {
|
||||
language = navigator.language || navigator.userLanguage;
|
||||
}
|
||||
}
|
||||
|
||||
// Select first available language
|
||||
const [language] = [
|
||||
// User profile
|
||||
currentUser?.profile?.language,
|
||||
// Browser locale
|
||||
navigator.languages?.at(0),
|
||||
navigator.language,
|
||||
navigator.userLanguage,
|
||||
].filter(Boolean);
|
||||
if (language) {
|
||||
TAPi18n.setLanguage(language);
|
||||
// eslint-disable-next-line no-console
|
||||
// console.log('language set!');
|
||||
T9n.setLanguage(language);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
window.Popup = new (class {
|
||||
constructor() {
|
||||
// The template we use to render popups
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
const passwordField = AccountsTemplates.removeField('password');
|
||||
const emailField = AccountsTemplates.removeField('email');
|
||||
|
||||
|
@ -89,5 +90,3 @@ if (Meteor.isServer) {
|
|||
};
|
||||
});
|
||||
}
|
||||
|
||||
*/
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import moment from 'moment';
|
||||
import { TAPi18n } from '/imports/i18n';
|
||||
import {
|
||||
OPERATOR_ASSIGNEE,
|
||||
OPERATOR_BOARD,
|
||||
|
@ -46,7 +48,6 @@ import {
|
|||
PREDICATE_YEAR,
|
||||
} from './search-const';
|
||||
import Boards from '../models/boards';
|
||||
import moment from 'moment';
|
||||
|
||||
export class QueryDebug {
|
||||
predicate = null;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { TAPi18n } from '/imports/i18n';
|
||||
|
||||
let previousPath;
|
||||
FlowRouter.triggers.exit([
|
||||
({ path }) => {
|
||||
|
@ -7,7 +9,7 @@ FlowRouter.triggers.exit([
|
|||
|
||||
FlowRouter.route('/', {
|
||||
name: 'home',
|
||||
//triggersEnter: [qAccountsTemplates.ensureSignedIn],
|
||||
triggersEnter: [AccountsTemplates.ensureSignedIn],
|
||||
action() {
|
||||
Session.set('currentBoard', null);
|
||||
Session.set('currentList', null);
|
||||
|
@ -31,7 +33,7 @@ FlowRouter.route('/', {
|
|||
|
||||
FlowRouter.route('/public', {
|
||||
name: 'public',
|
||||
//triggersEnter: [AccountsTemplates.ensureSignedIn],
|
||||
triggersEnter: [AccountsTemplates.ensureSignedIn],
|
||||
action() {
|
||||
Session.set('currentBoard', null);
|
||||
Session.set('currentList', null);
|
||||
|
@ -150,7 +152,7 @@ FlowRouter.route('/b/templates', {
|
|||
|
||||
FlowRouter.route('/my-cards', {
|
||||
name: 'my-cards',
|
||||
//triggersEnter: [AccountsTemplates.ensureSignedIn],
|
||||
triggersEnter: [AccountsTemplates.ensureSignedIn],
|
||||
action() {
|
||||
Filter.reset();
|
||||
Session.set('sortBy', '');
|
||||
|
@ -170,7 +172,7 @@ FlowRouter.route('/my-cards', {
|
|||
|
||||
FlowRouter.route('/due-cards', {
|
||||
name: 'due-cards',
|
||||
//triggersEnter: [AccountsTemplates.ensureSignedIn],
|
||||
triggersEnter: [AccountsTemplates.ensureSignedIn],
|
||||
action() {
|
||||
Filter.reset();
|
||||
Session.set('sortBy', '');
|
||||
|
@ -190,7 +192,7 @@ FlowRouter.route('/due-cards', {
|
|||
|
||||
FlowRouter.route('/global-search', {
|
||||
name: 'global-search',
|
||||
//triggersEnter: [AccountsTemplates.ensureSignedIn],
|
||||
triggersEnter: [AccountsTemplates.ensureSignedIn],
|
||||
action() {
|
||||
Filter.reset();
|
||||
Session.set('sortBy', '');
|
||||
|
@ -236,7 +238,7 @@ FlowRouter.route('/broken-cards', {
|
|||
|
||||
FlowRouter.route('/import/:source', {
|
||||
name: 'import',
|
||||
//triggersEnter: [AccountsTemplates.ensureSignedIn],
|
||||
triggersEnter: [AccountsTemplates.ensureSignedIn],
|
||||
action(params) {
|
||||
if (Session.get('currentBoard')) {
|
||||
Session.set('fromBoard', Session.get('currentBoard'));
|
||||
|
@ -261,7 +263,7 @@ FlowRouter.route('/import/:source', {
|
|||
FlowRouter.route('/setting', {
|
||||
name: 'setting',
|
||||
triggersEnter: [
|
||||
//AccountsTemplates.ensureSignedIn,
|
||||
AccountsTemplates.ensureSignedIn,
|
||||
() => {
|
||||
Session.set('currentBoard', null);
|
||||
Session.set('currentList', null);
|
||||
|
@ -286,7 +288,7 @@ FlowRouter.route('/setting', {
|
|||
FlowRouter.route('/information', {
|
||||
name: 'information',
|
||||
triggersEnter: [
|
||||
//AccountsTemplates.ensureSignedIn,
|
||||
AccountsTemplates.ensureSignedIn,
|
||||
() => {
|
||||
Session.set('currentBoard', null);
|
||||
Session.set('currentList', null);
|
||||
|
@ -310,7 +312,7 @@ FlowRouter.route('/information', {
|
|||
FlowRouter.route('/people', {
|
||||
name: 'people',
|
||||
triggersEnter: [
|
||||
//AccountsTemplates.ensureSignedIn,
|
||||
AccountsTemplates.ensureSignedIn,
|
||||
() => {
|
||||
Session.set('currentBoard', null);
|
||||
Session.set('currentList', null);
|
||||
|
@ -334,7 +336,7 @@ FlowRouter.route('/people', {
|
|||
FlowRouter.route('/admin-reports', {
|
||||
name: 'admin-reports',
|
||||
triggersEnter: [
|
||||
//AccountsTemplates.ensureSignedIn,
|
||||
AccountsTemplates.ensureSignedIn,
|
||||
() => {
|
||||
Session.set('currentBoard', null);
|
||||
Session.set('currentList', null);
|
||||
|
|
63
imports/i18n/accounts.js
Normal file
63
imports/i18n/accounts.js
Normal file
|
@ -0,0 +1,63 @@
|
|||
// Load all useraccounts translations at once
|
||||
import { Tracker } from 'meteor/tracker';
|
||||
import { T9n } from 'meteor-accounts-t9n';
|
||||
import { TAPi18n } from './tap';
|
||||
|
||||
T9n.setTracker({ Tracker });
|
||||
|
||||
T9n.map('ar', require('meteor-accounts-t9n/build/ar').ar);
|
||||
T9n.map('ca', require('meteor-accounts-t9n/build/ca').ca);
|
||||
T9n.map('cs', require('meteor-accounts-t9n/build/cs').cs);
|
||||
T9n.map('da', require('meteor-accounts-t9n/build/da').da);
|
||||
T9n.map('de', require('meteor-accounts-t9n/build/de').de);
|
||||
T9n.map('el', require('meteor-accounts-t9n/build/el').el);
|
||||
T9n.map('en', require('meteor-accounts-t9n/build/en').en);
|
||||
T9n.map('es', require('meteor-accounts-t9n/build/es').es);
|
||||
T9n.map('es-ES', require('meteor-accounts-t9n/build/es_ES').es_ES);
|
||||
T9n.map('es-ES-formal', require('meteor-accounts-t9n/build/es_ES_formal').es_ES_formal);
|
||||
T9n.map('es-formal', require('meteor-accounts-t9n/build/es_formal').es_formal);
|
||||
T9n.map('et', require('meteor-accounts-t9n/build/et').et);
|
||||
T9n.map('fa', require('meteor-accounts-t9n/build/fa').fa);
|
||||
T9n.map('fi', require('meteor-accounts-t9n/build/fi').fi);
|
||||
T9n.map('fr', require('meteor-accounts-t9n/build/fr').fr);
|
||||
T9n.map('fr-CA', require('meteor-accounts-t9n/build/fr_CA').fr_CA);
|
||||
T9n.map('he', require('meteor-accounts-t9n/build/he').he);
|
||||
T9n.map('hr', require('meteor-accounts-t9n/build/hr').hr);
|
||||
T9n.map('hu', require('meteor-accounts-t9n/build/hu').hu);
|
||||
T9n.map('id', require('meteor-accounts-t9n/build/id').id);
|
||||
T9n.map('it', require('meteor-accounts-t9n/build/it').it);
|
||||
T9n.map('ja', require('meteor-accounts-t9n/build/ja').ja);
|
||||
T9n.map('kh', require('meteor-accounts-t9n/build/kh').kh);
|
||||
T9n.map('ko', require('meteor-accounts-t9n/build/ko').ko);
|
||||
T9n.map('nl', require('meteor-accounts-t9n/build/nl').nl);
|
||||
T9n.map('no-NB', require('meteor-accounts-t9n/build/no_NB').no_NB);
|
||||
T9n.map('pl', require('meteor-accounts-t9n/build/pl').pl);
|
||||
T9n.map('pt', require('meteor-accounts-t9n/build/pt').pt);
|
||||
T9n.map('pt-PT', require('meteor-accounts-t9n/build/pt_PT').pt_PT);
|
||||
T9n.map('ro', require('meteor-accounts-t9n/build/ro').ro);
|
||||
T9n.map('ru', require('meteor-accounts-t9n/build/ru').ru);
|
||||
T9n.map('sk', require('meteor-accounts-t9n/build/sk').sk);
|
||||
T9n.map('sl', require('meteor-accounts-t9n/build/sl').sl);
|
||||
T9n.map('sv', require('meteor-accounts-t9n/build/sv').sv);
|
||||
T9n.map('th', require('meteor-accounts-t9n/build/th').th);
|
||||
T9n.map('tr', require('meteor-accounts-t9n/build/tr').tr);
|
||||
T9n.map('uk', require('meteor-accounts-t9n/build/uk').uk);
|
||||
T9n.map('vi', require('meteor-accounts-t9n/build/vi').vi);
|
||||
T9n.map('zh-CN', require('meteor-accounts-t9n/build/zh_CN').zh_CN);
|
||||
T9n.map('zh-HK', require('meteor-accounts-t9n/build/zh_HK').zh_HK);
|
||||
T9n.map('zh-TW', require('meteor-accounts-t9n/build/zh_TW').zh_TW);
|
||||
|
||||
// Reactively adjust useraccounts:core translations
|
||||
Tracker.autorun(() => {
|
||||
const language = TAPi18n.getLanguage();
|
||||
try {
|
||||
T9n.setLanguage(language);
|
||||
} catch (err) {
|
||||
// Try to extract & set the language part only (e.g. "en" instead of "en-UK")
|
||||
try {
|
||||
T9n.setLanguage(language.split('-')[0]);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
});
|
8
imports/i18n/blaze.js
Normal file
8
imports/i18n/blaze.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { Blaze } from 'meteor/blaze';
|
||||
import { TAPi18n } from './tap';
|
||||
|
||||
Blaze.registerHelper('_', (...args) => {
|
||||
const { hash } = args.pop();
|
||||
const [key] = args.splice(0, 1);
|
||||
return TAPi18n.__(key, { ...hash, sprintf: args });
|
||||
});
|
1148
imports/i18n/data/el.i18n.json
Normal file
1148
imports/i18n/data/el.i18n.json
Normal file
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue