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 = []; const tree = [];
for (const rule of rules) { for (const rule of rules) {
const ruleTypeSettings = ruleHelpers.getRuleTypeSettings(rule); 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({ tree.push({
rule, rule,

View file

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

View file

@ -500,6 +500,7 @@
"importName-1": "Import \"{{name}}\"", "importName-1": "Import \"{{name}}\"",
"run": "Run", "run": "Run",
"customFormsName": "Custom Forms \"{{name}}\"", "customFormsName": "Custom Forms \"{{name}}\"",
"newRule": "New rule",
"segmentSaved": "Segment saved", "segmentSaved": "Segment saved",
"deletingSegment": "Deleting segment ...", "deletingSegment": "Deleting segment ...",
"segmentDeleted": "Segment deleted", "segmentDeleted": "Segment deleted",
@ -543,7 +544,6 @@
"valueInColumnColNameIsGreaterThanValue": "Value in column \"{{colName}}\" is greater than {{value}}", "valueInColumnColNameIsGreaterThanValue": "Value in column \"{{colName}}\" is greater than {{value}}",
"greaterThanOrEqualTo": "Greater than or equal to", "greaterThanOrEqualTo": "Greater than or equal to",
"valueInColumnColNameIsGreaterThanOrEqual": "Value in column \"{{colName}}\" is greater than or equal to {{value}}", "valueInColumnColNameIsGreaterThanOrEqual": "Value in column \"{{colName}}\" is greater than or equal to {{value}}",
"dateInColumnColName": "Date in column \"{{colName}}\" ",
"on": "On", "on": "On",
"dateInColumnColNameIsValue": "Date in column \"{{colName}}\" is {{value}}", "dateInColumnColNameIsValue": "Date in column \"{{colName}}\" is {{value}}",
"before": "Before", "before": "Before",
@ -555,10 +555,23 @@
"afterOrOn": "After or on", "afterOrOn": "After or on",
"dateInColumnColNameIsAfterOrOnValue": "Date in column \"{{colName}}\" is after or on {{value}}", "dateInColumnColNameIsAfterOrOnValue": "Date in column \"{{colName}}\" is after or on {{value}}",
"onXthDayBeforeafterCurrentDate": "On x-th day before/after current date", "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", "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", "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", "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", "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", "isSelected": "Is selected",
"valueInColumnColNameIsSelected": "Value in column \"{{colName}}\" is selected", "valueInColumnColNameIsSelected": "Value in column \"{{colName}}\" is selected",
"isNotSelected": "Is not selected", "isNotSelected": "Is not selected",
@ -860,12 +873,6 @@
"foundAddedMessagesNewCampaignMessages": "Found {{addedMessages}} new campaign messages from feed {{campaignId}}", "foundAddedMessagesNewCampaignMessages": "Found {{addedMessages}} new campaign messages from feed {{campaignId}}",
"foundNothingNewFromTheFeed": "Found nothing new from the feed", "foundNothingNewFromTheFeed": "Found nothing new from the feed",
"missingEmail": "Missing email", "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", "thePasswordMustBeAtLeastMinLength": "The password must be at least {{ minLength }} characters long",
"thePasswordMustBeFewerThanMaxLength": "The password must be fewer than {{ maxLength }} characters", "thePasswordMustBeFewerThanMaxLength": "The password must be fewer than {{ maxLength }} characters",
"thePasswordMayNotContainSequencesOfThree": "The password may not contain sequences of three or more repeated characters", "thePasswordMayNotContainSequencesOfThree": "The password may not contain sequences of three or more repeated characters",