$.validator.addMethod('phoneFR', function(phone_number, element) { phone_number = phone_number.replace(/\(|\)|\s+|-/g, ''); return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(?:(?:(?:00\s?|\+)33\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/); }, i18next.t('Please enter a valid phone number'));
const Simple = () => ( <div> <h4>Simple Component</h4> <Sections t={i18next.t.bind(i18next)} /> </div> )
afterSetData(args) { const occupant = args[0]; $(domSelector + ' #occupantNameLabel').html(i18next.t('\'s documents', {name:occupant.name})); }
_companyChanged($select) { var selection = $select.find(':selected').val(); if (selection === 'true') { $('#occupant-form .private-fields').hide(); $('#occupant-form .js-company-fields').show(); $('#occupant-form #manager-label').html(i18next.t('Effective manager (first and last name)')); } else { $('#occupant-form .js-company-fields').hide(); $('#occupant-form .private-fields').show(); $('#occupant-form #manager-label').html(i18next.t('First and last name')); } }
// ISO2 to country name mappings export function co(ISO2) { return i18next.t(`countries:${ISO2}`); }
// Method helpers static get _Intl() { return { NumberFormat: new Intl.NumberFormat(i18next.language, { style: 'decimal', minimumFractionDigits: 2, maximumFractionDigits: 2 }), NumberFormatPercent: new Intl.NumberFormat(i18next.language, { style: 'percent', minimumFractionDigits: 2, maximumFractionDigits: 2 }), NumberFormatCurrency: new Intl.NumberFormat(i18next.language, { style: 'currency', currency: i18next.t('__currency_code') }) }; }
Handlebars.registerHelper('paymentBadgeStatus', function() { var html = ''; if (this.status === 'paid') { html = '<span class="label label-success" data-toggle="tooltip" data-placement="bottom" title="'+i18next.t('Paid')+'"><i class="fa fa-check"></i> '+moment.monthsShort()[parseInt(this.month, 10)-1].toUpperCase()+'</span>'; } else if (this.status === 'partialypaid') { html = '<span class="label label-warning" data-toggle="tooltip" data-placement="bottom" title="'+i18next.t('Partially paid')+'"><i class="fa fa-exclamation-triangle"></i> '+moment.monthsShort()[parseInt(this.month, 10)-1].toUpperCase()+'</span>'; } else if (this.status === 'notpaid') { html = '<span class="label label-danger" data-toggle="tooltip" data-placement="bottom" title="'+i18next.t('Not paid')+'"><i class="fa fa-exclamation-triangle"></i> '+moment.monthsShort()[parseInt(this.month, 10)-1].toUpperCase()+'</span>'; } return new Handlebars.SafeString(html); });
install (Vue) { Vue.prototype.$i18nUserLanguage = language Vue.prototype.$t = (...args) => i18next.t(...args) }
Handlebars.registerHelper('paymentType', function(paymentType) { if (this.type) { paymentType = this.type; } if (paymentType === 'cheque') { return new Handlebars.SafeString(i18next.t('cheque')); } if (paymentType === 'cash') { return new Handlebars.SafeString(i18next.t('cash')); } if (paymentType === 'levy') { return new Handlebars.SafeString(i18next.t('levy')); } if (paymentType === 'transfer') { return new Handlebars.SafeString(i18next.t('transfer')); } return new Handlebars.SafeString(i18next.t('unknown')); });
afterSetData(args) { const property = args[0]; if (property && property._id) { $(domSelector + ' #propertyNameLabel').html(property.name); $('.js-user-action[data-id="list-action-remove-property"]').show(); } else { $(domSelector + ' #propertyNameLabel').html(i18next.t('Property to rent')); $('.js-user-action[data-id="list-action-remove-property"]').hide(); } this._typeChanged($(domSelector + ' #type')); this._computeRent(); }
Handlebars.registerHelper('paymentStatus', function() { var html = ''; if (this.status === 'paid') { html = i18next.t('Paid'); } else if (this.status === 'notpaid') { html = i18next.t('Not paid'); } else if (this.status === 'partialypaid') { html = i18next.t('Partially paid'); } return new Handlebars.SafeString(html); });
Handlebars.registerHelper('propertyName', function(propertyType) { if (this.type) { propertyType = this.type; } if (propertyType === 'office') { return new Handlebars.SafeString(i18next.t('Room')); } if (propertyType === 'parking') { return new Handlebars.SafeString(i18next.t('Car park')); } if (propertyType === 'letterbox') { return new Handlebars.SafeString(i18next.t('Letterbox')); } return new Handlebars.SafeString(i18next.t('unknown')); });
// Standard text string translations export function t(...args) { return i18next.t(...args); }
// ISO2 to currencies mappings export function cu(ISO2) { return i18next.t(`currencies:${ISO2}`); }
// Links and URLS export function l(link) { return i18next.t(`links:${link}`); }