From fc4d8ed7b22a20b0d9f38d267580a6c76bd945cb Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Wed, 6 Oct 2021 18:15:02 +0200 Subject: [PATCH] include words for relativetime --- bl-kernel/page.class.php | 18 ++++++++++-------- bl-languages/en.json | 8 +++++++- bl-languages/es.json | 29 ++++++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 12 deletions(-) diff --git a/bl-kernel/page.class.php b/bl-kernel/page.class.php index 437ffdde..20cc26c6 100644 --- a/bl-kernel/page.class.php +++ b/bl-kernel/page.class.php @@ -652,6 +652,8 @@ class Page { */ public function relativeTime(bool $complete=false): string { + global $language; + $current = new DateTime; $past = new DateTime($this->getValue('dateRaw')); $elapsed = $current->diff($past); @@ -660,13 +662,13 @@ class Page { $elapsed->d -= $elapsed->w * 7; $string = array( - 'y' => 'year', - 'm' => 'month', - 'w' => 'week', - 'd' => 'day', - 'h' => 'hour', - 'i' => 'minute', - 's' => 'second', + 'y' => $language->g('year'), + 'm' => $language->g('month'), + 'w' => $language->g('week'), + 'd' => $language->g('day'), + 'h' => $language->g('hour'), + 'i' => $language->g('minute'), + 's' => $language->g('second') ); foreach ($string as $key => &$value) { @@ -681,7 +683,7 @@ class Page { $string = array_slice($string, 0 , 1); } - return $string ? implode(', ', $string) . ' ago' : 'Just now'; + return $string ? implode(', ', $string) . ' '.$language->g('ago') : $language->g('Just now'); } } diff --git a/bl-languages/en.json b/bl-languages/en.json index cf07f4c7..060bed9b 100644 --- a/bl-languages/en.json +++ b/bl-languages/en.json @@ -398,5 +398,11 @@ "insert-file": "Insert file", "insert-original-size": "Insert original size", "insert-small-size": "Insert small size", - "insert-medium-size": "Insert medium size" + "insert-medium-size": "Insert medium size", + "year": "year", + "month": "month", + "week": "week", + "day": "day", + "hour": "hour", + "second": "second" } diff --git a/bl-languages/es.json b/bl-languages/es.json index 03767612..2c76e776 100644 --- a/bl-languages/es.json +++ b/bl-languages/es.json @@ -291,7 +291,6 @@ "extreme-friendly-url": "URL amistosas", "title-formats": "Formatos de los títulos", "delete-content": "Eliminar contenido", - "are-you-sure-you-want-to-delete-this-page": "¿Confirma que desea eliminar esta página?", "sticky": "Sticky", "actions": "Acciones", "edit": "Editar", @@ -314,7 +313,6 @@ "uncategorized": "Sin categoría", "done": "Hecho", "delete-category": "Eliminar categoría", - "are-you-sure-you-want-to-delete-this-category?": "¿Confirma que desea eliminar esta categoría?", "confirm-new-password": "Confirmar nueva contraseña", "the-nickname-is-almost-used-in-the-themes-to-display-the-author-of-the-content": "El apodo casi siempre es utilizado en los temas para mostrar el autor del contenido.", "allow-unicode": "Permitir Unicode", @@ -376,5 +374,30 @@ "custom-fields": "Campos personalizados", "define-custom-fields-for-the-content": "Defina campos personalizados para el contenido. Obtenga más información acerca de los campos personalizados en la documentación<\/a>.", "start-typing-to-see-a-list-of-suggestions": "Comience a escribir para ver una lista de sugerencias.", - "view": "Ver" + "view": "Ver", + "confirm": "Confirm", + "current-password": "Current password", + "are-you-sure-you-want-to-disable-this-user": "Are you sure you want to disable this user?", + "are-you-sure-you-want-to-delete-the-profile-picture": "Are you sure you want to delete the profile picture?", + "are-you-sure-you-want-to-delete-the-site-logo": "Are you sure you want to delete the site logo?", + "are-you-sure-you-want-to-delete-this-user": "Are you sure you want to delete this user?", + "are-you-sure-you-want-to-delete-this-page": "¿Confirma que desea eliminar esta página?", + "are-you-sure-you-want-to-delete-this-category": "¿Confirma que desea eliminar esta categoría?", + "are-you-sure-you-want-to-change-the-password": "Are you sure you want to change the password?", + "website-plugins": "Website plugins", + "dashboard-plugins": "Dashboard plugins", + "powered-by-bludit": "Powered by Bludit", + "build-number": "Build Number", + "disk-usage": "Disk usage", + "standard": "Standard", + "insert-file": "Insert file", + "insert-original-size": "Insert original size", + "insert-small-size": "Insert small size", + "insert-medium-size": "Insert medium size", + "year": "año", + "month": "mes", + "week": "semana", + "day": "dia", + "hour": "horas", + "second": "segundos" } \ No newline at end of file