language updates

This commit is contained in:
Andy Miller
2018-10-24 14:46:24 -06:00
parent 6919d9437a
commit 442a63b0e7
5 changed files with 982 additions and 207 deletions

View File

@@ -760,7 +760,6 @@ class AdminPlugin extends Plugin
$separator = (end($strings) === $string) ? '' : ',';
$translations .= '"' . $string . '": "' . $this->admin->translate('PLUGIN_FORM.' . $string) . '"' . $separator;
}
$translations .= '};';
$translations .= 'this.GravAdmin.translations.GRAV_CORE = {';
@@ -787,15 +786,14 @@ class AdminPlugin extends Plugin
'CRON.ERROR1',
'CRON.ERROR2',
'CRON.ERROR3',
'CRON.ERROR4'
'CRON.ERROR4',
'MONTHS_OF_THE_YEAR',
'DAYS_OF_THE_WEEK'
];
foreach ($strings as $string) {
$separator = (end($strings) === $string) ? '' : ',';
$translations .= '"' . $string . '": ' . json_encode($this->admin->translate($string)) . $separator;
$translations .= '"' . $string . '": ' . json_encode($this->admin->translate('GRAV.'.$string)) . $separator;
}
$translations .= ",'MONTHS_OF_THE_YEAR': ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],";
$translations .= "'DAYS_OF_THE_WEEK': ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']";
$translations .= '};';
// set the actual translations state back

View File

@@ -94,7 +94,7 @@ class AdminTwigExtension extends \Twig_Extension
public function adminNicetimeFilter($date, $long_strings = true)
{
if (empty($date)) {
return $this->grav['admin']->translate('NICETIME.NO_DATE_PROVIDED', null, true);
return $this->grav['admin']->translate('GRAV.NICETIME.NO_DATE_PROVIDED', null, true);
}
if ($long_strings) {
@@ -134,17 +134,17 @@ class AdminTwigExtension extends \Twig_Extension
// check validity of date
if (empty($unix_date)) {
return $this->grav['admin']->translate('NICETIME.BAD_DATE', null, true);
return $this->grav['admin']->translate('GRAV.NICETIME.BAD_DATE', null, true);
}
// is it future date or past date
if ($now > $unix_date) {
$difference = $now - $unix_date;
$tense = $this->grav['admin']->translate('NICETIME.AGO', null, true);
$tense = $this->grav['admin']->translate('GRAV.NICETIME.AGO', null, true);
} else {
$difference = $unix_date - $now;
$tense = $this->grav['admin']->translate('NICETIME.FROM_NOW', null, true);
$tense = $this->grav['admin']->translate('GRAV.NICETIME.FROM_NOW', null, true);
}
$len = count($lengths) - 1;
@@ -166,7 +166,7 @@ class AdminTwigExtension extends \Twig_Extension
}
}
$periods[$j] = $this->grav['admin']->translate($periods[$j], null, true);
$periods[$j] = $this->grav['admin']->translate('GRAV.'.$periods[$j], null, true);
return "{$difference} {$periods[$j]} {$tense}";
}

View File

@@ -38,31 +38,31 @@ export default class CronField {
},
texts: {
en: {
empty: translations.GRAV_CORE['CRON.EVERY'],
empty_minutes: translations.GRAV_CORE['CRON.EVERY'],
empty_time_hours: translations.GRAV_CORE['CRON.EVERY_HOUR'],
empty_time_minutes: translations.GRAV_CORE['CRON.EVERY_MINUTE'],
empty_day_of_week: translations.GRAV_CORE['CRON.EVERY_DAY_OF_WEEK'],
empty_day_of_month: translations.GRAV_CORE['CRON.EVERY_DAY_OF_MONTH'],
empty_month: translations.GRAV_CORE['CRON.EVERY_MONTH'],
empty: translations.GRAV_CORE['GRAV.CRON.EVERY'],
empty_minutes: translations.GRAV_CORE['GRAV.CRON.EVERY'],
empty_time_hours: translations.GRAV_CORE['GRAV.CRON.EVERY_HOUR'],
empty_time_minutes: translations.GRAV_CORE['GRAV.CRON.EVERY_MINUTE'],
empty_day_of_week: translations.GRAV_CORE['GRAV.CRON.EVERY_DAY_OF_WEEK'],
empty_day_of_month: translations.GRAV_CORE['GRAV.CRON.EVERY_DAY_OF_MONTH'],
empty_month: translations.GRAV_CORE['GRAV.CRON.EVERY_MONTH'],
name_minute: translations.GRAV_CORE['NICETIME.MINUTE'],
name_hour: translations.GRAV_CORE['NICETIME.HOUR'],
name_day: translations.GRAV_CORE['NICETIME.DAY'],
name_week: translations.GRAV_CORE['NICETIME.WEEK'],
name_month: translations.GRAV_CORE['NICETIME.MONTH'],
name_year: translations.GRAV_CORE['NICETIME.YEAR'],
text_period: translations.GRAV_CORE['CRON.TEXT_PERIOD'],
text_mins: translations.GRAV_CORE['CRON.TEXT_MINS'],
text_time: translations.GRAV_CORE['CRON.TEXT_TIME'],
text_dow: translations.GRAV_CORE['CRON.TEXT_DOW'],
text_month: translations.GRAV_CORE['CRON.TEXT_MONTH'],
text_dom: translations.GRAV_CORE['CRON.TEXT_DOM'],
error1: translations.GRAV_CORE['CRON.ERROR1'],
error2: translations.GRAV_CORE['CRON.ERROR2'],
error3: translations.GRAV_CORE['CRON.ERROR3'],
error4: translations.GRAV_CORE['CRON.ERROR4'],
weekdays: translations.GRAV_CORE['DAYS_OF_THE_WEEK'],
months: translations.GRAV_CORE['MONTHS_OF_THE_YEAR']
text_period: translations.GRAV_CORE['GRAV.CRON.TEXT_PERIOD'],
text_mins: translations.GRAV_CORE['GRAV.CRON.TEXT_MINS'],
text_time: translations.GRAV_CORE['GRAV.CRON.TEXT_TIME'],
text_dow: translations.GRAV_CORE['GRAV.CRON.TEXT_DOW'],
text_month: translations.GRAV_CORE['GRAV.CRON.TEXT_MONTH'],
text_dom: translations.GRAV_CORE['GRAV.CRON.TEXT_DOM'],
error1: translations.GRAV_CORE['GRAV.CRON.ERROR1'],
error2: translations.GRAV_CORE['GRAV.CRON.ERROR2'],
error3: translations.GRAV_CORE['GRAV.CRON.ERROR3'],
error4: translations.GRAV_CORE['GRAV.CRON.ERROR4'],
weekdays: translations.GRAV_CORE['GRAV.DAYS_OF_THE_WEEK'],
months: translations.GRAV_CORE['GRAV.MONTHS_OF_THE_YEAR']
}
}
});

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff