From c1dfa16eed49df4423e139170f7ca83d6be378cc Mon Sep 17 00:00:00 2001 From: jelhan Date: Fri, 20 Nov 2015 02:18:19 +0100 Subject: [PATCH] update ember-i18n --- app/components/language-select.js | 18 + app/controllers/application.js | 16 +- app/controllers/create.js | 4 +- app/controllers/create/index.js | 22 +- app/controllers/create/options.js | 5 +- app/controllers/create/settings.js | 57 ++- app/controllers/poll/participation.js | 3 +- app/initializers/translations.js | 45 --- app/instance-initializers/i18n.js | 52 +++ app/lang/translations.js | 326 ------------------ app/locales/de/translations.js | 108 ++++++ app/locales/en/translations.js | 108 ++++++ app/locales/es/translations.js | 108 ++++++ app/routes/application.js | 4 +- app/styles/app.less | 2 +- app/templates/application.hbs | 6 +- app/templates/components/language-select.hbs | 3 + app/templates/create/options.hbs | 2 +- app/templates/language-switch.hbs | 3 - app/views/language-switch.js | 14 - app/views/poll.js | 2 +- app/views/poll/evaluation.js | 2 +- config/environment.js | 6 +- ember-cli-build.js | 3 - package.json | 1 + tests/.jshintrc | 3 +- tests/acceptance/create-a-poll-test.js | 5 +- .../acceptance/participate-in-a-poll-test.js | 7 +- tests/helpers/poll-has-options.js | 2 +- tests/helpers/start-app.js | 1 + tests/helpers/t.js | 5 + tests/integration/create-a-poll-test.js | 6 +- tests/integration/legacy-support-test.js | 24 +- tests/unit/lang-test.js | 30 -- 34 files changed, 516 insertions(+), 487 deletions(-) create mode 100644 app/components/language-select.js delete mode 100644 app/initializers/translations.js create mode 100644 app/instance-initializers/i18n.js delete mode 100644 app/lang/translations.js create mode 100644 app/locales/de/translations.js create mode 100644 app/locales/en/translations.js create mode 100644 app/locales/es/translations.js create mode 100644 app/templates/components/language-select.hbs delete mode 100644 app/templates/language-switch.hbs delete mode 100644 app/views/language-switch.js create mode 100644 tests/helpers/t.js delete mode 100644 tests/unit/lang-test.js diff --git a/app/components/language-select.js b/app/components/language-select.js new file mode 100644 index 0000000..069cb77 --- /dev/null +++ b/app/components/language-select.js @@ -0,0 +1,18 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + tagName: 'select', + classNames: [ 'language-select' ], + i18n: Ember.inject.service(), + current: Ember.computed.readOnly('i18n.locale'), + + locales: Ember.computed('i18n.locales', function() { + return this.get('i18n.locales').map(function (locale) { + return { id: locale, text: locale }; + }); + }), + + change() { + this.get('i18n').set('locale', this.$().val()); + } +}); diff --git a/app/controllers/application.js b/app/controllers/application.js index d9c0507..e69223e 100644 --- a/app/controllers/application.js +++ b/app/controllers/application.js @@ -1,16 +1,18 @@ import Ember from "ember"; +/* global moment */ + +export default Ember.Controller.extend({ + i18n: Ember.inject.service(), -export default Ember.Controller.extend({ languageChanged: function() { // change language - var language = this.get('language.selected'); - + var language = this.get('i18n.locale'); + // save language in cookie document.cookie="language=" + language + ";" + // give cookie a lifetime of one year "max-age=" + 60*60*24*356 + ";"; - - // rerender page - window.location.reload(false); - }.observes('language.selected') + + moment.locale(language); + }.observes('i18n.locale') }); diff --git a/app/controllers/create.js b/app/controllers/create.js index 02e16cf..411abad 100644 --- a/app/controllers/create.js +++ b/app/controllers/create.js @@ -24,7 +24,7 @@ var OptionsDateTimesObjectValidations = buildValidations({ return value.get('length') >= 1; }, { dependentKeys: ['times.[]'], - message: Ember.I18n.t('create.options-datetime.error.notEnoughTimes') + // message: Ember.I18n.t('create.options-datetime.error.notEnoughTimes') }) ] }); @@ -62,7 +62,7 @@ var OptionsDateTimesTimeObjectValidations = buildValidations({ return options.message; } }, { - message: Ember.I18n.t('create.options-datetime.error.correctTimeFormat') + // message: Ember.I18n.t('create.options-datetime.error.correctTimeFormat') } ) }); diff --git a/app/controllers/create/index.js b/app/controllers/create/index.js index ed5a11a..b3f451a 100644 --- a/app/controllers/create/index.js +++ b/app/controllers/create/index.js @@ -13,6 +13,14 @@ var Validations = buildValidations({ ] }); +var TranslateableObject = Ember.Object.extend({ + i18n: Ember.inject.service(), + label: Ember.computed('labelTranslation', function() { + return this.get('i18n').t(this.get('labelTranslation')); + }), + labelTranslation: undefined +}); + export default Ember.Controller.extend(Validations, { actions: { submit: function() { @@ -20,17 +28,23 @@ export default Ember.Controller.extend(Validations, { } }, + i18n: Ember.inject.service(), + pollType: Ember.computed.alias('model.pollType'), pollTypes: function(){ + var container = this.get('container'); + return [ - Ember.Object.extend(Ember.I18n.TranslateableProperties, {}).create({ + TranslateableObject.create({ id : "FindADate", - labelTranslation : "pollTypes.findADate.label" + labelTranslation : "pollTypes.findADate.label", + container }), - Ember.Object.extend(Ember.I18n.TranslateableProperties, {}).create({ + TranslateableObject.create({ id : "MakeAPoll", - labelTranslation : "pollTypes.makeAPoll.label" + labelTranslation : "pollTypes.makeAPoll.label", + container }) ]; }.property() diff --git a/app/controllers/create/options.js b/app/controllers/create/options.js index 843071a..2f25d27 100644 --- a/app/controllers/create/options.js +++ b/app/controllers/create/options.js @@ -23,7 +23,7 @@ var Validations = buildValidations({ return 2; } }, - message: Ember.I18n.t('create.options.error.notEnoughOptions') + // message: Ember.I18n.t('create.options.error.notEnoughOptions') }), validator('valid-collection', { active() { @@ -52,13 +52,14 @@ var Validations = buildValidations({ return 2; } }, - message: Ember.I18n.t('create.options.error.notEnoughDates') + // message: Ember.I18n.t('create.options.error.notEnoughDates') }) ] }); export default Ember.Controller.extend(Validations, { needs: 'create', + i18n: Ember.inject.service(), isFindADate: Ember.computed.readOnly('model.isFindADate'), isMakeAPoll: Ember.computed.readOnly('model.isMakeAPoll'), diff --git a/app/controllers/create/settings.js b/app/controllers/create/settings.js index 26f19a3..2b52b94 100644 --- a/app/controllers/create/settings.js +++ b/app/controllers/create/settings.js @@ -16,6 +16,14 @@ var Validations = buildValidations({ forceAnswer: validator('presence', true) }); +var TranslateableObject = Ember.Object.extend({ + i18n: Ember.inject.service(), + label: Ember.computed('labelTranslation', function() { + return this.get('i18n').t(this.get('labelTranslation')); + }), + labelTranslation: undefined +}); + export default Ember.Controller.extend(Validations, { actions: { submit: function(){ @@ -34,8 +42,10 @@ export default Ember.Controller.extend(Validations, { answerType: Ember.computed.alias('model.answerType'), answerTypes: function() { + var container = this.get('container'); + return [ - Ember.Object.extend(Ember.I18n.TranslateableProperties, {}).create({ + TranslateableObject.create({ id : "YesNo", labelTranslation : "answerTypes.yesNo.label", answers : [ @@ -49,9 +59,10 @@ export default Ember.Controller.extend(Validations, { labelTranslation: "answerTypes.no.label", icon: "glyphicon glyphicon-thumbs-down" }) - ] + ], + container }), - Ember.Object.extend(Ember.I18n.TranslateableProperties, {}).create({ + TranslateableObject.create({ id : "YesNoMaybe", labelTranslation : "answerTypes.yesNoMaybe.label", answers : [ @@ -70,12 +81,14 @@ export default Ember.Controller.extend(Validations, { labelTranslation: "answerTypes.no.label", icon: "glyphicon glyphicon-thumbs-down" }) - ] + ], + container }), - Ember.Object.extend(Ember.I18n.TranslateableProperties, {}).create({ + TranslateableObject.create({ id : "FreeText", labelTranslation : "answerTypes.freeText.label", - answers : [] + answers : [], + container }) ]; }.property(), @@ -83,30 +96,38 @@ export default Ember.Controller.extend(Validations, { expirationDuration: 'P3M', expirationDurations: function() { + var container = this.get('container'); + return [ - Ember.Object.extend(Ember.I18n.TranslateableProperties, {}).create({ + TranslateableObject.create({ id: 'P7D', - labelTranslation: 'create.settings.expirationDurations.P7D' + labelTranslation: 'create.settings.expirationDurations.P7D', + container }), - Ember.Object.extend(Ember.I18n.TranslateableProperties, {}).create({ + TranslateableObject.create({ id: 'P1M', - labelTranslation: 'create.settings.expirationDurations.P1M' + labelTranslation: 'create.settings.expirationDurations.P1M', + container }), - Ember.Object.extend(Ember.I18n.TranslateableProperties, {}).create({ + TranslateableObject.create({ id: 'P3M', - labelTranslation: 'create.settings.expirationDurations.P3M' + labelTranslation: 'create.settings.expirationDurations.P3M', + container }), - Ember.Object.extend(Ember.I18n.TranslateableProperties, {}).create({ + TranslateableObject.create({ id: 'P6M', - labelTranslation: 'create.settings.expirationDurations.P6M' + labelTranslation: 'create.settings.expirationDurations.P6M', + container }), - Ember.Object.extend(Ember.I18n.TranslateableProperties, {}).create({ + TranslateableObject.create({ id: 'P1Y', - labelTranslation: 'create.settings.expirationDurations.P1Y' + labelTranslation: 'create.settings.expirationDurations.P1Y', + container }), - Ember.Object.extend(Ember.I18n.TranslateableProperties, {}).create({ + TranslateableObject.create({ id: '', - labelTranslation: 'create.settings.expirationDurations.never' + labelTranslation: 'create.settings.expirationDurations.never', + container }) ]; }.property(), diff --git a/app/controllers/poll/participation.js b/app/controllers/poll/participation.js index bb1be22..6a92970 100644 --- a/app/controllers/poll/participation.js +++ b/app/controllers/poll/participation.js @@ -113,6 +113,7 @@ export default Ember.Controller.extend(Validations, { anonymousUser: Ember.computed.readOnly('pollController.model.anonymousUser'), encryption: Ember.inject.service(), forceAnswer: Ember.computed.readOnly('pollController.model.forceAnswer'), + i18n: Ember.inject.service(), isDateTime: Ember.computed.readOnly('pollController.model.isDateTime'), isFreeText: Ember.computed.readOnly('pollController.model.isFreeText'), isFindADate: Ember.computed.readOnly('pollController.model.isFindADate'), @@ -126,7 +127,7 @@ export default Ember.Controller.extend(Validations, { var label; if (!Ember.isEmpty(answer.get('labelTranslation'))) { - label = Ember.I18n.t(answer.get('labelTranslation')); + label = this.get('i18n').t(answer.get('labelTranslation')); } else { label = answer.get('label'); } diff --git a/app/initializers/translations.js b/app/initializers/translations.js deleted file mode 100644 index 7f760dd..0000000 --- a/app/initializers/translations.js +++ /dev/null @@ -1,45 +0,0 @@ -import Ember from "ember"; -import translations from "croodle/lang/translations"; -import moment from "moment"; - -export default { - name: 'i18n', - initialize: function(container, application) { - // detect browser language - var language = ''; - - // have a look if it's already stored in a cookie - var cookie = document.cookie.replace(" ", "").split(";"); - cookie.forEach(function(t){ - var x = t.split("="); - if (x[0] === "language") { - language = x[1]; - } - }); - - // if not we do it by browser language - if (language === '') { - language = (window.navigator.userLanguage || window.navigator.language).split("-")[0]; - } - - // check if language is supported - if(typeof translations[language] !== "object") { - language = "en"; - } - - Ember.FEATURES.I18N_TRANSLATE_HELPER_SPAN = false; - Ember.ENV.I18N_COMPILE_WITHOUT_HANDLEBARS = true; - Ember.I18n.translations = Ember.copy(translations[language]); - Ember.I18n.locale = language; - - // inject into controller - var languageStorage = Ember.Object.extend({ - selected: language - }); - container.register('language:current', languageStorage, {singleton: true}); - application.inject('controller', 'language', 'language:current'); - - // set moment locale - moment.locale( language ); - } -}; diff --git a/app/instance-initializers/i18n.js b/app/instance-initializers/i18n.js new file mode 100644 index 0000000..425f805 --- /dev/null +++ b/app/instance-initializers/i18n.js @@ -0,0 +1,52 @@ +import moment from "moment"; + +export default { + name: 'i18n', + initialize: function({ container }) { + var i18n = container.lookup('service:i18n'), + availableLocales = i18n.get('locales'), + locale = getLocale(availableLocales); + + i18n.set('locale', locale); + moment.locale( locale ); + } +}; + +function getLocale(availableLocales) { + var methods = [ + getLocaleByBrowser, + getLocaleFromCookie + ]; + var locale; + + methods.any((method) => { + var l = method(); + if (l && availableLocales.indexOf(l) !== -1) { + locale = l; + return true; + } + }); + + if (locale) { + return locale; + } else { + return 'en'; + } +} + +function getLocaleByBrowser() { + return (window.navigator.userLanguage || window.navigator.language).split("-")[0]; +} + +function getLocaleFromCookie() { + var language; + + var cookie = document.cookie.replace(" ", "").split(";"); + cookie.forEach(function(t){ + var x = t.split("="); + if (x[0] === "language") { + language = x[1]; + } + }); + return language; +} diff --git a/app/lang/translations.js b/app/lang/translations.js deleted file mode 100644 index ef20885..0000000 --- a/app/lang/translations.js +++ /dev/null @@ -1,326 +0,0 @@ -export default { - "en": { - "answerTypes.yes.label": "Yes", - "answerTypes.no.label": "No", - "answerTypes.maybe.label": "Maybe", - "answerTypes.freeText.label": "Allow free text", - "answerTypes.yesNo.label": "Yes, No", - "answerTypes.yesNoMaybe.label": "Yes, No, Maybe", - "create.index.input.pollType.label": "What is the purpose of your poll?", - "create.meta.input.title.label": "Title", - "create.meta.input.title.placeholder": "Add a poll title.", - "create.meta.input.description.label": "Description", - "create.meta.input.description.placeholder": "Optional: Add a description to the poll.", - "create.next": "Next", - "create.options.button.add.label": "add another option after this one", - "create.options.button.delete.label": "delete this option", - "create.options.options.label": "Answer options", - "create.options.error.notEnoughDates": "You have to choose either two days or one day plus the option 'set times'.", - "create.options.error.notEnoughOptions": "Enter at least two answer options.", - "create.options.defineTimes.label": "Set times?", - "create.options.input.moreOptions.label": "Add further answer options", - "create.options-datetime.datetimes.label": "Times", - "create.options-datetime.more-inputs": "Add further times", - "create.options-datetime.copy-first-line": "Adopt times of the first line for all others", - "create.options-datetime.error.notEnoughTimes": "At least one valid time has to be set per day. If only one day was chosen, at least two times have to be set.", - "create.options-datetime.error.correctTimeFormat": "Hours and minutes of the time have to be separated by a colon (e.g. 13:00).", - "create.settings.answerType.label": "Which answers should be available?", - "create.settings.anonymousUser.label": "Allow anonymous participation in the poll?", - "create.settings.expirationDate.label": "When should the poll expire and be deleted?", - "create.settings.expirationDurations.P7D": "a week from today", - "create.settings.expirationDurations.P1M": "a month from today", - "create.settings.expirationDurations.P3M": "three month from today", - "create.settings.expirationDurations.P6M": "six month from today", - "create.settings.expirationDurations.P1Y": "a year from today", - "create.settings.expirationDurations.never": "never", - "create.settings.forceAnswer.label": "Force answer for every option?", - "create.save": "Save", - "errors.inclusion": "is not part of the list", - "errors.exclusion": "reserved", - "errors.invalid": "invalid", - "errors.confirmation": "does not accord with {{attribute}}", - "errors.accepted": "has to be accepted", - "errors.empty": "cannot be left blank", - "errors.blank": "Must be filled in.", - "errors.present": "Has to be left blank.", - "errors.tooLong": "is too long (Maximum are {{count}} characters)", - "errors.tooShort": "Please insert at least {{count}} characters.", - "errors.wrongLength": "has invalid length (Minimum length {{count}} characters)", - "errors.notANumber": "is not a number", - "errors.notAnInteger": "Has to be a whole number.", - "errors.greaterThan": "has to be bigger than {{count}}", - "errors.greaterThanOrEqualTo": "must be bigger or same as {{count}}", - "errors.equalTo": "must equal {{count}}", - "errors.lessThan": "must be smaller than {{count}}", - "errors.lessThanOrEqualTo": "must be smaller or equal to {{count}}", - "errors.otherThan": "must be a different number than {{count}}", - "errors.odd": "must be unequal to", - "errors.even": "must be equal to", - "errors.url": "is not a valid URL", - "index.title": "Croodle simplifies making appointments and finding decisions ...
... and at the same time protects your data", - "index.features.title": "Functions", - "index.features.list.overview": "Find a date or do a poll with as many people as you like.", - "index.features.list.privacy": "Your data stays private: Already in your browser they are being encrypted. Only the people who you send the link of the poll to will know what your poll is about.", - "index.features.list.options": "You can set as many answer options as you like. You can choose your preferred date or compile any questions", - "index.features.list.answers": "you can use pre-defined answer options like yes, no, maybe or allow own questions.", - "index.features.list.evaluation": "You keep the overview through overview of preferred answers.", - "index.link.have-a-try": "test it now", - "index.hoster.title": "Host your own Croodle:", - "index.hoster.text": "You don’t have to trust this Croodle. Croodle is a free software and you can install it on your own server. You only a few megabytes memory capacity, PHP and SSL-encryption. You can find the software and tips for installation here GitHub.", - "modal.save-retry.title": "Save failed", - "modal.save-retry.text": "

Your membership could not be saved. Please check your Internet connection and try it again.

If this does not help, a short-term failure of the server could be the problem. Please wait a few minutes before trying again. You can leave as long as the page opens.

If problem persists, please contact contact administrators of the page.

", - "modal.save-retry.button-retry": "Retry", - "poll.created-time": "Created on {{creationDate}}.", - "poll.error.newUser.everyOptionIsAnswered": "Please answer ever option.", - "poll.error.newUserName": "You have to give a user name.", - "poll.evaluation.label": "Evaluation", - "poll.evaluation.bestOption.label.findADate.one": "The preferred date is", - "poll.evaluation.bestOption.label.findADate.other": "The preferred dates are", - "poll.evaluation.bestOption.label.makeAPoll.one": "The preferred choice is", - "poll.evaluation.bestOption.label.makeAPoll.other": "The preferred choices are", - "poll.evaluation.bestOptionParticipants.findADate.yes.one": "One person is available.", - "poll.evaluation.bestOptionParticipants.findADate.yes.other": "{{count}} persons are available.", - "poll.evaluation.bestOptionParticipants.findADate.maybe.one": "One person is maybe available.", - "poll.evaluation.bestOptionParticipants.findADate.maybe.other": "{{count}} are maybe available.", - "poll.evaluation.bestOptionParticipants.findADate.no.one": "One person is unavailable.", - "poll.evaluation.bestOptionParticipants.findADate.no.other": "{{count}} persons are unavailable.", - "poll.evaluation.bestOptionParticipants.makeAPoll.yes.one": "One person ticks this choice.", - "poll.evaluation.bestOptionParticipants.makeAPoll.yes.other": "{{count}} persons tick this choice.", - "poll.evaluation.bestOptionParticipants.makeAPoll.maybe.one": "One person will maybe tick this choice.", - "poll.evaluation.bestOptionParticipants.makeAPoll.maybe.other": "{{count}} persons will maybe tick this choice.", - "poll.evaluation.bestOptionParticipants.makeAPoll.no.one": "One person won't tick this choice.", - "poll.evaluation.bestOptionParticipants.makeAPoll.no.other": "{{count}} persons won't tick this choice.", - "poll.evaluation.lastParticipation": "The last one participated {{ago}}.", - "poll.evaluation.participants.one": "One person had participated in the poll.", - "poll.evaluation.participants.other": "{{count}} persons have participated in the poll.", - "poll.input.newUserName.label": "Name", - "poll.input.newUserName.placeholder": "Your name", - "poll.modal.timezoneDiffers.title": "Which time zone should be used to display the data?", - "poll.modal.timezoneDiffers.body": "The poll has been set up for a time zone that differs from your local time. Which time zone should be used to display the data?", - "poll.modal.timezoneDiffers.button.useLocalTimezone": "my time zones", - "poll.modal.timezoneDiffers.button.usePollTimezone": "Original time zone", - "poll.save": "Save", - "poll.share": "Share the link and invite others to the poll.", - "poll.share.notice": "Anyone who knows the link can see your poll. If this contains private data, you should only pass on this link via encrypted e-mail or chat with end-to-end-encryption.", - "poll.input.showEvaluation.hide": "Hide", - "poll.input.showEvaluation.show": "Show", - "pollTypes.findADate.label": "I would like to make a date. (e.g. date or time for appointment)", - "pollTypes.makeAPoll.label": "I would like to answer a question. (e.g. what goes best with coffee?)", - }, - "de": { - "answerTypes.yes.label": "Ja", - "answerTypes.no.label": "Nein", - "answerTypes.maybe.label": "Vielleicht", - "answerTypes.freeText.label": "Freitext erlauben", - "answerTypes.yesNo.label": "Ja, Nein", - "answerTypes.yesNoMaybe.label": "Ja, Nein, Vielleicht", - "create.index.input.pollType.label": "Was ist der Zweck deiner Umfrage?", - "create.meta.input.title.label": "Titel", - "create.meta.input.title.placeholder": "Füge einen Umfragetitel hinzu.", - "create.meta.input.description.label": "Beschreibung", - "create.meta.input.description.placeholder": "Optional: Füge der Umfrage eine Beschreibung hinzu.", - "create.next": "Weiter", - "create.options.button.add.label": "Weitere Option nach dieser hinzufügen", - "create.options.button.delete.label": "Diese Option löschen", - "create.options.options.label": "Antwort-Optionen", - "create.options.error.notEnoughDates": "Es müssen entweder zwei Tage ausgewählt, oder ein Tag und die Option 'Uhrzeiten festlegen' gewählt werden.", - "create.options.error.notEnoughOptions": "Es müssen mindestens zwei Antwort-Optionen eingetragen werden.", - "create.options.defineTimes.label": "Uhrzeiten festlegen?", - "create.options.input.moreOptions.label": "weitere Antwort-Optionen hinzufügen", - "create.options-datetime.datetimes.label": "Uhrzeiten", - "create.options-datetime.more-inputs": "Weitere Uhrzeiten eingeben", - "create.options-datetime.copy-first-line": "Uhrzeiten der ersten Zeile für alle anderen übernehmen", - "create.options-datetime.error.notEnoughTimes": "Es muss mindestens eine gültige Uhrzeit pro Tag festgelegt werden. Falls nur ein einziger Tag ausgewählt wurde, müssen mindestens 2 Uhrzeiten festgelegt werden.", - "create.options-datetime.error.correctTimeFormat": "Uhrzeiten müssen als Stunden und Minuten getrennt durch einen Doppelpunkt eingegeben werden (z.B. 13:00).", - "create.settings.answerType.label": "Welche Antworten sollen verfügbar sein?", - "create.settings.anonymousUser.label": "Anonyme Teilnahme an der Umfrage erlauben?", - "create.settings.expirationDate.label": "Wann soll Ihre Umfrage verfallen und gelöscht werden?", - "create.settings.expirationDurations.P7D": "in einer Woche", - "create.settings.expirationDurations.P1M": "in einem Monat", - "create.settings.expirationDurations.P3M": "in drei Monaten", - "create.settings.expirationDurations.P6M": "in einem halben Jahr", - "create.settings.expirationDurations.P1Y": "in einem Jahr", - "create.settings.expirationDurations.never": "niemals", - "create.settings.forceAnswer.label": "Eine Antwort für jede Option erzwingen?", - "create.save": "Speichern", - "errors.inclusion": "ist kein Bestandteil der Liste", - "errors.exclusion": "reserviert", - "errors.invalid": "ungültig", - "errors.confirmation": "stimmt nicht mit {{attribute}} überein", - "errors.accepted": "muss akzeptiert werden", - "errors.empty": "darf nicht freigelassen sein", - "errors.blank": "Muss ausgefüllt werden.", - "errors.present": "Muss frei bleiben.", - "errors.tooLong": "ist zu lang (Maximum sind {{count}} Zeichen)", - "errors.tooShort": "Bitte gebe mindestens {{count}} Zeichen ein.", - "errors.wrongLength": "hat die falsche Länge (Mindestlänge {{count}} Zeichen)", - "errors.notANumber": "ist keine Zahl", - "errors.notAnInteger": "Muss eine ganze Zahl sein.", - "errors.greaterThan": "muss größer als {{count}} sein", - "errors.greaterThanOrEqualTo": "muss größer oder gleich {{count}} sein", - "errors.equalTo": "muss gleich {{count}} sein", - "errors.lessThan": "muss kleiner als {{count}} sein", - "errors.lessThanOrEqualTo": "muss kleiner oder gleich {{count}} sein", - "errors.otherThan": "muss einen anderen Wert als {{count}} haben", - "errors.odd": "muss ungleich sein", - "errors.even": "muss gleich sein", - "errors.url": "ist keine gültige URL", - "index.title": "Croodle vereinfacht die Termin- und Entscheidungsfindung ...
... und schützt dabei deine Daten", - "index.features.title": "Funktionen", - "index.features.list.overview": "Finde einen Termin oder mache eine Umfrage mit so vielen Leuten, wie du möchtest.", - "index.features.list.privacy": "Deine Daten bleiben privat: Sie werden bereits in deinem Browser verschlüsselt. Worum es in deiner Umfrage geht, wissen nur die Personen, denen du den Umfrage-Link sendest.", - "index.features.list.options": "Du kannst so viele Antwortmöglichkeiten festlegen, wie du möchtest. Du kannst deinen Wunschtermin im Kalender auswählen, oder beliebige Fragen erstellen.", - "index.features.list.answers": "Du kannst vordefinierte Anwortmöglichkeiten nutzen, wie zum Beispiel ja, nein, vielleicht oder selbsterstellte Antworten erlauben.", - "index.features.list.evaluation": "Du behälst den Überblick durch eine automatisch aktualisierte Übersicht der bevorzugten Antworten.", - "index.link.have-a-try": "probiere es jetzt aus", - "index.hoster.title": "Hoste dein eigenes Croodle:", - "index.hoster.text": "Du musst diesem Croodle nicht vertrauen. Croodle ist freie Software und kannst sie auf deinem eigenen Server installieren. Hierzu werden lediglich einige Megabyte Speicherplatz, PHP und SSL-Verschlüsselung benötigt. Die Software und Tipps zur Installation findest du auf GitHub.", - "modal.save-retry.title": "Speichern fehlgeschlagen.", - "modal.save-retry.text": "

Deine Teilnahme konnte nicht gespeichert werden. Bitte prüfe deine Internetverbindung und versuche es anschließend erneut.

Sollte dies nicht helfen, kann ein kurzfristiges Ausfall des Servers schuld sein. Warte bitte einige Minuten bevor du es erneut versuchst. Du kannst die Seite so lange geöffnet lassen.

Sollten die Probleme anhalten, wende dich bitte an die Administratoren der Seite.

", - "modal.save-retry.button-retry": "erneut versuchen", - "poll.created-time": "Erstellt am {{creationDate}}.", - "poll.error.newUser.everyOptionIsAnswered": "Bitte beantworte jede Option.", - "poll.error.newUserName": "Du musst einen Nutzernamen angeben.", - "poll.evaluation.label": "Auswertung", - "poll.evaluation.bestOption.label.findADate.one": "Der bevorzugte Termin ist", - "poll.evaluation.bestOption.label.findADate.other": "Die bevorzugten Termine sind", - "poll.evaluation.bestOption.label.makeAPoll.one": "Die bevorzugte Option ist", - "poll.evaluation.bestOption.label.makeAPoll.other": "Die bevorzugten Optionen sind", - "poll.evaluation.bestOptionParticipants.findADate.yes.one": "Eine Person hat Zeit.", - "poll.evaluation.bestOptionParticipants.findADate.yes.other": "{{count}} Personen haben Zeit.", - "poll.evaluation.bestOptionParticipants.findADate.maybe.one": "Eine Person hat vielleicht Zeit.", - "poll.evaluation.bestOptionParticipants.findADate.maybe.other": "{{count}} Personen haben vielleicht Zeit.", - "poll.evaluation.bestOptionParticipants.findADate.no.one": "Eine Person hat keine Zeit.", - "poll.evaluation.bestOptionParticipants.findADate.no.other": "{{count}} Personen haben keine Zeit.", - "poll.evaluation.bestOptionParticipants.makeAPoll.yes.one": "Einer Person gefällt diese Option.", - "poll.evaluation.bestOptionParticipants.makeAPoll.yes.other": "{{count}} Personen gefällt diese Option.", - "poll.evaluation.bestOptionParticipants.makeAPoll.maybe.one": "Einer Person gefällt diese Option vielleicht.", - "poll.evaluation.bestOptionParticipants.makeAPoll.maybe.other": "{{count}} Personen gefällt diese Option vielleicht.", - "poll.evaluation.bestOptionParticipants.makeAPoll.no.one": "Einer Person gefällt diese Option nicht.", - "poll.evaluation.bestOptionParticipants.makeAPoll.no.other": "{{count}} Personen gefällt diese Option nicht.", - "poll.evaluation.lastParticipation": "Die letzte Person hat {{ago}} teilgenommen.", - "poll.evaluation.participants.one": "Eine Person hat sich an der Umfrage beteiligt.", - "poll.evaluation.participants.other": "{{count}} Personen haben sich an der Umfrage beteiligt.", - "poll.input.newUserName.label": "Name", - "poll.input.newUserName.placeholder": "Dein Name", - "poll.modal.timezoneDiffers.title": "In welcher Zeitzone sollen die Daten angezeigt werden?", - "poll.modal.timezoneDiffers.body": "Die Umfrage wurde für eine Zeitzone angelegt, die von deiner lokalen Zeit abweicht. In welcher Zeitzone sollen die Daten angezeigt werden?", - "poll.modal.timezoneDiffers.button.useLocalTimezone": "meine Zeitzone", - "poll.modal.timezoneDiffers.button.usePollTimezone": "Original-Zeitzone", - "poll.save": "Speichern", - "poll.share": "Teile den Link und lade Andere zu deiner Umfrage ein.", - "poll.share.notice": "Jeder der den Link kennt, kann deine Umfrage ansehen. Falls diese private Daten enthält, solltest du den Link nur per verschlüsselter Mail oder Chat mit End-to-End-Verschlüsselung weitergeben.", - "poll.input.showEvaluation.hide": "Verbergen", - "poll.input.showEvaluation.show": "Anzeigen", - "pollTypes.findADate.label": "Ich möchte einen Termin finden. (z.B. Datum oder Uhrzeit für eine Verabredung)", - "pollTypes.makeAPoll.label": "Ich möchte eine Frage beantworten. (z.B. Wozu schmeckt Kaffe am Besten?)", - }, - "es": { - "answerTypes.yes.label": "Si", - "answerTypes.no.label": "No", - "answerTypes.maybe.label": "Quizás", - "answerTypes.freeText.label": "Permitir escribir texto libremente", - "answerTypes.yesNo.label": "Si, No", - "answerTypes.yesNoMaybe.label": "Si, No, Quizás", - "create.index.input.pollType.label": "¿Que tipo de encuesta quieres hacer?", - "create.meta.input.title.label": "Título", - "create.meta.input.title.placeholder": "Añde el título de la encuesta.", - "create.meta.input.description.label": "Descripción", - "create.meta.input.description.placeholder": "Opcional: Añade una descripción a la encuesta.", - "create.next": "Siguiente", - "create.options.button.add.label": "add another option after this one", - "create.options.button.delete.label": "delete this option", - "create.options.options.label": "Opciones de respuesta", - "create.options.error.notEnoughDates": "Tienes que elegir almenos dos días o un único día con la opción 'establecer horarios'.", - "create.options.error.notEnoughOptions": "Introduce almenos dos opciones para la respuesta.", - "create.options.defineTimes.label": "¿Establecer horarios?", - "create.options.input.moreOptions.label": "Añadir más opciones de respuesta", - "create.options-datetime.datetimes.label": "Horarios", - "create.options-datetime.more-inputs": "Añadir más horarios", - "create.options-datetime.copy-first-line": "Utilizar el horario de la primera línea para todas las demás.", - "create.options-datetime.error.notEnoughTimes": "Ha de establecerse almenos un horario correcto para cada día. Si se ha elegido únicamente un día, hay que establecer almenos dos horarios.", - "create.options-datetime.error.correctTimeFormat": "Las horas y minutos del horario deben ser separadas por el caracter dospuntos (p.ej. 13:00).", - "create.settings.answerType.label": "¿Que respuesta debería estar disponible?", - "create.settings.anonymousUser.label": "¿permitir participantes anónimos en la encuesta?", - "create.settings.expirationDate.label": "When should the poll expire and be deleted?", - "create.settings.expirationDurations.P7D": "a week from today", - "create.settings.expirationDurations.P1M": "a month from today", - "create.settings.expirationDurations.P3M": "three month from today", - "create.settings.expirationDurations.P6M": "six month from today", - "create.settings.expirationDurations.P1Y": "a year from today", - "create.settings.expirationDurations.never": "never", - "create.settings.forceAnswer.label": "¿Obligar a responder todas las preguntas/opciones?", - "create.save": "Guardar", - "errors.inclusion": "no es parte de la lista", - "errors.exclusion": "reservado", - "errors.invalid": "invalido", - "errors.confirmation": "no concuerda con {{attribute}}", - "errors.accepted": "tiene que ser aceptado", - "errors.empty": "no puede dejarse vacío", - "errors.blank": "Debe rellenarse.", - "errors.present": "Debe dejarse vacío", - "errors.tooLong": "Es demasiado largo (el máximo son {{count}} caractéres)", - "errors.tooShort": "Por favor, escribir un mínimo de {{count}} caractéres.", - "errors.wrongLength": "tiene una longitud incorrecta (Un minimo de {{count}} caractéres)", - "errors.notANumber": "no es un número", - "errors.notAnInteger": "Tiene que ser un número entero.", - "errors.greaterThan": "tiene que ser mayor que {{count}}", - "errors.greaterThanOrEqualTo": "tiene que ser mayor o igual a {{count}}", - "errors.equalTo": "tiene que ser igual a {{count}}", - "errors.lessThan": "tiene que ser menor que {{count}}", - "errors.lessThanOrEqualTo": "tiene que ser menor o igual a {{count}}", - "errors.otherThan": "tiene que ser un número distinto que {{count}}", - "errors.odd": "tiene que ser distinto que", - "errors.even": "tiene que ser igual que", - "errors.url": "no es una URL valida", - "index.title": "Croodle simplifica las citas y la toma de decisiones ...
... y al mismo tiempo protege tus datos", - "index.features.title": "Funciones", - "index.features.list.overview": "Encontrar una fecha o hacer una encuesta con la cantidad de personas que quieras.", - "index.features.list.privacy": "Tus datos son privados: Ya desde tu navegador los datos son encriptados. ünicamente las personas a las que mandes el enlace directamente sabrán que tu encuesta existe y de que se trata.", - "index.features.list.options": "Puedes incluir tantas opciones de respuesta como quieras. Puedes elegir tus fechas preferidas o escribir cualquier pregunta", - "index.features.list.answers": "Puedes utilizar respuestas pre definidas como si,no, quizás o permitir una respuesta libre.", - "index.features.list.evaluation": "Mantendrás el control mediante la revisión de las respuestas favoritas.", - "index.link.have-a-try": "pruebalo ahora", - "index.hoster.title": "Instala tu propio Croodle:", - "index.hoster.text": "No tienes porque fiarte de este Croodle. Croodle es software libre y tu puedes instalarlo en tu propio servidor. Sólo unos pocos megas de espacio, PHP y encriptación-SSL. Puesde encontrar el software y ayuda en inglés para la instalación aquí GitHub.", - "modal.save-retry.title": "Error al guardar", - "modal.save-retry.text": "

Tu inscripción no pudo ser guardada. Por favor, comprueba tu conexión a internet e inténtalo de nuevo.

Si esto no ayuda, podría ser debido a un breve fallo en el servidor. Por favor, espera unos minutos e inténtalo de nuevo. Puedes esperar mientras la página se abre.

Si los problemas continúan, por favor, contacte al administrador de la página.

", - "modal.save-retry.button-retry": "Reintentar", - "poll.created-time": "Creada el {{creationDate}}.", - "poll.error.newUser.everyOptionIsAnswered": "Por favor responde a todas las opciones.", - "poll.error.newUserName": "Tienes que poner un nombre.", - "poll.evaluation.label": "Evaluar", - "poll.evaluation.bestOption.label.findADate.one": "The preferred date is", - "poll.evaluation.bestOption.label.findADate.other": "The preferred dates are", - "poll.evaluation.bestOption.label.makeAPoll.one": "The preferred option is", - "poll.evaluation.bestOption.label.makeAPoll.other": "The preferred options are", - "poll.evaluation.bestOptionParticipants.findADate.yes.one": "One person has time.", - "poll.evaluation.bestOptionParticipants.findADate.yes.other": "{{count}} persons have time.", - "poll.evaluation.bestOptionParticipants.findADate.maybe.one": "One person has maybe time.", - "poll.evaluation.bestOptionParticipants.findADate.maybe.other": "{{count}} have maybe time.", - "poll.evaluation.bestOptionParticipants.findADate.no.one": "One person has no time.", - "poll.evaluation.bestOptionParticipants.findADate.no.other": "{{count}} persons have no time.", - "poll.evaluation.bestOptionParticipants.makeAPoll.yes.one": "One person likes this option.", - "poll.evaluation.bestOptionParticipants.makeAPoll.yes.other": "{{count}} persons like these option.", - "poll.evaluation.bestOptionParticipants.makeAPoll.maybe.one": "One person maybe likes these option.", - "poll.evaluation.bestOptionParticipants.makeAPoll.maybe.other": "{{count}} persons like these option.", - "poll.evaluation.bestOptionParticipants.makeAPoll.no.one": "One person does not like these option.", - "poll.evaluation.bestOptionParticipants.makeAPoll.no.other": "{{count}} persons does not like these options.", - "poll.evaluation.lastParticipation": "The last person has participated {{ago}}.", - "poll.evaluation.participants.one": "One person had participated in the poll.", - "poll.evaluation.participants.other": "{{count}} persons have participated in the poll.", - "poll.input.newUserName.label": "Name", - "poll.input.newUserName.placeholder": "Tu nombre", - "poll.modal.timezoneDiffers.title": "¿Que zona horaria deseas utilizar para mostrar los datos?", - "poll.modal.timezoneDiffers.body": "La encuesta ha sido configurada para una zona horaria distinta de tu hora local. ¿Con qué zona horaria debería mostrarse la información?", - "poll.modal.timezoneDiffers.button.useLocalTimezone": "mi zona horaria", - "poll.modal.timezoneDiffers.button.usePollTimezone": "la zona horaria original", - "poll.save": "Guardar", - "poll.share": "Comparte el enlace e invita a otras personas a la encuesta.", - "poll.share.notice": "Cualquiera que conozca el enlace podrá ver tu encuesta. Si esta contiene información privada deberías compartir el enlace únicamente mediante un correo electrónico encriptado o mediante chat con encriptación de-punto-a-punto.", - "poll.input.showEvaluation.hide": "Esconder", - "poll.input.showEvaluation.show": "Mostrar", - "pollTypes.findADate.label": "Querría crear una fecha (p. ej. fecha para una reunión).", - "pollTypes.makeAPoll.label": "Querría responder a una pregunta (p. ej. ¿con que tomas el café?).", - }, -}; diff --git a/app/locales/de/translations.js b/app/locales/de/translations.js new file mode 100644 index 0000000..c7bd056 --- /dev/null +++ b/app/locales/de/translations.js @@ -0,0 +1,108 @@ +export default { + "answerTypes.yes.label": "Ja", + "answerTypes.no.label": "Nein", + "answerTypes.maybe.label": "Vielleicht", + "answerTypes.freeText.label": "Freitext erlauben", + "answerTypes.yesNo.label": "Ja, Nein", + "answerTypes.yesNoMaybe.label": "Ja, Nein, Vielleicht", + "create.index.input.pollType.label": "Was ist der Zweck deiner Umfrage?", + "create.meta.input.title.label": "Titel", + "create.meta.input.title.placeholder": "Füge einen Umfragetitel hinzu.", + "create.meta.input.description.label": "Beschreibung", + "create.meta.input.description.placeholder": "Optional: Füge der Umfrage eine Beschreibung hinzu.", + "create.next": "Weiter", + "create.options.button.add.label": "Weitere Option nach dieser hinzufügen", + "create.options.button.delete.label": "Diese Option löschen", + "create.options.options.label": "Antwort-Optionen", + "create.options.error.notEnoughDates": "Es müssen entweder zwei Tage ausgewählt, oder ein Tag und die Option 'Uhrzeiten festlegen' gewählt werden.", + "create.options.error.notEnoughOptions": "Es müssen mindestens zwei Antwort-Optionen eingetragen werden.", + "create.options.defineTimes.label": "Uhrzeiten festlegen?", + "create.options.input.moreOptions.label": "weitere Antwort-Optionen hinzufügen", + "create.options-datetime.datetimes.label": "Uhrzeiten", + "create.options-datetime.more-inputs": "Weitere Uhrzeiten eingeben", + "create.options-datetime.copy-first-line": "Uhrzeiten der ersten Zeile für alle anderen übernehmen", + "create.options-datetime.error.notEnoughTimes": "Es muss mindestens eine gültige Uhrzeit pro Tag festgelegt werden. Falls nur ein einziger Tag ausgewählt wurde, müssen mindestens 2 Uhrzeiten festgelegt werden.", + "create.options-datetime.error.correctTimeFormat": "Uhrzeiten müssen als Stunden und Minuten getrennt durch einen Doppelpunkt eingegeben werden (z.B. 13:00).", + "create.settings.answerType.label": "Welche Antworten sollen verfügbar sein?", + "create.settings.anonymousUser.label": "Anonyme Teilnahme an der Umfrage erlauben?", + "create.settings.expirationDate.label": "Wann soll Ihre Umfrage verfallen und gelöscht werden?", + "create.settings.expirationDurations.P7D": "in einer Woche", + "create.settings.expirationDurations.P1M": "in einem Monat", + "create.settings.expirationDurations.P3M": "in drei Monaten", + "create.settings.expirationDurations.P6M": "in einem halben Jahr", + "create.settings.expirationDurations.P1Y": "in einem Jahr", + "create.settings.expirationDurations.never": "niemals", + "create.settings.forceAnswer.label": "Eine Antwort für jede Option erzwingen?", + "create.save": "Speichern", + "errors.inclusion": "ist kein Bestandteil der Liste", + "errors.exclusion": "reserviert", + "errors.invalid": "ungültig", + "errors.confirmation": "stimmt nicht mit {{attribute}} überein", + "errors.accepted": "muss akzeptiert werden", + "errors.empty": "darf nicht freigelassen sein", + "errors.blank": "Muss ausgefüllt werden.", + "errors.present": "Muss frei bleiben.", + "errors.tooLong": "ist zu lang (Maximum sind {{count}} Zeichen)", + "errors.tooShort": "Bitte gebe mindestens {{count}} Zeichen ein.", + "errors.wrongLength": "hat die falsche Länge (Mindestlänge {{count}} Zeichen)", + "errors.notANumber": "ist keine Zahl", + "errors.notAnInteger": "Muss eine ganze Zahl sein.", + "errors.greaterThan": "muss größer als {{count}} sein", + "errors.greaterThanOrEqualTo": "muss größer oder gleich {{count}} sein", + "errors.equalTo": "muss gleich {{count}} sein", + "errors.lessThan": "muss kleiner als {{count}} sein", + "errors.lessThanOrEqualTo": "muss kleiner oder gleich {{count}} sein", + "errors.otherThan": "muss einen anderen Wert als {{count}} haben", + "errors.odd": "muss ungleich sein", + "errors.even": "muss gleich sein", + "errors.url": "ist keine gültige URL", + "index.title": "Croodle vereinfacht die Termin- und Entscheidungsfindung ...
... und schützt dabei deine Daten", + "index.features.title": "Funktionen", + "index.features.list.overview": "Finde einen Termin oder mache eine Umfrage mit so vielen Leuten, wie du möchtest.", + "index.features.list.privacy": "Deine Daten bleiben privat: Sie werden bereits in deinem Browser verschlüsselt. Worum es in deiner Umfrage geht, wissen nur die Personen, denen du den Umfrage-Link sendest.", + "index.features.list.options": "Du kannst so viele Antwortmöglichkeiten festlegen, wie du möchtest. Du kannst deinen Wunschtermin im Kalender auswählen, oder beliebige Fragen erstellen.", + "index.features.list.answers": "Du kannst vordefinierte Anwortmöglichkeiten nutzen, wie zum Beispiel ja, nein, vielleicht oder selbsterstellte Antworten erlauben.", + "index.features.list.evaluation": "Du behälst den Überblick durch eine automatisch aktualisierte Übersicht der bevorzugten Antworten.", + "index.link.have-a-try": "probiere es jetzt aus", + "index.hoster.title": "Hoste dein eigenes Croodle:", + "index.hoster.text": "Du musst diesem Croodle nicht vertrauen. Croodle ist freie Software und kannst sie auf deinem eigenen Server installieren. Hierzu werden lediglich einige Megabyte Speicherplatz, PHP und SSL-Verschlüsselung benötigt. Die Software und Tipps zur Installation findest du auf GitHub.", + "modal.save-retry.title": "Speichern fehlgeschlagen.", + "modal.save-retry.text": "

Deine Teilnahme konnte nicht gespeichert werden. Bitte prüfe deine Internetverbindung und versuche es anschließend erneut.

Sollte dies nicht helfen, kann ein kurzfristiges Ausfall des Servers schuld sein. Warte bitte einige Minuten bevor du es erneut versuchst. Du kannst die Seite so lange geöffnet lassen.

Sollten die Probleme anhalten, wende dich bitte an die Administratoren der Seite.

", + "modal.save-retry.button-retry": "erneut versuchen", + "poll.created-time": "Erstellt am {{creationDate}}.", + "poll.error.newUser.everyOptionIsAnswered": "Bitte beantworte jede Option.", + "poll.error.newUserName": "Du musst einen Nutzernamen angeben.", + "poll.evaluation.label": "Auswertung", + "poll.evaluation.bestOption.label.findADate.one": "Der bevorzugte Termin ist", + "poll.evaluation.bestOption.label.findADate.other": "Die bevorzugten Termine sind", + "poll.evaluation.bestOption.label.makeAPoll.one": "Die bevorzugte Option ist", + "poll.evaluation.bestOption.label.makeAPoll.other": "Die bevorzugten Optionen sind", + "poll.evaluation.bestOptionParticipants.findADate.yes.one": "Eine Person hat Zeit.", + "poll.evaluation.bestOptionParticipants.findADate.yes.other": "{{count}} Personen haben Zeit.", + "poll.evaluation.bestOptionParticipants.findADate.maybe.one": "Eine Person hat vielleicht Zeit.", + "poll.evaluation.bestOptionParticipants.findADate.maybe.other": "{{count}} Personen haben vielleicht Zeit.", + "poll.evaluation.bestOptionParticipants.findADate.no.one": "Eine Person hat keine Zeit.", + "poll.evaluation.bestOptionParticipants.findADate.no.other": "{{count}} Personen haben keine Zeit.", + "poll.evaluation.bestOptionParticipants.makeAPoll.yes.one": "Einer Person gefällt diese Option.", + "poll.evaluation.bestOptionParticipants.makeAPoll.yes.other": "{{count}} Personen gefällt diese Option.", + "poll.evaluation.bestOptionParticipants.makeAPoll.maybe.one": "Einer Person gefällt diese Option vielleicht.", + "poll.evaluation.bestOptionParticipants.makeAPoll.maybe.other": "{{count}} Personen gefällt diese Option vielleicht.", + "poll.evaluation.bestOptionParticipants.makeAPoll.no.one": "Einer Person gefällt diese Option nicht.", + "poll.evaluation.bestOptionParticipants.makeAPoll.no.other": "{{count}} Personen gefällt diese Option nicht.", + "poll.evaluation.lastParticipation": "Die letzte Person hat {{ago}} teilgenommen.", + "poll.evaluation.participants.one": "Eine Person hat sich an der Umfrage beteiligt.", + "poll.evaluation.participants.other": "{{count}} Personen haben sich an der Umfrage beteiligt.", + "poll.input.newUserName.label": "Name", + "poll.input.newUserName.placeholder": "Dein Name", + "poll.modal.timezoneDiffers.title": "In welcher Zeitzone sollen die Daten angezeigt werden?", + "poll.modal.timezoneDiffers.body": "Die Umfrage wurde für eine Zeitzone angelegt, die von deiner lokalen Zeit abweicht. In welcher Zeitzone sollen die Daten angezeigt werden?", + "poll.modal.timezoneDiffers.button.useLocalTimezone": "meine Zeitzone", + "poll.modal.timezoneDiffers.button.usePollTimezone": "Original-Zeitzone", + "poll.save": "Speichern", + "poll.share": "Teile den Link und lade Andere zu deiner Umfrage ein.", + "poll.share.notice": "Jeder der den Link kennt, kann deine Umfrage ansehen. Falls diese private Daten enthält, solltest du den Link nur per verschlüsselter Mail oder Chat mit End-to-End-Verschlüsselung weitergeben.", + "poll.input.showEvaluation.hide": "Verbergen", + "poll.input.showEvaluation.show": "Anzeigen", + "pollTypes.findADate.label": "Ich möchte einen Termin finden. (z.B. Datum oder Uhrzeit für eine Verabredung)", + "pollTypes.makeAPoll.label": "Ich möchte eine Frage beantworten. (z.B. Wozu schmeckt Kaffe am Besten?)" +}; diff --git a/app/locales/en/translations.js b/app/locales/en/translations.js new file mode 100644 index 0000000..7f96892 --- /dev/null +++ b/app/locales/en/translations.js @@ -0,0 +1,108 @@ +export default { + "answerTypes.yes.label": "Yes", + "answerTypes.no.label": "No", + "answerTypes.maybe.label": "Maybe", + "answerTypes.freeText.label": "Allow free text", + "answerTypes.yesNo.label": "Yes, No", + "answerTypes.yesNoMaybe.label": "Yes, No, Maybe", + "create.index.input.pollType.label": "What is the purpose of your poll?", + "create.meta.input.title.label": "Title", + "create.meta.input.title.placeholder": "Add a poll title.", + "create.meta.input.description.label": "Description", + "create.meta.input.description.placeholder": "Optional: Add a description to the poll.", + "create.next": "Next", + "create.options.button.add.label": "add another option after this one", + "create.options.button.delete.label": "delete this option", + "create.options.options.label": "Answer options", + "create.options.error.notEnoughDates": "You have to choose either two days or one day plus the option 'set times'.", + "create.options.error.notEnoughOptions": "Enter at least two answer options.", + "create.options.defineTimes.label": "Set times?", + "create.options.input.moreOptions.label": "Add further answer options", + "create.options-datetime.datetimes.label": "Times", + "create.options-datetime.more-inputs": "Add further times", + "create.options-datetime.copy-first-line": "Adopt times of the first line for all others", + "create.options-datetime.error.notEnoughTimes": "At least one valid time has to be set per day. If only one day was chosen, at least two times have to be set.", + "create.options-datetime.error.correctTimeFormat": "Hours and minutes of the time have to be separated by a colon (e.g. 13:00).", + "create.settings.answerType.label": "Which answers should be available?", + "create.settings.anonymousUser.label": "Allow anonymous participation in the poll?", + "create.settings.expirationDate.label": "When should the poll expire and be deleted?", + "create.settings.expirationDurations.P7D": "a week from today", + "create.settings.expirationDurations.P1M": "a month from today", + "create.settings.expirationDurations.P3M": "three month from today", + "create.settings.expirationDurations.P6M": "six month from today", + "create.settings.expirationDurations.P1Y": "a year from today", + "create.settings.expirationDurations.never": "never", + "create.settings.forceAnswer.label": "Force answer for every option?", + "create.save": "Save", + "errors.inclusion": "is not part of the list", + "errors.exclusion": "reserved", + "errors.invalid": "invalid", + "errors.confirmation": "does not accord with {{attribute}}", + "errors.accepted": "has to be accepted", + "errors.empty": "cannot be left blank", + "errors.blank": "Must be filled in.", + "errors.present": "Has to be left blank.", + "errors.tooLong": "is too long (Maximum are {{count}} characters)", + "errors.tooShort": "Please insert at least {{count}} characters.", + "errors.wrongLength": "has invalid length (Minimum length {{count}} characters)", + "errors.notANumber": "is not a number", + "errors.notAnInteger": "Has to be a whole number.", + "errors.greaterThan": "has to be bigger than {{count}}", + "errors.greaterThanOrEqualTo": "must be bigger or same as {{count}}", + "errors.equalTo": "must equal {{count}}", + "errors.lessThan": "must be smaller than {{count}}", + "errors.lessThanOrEqualTo": "must be smaller or equal to {{count}}", + "errors.otherThan": "must be a different number than {{count}}", + "errors.odd": "must be unequal to", + "errors.even": "must be equal to", + "errors.url": "is not a valid URL", + "index.title": "Croodle simplifies making appointments and finding decisions ...
... and at the same time protects your data", + "index.features.title": "Functions", + "index.features.list.overview": "Find a date or do a poll with as many people as you like.", + "index.features.list.privacy": "Your data stays private: Already in your browser they are being encrypted. Only the people who you send the link of the poll to will know what your poll is about.", + "index.features.list.options": "You can set as many answer options as you like. You can choose your preferred date or compile any questions", + "index.features.list.answers": "you can use pre-defined answer options like yes, no, maybe or allow own questions.", + "index.features.list.evaluation": "You keep the overview through overview of preferred answers.", + "index.link.have-a-try": "test it now", + "index.hoster.title": "Host your own Croodle:", + "index.hoster.text": "You don’t have to trust this Croodle. Croodle is a free software and you can install it on your own server. You only a few megabytes memory capacity, PHP and SSL-encryption. You can find the software and tips for installation here GitHub.", + "modal.save-retry.title": "Save failed", + "modal.save-retry.text": "

Your membership could not be saved. Please check your Internet connection and try it again.

If this does not help, a short-term failure of the server could be the problem. Please wait a few minutes before trying again. You can leave as long as the page opens.

If problem persists, please contact contact administrators of the page.

", + "modal.save-retry.button-retry": "Retry", + "poll.created-time": "Created on {{creationDate}}.", + "poll.error.newUser.everyOptionIsAnswered": "Please answer ever option.", + "poll.error.newUserName": "You have to give a user name.", + "poll.evaluation.label": "Evaluation", + "poll.evaluation.bestOption.label.findADate.one": "The preferred date is", + "poll.evaluation.bestOption.label.findADate.other": "The preferred dates are", + "poll.evaluation.bestOption.label.makeAPoll.one": "The preferred choice is", + "poll.evaluation.bestOption.label.makeAPoll.other": "The preferred choices are", + "poll.evaluation.bestOptionParticipants.findADate.yes.one": "One person is available.", + "poll.evaluation.bestOptionParticipants.findADate.yes.other": "{{count}} persons are available.", + "poll.evaluation.bestOptionParticipants.findADate.maybe.one": "One person is maybe available.", + "poll.evaluation.bestOptionParticipants.findADate.maybe.other": "{{count}} are maybe available.", + "poll.evaluation.bestOptionParticipants.findADate.no.one": "One person is unavailable.", + "poll.evaluation.bestOptionParticipants.findADate.no.other": "{{count}} persons are unavailable.", + "poll.evaluation.bestOptionParticipants.makeAPoll.yes.one": "One person ticks this choice.", + "poll.evaluation.bestOptionParticipants.makeAPoll.yes.other": "{{count}} persons tick this choice.", + "poll.evaluation.bestOptionParticipants.makeAPoll.maybe.one": "One person will maybe tick this choice.", + "poll.evaluation.bestOptionParticipants.makeAPoll.maybe.other": "{{count}} persons will maybe tick this choice.", + "poll.evaluation.bestOptionParticipants.makeAPoll.no.one": "One person won't tick this choice.", + "poll.evaluation.bestOptionParticipants.makeAPoll.no.other": "{{count}} persons won't tick this choice.", + "poll.evaluation.lastParticipation": "The last one participated {{ago}}.", + "poll.evaluation.participants.one": "One person had participated in the poll.", + "poll.evaluation.participants.other": "{{count}} persons have participated in the poll.", + "poll.input.newUserName.label": "Name", + "poll.input.newUserName.placeholder": "Your name", + "poll.modal.timezoneDiffers.title": "Which time zone should be used to display the data?", + "poll.modal.timezoneDiffers.body": "The poll has been set up for a time zone that differs from your local time. Which time zone should be used to display the data?", + "poll.modal.timezoneDiffers.button.useLocalTimezone": "my time zones", + "poll.modal.timezoneDiffers.button.usePollTimezone": "Original time zone", + "poll.save": "Save", + "poll.share": "Share the link and invite others to the poll.", + "poll.share.notice": "Anyone who knows the link can see your poll. If this contains private data, you should only pass on this link via encrypted e-mail or chat with end-to-end-encryption.", + "poll.input.showEvaluation.hide": "Hide", + "poll.input.showEvaluation.show": "Show", + "pollTypes.findADate.label": "I would like to make a date. (e.g. date or time for appointment)", + "pollTypes.makeAPoll.label": "I would like to answer a question. (e.g. what goes best with coffee?)" +} diff --git a/app/locales/es/translations.js b/app/locales/es/translations.js new file mode 100644 index 0000000..dfcffe3 --- /dev/null +++ b/app/locales/es/translations.js @@ -0,0 +1,108 @@ +export default { + "answerTypes.yes.label": "Si", + "answerTypes.no.label": "No", + "answerTypes.maybe.label": "Quizás", + "answerTypes.freeText.label": "Permitir escribir texto libremente", + "answerTypes.yesNo.label": "Si, No", + "answerTypes.yesNoMaybe.label": "Si, No, Quizás", + "create.index.input.pollType.label": "¿Que tipo de encuesta quieres hacer?", + "create.meta.input.title.label": "Título", + "create.meta.input.title.placeholder": "Añde el título de la encuesta.", + "create.meta.input.description.label": "Descripción", + "create.meta.input.description.placeholder": "Opcional: Añade una descripción a la encuesta.", + "create.next": "Siguiente", + "create.options.button.add.label": "add another option after this one", + "create.options.button.delete.label": "delete this option", + "create.options.options.label": "Opciones de respuesta", + "create.options.error.notEnoughDates": "Tienes que elegir almenos dos días o un único día con la opción 'establecer horarios'.", + "create.options.error.notEnoughOptions": "Introduce almenos dos opciones para la respuesta.", + "create.options.defineTimes.label": "¿Establecer horarios?", + "create.options.input.moreOptions.label": "Añadir más opciones de respuesta", + "create.options-datetime.datetimes.label": "Horarios", + "create.options-datetime.more-inputs": "Añadir más horarios", + "create.options-datetime.copy-first-line": "Utilizar el horario de la primera línea para todas las demás.", + "create.options-datetime.error.notEnoughTimes": "Ha de establecerse almenos un horario correcto para cada día. Si se ha elegido únicamente un día, hay que establecer almenos dos horarios.", + "create.options-datetime.error.correctTimeFormat": "Las horas y minutos del horario deben ser separadas por el caracter dospuntos (p.ej. 13:00).", + "create.settings.answerType.label": "¿Que respuesta debería estar disponible?", + "create.settings.anonymousUser.label": "¿permitir participantes anónimos en la encuesta?", + "create.settings.expirationDate.label": "When should the poll expire and be deleted?", + "create.settings.expirationDurations.P7D": "a week from today", + "create.settings.expirationDurations.P1M": "a month from today", + "create.settings.expirationDurations.P3M": "three month from today", + "create.settings.expirationDurations.P6M": "six month from today", + "create.settings.expirationDurations.P1Y": "a year from today", + "create.settings.expirationDurations.never": "never", + "create.settings.forceAnswer.label": "¿Obligar a responder todas las preguntas/opciones?", + "create.save": "Guardar", + "errors.inclusion": "no es parte de la lista", + "errors.exclusion": "reservado", + "errors.invalid": "invalido", + "errors.confirmation": "no concuerda con {{attribute}}", + "errors.accepted": "tiene que ser aceptado", + "errors.empty": "no puede dejarse vacío", + "errors.blank": "Debe rellenarse.", + "errors.present": "Debe dejarse vacío", + "errors.tooLong": "Es demasiado largo (el máximo son {{count}} caractéres)", + "errors.tooShort": "Por favor, escribir un mínimo de {{count}} caractéres.", + "errors.wrongLength": "tiene una longitud incorrecta (Un minimo de {{count}} caractéres)", + "errors.notANumber": "no es un número", + "errors.notAnInteger": "Tiene que ser un número entero.", + "errors.greaterThan": "tiene que ser mayor que {{count}}", + "errors.greaterThanOrEqualTo": "tiene que ser mayor o igual a {{count}}", + "errors.equalTo": "tiene que ser igual a {{count}}", + "errors.lessThan": "tiene que ser menor que {{count}}", + "errors.lessThanOrEqualTo": "tiene que ser menor o igual a {{count}}", + "errors.otherThan": "tiene que ser un número distinto que {{count}}", + "errors.odd": "tiene que ser distinto que", + "errors.even": "tiene que ser igual que", + "errors.url": "no es una URL valida", + "index.title": "Croodle simplifica las citas y la toma de decisiones ...
... y al mismo tiempo protege tus datos", + "index.features.title": "Funciones", + "index.features.list.overview": "Encontrar una fecha o hacer una encuesta con la cantidad de personas que quieras.", + "index.features.list.privacy": "Tus datos son privados: Ya desde tu navegador los datos son encriptados. ünicamente las personas a las que mandes el enlace directamente sabrán que tu encuesta existe y de que se trata.", + "index.features.list.options": "Puedes incluir tantas opciones de respuesta como quieras. Puedes elegir tus fechas preferidas o escribir cualquier pregunta", + "index.features.list.answers": "Puedes utilizar respuestas pre definidas como si,no, quizás o permitir una respuesta libre.", + "index.features.list.evaluation": "Mantendrás el control mediante la revisión de las respuestas favoritas.", + "index.link.have-a-try": "pruebalo ahora", + "index.hoster.title": "Instala tu propio Croodle:", + "index.hoster.text": "No tienes porque fiarte de este Croodle. Croodle es software libre y tu puedes instalarlo en tu propio servidor. Sólo unos pocos megas de espacio, PHP y encriptación-SSL. Puesde encontrar el software y ayuda en inglés para la instalación aquí GitHub.", + "modal.save-retry.title": "Error al guardar", + "modal.save-retry.text": "

Tu inscripción no pudo ser guardada. Por favor, comprueba tu conexión a internet e inténtalo de nuevo.

Si esto no ayuda, podría ser debido a un breve fallo en el servidor. Por favor, espera unos minutos e inténtalo de nuevo. Puedes esperar mientras la página se abre.

Si los problemas continúan, por favor, contacte al administrador de la página.

", + "modal.save-retry.button-retry": "Reintentar", + "poll.created-time": "Creada el {{creationDate}}.", + "poll.error.newUser.everyOptionIsAnswered": "Por favor responde a todas las opciones.", + "poll.error.newUserName": "Tienes que poner un nombre.", + "poll.evaluation.label": "Evaluar", + "poll.evaluation.bestOption.label.findADate.one": "The preferred date is", + "poll.evaluation.bestOption.label.findADate.other": "The preferred dates are", + "poll.evaluation.bestOption.label.makeAPoll.one": "The preferred option is", + "poll.evaluation.bestOption.label.makeAPoll.other": "The preferred options are", + "poll.evaluation.bestOptionParticipants.findADate.yes.one": "One person has time.", + "poll.evaluation.bestOptionParticipants.findADate.yes.other": "{{count}} persons have time.", + "poll.evaluation.bestOptionParticipants.findADate.maybe.one": "One person has maybe time.", + "poll.evaluation.bestOptionParticipants.findADate.maybe.other": "{{count}} have maybe time.", + "poll.evaluation.bestOptionParticipants.findADate.no.one": "One person has no time.", + "poll.evaluation.bestOptionParticipants.findADate.no.other": "{{count}} persons have no time.", + "poll.evaluation.bestOptionParticipants.makeAPoll.yes.one": "One person likes this option.", + "poll.evaluation.bestOptionParticipants.makeAPoll.yes.other": "{{count}} persons like these option.", + "poll.evaluation.bestOptionParticipants.makeAPoll.maybe.one": "One person maybe likes these option.", + "poll.evaluation.bestOptionParticipants.makeAPoll.maybe.other": "{{count}} persons like these option.", + "poll.evaluation.bestOptionParticipants.makeAPoll.no.one": "One person does not like these option.", + "poll.evaluation.bestOptionParticipants.makeAPoll.no.other": "{{count}} persons does not like these options.", + "poll.evaluation.lastParticipation": "The last person has participated {{ago}}.", + "poll.evaluation.participants.one": "One person had participated in the poll.", + "poll.evaluation.participants.other": "{{count}} persons have participated in the poll.", + "poll.input.newUserName.label": "Name", + "poll.input.newUserName.placeholder": "Tu nombre", + "poll.modal.timezoneDiffers.title": "¿Que zona horaria deseas utilizar para mostrar los datos?", + "poll.modal.timezoneDiffers.body": "La encuesta ha sido configurada para una zona horaria distinta de tu hora local. ¿Con qué zona horaria debería mostrarse la información?", + "poll.modal.timezoneDiffers.button.useLocalTimezone": "mi zona horaria", + "poll.modal.timezoneDiffers.button.usePollTimezone": "la zona horaria original", + "poll.save": "Guardar", + "poll.share": "Comparte el enlace e invita a otras personas a la encuesta.", + "poll.share.notice": "Cualquiera que conozca el enlace podrá ver tu encuesta. Si esta contiene información privada deberías compartir el enlace únicamente mediante un correo electrónico encriptado o mediante chat con encriptación de-punto-a-punto.", + "poll.input.showEvaluation.hide": "Esconder", + "poll.input.showEvaluation.show": "Mostrar", + "pollTypes.findADate.label": "Querría crear una fecha (p. ej. fecha para una reunión).", + "pollTypes.makeAPoll.label": "Querría responder a una pregunta (p. ej. ¿con que tomas el café?)." +}; diff --git a/app/routes/application.js b/app/routes/application.js index 50e92e1..8af46c5 100644 --- a/app/routes/application.js +++ b/app/routes/application.js @@ -11,7 +11,7 @@ export default Ember.Route.extend({ controller: modalController }); }, - + removeModal: function(){ this.disconnectOutlet({ outlet: 'modal', @@ -19,4 +19,4 @@ export default Ember.Route.extend({ }); } } -}); \ No newline at end of file +}); diff --git a/app/styles/app.less b/app/styles/app.less index a6d7741..da96bbe 100644 --- a/app/styles/app.less +++ b/app/styles/app.less @@ -16,7 +16,7 @@ body { #header h1.logo { float: left; } -#header #language-switch { +#header .language-select { float: right; margin-top: 20px; } diff --git a/app/templates/application.hbs b/app/templates/application.hbs index 20f4787..ac6ebbd 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -1,11 +1,13 @@
{{outlet}}
-{{outlet 'modal'}} \ No newline at end of file +{{outlet 'modal'}} diff --git a/app/templates/components/language-select.hbs b/app/templates/components/language-select.hbs new file mode 100644 index 0000000..0d012ae --- /dev/null +++ b/app/templates/components/language-select.hbs @@ -0,0 +1,3 @@ +{{#each locales as |locale|}} + +{{/each}} diff --git a/app/templates/create/options.hbs b/app/templates/create/options.hbs index 8641462..848023c 100644 --- a/app/templates/create/options.hbs +++ b/app/templates/create/options.hbs @@ -37,7 +37,7 @@ multidate=true calendarWeeks=true todayHighlight=true - language=language.selected + language=i18n.locale }} diff --git a/app/templates/language-switch.hbs b/app/templates/language-switch.hbs deleted file mode 100644 index ee82d38..0000000 --- a/app/templates/language-switch.hbs +++ /dev/null @@ -1,3 +0,0 @@ -
- {{view "select" content=view.languages selection=controller.language.selected}} -
diff --git a/app/views/language-switch.js b/app/views/language-switch.js deleted file mode 100644 index 563997e..0000000 --- a/app/views/language-switch.js +++ /dev/null @@ -1,14 +0,0 @@ -import Ember from "ember"; -import translations from "croodle/lang/translations"; - -export default Ember.View.extend({ - templateName: 'language-switch', - - languages: function() { - var languages = []; - for(var lang in translations) { - languages.push(lang); - } - return languages; - }.property() -}); diff --git a/app/views/poll.js b/app/views/poll.js index a129920..946aa2a 100644 --- a/app/views/poll.js +++ b/app/views/poll.js @@ -1,7 +1,7 @@ import Ember from "ember"; /* global moment */ -export default Ember.View.extend(Ember.I18n.TranslateableProperties, { +export default Ember.View.extend({ showEvaluation: false, actions: { diff --git a/app/views/poll/evaluation.js b/app/views/poll/evaluation.js index f837281..7c5e343 100644 --- a/app/views/poll/evaluation.js +++ b/app/views/poll/evaluation.js @@ -1,6 +1,6 @@ import Ember from "ember"; -export default Ember.View.extend(Ember.I18n.TranslateableProperties, { +export default Ember.View.extend({ didInsertElement : function(){ this._super(); Ember.run.scheduleOnce('afterRender', this, function(){ diff --git a/config/environment.js b/config/environment.js index 297e598..67e9d64 100644 --- a/config/environment.js +++ b/config/environment.js @@ -15,7 +15,7 @@ module.exports = function(environment) { // Here you can pass flags/options to your application instance // when it is created }, - + contentSecurityPolicy: { 'default-src': "'none'", 'script-src': "'self' 'unsafe-eval'", @@ -29,6 +29,10 @@ module.exports = function(environment) { moment: { includeLocales: ['de', 'es'], includeTimezone: '2010-2020' + }, + + i18n: { + defaultLocale: 'en' } }; diff --git a/ember-cli-build.js b/ember-cli-build.js index 85dd682..bf57967 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -49,9 +49,6 @@ module.exports = function(defaults) { app.import('bower_components/bootstrap-datepicker/js/bootstrap-datepicker.js'); app.import('bower_components/bootstrap-datepicker/js/locales/bootstrap-datepicker.de.js'); - app.import('bower_components/ember-i18n/lib/i18n.js'); - app.import('bower_components/ember-i18n/lib/i18n-plurals.js'); - app.import({ development: 'bower_components/floatThead/dist/jquery.floatThead.js', production: 'bower_components/floatThead/dist/jquery.floatThead.min.js' diff --git a/package.json b/package.json index f638643..3069c90 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "ember-export-application-global": "^1.0.3", "ember-form-master-2000": "0.2.0", "ember-get-helper": "1.0.4", + "ember-i18n": "4.1.4", "ember-moment": "3.6.4", "ember-radio-button": "^0.1.2", "express": "^4.8.5", diff --git a/tests/.jshintrc b/tests/.jshintrc index 8d3f396..baaa326 100644 --- a/tests/.jshintrc +++ b/tests/.jshintrc @@ -30,7 +30,8 @@ "pollHasAnswers", "pollParticipate", "selectDates", - "switchTab" + "switchTab", + "t" ], "node": false, "browser": false, diff --git a/tests/acceptance/create-a-poll-test.js b/tests/acceptance/create-a-poll-test.js index 7baebdf..33ef286 100644 --- a/tests/acceptance/create-a-poll-test.js +++ b/tests/acceptance/create-a-poll-test.js @@ -3,7 +3,6 @@ import { module, test } from 'qunit'; import startApp from '../helpers/start-app'; import Pretender from 'pretender'; import serverPostPolls from '../helpers/server-post-polls'; -import formattedDateHelper from 'croodle/helpers/formatted-date'; /* global moment */ /* jshint proto: true */ @@ -91,8 +90,8 @@ test("create a default poll", function(assert) { pollDescriptionEqual(assert, ''); pollHasOptions(assert, formattedDates); pollHasAnswers(assert, [ - Ember.I18n.t('answerTypes.yes.label'), - Ember.I18n.t('answerTypes.no.label') + t('answerTypes.yes.label'), + t('answerTypes.no.label') ]); pollHasUsersCount(assert, 0); }); diff --git a/tests/acceptance/participate-in-a-poll-test.js b/tests/acceptance/participate-in-a-poll-test.js index 66ac2d0..2adf5d7 100644 --- a/tests/acceptance/participate-in-a-poll-test.js +++ b/tests/acceptance/participate-in-a-poll-test.js @@ -15,6 +15,7 @@ module('Acceptance | participate in a poll', { server = new Pretender(); }, + afterEach: function() { server.shutdown(); @@ -51,7 +52,7 @@ test("participate in a default poll", function(assert) { 'encryption key is part of query params' ); pollHasUsersCount(assert, 1, "user is added to user selections table"); - pollHasUser(assert, 'Max Meiner', [Ember.I18n.t('answerTypes.yes.label'), Ember.I18n.t('answerTypes.no.label')]); + pollHasUser(assert, 'Max Meiner', [t('answerTypes.yes.label'), t('answerTypes.no.label')]); }); }); }); @@ -116,7 +117,7 @@ test("participate in a poll which doesn't force an answer to all options", funct andThen(function(){ assert.equal(currentPath(), 'poll.evaluation'); pollHasUsersCount(assert, 1, "user is added to user selections table"); - pollHasUser(assert, "Karl Käfer", [Ember.I18n.t("answerTypes.yes.label"), ""]); + pollHasUser(assert, "Karl Käfer", [t("answerTypes.yes.label"), ""]); }); }); }); @@ -148,7 +149,7 @@ test("participate in a poll which allows anonymous participation", function(asse andThen(function(){ assert.equal(currentPath(), 'poll.evaluation'); pollHasUsersCount(assert, 1, "user is added to user selections table"); - pollHasUser(assert, "", [Ember.I18n.t("answerTypes.yes.label"), Ember.I18n.t("answerTypes.no.label")]); + pollHasUser(assert, "", [("answerTypes.yes.label"), ("answerTypes.no.label")]); }); }); }); diff --git a/tests/helpers/poll-has-options.js b/tests/helpers/poll-has-options.js index 5a6ddc0..2089126 100644 --- a/tests/helpers/poll-has-options.js +++ b/tests/helpers/poll-has-options.js @@ -1,6 +1,6 @@ import Ember from 'ember'; -export default Ember.Test.registerHelper('pollHasOptions', function(app, assert, expectedOptions, dateGroups) { +export default Ember.Test.registerHelper('pollHasOptions', function(app, assert, expectedOptions) { var elBase = find('.participation .selections'); assert.equal( diff --git a/tests/helpers/start-app.js b/tests/helpers/start-app.js index bd4efc8..7a6c981 100644 --- a/tests/helpers/start-app.js +++ b/tests/helpers/start-app.js @@ -9,6 +9,7 @@ import './poll-has-answers'; import './poll-participate'; import './select-dates'; import './switch-tab'; +import './t'; export default function startApp(attrs) { var application; diff --git a/tests/helpers/t.js b/tests/helpers/t.js new file mode 100644 index 0000000..7130dd5 --- /dev/null +++ b/tests/helpers/t.js @@ -0,0 +1,5 @@ +import Ember from 'ember'; + +export default Ember.Test.registerHelper('t', function(app, key, context) { + return app.__container__.lookup('service:i18n').t(key, context); +}); diff --git a/tests/integration/create-a-poll-test.js b/tests/integration/create-a-poll-test.js index 7e41fee..da11ab2 100644 --- a/tests/integration/create-a-poll-test.js +++ b/tests/integration/create-a-poll-test.js @@ -70,9 +70,9 @@ test("create a default poll and participate", function(assert) { assert, 'Max Hoelz', [ - Ember.I18n.t('answerTypes.no.label'), - Ember.I18n.t('answerTypes.no.label'), - Ember.I18n.t('answerTypes.yes.label') + t('answerTypes.no.label'), + t('answerTypes.no.label'), + t('answerTypes.yes.label') ] ); }); diff --git a/tests/integration/legacy-support-test.js b/tests/integration/legacy-support-test.js index 9d67353..b760214 100644 --- a/tests/integration/legacy-support-test.js +++ b/tests/integration/legacy-support-test.js @@ -33,9 +33,9 @@ test('show a default poll created with v0.3.0', function(assert) { ]); pollHasAnswers(assert, [ - Ember.I18n.t('answerTypes.yes.label'), - Ember.I18n.t('answerTypes.maybe.label'), - Ember.I18n.t('answerTypes.no.label') + t('answerTypes.yes.label'), + t('answerTypes.maybe.label'), + t('answerTypes.no.label') ]); switchTab('evaluation'); @@ -46,17 +46,17 @@ test('show a default poll created with v0.3.0', function(assert) { pollHasUser(assert, 'Fritz Bauer', [ - Ember.I18n.t('answerTypes.yes.label'), - Ember.I18n.t('answerTypes.no.label'), - Ember.I18n.t('answerTypes.no.label') + t('answerTypes.yes.label'), + t('answerTypes.no.label'), + t('answerTypes.no.label') ] ); pollHasUser(assert, 'Lothar Hermann', [ - Ember.I18n.t('answerTypes.maybe.label'), - Ember.I18n.t('answerTypes.yes.label'), - Ember.I18n.t('answerTypes.no.label') + t('answerTypes.maybe.label'), + t('answerTypes.yes.label'), + t('answerTypes.no.label') ] ); @@ -72,9 +72,9 @@ test('show a default poll created with v0.3.0', function(assert) { pollHasUser(assert, 'Hermann Langbein', [ - Ember.I18n.t('answerTypes.yes.label'), - Ember.I18n.t('answerTypes.maybe.label'), - Ember.I18n.t('answerTypes.yes.label') + t('answerTypes.yes.label'), + t('answerTypes.maybe.label'), + t('answerTypes.yes.label') ] ); }); diff --git a/tests/unit/lang-test.js b/tests/unit/lang-test.js deleted file mode 100644 index a7a1708..0000000 --- a/tests/unit/lang-test.js +++ /dev/null @@ -1,30 +0,0 @@ -import languages from '../../lang/translations'; -import { module, test } from 'qunit'; - -module('Unit | languages'); - -// Replace this with your real tests. -test('translations are correct', function(assert) { - assert.ok(languages); - - Object.keys(languages).map(function(language) { - if (language !== 'en') { - assert.equal( - Object.keys(languages[language]).length, - Object.keys(languages.en).length, - 'language ' + language + ' has same amount of translation keys as english language' - ); - } - }); - - Object.keys(languages.en).map(function(translationKey) { - Object.keys(languages).map(function(language) { - if (language !== 'en') { - assert.ok( - languages[language][translationKey], - 'translation with key ' + translationKey + ' exist for language ' + language - ); - } - }); - }); -});