Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Added polish locale, added translations in JavaScript story form. #222

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ tmp/
.rvmrc
.sass-cache/
*.DS_Store
config/deploy.rb
config/deploy.rb
.idea
8 changes: 8 additions & 0 deletions app/assets/javascripts/models/story.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ Fulcrum.Story = Backbone.Model.extend({
point_values: function() {
return this.collection.project.get('point_values');
},
story_types: function() {
var types = ["feature", "chore", "bug", "release"];
return types.map(function(t) { return I18n.t('story.types.' + t);});
},
states: function() {
var statuses = ['unscheduled','unstarted','started','finished', 'delivered','accepted','rejected'];
return statuses.map(function(s) { return I18n.t('story.states.' + s);});
},

// List available state transitions for this story
events: function() {
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/views/form_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ Fulcrum.FormView = Backbone.View.extend({
},

submit: function() {
var el = this.make('input', {id: "submit", type: "button", value: "Save"});
var el = this.make('input', {id: "submit", type: "button", value: I18n.t("save")});
return el;
},

destroy: function() {
var el = this.make('input', {id: "destroy", type: "button", value: "Delete"});
var el = this.make('input', {id: "destroy", type: "button", value: I18n.t("delete")});
return el;
},

cancel: function() {
var el = this.make('input', {id: "cancel", type: "button", value: "Cancel"});
var el = this.make('input', {id: "cancel", type: "button", value: I18n.t("cancel")});
return el;
},

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/views/note_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Fulcrum.NoteForm = Fulcrum.FormView.extend({
$(div).append('<br/>');
$(div).append(this.textArea("note"));

var submit = this.make('input', {id: 'note_submit', type: 'button', value: 'Add note'});
var submit = this.make('input', {id: 'note_submit', type: 'button', value: I18n.t('add_note')});
$(div).append(submit);
this.$el.html(div);

Expand Down
8 changes: 4 additions & 4 deletions app/assets/javascripts/views/story_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,23 +288,23 @@ Fulcrum.StoryView = Fulcrum.FormView.extend({
this.makeFormControl({
name: "estimate",
label: true,
control: this.select("estimate", this.model.point_values(), {blank: 'No estimate'})
control: this.select("estimate", this.model.point_values(), {blank: I18n.t('no_estimate')})
})
);

this.$el.append(
this.makeFormControl({
name: "story_type",
label: true,
control: this.select("story_type", ["feature", "chore", "bug", "release"])
control: this.select("story_type", this.model.story_types())
})
);

this.$el.append(
this.makeFormControl({
name: "state",
label: true,
control: this.select("state", ["unscheduled", "unstarted", "started", "finished", "delivered", "accepted", "rejected"])
control: this.select("state", this.model.states())
})
);

Expand Down Expand Up @@ -338,7 +338,7 @@ Fulcrum.StoryView = Fulcrum.FormView.extend({

this.$el.append(
this.makeFormControl(function(div) {
$(div).append(this.label("description", "Description"));
$(div).append(this.label("description", I18n.t('activerecord.attributes.story.description')));
$(div).append('<br/>');
if(this.model.isNew() || this.model.get('editingDescription')) {
$(div).append(this.textArea("description"));
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Application < Rails::Application
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
config.i18n.enforce_available_locales = true
config.i18n.available_locales = ['de', 'el', 'en', 'es', 'nl', 'ja']
config.i18n.available_locales = ['de', 'el', 'en', 'es', 'nl', 'ja', 'pl']

# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
Expand Down
41 changes: 41 additions & 0 deletions config/locales/devise.pl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
pl:
errors:
messages:
not_found: 'nie znaleziono'
already_confirmed: 'już został aktywowany, możesz się zalogować'
not_locked: 'nie był zablokowany'

devise:
failure:
unauthenticated: 'Zaloguj lub zarejestruj się, aby kontynuować.'
unconfirmed: 'Nie aktywowałeś jeszcze swojego konta - sprawdź swój e-mail.'
locked: 'Twoje konto jest zablokowane.'
invalid: 'Niepoprawny adres e-mail lub hasło.'
invalid_token: 'Niepoprawny token.'
timeout: 'Sesja wygasła - zaloguj się ponownie, aby kontynuować.'
inactive: 'Konto nie zostało jeszcze aktywowane.'
sessions:
signed_in: 'Witaj ponownie!'
signed_out: 'Wylogowałeś się. Zapraszamy ponownie!'
passwords:
send_instructions: 'Za chwilę wyślemy instrukcję zmiany hasła na Twój adres e-mail.'
updated: 'Zmieniłeś swoje hasło. Zostałeś automatycznie zalogowany.'
confirmations:
send_instructions: 'Za chwilę wyślemy instrukcję aktywowania konta na Twój adres e-mail.'
confirmed: 'Aktywowaliśmy Twoje konto. Zostałeś automatycznie zalogowany.'
invalid_token: 'Niepoprawny token.'
registrations:
signed_up: 'Witaj! Zarejestrowałeś się pomyślnie.'
signed_up_but_unconfirmed: 'E-mail z linkiem aktywacyjnym został wysłany na Twój adres e-mail. Sprawdź e-mail, aby dokończyć rejestrację.'
updated: 'Zaktualizowałeś swoje dane.'
destroyed: 'Usunąłeś swoje konto.'
unlocks:
send_instructions: 'Za chwilę wyślemy instrukcję odblokowania konta na Twój adres e-mail.'
unlocked: 'Odblokowaliśmy Twoje konto. Jesteś już zalogowany.'
mailer:
confirmation_instructions:
subject: 'Instrukcja aktywacji konta'
reset_password_instructions:
subject: 'Instrukcja ustawienia nowego hasła'
unlock_instructions:
subject: 'Instrukcja odblokowania konta'
28 changes: 22 additions & 6 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Sample localization file for English. Add more files in this directory for other locales.
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.

en:
fulcrum: "Fulcrum"

Expand All @@ -20,12 +17,16 @@ en:
points: "Points"
saving: "Saving ..."
expand: "Expand"
save: "Save"
cancel: "Cancel"

author unknown: "Author Unknown"
add story: "Add story"
add_note: 'Add note'
save error: "Save error"
override velocity: "Override velocity"
story title: "Story title"
no_estimate: "No estimate"

requested on date: 'Requested on {{date}}'
requested by user on date: 'Requested by {{user}} on {{date}}'
Expand All @@ -41,7 +42,7 @@ en:
n weeks:
one: '1 week'
other: '%{count} weeks'

keycuts:
keyboard_shortcuts: Keyboard shortcuts
help: Help (this)
Expand All @@ -55,7 +56,7 @@ en:
toggle_my_work: Toggle my work
toggle_labels_searches: Toggle labels &amp; searches
toggle_current: Toggle current

activerecord:
models:
user:
Expand Down Expand Up @@ -100,7 +101,7 @@ en:
project was successfully updated: "Project was successfully updated."

index:
listing projects: "Listing Projects"
listing projlisting projectsects: "Listing Projects"
are you sure you want to delete this project: "Are you sure you want to delete this project? This action cannot be undone."
the iteration starts on x with length of x weeks:
one: "Iterations start on %{day} with a length of 1 week"
Expand All @@ -118,6 +119,21 @@ en:
notify_me_when_my_stories_are: "Notify me when my stories are"
we_need_your_current_password_to_confirm_your_changes: "We need your current password to confirm your changes."

story:
states:
unscheduled: 'Unscheduled'
unstarted: 'Unstarted'
started: 'Started'
finished: 'Finished'
delivered: 'Delivered'
accepted: 'Accepted'
rejected: 'Rejected'
types:
feature: 'feature'
chore: 'chore'
bug: 'bug'
release: 'release'

time:
formats:
note_date: "%b %d, %Y"
144 changes: 144 additions & 0 deletions config/locales/pl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
pl:
fulcrum: "Fulcrum"

log out: "Wyloguj"
log in: "Zaloguj"
sign up: "Zarejestrj"
edit: "Edycja"
delete: "Usuń"
back: "Powrót"
import: "Import"
export: "Eksport"
revert: "Przywróć"
apply: "Zastosuj"
velocity: "Prędkość"
notes: "Notatki"
close: "Zamknij"
points: "Punkty"
saving: "Zapisuje ..."
expand: "Rozwiń"
save: "Zapisz"
cancel: "Anuluj"

author unknown: "Nieznany Autor"
add story: "Dodaj zadanie"
add_note: 'Dodaj notatkę'
save error: "Błąd Zapisu"
override velocity: "Nadpisz Prędkość"
story title: "Tytuł zadania"
no_estimate: "Nieoszacowane"

requested on date: 'Zgłoszono {{date}}'
requested by user on date: 'Zgłoszone przez {{user}} {{date}}'

imported n stories:
one: 'Zaimportowano 1 zadanie'
few: 'Zaimportowano %{count} zadania'
other: 'Zapmoprtowano %{count} zadań'

n stories failed to import:
one: 'Niepowiódł się import 1 zadania'
other: 'Niepowiódł się import %{count} zadań'

n weeks:
one: '1 tydzień'
few: '%{count} tygodnie'
other: '%{count} tygodni'

keycuts:
keyboard_shortcuts: 'Skróty klawiaturowe'
help: 'Pomoc'
add_story: 'Dodaj zadanie'
save_currently_open_story: 'Zapisz otwarte zadanie'
save_comment_being_edited: 'Zapisz edytowany komentarz'
toggle_backlog: 'Włącz/Wyłącz Zaległości'
toggle_done: 'Włącz/Wyłącz Zakończone'
toggle_history: 'Włącz/Wyłącz Historię'
toggle_icebox: 'Włącz/Wyłącz Poczekalnie'
toggle_my_work: 'Włącz/Wyłącz Moje zadania'
toggle_labels_searches: 'Włącz/Wyłącz Wyszukiwanie etykiet'
toggle_current: 'Włącz/Wyłącz Bieżące zadania'

activerecord:
models:
user:
one: 'Uczestnik'
few: 'Uczestnicy'
other: 'Uczestnicy'
project:
one: 'Projekt'
few: 'Projekty'
other: 'Projekty'
story:
one: 'Zadanie'
few: 'Zadania'
other: 'Zadań'

attributes:
note:
note: 'Notatka'
project:
name: 'Nazwa'
point_scale: 'Skala punktów'
start_date: 'Data rozpoczęcia'
iteration_start_day: 'Dzień rozpoczęcia iteracji'
iteration_length: 'Czas trwania iteracji'
default_velocity: 'Domyślna prędkość'
story:
title: 'Tytuł'
description: 'Opis'
estimate: 'Oszacowanie'
story_type: 'Typ zadania'
state: 'Stan'
accepted_at: 'Akceptowane'
position: 'Pozycja'
labels: 'Etykiety'
requested_by: 'Zgłoszone przez'
owned_by: 'Należy do'

projects:
new project: "Nowy Projekt"
edit project: "Edytuj Projekt"
project properties: "Właściwości Projektu"

project was successfully created: "Utworzenie projektu zakończone sukcesem."
project was successfully updated: "Uaktualnienie projektu zakończone sukcesem."

index:
listing projlisting projectsects: "Lista Projektów"
are you sure you want to delete this project: "Czy na pewno chcesz usunąć ten projekt? Tej akcji nie można cofnąć."
the iteration starts on x with length of x weeks:
one: "Iteracja zaczyna się %{day} i potrwa 1 tydzień"
few: "Iteracja zaczyna się %{day} i potrwa %{count} tygodnie"
other: "Iteracja zaczyna się %{day} i potrwa %{count} tygodni"

show:
done: "Zakończone"
in_progress: "W toku"
backlog: "Zaległości"
icebox: "Poczekalnia"

registrations:
edit:
leave_blank_if_you_dont_want_to_change_it: "Pozostaw puste, jeżeli nie chesz wprowadzić zmian"
notify_me_when_my_stories_are: "Powiadom mnie gdy moje zadania są"
we_need_your_current_password_to_confirm_your_changes: "Aby potwierdzić zmiany, potrzebujemy twojego hasła."

story:
states:
unscheduled: 'Niezaplanowane'
unstarted: 'Nierozpoczęte'
started: 'Rozpoczęte'
finished: 'Zakończone'
delivered: 'Dostarczone'
accepted: 'Zaakceptowane'
rejected: 'Odrzucone'
types:
feature: 'funkcjonalność'
chore: 'utrzymanie'
bug: 'błąd'
release: 'wdrożenie'

time:
formats:
note_date: "%d.%m.%Yr"
2 changes: 2 additions & 0 deletions spec/javascripts/views/story_view_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ describe('Fulcrum.StoryView', function() {
estimable: function() { return true; },
estimated: function() { return false; },
point_values: function() { return [0,1,2]; },
story_types: function() { return ["feature", "chore", "bug", "release"];},
states: function() { return ['unscheduled','unstarted','started','finished', 'delivered','accepted','rejected'];},
hasErrors: function() { return false; },
errorsOn: function() { return false; },
url: '/path/to/story',
Expand Down