Updates in localization

This commit is contained in:
Tomas Bures 2018-11-21 01:46:57 +03:00
parent b37ad9863c
commit 9f9cbc4c2b
3 changed files with 31 additions and 23 deletions

View file

@ -92,7 +92,7 @@ export default class CUD extends Component {
const tree = [];
for (const rule of rules) {
const ruleTypeSettings = ruleHelpers.getRuleTypeSettings(rule);
const title = ruleTypeSettings ? ruleTypeSettings.treeLabel(rule) : this.props.t('New rule');
const title = ruleTypeSettings ? ruleTypeSettings.treeLabel(rule) : this.props.t('newRule');
tree.push({
rule,

View file

@ -95,6 +95,7 @@ export function getRuleHelpers(t, fields) {
}
};
// FXIME - the localization here is still wrong
function getRelativeDateTreeLabel(rule, textFragment) {
if (rule.value === 0) {
return t(/*ignore*/'Date in column ' + textFragment + ' the current date', {colName: ruleHelpers.getColumnName(rule.column)})
@ -129,45 +130,45 @@ export function getRuleHelpers(t, fields) {
eqTodayPlusDays: {
dropdownLabel: t('onXthDayBeforeafterCurrentDate'),
/*
tMark('Date in column is the current date')
tMark('Date in column is {{value}}-th day after the current date')
tMark('Date in column is {{value}}-th day before the current date')
tMark('dateInColumnIsTheCurrentDate')
tMark('dateInColumnIsValuethDayAfterTheCurrent')
tMark('dateInColumnIsValuethDayBeforeTheCurrent')
*/
treeLabel: rule => getRelativeDateTreeLabel(rule, 'is'),
},
ltTodayPlusDays: {
dropdownLabel: t('beforeXthDayBeforeafterCurrentDate'),
/*
tMark('Date in column is before the current date')
tMark('Date in column is before {{value}}-th day after the current date')
tMark('Date in column is before {{value}}-th day before the current date')
tMark('dateInColumnIsBeforeTheCurrentDate')
tMark('dateInColumnIsBeforeValuethDayAfterThe')
tMark('dateInColumnIsBeforeValuethDayBeforeThe')
*/
treeLabel: rule => getRelativeDateTreeLabel(rule, 'is before'),
},
leTodayPlusDays: {
dropdownLabel: t('beforeOrOnXthDayBeforeafterCurrentDate'),
/*
tMark('Date in column is before or on the current date')
tMark('Date in column is before or on {{value}}-th day after the current date')
tMark('Date in column is before or on {{value}}-th day before the current date')
tMark('dateInColumnIsBeforeOrOnTheCurrentDate')
tMark('dateInColumnIsBeforeOrOnValuethDayAfter')
tMark('dateInColumnIsBeforeOrOnValuethDayBefore')
*/
treeLabel: rule => getRelativeDateTreeLabel(rule, 'is before or on'),
},
gtTodayPlusDays: {
dropdownLabel: t('afterXthDayBeforeafterCurrentDate'),
/*
tMark('Date in column is after the current date')
tMark('Date in column is after {{value}}-th day after the current date')
tMark('Date in column is after {{value}}-th day after the current date')
tMark('dateInColumnIsAfterTheCurrentDate')
tMark('dateInColumnIsAfterValuethDayAfterThe')
tMark('dateInColumnIsAfterValuethDayAfterThe')
*/
treeLabel: rule => getRelativeDateTreeLabel(rule, 'is after'),
},
geTodayPlusDays: {
dropdownLabel: t('afterOrOnXthDayBeforeafterCurrentDate'),
/*
tMark('Date in column is after or on the current date')
tMark('Date in column is after or on {{value}}-th day after the current date')
tMark('Date in column is after or on {{value}}-th day after the current date')
tMark('dateInColumnIsAfterOrOnTheCurrentDate')
tMark('dateInColumnIsAfterOrOnValuethDayAfter')
tMark('dateInColumnIsAfterOrOnValuethDayAfter')
*/
treeLabel: rule => getRelativeDateTreeLabel(rule, 'is after or on'),
}

View file

@ -500,6 +500,7 @@
"importName-1": "Import \"{{name}}\"",
"run": "Run",
"customFormsName": "Custom Forms \"{{name}}\"",
"newRule": "New rule",
"segmentSaved": "Segment saved",
"deletingSegment": "Deleting segment ...",
"segmentDeleted": "Segment deleted",
@ -543,7 +544,6 @@
"valueInColumnColNameIsGreaterThanValue": "Value in column \"{{colName}}\" is greater than {{value}}",
"greaterThanOrEqualTo": "Greater than or equal to",
"valueInColumnColNameIsGreaterThanOrEqual": "Value in column \"{{colName}}\" is greater than or equal to {{value}}",
"dateInColumnColName": "Date in column \"{{colName}}\" ",
"on": "On",
"dateInColumnColNameIsValue": "Date in column \"{{colName}}\" is {{value}}",
"before": "Before",
@ -555,10 +555,23 @@
"afterOrOn": "After or on",
"dateInColumnColNameIsAfterOrOnValue": "Date in column \"{{colName}}\" is after or on {{value}}",
"onXthDayBeforeafterCurrentDate": "On x-th day before/after current date",
"dateInColumnIsTheCurrentDate": "Date in column is the current date",
"dateInColumnIsValuethDayAfterTheCurrent": "Date in column is {{value}}-th day after the current date",
"dateInColumnIsValuethDayBeforeTheCurrent": "Date in column is {{value}}-th day before the current date",
"beforeXthDayBeforeafterCurrentDate": "Before x-th day before/after current date",
"dateInColumnIsBeforeTheCurrentDate": "Date in column is before the current date",
"dateInColumnIsBeforeValuethDayAfterThe": "Date in column is before {{value}}-th day after the current date",
"dateInColumnIsBeforeValuethDayBeforeThe": "Date in column is before {{value}}-th day before the current date",
"beforeOrOnXthDayBeforeafterCurrentDate": "Before or on x-th day before/after current date",
"dateInColumnIsBeforeOrOnTheCurrentDate": "Date in column is before or on the current date",
"dateInColumnIsBeforeOrOnValuethDayAfter": "Date in column is before or on {{value}}-th day after the current date",
"dateInColumnIsBeforeOrOnValuethDayBefore": "Date in column is before or on {{value}}-th day before the current date",
"afterXthDayBeforeafterCurrentDate": "After x-th day before/after current date",
"dateInColumnIsAfterTheCurrentDate": "Date in column is after the current date",
"dateInColumnIsAfterValuethDayAfterThe": "Date in column is after {{value}}-th day after the current date",
"afterOrOnXthDayBeforeafterCurrentDate": "After or on x-th day before/after current date",
"dateInColumnIsAfterOrOnTheCurrentDate": "Date in column is after or on the current date",
"dateInColumnIsAfterOrOnValuethDayAfter": "Date in column is after or on {{value}}-th day after the current date",
"isSelected": "Is selected",
"valueInColumnColNameIsSelected": "Value in column \"{{colName}}\" is selected",
"isNotSelected": "Is not selected",
@ -860,12 +873,6 @@
"foundAddedMessagesNewCampaignMessages": "Found {{addedMessages}} new campaign messages from feed {{campaignId}}",
"foundNothingNewFromTheFeed": "Found nothing new from the feed",
"missingEmail": "Missing email",
"en": "EN",
"english": "English",
"es": "ES",
"spanish": "Spanish",
"fake": "FAKE",
"fake-1": "Fake",
"thePasswordMustBeAtLeastMinLength": "The password must be at least {{ minLength }} characters long",
"thePasswordMustBeFewerThanMaxLength": "The password must be fewer than {{ maxLength }} characters",
"thePasswordMayNotContainSequencesOfThree": "The password may not contain sequences of three or more repeated characters",