diff --git a/.eslintignore b/.eslintignore index 5e8b92a1c90..54bd9d41efd 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,6 +7,7 @@ app/assets/javascripts/discourse/lib/autosize.js.es6 lib/javascripts/locale/ lib/javascripts/messageformat.js lib/javascripts/moment.js +lib/javascripts/moment-timezone-with-data.js lib/javascripts/moment_locale/ lib/highlight_js/ plugins/**/lib/javascripts/locale diff --git a/.gitignore b/.gitignore index 63fc931ed12..051211a4f3d 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ bootsnap-compile-cache/ !/plugins/discourse-nginx-performance-report !/plugins/discourse-narrative-bot !/plugins/discourse-presence +!/plugins/discourse-cronos /plugins/*/auto_generated/ /spec/fixtures/plugins/my_plugin/auto_generated diff --git a/lib/js_locale_helper.rb b/lib/js_locale_helper.rb index 09a41fd6439..24cd8d45fa8 100644 --- a/lib/js_locale_helper.rb +++ b/lib/js_locale_helper.rb @@ -151,6 +151,7 @@ module JsLocaleHelper # moment result << File.read("#{Rails.root}/lib/javascripts/moment.js") + result << File.read("#{Rails.root}/lib/javascripts/moment-timezone-with-data.js") result << moment_locale(locale_str) result << moment_formats diff --git a/lib/plugin/metadata.rb b/lib/plugin/metadata.rb index df61a5062b5..d6f7b64f548 100644 --- a/lib/plugin/metadata.rb +++ b/lib/plugin/metadata.rb @@ -39,7 +39,7 @@ class Plugin::Metadata "discourse-voting", "docker_manager", "discourse-signatures", - "discourse-chronos", + "discourse-cronos", "discourse-crowd", "discourse-footnote", "discourse-gradle-issue", diff --git a/plugins/discourse-cronos/assets/javascripts/discourse-cronos.js b/plugins/discourse-cronos/assets/javascripts/discourse-cronos.js new file mode 100644 index 00000000000..6ac50584e12 --- /dev/null +++ b/plugins/discourse-cronos/assets/javascripts/discourse-cronos.js @@ -0,0 +1,75 @@ +(function($) { + $.fn.cronos = function(repeat) { + function _formatTimezone(timezone) { + return timezone.replace("_", " ").split("/"); + } + + function processElement($element, options) { + repeat = repeat || true; + + if (this.timeout) { + clearTimeout(this.timeout); + } + + var relativeTime = moment.utc(options.date + " " + options.time, "YYYY-MM-DD HH:mm"); + + if (options.recurring && relativeTime < moment().utc()) { + var parts = options.recurring.split("."); + var count = parseInt(parts[0], 10); + var type = parts[1]; + var diff = moment().diff(relativeTime, type); + var add = Math.ceil(diff + count); + + relativeTime = relativeTime.add(add, type); + } + + var previews = options.timezones.split("|").map(function(timezone) { + var dateTime = relativeTime.tz(timezone).format(options.format); + var timezoneParts = _formatTimezone(timezone); + + if (dateTime.match(/TZ/)) { + return dateTime.replace("TZ", timezoneParts.join(": ")); + } else { + var output = timezoneParts[0]; + if (timezoneParts[1]) { + output += " (" + timezoneParts[1] + ")"; + } + output += " " + dateTime; + return output; + } + }); + + relativeTime = relativeTime.tz(moment.tz.guess()).format(options.format); + + var html = ""; + html += ""; + html += relativeTime.replace("TZ", _formatTimezone(moment.tz.guess()).join(": ")); + html += ""; + + $element + .html(html) + .attr("title", previews.join("\n")) + .attr("onclick", "alert('" + previews.join("\\n") + "');return false;") + .addClass("cooked"); + + if (repeat) { + this.timeout = setTimeout(function() { + processElement($element, options); + }, 10000); + } + } + + return this.each(function() { + var $this = $(this); + + var options = {}; + options.format = $this.attr("data-format"); + options.date = $this.attr("data-date"); + options.time = $this.attr("data-time"); + options.recurring = $this.attr("data-recurring"); + options.timezones = $this.attr("data-timezones") || "Etc/UTC"; + + processElement($this, options); + }); + }; +})(jQuery); diff --git a/plugins/discourse-cronos/assets/javascripts/discourse/components/discourse-cronos-create-form.js.es6 b/plugins/discourse-cronos/assets/javascripts/discourse/components/discourse-cronos-create-form.js.es6 new file mode 100644 index 00000000000..e7b61353526 --- /dev/null +++ b/plugins/discourse-cronos/assets/javascripts/discourse/components/discourse-cronos-create-form.js.es6 @@ -0,0 +1,117 @@ +import computed from "ember-addons/ember-computed-decorators"; +import { observes } from 'ember-addons/ember-computed-decorators'; + +export default Ember.Component.extend({ + timeFormat: "HH:mm", + dateFormat: "YYYY-MM-DD", + dateTimeFormat: "YYYY-MM-DD HH:mm", + config: null, + date: null, + time: null, + format: null, + formats: null, + recurring: null, + advancedMode: false, + + init() { + this._super(); + + this.set("date", moment().format(this.dateFormat)); + this.set("time", moment().format(this.timeFormat)); + this.set("format", `LLL`); + this.set("timezones", (this.siteSettings.discourse_cronos_default_timezones || "").split("|").filter(f => f)); + this.set("formats", (this.siteSettings.discourse_cronos_default_formats || "").split("|")); + }, + + didInsertElement() { + this._super(); + + this._setConfig(); + }, + + @computed + currentUserTimezone() { + return moment.tz.guess(); + }, + + @computed + recurringOptions() { + return [ + { name: "Every day", id: "1.days" }, + { name: "Every week", id: "1.weeks" }, + { name: "Every two weeks", id: "2.weeks" }, + { name: "Every month", id: "1.months" }, + { name: "Every two months", id: "2.months" }, + { name: "Every three months", id: "3.months" }, + { name: "Every six months", id: "6.months" }, + { name: "Every year", id: "1.years" }, + ]; + }, + + @computed() + allTimezones() { + return _.map(moment.tz.names(), (z) => z); + }, + + @observes("date", "time", "recurring", "format", "timezones") + _setConfig() { + const date = this.get("date"); + const time = this.get("time"); + const recurring = this.get("recurring"); + const format = this.get("format"); + const timezones = this.get("timezones"); + const dateTime = moment(`${date} ${time}`, this.dateTimeFormat).utc(); + + this.set("config", { + date: dateTime.format(this.dateFormat), + time: dateTime.format(this.timeFormat), + dateTime, + recurring, + format, + timezones, + }); + }, + + getTextConfig(config) { + let text = "[discourse-cronos "; + if (config.recurring) text += `recurring=${config.recurring};`; + text += `time=${config.time};`; + text += `date=${config.date};`; + text += `format=${config.format};`; + text += `timezones=${config.timezones.join("|")};`; + text += `]`; + return text; + }, + + @computed("config.dateTime") + validDate(dateTime) { + if (!dateTime) return false; + return dateTime.isValid(); + }, + + actions: { + advancedMode() { + this.toggleProperty("advancedMode"); + }, + + save() { + this._closeModal(); + + const textConfig = this.getTextConfig(this.get("config")); + this.get("toolbarEvent").addText(textConfig); + }, + + fillFormat(format) { + this.set("format", format); + }, + + cancel() { + this._closeModal(); + } + }, + + _closeModal() { + const composer = Discourse.__container__.lookup("controller:composer"); + composer.send("closeModal"); + } +}); diff --git a/plugins/discourse-cronos/assets/javascripts/discourse/templates/components/discourse-cronos-create-form.hbs b/plugins/discourse-cronos/assets/javascripts/discourse/templates/components/discourse-cronos-create-form.hbs new file mode 100644 index 00000000000..1ba16de2abd --- /dev/null +++ b/plugins/discourse-cronos/assets/javascripts/discourse/templates/components/discourse-cronos-create-form.hbs @@ -0,0 +1,77 @@ +{{#d-modal-body + title="discourse_cronos.create.modal_title" + class="discourse-cronos-create-modal" + style="overflow: auto"}} + +
+
+
+ {{date-picker-future class="date" value=date defaultDate="DD-MM-YYYY"}} + {{input type="time" value=time class="time"}} + {{currentUserTimezone}} +
+
+ +

{{i18n "discourse_cronos.create.form.recurring_title"}}

+
+ {{#if advancedMode}} + + {{/if}} +
+ {{combo-box content=recurringOptions value=recurring none="discourse_cronos.create.form.recurring_none"}} +
+
+ + {{d-button + class="advanced-mode-btn" + action=(action "advancedMode") + icon="cog" + label="discourse_cronos.create.form.advanced_mode"}} + + {{#if advancedMode}} +
+
+ +
+ {{text-field value=format}} +
+
+
+
    + {{#each formats as |format|}} +
  • + {{format}} +
  • + {{/each}} +
+
+ +

{{i18n "discourse_cronos.create.form.timezones_title"}}

+
+ +
+ {{multi-select allowAny=false maximum=5 content=allTimezones values=timezones}} +
+
+
+ {{/if}} +
+{{/d-modal-body}} + + diff --git a/plugins/discourse-cronos/assets/javascripts/discourse/templates/modal/discourse-cronos-create-modal.hbs b/plugins/discourse-cronos/assets/javascripts/discourse/templates/modal/discourse-cronos-create-modal.hbs new file mode 100644 index 00000000000..4c5b8309a29 --- /dev/null +++ b/plugins/discourse-cronos/assets/javascripts/discourse/templates/modal/discourse-cronos-create-modal.hbs @@ -0,0 +1 @@ +{{discourse-cronos-create-form config=config toolbarEvent=toolbarEvent}} diff --git a/plugins/discourse-cronos/assets/javascripts/initializers/discourse-cronos.js.es6 b/plugins/discourse-cronos/assets/javascripts/initializers/discourse-cronos.js.es6 new file mode 100644 index 00000000000..55be4ec55d4 --- /dev/null +++ b/plugins/discourse-cronos/assets/javascripts/initializers/discourse-cronos.js.es6 @@ -0,0 +1,37 @@ +import { withPluginApi } from "discourse/lib/plugin-api"; +import showModal from "discourse/lib/show-modal"; + +function initializeDiscourseCronos(api) { + api.decorateCooked($elem => { + $(".discourse-cronos", $elem).cronos(); + }); + + api.addToolbarPopupMenuOptionsCallback(() => { + return { + action: "insertDiscourseCronos", + icon: "globe", + label: "discourse_cronos.title" + }; + }); + + api.modifyClass('controller:composer', { + actions: { + insertDiscourseCronos() { + showModal("discourse-cronos-create-modal").setProperties({ + toolbarEvent: this.get("toolbarEvent") + }); + } + } + }); +} + +export default { + name: "discourse-cronos", + + initialize(container) { + const siteSettings = container.lookup("site-settings:main"); + if (siteSettings.discourse_cronos_enabled) { + withPluginApi("0.8.8", initializeDiscourseCronos); + } + } +}; diff --git a/plugins/discourse-cronos/assets/javascripts/lib/discourse-markdown/discourse-cronos.js.es6 b/plugins/discourse-cronos/assets/javascripts/lib/discourse-markdown/discourse-cronos.js.es6 new file mode 100644 index 00000000000..d7d306edd5c --- /dev/null +++ b/plugins/discourse-cronos/assets/javascripts/lib/discourse-markdown/discourse-cronos.js.es6 @@ -0,0 +1,76 @@ +import { registerOption } from 'pretty-text/pretty-text'; + +registerOption((siteSettings, opts) => { + opts.features['discourse-cronos'] = !!siteSettings.discourse_cronos_enabled; +}); + +function addcronos(buffer, matches, state) { + let token; + + let config = { + date: null, + time: null, + format: "YYYY-MM-DD HH:mm", + timezones: "" + }; + + const options = matches[1].split(";"); + options.forEach((option) => { + let o = option.split("="); + config[o[0]] = o[1]; + }); + + token = new state.Token('a_open', 'a', 1); + token.attrs = [ + ['class', 'discourse-cronos'], + ['data-date', config.date], + ['data-time', config.time], + ['data-recurring', config.recurring], + ['data-format', config.format], + ['data-timezones', config.timezones], + ]; + buffer.push(token); + + const previews = config.timezones.split("|").filter(t => t).map(timezone => { + const dateTime = moment + .utc(`${config.date} ${config.time}`, "YYYY-MM-DD HH:mm") + .tz(timezone) + .format(config.format); + + const formattedTimezone = timezone.replace("/", ": ").replace("_", " "); + + if (dateTime.match(/TZ/)) { + return dateTime.replace("TZ", formattedTimezone); + } else { + return `${dateTime} (${formattedTimezone})`; + } + }); + + token = new state.Token('text', '', 0); + token.content = previews.join(", "); + buffer.push(token); + + token = new state.Token('a_close', 'a', -1); + buffer.push(token); +} + +export function setup(helper) { + helper.whiteList([ + 'a.discourse-cronos', + 'a[data-*]', + 'a[title]' + ]); + + helper.registerOptions((opts, siteSettings) => { + opts.features['discourse-cronos'] = !!siteSettings.discourse_cronos_enabled; + }); + + helper.registerPlugin(md => { + const rule = { + matcher: /\[discourse-cronos (.*?)\]/, + onMatch: addcronos + }; + + md.core.textPostProcess.ruler.push('discourse-cronos', rule); + }); +} diff --git a/plugins/discourse-cronos/assets/stylesheets/discourse-cronos.scss b/plugins/discourse-cronos/assets/stylesheets/discourse-cronos.scss new file mode 100644 index 00000000000..64547d5584c --- /dev/null +++ b/plugins/discourse-cronos/assets/stylesheets/discourse-cronos.scss @@ -0,0 +1,83 @@ +.discourse-cronos { + display: inline-block; + vertical-align: top; + + &.cooked { + color: $primary; + font-weight: bold; + cursor: pointer; + + .d-icon-globe { + margin-right: .25em; + color: $primary-medium; + + &:hover { + color: $primary-high; + } + } + + &:hover .d-icon-globe { + color: $primary-high; + } + } + + + .discourse-cronos { + margin-left: .5em; + } +} + +.discourse-cronos-create-modal-footer { + display: flex; + align-items: center; + justify-content: space-between; + + .validation-error { + color: $danger; + } + + &:before, &:after { + content: none; + } +} + +.discourse-cronos-create-modal { + min-height: 300px; + display: flex; + flex-direction: row; + + .form { + flex: 1; + .controls { + &.date-time { + display: flex; + justify-content: flex-start; + align-items: center; + margin-bottom: 1em; + + .date { + margin: 0 0.5em 0 0; + } + + .date-picker { + padding-top: 5px; + bottom: 5px; + margin: 0; + } + + .time { + margin: 0 0.5em 0 0; + max-width: 100px; + } + } + } + + .advanced-mode-btn { + margin-top: 2em; + margin-bottom: 1em; + } + } + + .select-kit.multi-select { + width: 90%; + } +} diff --git a/plugins/discourse-cronos/bin/pull_translations.rb b/plugins/discourse-cronos/bin/pull_translations.rb new file mode 100755 index 00000000000..a4052d80105 --- /dev/null +++ b/plugins/discourse-cronos/bin/pull_translations.rb @@ -0,0 +1,8 @@ +#!/usr/bin/env ruby + +require 'translations_manager' + +YML_DIRS = ['config/locales'].map { |d| File.expand_path(d) } +YML_FILE_PREFIXES = ['client', 'server'] + +TranslationsManager::TransifexUpdater.new(YML_DIRS, YML_FILE_PREFIXES, *ARGV).perform diff --git a/plugins/discourse-cronos/config/locales/client.ar.yml b/plugins/discourse-cronos/config/locales/client.ar.yml new file mode 100644 index 00000000000..79ea4de8157 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.ar.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ar: {} diff --git a/plugins/discourse-cronos/config/locales/client.bs_BA.yml b/plugins/discourse-cronos/config/locales/client.bs_BA.yml new file mode 100644 index 00000000000..7b73cd2f229 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.bs_BA.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +bs_BA: {} diff --git a/plugins/discourse-cronos/config/locales/client.ca.yml b/plugins/discourse-cronos/config/locales/client.ca.yml new file mode 100644 index 00000000000..e155a119c24 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.ca.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ca: {} diff --git a/plugins/discourse-cronos/config/locales/client.cs.yml b/plugins/discourse-cronos/config/locales/client.cs.yml new file mode 100644 index 00000000000..c0f2fec763b --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.cs.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +cs: {} diff --git a/plugins/discourse-cronos/config/locales/client.da.yml b/plugins/discourse-cronos/config/locales/client.da.yml new file mode 100644 index 00000000000..9ca8189621d --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.da.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +da: {} diff --git a/plugins/discourse-cronos/config/locales/client.de.yml b/plugins/discourse-cronos/config/locales/client.de.yml new file mode 100644 index 00000000000..f53502010cf --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.de.yml @@ -0,0 +1,23 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +de: + js: + discourse_cronos: + title: Datum einfügen + create: + modal_title: Datum einfügen + form: + insert: Einfügen + advanced_mode: Erweiterter Modus + format_description: "Format für die Benutzeranzeige von Datumswerten. Verwende \"\\T\\Z\", um die Benutzerzeitzone in Worten darzustellen (Europe/Paris)" + timezones_title: Anzuzeigende Zeitzonen + timezones_description: Zeitzonen werden für die Anzeige von Datumswerten in der Zukunft und in der Vergangenheit verwendet. + recurring_title: Wiederholung + recurring_description: "Definiere die Wiederholung eines Ereignisses. Du kannst die Wiederholungsoptionen auch manuell bearbeiten, die vom Formular generiert wurden, und einen der folgenden Schlüssel verwenden: years, quarters, months, weeks, days, hours, minutes, seconds, milliseconds." + recurring_none: Keine Wiederholung + invalid_date: Ungültige Datumsangabe, stelle sicher, dass Datum und Zeit korrekt sind. diff --git a/plugins/discourse-cronos/config/locales/client.el.yml b/plugins/discourse-cronos/config/locales/client.el.yml new file mode 100644 index 00000000000..63bf4b0e2fe --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.el.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +el: {} diff --git a/plugins/discourse-cronos/config/locales/client.en.yml b/plugins/discourse-cronos/config/locales/client.en.yml new file mode 100644 index 00000000000..1344ab22875 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.en.yml @@ -0,0 +1,16 @@ +en: + js: + discourse_cronos: + title: Insert date + create: + modal_title: Insert date + form: + insert: Insert + advanced_mode: Advanced mode + format_description: "Format used to display the date to the user. Use \"\\T\\Z\" to display the user timezone in words (Europe/Paris)" + timezones_title: Timezones to display + timezones_description: Timezones will be used to display dates in preview and fallback. + recurring_title: Recurrence + recurring_description: "Define the recurrence of an event. You can also manually edit the recurring option generated by the form and use one of the following keys: years, quarters, months, weeks, days, hours, minutes, seconds, milliseconds." + recurring_none: No recurrence + invalid_date: Invalid date, make sure date and time are correct diff --git a/plugins/discourse-cronos/config/locales/client.es.yml b/plugins/discourse-cronos/config/locales/client.es.yml new file mode 100644 index 00000000000..a23f303ee88 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.es.yml @@ -0,0 +1,23 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +es: + js: + discourse_cronos: + title: Insertar fecha + create: + modal_title: Insertar fecha + form: + insert: Insertar + advanced_mode: Modo avanzado + format_description: "Formato usado para mostrarle la fecha al usuario. Usar \"\\T\\Z\" para mostrar la zona horaria del usuario con palabras (Europe/París)" + timezones_title: Zonas horarias a mostrar + timezones_description: Las zonas horarias serán usadas para mostrar fechas en previsualización y alternativa. + recurring_title: Recurrencia + recurring_description: "Define la recurrencia de un evento. También puedes editar manualmente la opción de recurrencia generada por el formulario y usar una de las siguientes opciones: years, quarters, months, weeks, days, hours, minutes, seconds, milliseconds." + recurring_none: Sin recurrencia + invalid_date: Fecha no válida, asegúrate de que la fecha y la hora son correctas diff --git a/plugins/discourse-cronos/config/locales/client.et.yml b/plugins/discourse-cronos/config/locales/client.et.yml new file mode 100644 index 00000000000..8c601aa1ed9 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.et.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +et: {} diff --git a/plugins/discourse-cronos/config/locales/client.fa_IR.yml b/plugins/discourse-cronos/config/locales/client.fa_IR.yml new file mode 100644 index 00000000000..07580f2d7d8 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.fa_IR.yml @@ -0,0 +1,13 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +fa_IR: + js: + discourse_cronos: + create: + form: + timezones_title: نمایش منطقه زمانی diff --git a/plugins/discourse-cronos/config/locales/client.fi.yml b/plugins/discourse-cronos/config/locales/client.fi.yml new file mode 100644 index 00000000000..b947adbbec6 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.fi.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +fi: {} diff --git a/plugins/discourse-cronos/config/locales/client.fr.yml b/plugins/discourse-cronos/config/locales/client.fr.yml new file mode 100644 index 00000000000..71c927457ab --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.fr.yml @@ -0,0 +1,22 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +fr: + js: + discourse_cronos: + title: Insérer date + create: + modal_title: Insérer date + form: + insert: Insérer + advanced_mode: Mode avancé + format_description: "Format utilisé pour afficher la date pour l'utilisateur. Utiliser \"\\T\\Z\" pour afficher le fuseaux horaire de l'utilisateur en toutes lettres (Europe/Paris)" + timezones_title: Fuseaux horaires à afficher + timezones_description: Les fuseaux horaires seront utilisés pour afficher les dates en aperçu et en mode recours. + recurring_title: Périodicité + recurring_description: "Définir la périodicité d'un événement. Vous pouvez aussi modifier manuellement l'option de périodicité générée par le formulaire et utiliser une des clefs suivantes: years, quarters, months, weeks, days, hours, minutes, seconds, milliseconds. " + recurring_none: Pas de périodicité diff --git a/plugins/discourse-cronos/config/locales/client.gl.yml b/plugins/discourse-cronos/config/locales/client.gl.yml new file mode 100644 index 00000000000..695b5cf2879 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.gl.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +gl: {} diff --git a/plugins/discourse-cronos/config/locales/client.he.yml b/plugins/discourse-cronos/config/locales/client.he.yml new file mode 100644 index 00000000000..4d27aff892b --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.he.yml @@ -0,0 +1,15 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +he: + js: + discourse_cronos: + create: + form: + format_description: "תבנית להצגת תאריך המשתמש. יש להשתמש ב־„‎\\T\\Z” כדי להציג את אזור הזמן של המשתמש במילים (אסיה/ירושלים)" + timezones_title: אזורי זמן + timezones_description: באזורי זמן נעשה שימוש לטובת הצגת תאריך בתצוגה מקדימה וכבררת מחדל. diff --git a/plugins/discourse-cronos/config/locales/client.id.yml b/plugins/discourse-cronos/config/locales/client.id.yml new file mode 100644 index 00000000000..2112cad6a27 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.id.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +id: {} diff --git a/plugins/discourse-cronos/config/locales/client.it.yml b/plugins/discourse-cronos/config/locales/client.it.yml new file mode 100644 index 00000000000..12c5162aabd --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.it.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +it: {} diff --git a/plugins/discourse-cronos/config/locales/client.ja.yml b/plugins/discourse-cronos/config/locales/client.ja.yml new file mode 100644 index 00000000000..8c2dc009047 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.ja.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ja: {} diff --git a/plugins/discourse-cronos/config/locales/client.ko.yml b/plugins/discourse-cronos/config/locales/client.ko.yml new file mode 100644 index 00000000000..bf4e05d6f4f --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.ko.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ko: {} diff --git a/plugins/discourse-cronos/config/locales/client.lv.yml b/plugins/discourse-cronos/config/locales/client.lv.yml new file mode 100644 index 00000000000..dc48bb58eef --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.lv.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +lv: {} diff --git a/plugins/discourse-cronos/config/locales/client.nb_NO.yml b/plugins/discourse-cronos/config/locales/client.nb_NO.yml new file mode 100644 index 00000000000..2231ad97497 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.nb_NO.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +nb_NO: {} diff --git a/plugins/discourse-cronos/config/locales/client.nl.yml b/plugins/discourse-cronos/config/locales/client.nl.yml new file mode 100644 index 00000000000..bb31021aaae --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.nl.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +nl: {} diff --git a/plugins/discourse-cronos/config/locales/client.pl_PL.yml b/plugins/discourse-cronos/config/locales/client.pl_PL.yml new file mode 100644 index 00000000000..c04d371e5a4 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.pl_PL.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +pl_PL: {} diff --git a/plugins/discourse-cronos/config/locales/client.pt.yml b/plugins/discourse-cronos/config/locales/client.pt.yml new file mode 100644 index 00000000000..d12527a51fa --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.pt.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +pt: {} diff --git a/plugins/discourse-cronos/config/locales/client.pt_BR.yml b/plugins/discourse-cronos/config/locales/client.pt_BR.yml new file mode 100644 index 00000000000..bc85fd86b17 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.pt_BR.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +pt_BR: {} diff --git a/plugins/discourse-cronos/config/locales/client.ro.yml b/plugins/discourse-cronos/config/locales/client.ro.yml new file mode 100644 index 00000000000..31d1c440135 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.ro.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ro: {} diff --git a/plugins/discourse-cronos/config/locales/client.ru.yml b/plugins/discourse-cronos/config/locales/client.ru.yml new file mode 100644 index 00000000000..a9abbf32fc3 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.ru.yml @@ -0,0 +1,22 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ru: + js: + discourse_cronos: + title: Вставить дату + create: + modal_title: Вставить дату + form: + insert: Вставить + advanced_mode: Расширенный режим + format_description: "Формат, используемый для отображения даты пользователю. Используйте \"\\T\\Z\" для отображения часового пояса пользователя в словах (Europe/Paris)" + timezones_title: Часовые пояса для отображения + timezones_description: Часовые пояса будут использоваться для отображения дат в режиме предварительного просмотра и отката назад. + recurring_title: Повторение + recurring_description: "Определите повторение события. Кроме того, можно вручную изменить параметр повтора, созданный формой, и использовать один из следующих ключей: годы, кварталы, месяцы, недели, дни, часы, минуты, секунды, миллисекунды." + recurring_none: Отсутствие рецидивирования diff --git a/plugins/discourse-cronos/config/locales/client.sk.yml b/plugins/discourse-cronos/config/locales/client.sk.yml new file mode 100644 index 00000000000..bcc3a93dc5b --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.sk.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +sk: {} diff --git a/plugins/discourse-cronos/config/locales/client.sq.yml b/plugins/discourse-cronos/config/locales/client.sq.yml new file mode 100644 index 00000000000..4526be31621 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.sq.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +sq: {} diff --git a/plugins/discourse-cronos/config/locales/client.sv.yml b/plugins/discourse-cronos/config/locales/client.sv.yml new file mode 100644 index 00000000000..fd54901f750 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.sv.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +sv: {} diff --git a/plugins/discourse-cronos/config/locales/client.te.yml b/plugins/discourse-cronos/config/locales/client.te.yml new file mode 100644 index 00000000000..49141baa040 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.te.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +te: {} diff --git a/plugins/discourse-cronos/config/locales/client.th.yml b/plugins/discourse-cronos/config/locales/client.th.yml new file mode 100644 index 00000000000..7ed98e15d8c --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.th.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +th: {} diff --git a/plugins/discourse-cronos/config/locales/client.tr_TR.yml b/plugins/discourse-cronos/config/locales/client.tr_TR.yml new file mode 100644 index 00000000000..00efffd6707 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.tr_TR.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +tr_TR: {} diff --git a/plugins/discourse-cronos/config/locales/client.uk.yml b/plugins/discourse-cronos/config/locales/client.uk.yml new file mode 100644 index 00000000000..3acfff74e88 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.uk.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +uk: {} diff --git a/plugins/discourse-cronos/config/locales/client.ur.yml b/plugins/discourse-cronos/config/locales/client.ur.yml new file mode 100644 index 00000000000..09baee6a864 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.ur.yml @@ -0,0 +1,15 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ur: + js: + discourse_cronos: + create: + form: + format_description: "صارف کو تاریخ ظاہر کرنے کیلئے استعمال کیے جانے والا فارمیٹ۔ الفاظ (یورپ/پیرس) میں صارف ٹائم زَون کو ظاہر کرنے کیلئے \"\\T\\Z\" استعمال کریں" + timezones_title: ظاہر کیے جانے والے ٹائم زَونز + timezones_description: پیشگی اور فالبَیک میں تاریخیں ظاہر کرنے کیلئے ٹائم زَونز استعمال کیے جائیں گے۔ diff --git a/plugins/discourse-cronos/config/locales/client.vi.yml b/plugins/discourse-cronos/config/locales/client.vi.yml new file mode 100644 index 00000000000..fa809fe162c --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.vi.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +vi: {} diff --git a/plugins/discourse-cronos/config/locales/client.zh_CN.yml b/plugins/discourse-cronos/config/locales/client.zh_CN.yml new file mode 100644 index 00000000000..841b4d49acf --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.zh_CN.yml @@ -0,0 +1,16 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +zh_CN: + js: + discourse_cronos: + title: 插入日期 + create: + modal_title: 插入日期 + form: + insert: 插入 + advanced_mode: 高级模式 diff --git a/plugins/discourse-cronos/config/locales/client.zh_TW.yml b/plugins/discourse-cronos/config/locales/client.zh_TW.yml new file mode 100644 index 00000000000..92c18de9aec --- /dev/null +++ b/plugins/discourse-cronos/config/locales/client.zh_TW.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +zh_TW: {} diff --git a/plugins/discourse-cronos/config/locales/server.ar.yml b/plugins/discourse-cronos/config/locales/server.ar.yml new file mode 100644 index 00000000000..79ea4de8157 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.ar.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ar: {} diff --git a/plugins/discourse-cronos/config/locales/server.bs_BA.yml b/plugins/discourse-cronos/config/locales/server.bs_BA.yml new file mode 100644 index 00000000000..7b73cd2f229 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.bs_BA.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +bs_BA: {} diff --git a/plugins/discourse-cronos/config/locales/server.ca.yml b/plugins/discourse-cronos/config/locales/server.ca.yml new file mode 100644 index 00000000000..e155a119c24 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.ca.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ca: {} diff --git a/plugins/discourse-cronos/config/locales/server.cs.yml b/plugins/discourse-cronos/config/locales/server.cs.yml new file mode 100644 index 00000000000..c0f2fec763b --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.cs.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +cs: {} diff --git a/plugins/discourse-cronos/config/locales/server.da.yml b/plugins/discourse-cronos/config/locales/server.da.yml new file mode 100644 index 00000000000..9ca8189621d --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.da.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +da: {} diff --git a/plugins/discourse-cronos/config/locales/server.de.yml b/plugins/discourse-cronos/config/locales/server.de.yml new file mode 100644 index 00000000000..5d7267a1b33 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.de.yml @@ -0,0 +1,12 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +de: + site_settings: + discourse_cronos_enabled: "Aktiviert das discourse-cronos Plugin. Wenn du diese Einstellung änderst, musst du alle Beiträge mit \"rake posts:rebake\" neu generieren." + discourse_cronos_default_formats: "Häufig verwendete Datums- und Zeitformate, siehe: momentjs string format" + discourse_cronos_default_timezones: "Standard-Liste von Zeitzonen, muss eine gültige TZ sein" diff --git a/plugins/discourse-cronos/config/locales/server.el.yml b/plugins/discourse-cronos/config/locales/server.el.yml new file mode 100644 index 00000000000..63bf4b0e2fe --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.el.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +el: {} diff --git a/plugins/discourse-cronos/config/locales/server.en.yml b/plugins/discourse-cronos/config/locales/server.en.yml new file mode 100644 index 00000000000..a7cc7711e56 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.en.yml @@ -0,0 +1,5 @@ +en: + site_settings: + discourse_cronos_enabled: "Enable the discourse-cronos plugin. If you change this, you must rebake all posts with: \"rake posts:rebake\"." + discourse_cronos_default_formats: "Frequently used date time formats, see: momentjs string format" + discourse_cronos_default_timezones: "Default list of timezones, must be a valid TZ" diff --git a/plugins/discourse-cronos/config/locales/server.es.yml b/plugins/discourse-cronos/config/locales/server.es.yml new file mode 100644 index 00000000000..f718519d2fc --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.es.yml @@ -0,0 +1,12 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +es: + site_settings: + discourse_cronos_enabled: "Activar el plugin discourse-cronos. Si cambias esto, debes hacer rebake de todos los posts con \"rake posts:rebake\"." + discourse_cronos_default_formats: "Formatos de fecha utilizados frecuentemente, ver: momentjs string format" + discourse_cronos_default_timezones: "Lista de zonas horarias por defecto, deben ser TZ válidas" diff --git a/plugins/discourse-cronos/config/locales/server.et.yml b/plugins/discourse-cronos/config/locales/server.et.yml new file mode 100644 index 00000000000..8c601aa1ed9 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.et.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +et: {} diff --git a/plugins/discourse-cronos/config/locales/server.fa_IR.yml b/plugins/discourse-cronos/config/locales/server.fa_IR.yml new file mode 100644 index 00000000000..3f564b2f111 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.fa_IR.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +fa_IR: {} diff --git a/plugins/discourse-cronos/config/locales/server.fi.yml b/plugins/discourse-cronos/config/locales/server.fi.yml new file mode 100644 index 00000000000..b947adbbec6 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.fi.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +fi: {} diff --git a/plugins/discourse-cronos/config/locales/server.fr.yml b/plugins/discourse-cronos/config/locales/server.fr.yml new file mode 100644 index 00000000000..7605c16c011 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.fr.yml @@ -0,0 +1,12 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +fr: + site_settings: + discourse_cronos_enabled: "Activer le plugin discourse-cronos. Si vous modifiez ceci, vous devez regénérer tous les messages avec : \"rake posts:rebake\"." + discourse_cronos_default_formats: "Formats de date fréquemment utilisés, voir : momentjs string format" + discourse_cronos_default_timezones: "Liste de fuseaux horaires par défaut, doit être un fuseaux horaire valide Wikipedia (anglais)" diff --git a/plugins/discourse-cronos/config/locales/server.gl.yml b/plugins/discourse-cronos/config/locales/server.gl.yml new file mode 100644 index 00000000000..695b5cf2879 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.gl.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +gl: {} diff --git a/plugins/discourse-cronos/config/locales/server.he.yml b/plugins/discourse-cronos/config/locales/server.he.yml new file mode 100644 index 00000000000..7bdee729cec --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.he.yml @@ -0,0 +1,12 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +he: + site_settings: + discourse_cronos_enabled: "הפעלת התוסף discourse-cronos. שינוי ההגדרה הזאת יאלץ אותך לאפות את כל הרשומות מחדש עם: „rake posts:rebake”." + discourse_cronos_default_formats: "תבניות זמן נפוצות, ניתן לעיין ב: תבנית מחרוזת momentjs" + discourse_cronos_default_timezones: "רשימת בררת מחדל של אזורי זמן, חיי להיות TZ תקני" diff --git a/plugins/discourse-cronos/config/locales/server.id.yml b/plugins/discourse-cronos/config/locales/server.id.yml new file mode 100644 index 00000000000..2112cad6a27 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.id.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +id: {} diff --git a/plugins/discourse-cronos/config/locales/server.it.yml b/plugins/discourse-cronos/config/locales/server.it.yml new file mode 100644 index 00000000000..12c5162aabd --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.it.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +it: {} diff --git a/plugins/discourse-cronos/config/locales/server.ja.yml b/plugins/discourse-cronos/config/locales/server.ja.yml new file mode 100644 index 00000000000..8c2dc009047 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.ja.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ja: {} diff --git a/plugins/discourse-cronos/config/locales/server.ko.yml b/plugins/discourse-cronos/config/locales/server.ko.yml new file mode 100644 index 00000000000..bf4e05d6f4f --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.ko.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ko: {} diff --git a/plugins/discourse-cronos/config/locales/server.lv.yml b/plugins/discourse-cronos/config/locales/server.lv.yml new file mode 100644 index 00000000000..dc48bb58eef --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.lv.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +lv: {} diff --git a/plugins/discourse-cronos/config/locales/server.nb_NO.yml b/plugins/discourse-cronos/config/locales/server.nb_NO.yml new file mode 100644 index 00000000000..2231ad97497 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.nb_NO.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +nb_NO: {} diff --git a/plugins/discourse-cronos/config/locales/server.nl.yml b/plugins/discourse-cronos/config/locales/server.nl.yml new file mode 100644 index 00000000000..bb31021aaae --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.nl.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +nl: {} diff --git a/plugins/discourse-cronos/config/locales/server.pl_PL.yml b/plugins/discourse-cronos/config/locales/server.pl_PL.yml new file mode 100644 index 00000000000..c04d371e5a4 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.pl_PL.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +pl_PL: {} diff --git a/plugins/discourse-cronos/config/locales/server.pt.yml b/plugins/discourse-cronos/config/locales/server.pt.yml new file mode 100644 index 00000000000..d12527a51fa --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.pt.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +pt: {} diff --git a/plugins/discourse-cronos/config/locales/server.pt_BR.yml b/plugins/discourse-cronos/config/locales/server.pt_BR.yml new file mode 100644 index 00000000000..bc85fd86b17 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.pt_BR.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +pt_BR: {} diff --git a/plugins/discourse-cronos/config/locales/server.ro.yml b/plugins/discourse-cronos/config/locales/server.ro.yml new file mode 100644 index 00000000000..31d1c440135 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.ro.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ro: {} diff --git a/plugins/discourse-cronos/config/locales/server.ru.yml b/plugins/discourse-cronos/config/locales/server.ru.yml new file mode 100644 index 00000000000..3e62866b1ff --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.ru.yml @@ -0,0 +1,12 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ru: + site_settings: + discourse_cronos_enabled: "Включить плагин discourse-cronos. Если вы измените это, вы должны rebake все посты: \"rake posts:rebake\"." + discourse_cronos_default_formats: "Часто используемые форматы даты и времени, см.: формат строки momentjs" + discourse_cronos_default_timezones: "Список часовых поясов по умолчанию должен быть допустимым TZ" diff --git a/plugins/discourse-cronos/config/locales/server.sk.yml b/plugins/discourse-cronos/config/locales/server.sk.yml new file mode 100644 index 00000000000..bcc3a93dc5b --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.sk.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +sk: {} diff --git a/plugins/discourse-cronos/config/locales/server.sq.yml b/plugins/discourse-cronos/config/locales/server.sq.yml new file mode 100644 index 00000000000..4526be31621 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.sq.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +sq: {} diff --git a/plugins/discourse-cronos/config/locales/server.sv.yml b/plugins/discourse-cronos/config/locales/server.sv.yml new file mode 100644 index 00000000000..fd54901f750 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.sv.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +sv: {} diff --git a/plugins/discourse-cronos/config/locales/server.te.yml b/plugins/discourse-cronos/config/locales/server.te.yml new file mode 100644 index 00000000000..49141baa040 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.te.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +te: {} diff --git a/plugins/discourse-cronos/config/locales/server.th.yml b/plugins/discourse-cronos/config/locales/server.th.yml new file mode 100644 index 00000000000..7ed98e15d8c --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.th.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +th: {} diff --git a/plugins/discourse-cronos/config/locales/server.tr_TR.yml b/plugins/discourse-cronos/config/locales/server.tr_TR.yml new file mode 100644 index 00000000000..00efffd6707 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.tr_TR.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +tr_TR: {} diff --git a/plugins/discourse-cronos/config/locales/server.uk.yml b/plugins/discourse-cronos/config/locales/server.uk.yml new file mode 100644 index 00000000000..3acfff74e88 --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.uk.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +uk: {} diff --git a/plugins/discourse-cronos/config/locales/server.ur.yml b/plugins/discourse-cronos/config/locales/server.ur.yml new file mode 100644 index 00000000000..2607da958ae --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.ur.yml @@ -0,0 +1,12 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +ur: + site_settings: + discourse_cronos_enabled: "ڈِسکورس-کرَونَوس پلگ اِن فعال کریں۔ اگر آپ اس کو تبدیل کرتے ہیں تو، آپ کو تمام پوسٹس کو دوبارہ رِیبَیک کرنا ہوگا: \"rake posts:rebake\"" + discourse_cronos_default_formats: "اکثر استعمال ہونے والے تاریخ ٹائم فارمیٹس، دیکھیے: momentjs سٹرِنگ فارمَیٹ" + discourse_cronos_default_timezones: "ٹائم زَونَوں کی ڈِیفالٹ فہرست، ایک درست TZ ہونا لازمی ہے" diff --git a/plugins/discourse-cronos/config/locales/server.vi.yml b/plugins/discourse-cronos/config/locales/server.vi.yml new file mode 100644 index 00000000000..fa809fe162c --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.vi.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +vi: {} diff --git a/plugins/discourse-cronos/config/locales/server.zh_CN.yml b/plugins/discourse-cronos/config/locales/server.zh_CN.yml new file mode 100644 index 00000000000..53c9902287c --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.zh_CN.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +zh_CN: {} diff --git a/plugins/discourse-cronos/config/locales/server.zh_TW.yml b/plugins/discourse-cronos/config/locales/server.zh_TW.yml new file mode 100644 index 00000000000..92c18de9aec --- /dev/null +++ b/plugins/discourse-cronos/config/locales/server.zh_TW.yml @@ -0,0 +1,8 @@ +# encoding: utf-8 +# +# Never edit this file. It will be overwritten when translations are pulled from Transifex. +# +# To work with us on translations, join this project: +# https://www.transifex.com/projects/p/discourse-org/ + +zh_TW: {} diff --git a/plugins/discourse-cronos/config/settings.yml b/plugins/discourse-cronos/config/settings.yml new file mode 100644 index 00000000000..6f4ecae16cf --- /dev/null +++ b/plugins/discourse-cronos/config/settings.yml @@ -0,0 +1,12 @@ +plugins: + discourse_cronos_enabled: + default: true + client: true + discourse_cronos_default_formats: + default: "LLL|LTS|LL|LLLL" + client: true + type: list + discourse_cronos_default_timezones: + default: "Europe/Paris|America/Los_Angeles" + client: true + type: list diff --git a/plugins/discourse-cronos/lib/discourse_cronos/engine.rb b/plugins/discourse-cronos/lib/discourse_cronos/engine.rb new file mode 100644 index 00000000000..5e7d1c98458 --- /dev/null +++ b/plugins/discourse-cronos/lib/discourse_cronos/engine.rb @@ -0,0 +1,8 @@ +module ::DiscourseCronos + PLUGIN_NAME = "discourse-cronos" + + class Engine < ::Rails::Engine + engine_name DiscourseCronos::PLUGIN_NAME + isolate_namespace DiscourseCronos + end +end diff --git a/plugins/discourse-cronos/plugin.rb b/plugins/discourse-cronos/plugin.rb new file mode 100644 index 00000000000..f4a69a003ff --- /dev/null +++ b/plugins/discourse-cronos/plugin.rb @@ -0,0 +1,13 @@ +# name: discourse-cronos +# about: Display a date in your local timezone +# version: 0.1 +# author: Joffrey Jaffeux + +register_asset "javascripts/discourse-cronos.js" +register_asset "stylesheets/discourse-cronos.scss" +register_asset "moment.js", :vendored_core_pretty_text +register_asset "moment-timezone.js", :vendored_core_pretty_text + +enabled_site_setting :discourse_cronos_enabled + +load File.expand_path('../lib/discourse_cronos/engine.rb', __FILE__) diff --git a/plugins/discourse-cronos/spec/lib/pretty_text_spec.rb b/plugins/discourse-cronos/spec/lib/pretty_text_spec.rb new file mode 100644 index 00000000000..2c346eb4697 --- /dev/null +++ b/plugins/discourse-cronos/spec/lib/pretty_text_spec.rb @@ -0,0 +1,17 @@ +require 'rails_helper' + +describe PrettyText do + it 'supports inserting date' do + freeze_time + cooked = PrettyText.cook <<~MD + [discourse-cronos time=22:00;date=2018-05-08;format=LLL;timezones=Europe/Paris|America/Los_Angeles;][/discourse-cronos] + MD + + expect(cooked).to include('class="discourse-cronos"') + expect(cooked).to include('data-date="2018-05-08"') + expect(cooked).to include('data-format="LLL"') + expect(cooked).to include('data-timezones="Europe/Paris|America/Los_Angeles"') + expect(cooked).to include('May 8, 2018 3:00 PM (America: Los Angeles)') + expect(cooked).to include('May 9, 2018 12:00 AM (Europe: Paris)') + end +end diff --git a/script/plugin-translations.rb b/script/plugin-translations.rb index 430fe99b2cd..ea8701ceccd 100644 --- a/script/plugin-translations.rb +++ b/script/plugin-translations.rb @@ -19,7 +19,7 @@ class PluginTxUpdater 'discourse-canned-replies', 'discourse-characters-required', 'discourse-chat-integration', - 'discourse-chronos', + 'discourse-cronos', 'discourse-data-explorer', 'discourse-math', 'discourse-oauth2-basic',