From ae6f39a0d06a4070f7b76b8092382b57d3a6b0a9 Mon Sep 17 00:00:00 2001 From: minilibra Date: Fri, 8 Oct 2010 02:09:13 +0700 Subject: [PATCH 1/4] Localization file for Indonesian added. Change "en" at the top of both files to "id". Thanks to rsofaer. --- config/locales/devise/devise.id.yml | 43 ++++++ config/locales/diaspora/id.yml | 208 ++++++++++++++++++++++++++++ 2 files changed, 251 insertions(+) create mode 100644 config/locales/devise/devise.id.yml create mode 100644 config/locales/diaspora/id.yml diff --git a/config/locales/devise/devise.id.yml b/config/locales/devise/devise.id.yml new file mode 100644 index 000000000..744fd7eaf --- /dev/null +++ b/config/locales/devise/devise.id.yml @@ -0,0 +1,43 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. +# +# Indonesian Localization. +# + +id: + errors: + messages: + not_found: "tidak ditemukan" + already_confirmed: "sudah dikonfirmasi" + not_locked: "tidak terkunci" + + devise: + failure: + unauthenticated: "Anda harus masuk atau mendaftar sebelum melanjutkan." + unconfirmed: "Anda harus mengkonfirmasi akun Anda sebelum melanjutkan." + locked: "Akun anda terkunci." + invalid: "Email atau password tidak valid." + invalid_token: "Token otentikasi tidak valid." + timeout: "Sesi anda telah berakhir, silahkan masuk lagi untuk melanjutkan." + inactive: "Akun anda belum diaktifkan." + sessions: + signed_in: "Berhasil masuk." + signed_out: "Berhasil keluar." + passwords: + send_instructions: "Anda akan menerima email berisi petunjuk cara me-reset password Anda dalam beberapa menit." + updated: "Password Anda telah berhasil diubah. Anda sekarang masuk." + confirmations: + send_instructions: "Anda akan menerima email berisi instruksi bagaimana mengkonfirmasi akun Anda dalam beberapa menit." + confirmed: "Akun Anda telah berhasil dikonfirmasi. Anda sekarang masuk." + registrations: + signed_up: "Anda telah berhasil mendaftar. Jika diaktifkan, konfirmasi dikirim ke e-mail Anda." + updated: "Anda berhasil memperbarui akun anda." + destroyed: "Bye! Akun Anda telah berhasil dibatalkan. Kami berharap dapat melihat Anda lagi." + unlocks: + send_instructions: "Anda akan menerima email berisi instruksi bagaimana membuka akun Anda dalam beberapa menit." + unlocked: "Akun Anda telah berhasil dibuka. Anda sekarang masuk." + mailer: + confirmation_instructions: "Instruksi konfirmasi" + reset_password_instructions: "Instruksi me-reset password" + unlock_instructions: "Instruksi membuka" diff --git a/config/locales/diaspora/id.yml b/config/locales/diaspora/id.yml new file mode 100644 index 000000000..c844250d6 --- /dev/null +++ b/config/locales/diaspora/id.yml @@ -0,0 +1,208 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +# Localization file for Indonesian. + +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +id: + hello: "Apa kabar dunia" + application: + helper: + unknown_person: "orang tak dikenal" + new_requests: "permintaan baru" + dashboards: + helper: + home: "beranda" + error_messages: + helper: + invalid_fields: "Field tidak valid" + correct_the_following_errors_and_try_again: "Perbaiki kesalahan berikut dan coba lagi." + people: + helper: + results_for: " hasil untuk %{params}" + people_on_pod_are_aware_of: " people on pod are aware of" + layouts: + application: + edit_profile: "ubah profil" + logout: "keluar" + shared: + aspect_nav: + all_aspects: "Seluruh Aspek" + manage: "Kelola" + manage_your_aspects: "Kelola Aspek anda" + sub_header: + all_aspects: "Seluruh Aspek" + manage_aspects: "Kelola Aspek" + publisher: + share: "Bagikan" + aspect_friends: + add_friends: "tambah teman" + albums: + album: + you: "anda" + new_album: + create: "Ciptakan" + add_a_new_album: "Tambah album baru" + show: + edit_album: "Ubah Album" + albums: "album" + updated: "diperbarui" + by: "oleh" + edit: + editing: "Diubah" + updated: "diperbarui" + are_you_sure: "Apakah anda yakin?" + delete_album: "Hapus Album" + cancel: "Batal" + index: + home: "beranda" + new_album: "Album Baru" + create: + success: "Anda telah membuat sebuah album dengan nama %{name}." + update: + success: "Album %{name} berhasil diubah." + failure: "Gagal mengubah album %{name}." + destroy: + success: "Album %{name} dihapus." + helper: + friends_albums: "Album Teman" + your_albums: "Album Anda" + aspects: + index: + photos: "Foto" + show: + photos: "foto" + manage: + add_a_new_aspect: "Tambah aspek baru" + add_a_new_friend: "Tambah teman baru" + show: "Tampilkan" + update_aspects: "Perbarui Aspek" + requests: "Permintaan" + ignore_remove: "Abaikan/Hapus" + new_aspect: + add_a_new_aspect: "Tambah aspek baru" + create: "Ciptakan" + create: + success: "Klik pada tanda plus di sisi kiri untuk memberitahu Diaspora siapa yang dapat melihat aspek baru Anda." + failure: "Aspek gagal dibuat." + destroy: + success: "%{name} berhasil dihapus." + update: + success: "Aspek anda, %{name}, telah berhasil diubah." + move_friends: + failure: "Gagal mengubah aspek untuk teman %{real_name}." + success: "Aspek berhasil diubah." + move_friend: + failure: "tidak dapat %{inspect}" + success: "Anda sekarang menunjukkan teman Anda aspek yang berbeda dari diri Anda sendiri." + helper: + remove: "hapus" + aspect_not_empty: "Aspek tidak kosong" + users: + edit: + editing_profile: "Mengubah profil" + profile: + cancel: "Batal" + update_profile: "Perbarui Profil" + home: "Beranda" + diaspora_username: "USERNAME DIASPORA" + info: "Info" + picture: "Foto" + editing_profile: "Mengubah profil" + albums: "Album" + you_dont_have_any_photos: "Anda tidak memiliki satupun foto! Kunjungi halaman" + page_to_upload_some: "untuk meng-unggah beberapa foto." + comments: + comment: + ago: "yang lalu" + new_comment: + comment: "Komentar" + photos: + show: + prev: "sebelumnya" + full_size: "ukuran penuh" + next: "berikutnya" + edit_photo: "Ubah Foto" + delete_photo: "Hapus Foto" + are_you_sure: "Apakah anda yakin?" + comments: "komentar" + edit: + editing: "Mengubah" + are_you_sure: "Apakah anda yakin?" + delete_photo: "Hapus Foto" + photo: + show_comments: "tampilkan komentar" + posted_a_new_photo_to: "kirim sebuah foto ke" + new: + new_photo: "Foto Baru" + back_to_list: "Kembali ke Daftar" + post_it: "posting!" + create: + runtime_error: "Foto gagal diunggah. Apakah Anda yakin sabuk pengaman Anda telah dikencangkan?" + integrity_error: "Foto gagal diunggah. Apakah Anda yakin itu gambar?" + type_error: "Foto gagal diunggah. Apakah Anda yakin gambar telah ditambahkan?" + update: + notice: "Foto berhasil diperbarui." + error: "Gagal mengubah foto." + destroy: + notice: "Foto dihapus." + registrations: + new: + sign_up: "Daftar" + create: + success: "Anda telah bergabung dengan Diaspora!" + status_messages: + new_status_message: + tell_me_something_good: "katakan padaku sesuatu yang baik" + oh_yeah: "oh yeah!" + status_message: + show_comments: "tampilkan komentar" + delete: "Hapus" + are_you_sure: "Apakah anda yakin?" + show: + status_message: "Status Pesan" + comments: "komentar" + are_you_sure: "Apakah anda yakin?" + destroy: "Hapus" + view_all: "Tampilkan Seluruhnya" + message: "Pesan" + owner: "Pemilik" + helper: + no_message_to_display: "Tidak ada pesan yang dapat ditampilkan." + people: + person: + add_friend: "tambah teman" + pending_request: "permintaan tertunda" + index: + add_friend: "tambah teman" + real_name: "nama asli" + diaspora_handle: "diaspora handle" + thats_you: "itu anda!" + friend_request_pending: "permintaan pertemanan tertunda" + you_have_a_friend_request_from_this_person: "anda memiliki permintaan pertemanan dari orang ini" + new: + new_person: "Orang Baru" + back_to_list: "Kembali ke Daftar" + show: + last_seen: "terakhir terlihat: %{how_long_ago}" + friends_since: "teman sejak: %{how_long_ago}" + save: "simpan" + are_you_sure: "Apakah anda yakin?" + remove_friend: "hapus teman" + requests: + new_request: + add_a_new_friend_to: "Tambah teman baru ke" + enter_a_diaspora_username: "Masukkan Username Diaspora:" + your_diaspora_username_is: "Username Diaspora anda adalah: %{diaspora_handle}" + friends_username: "Username teman" + destroy: + success: "Anda sekarang berteman." + error: "Silahkan pilih sebuah aspek!" + ignore: "Permintaan pertemanan yang diabaikan." + create: + error: "Tidak ada benih diaspora ditemukan dengan email ini!" + already_friends: "Anda sudah berteman dengan %{destination_url}!" + success: "Sebuah permintaan pertemanan telah terkirim ke %{destination_url}." + horribly_wrong: "Ada sesuatu mengerikan yang salah." From 1d463d22a1336e592f92f6e3b7f54bcbd717e37e Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 7 Oct 2010 16:50:19 -0700 Subject: [PATCH 2/4] Person show for a nonexistent person now redirects to people index page, rather than giving a 500 --- app/controllers/people_controller.rb | 14 +++++++++++++- spec/controllers/people_controller_spec.rb | 8 ++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 6ada5bfe1..1e5ef5c23 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -17,7 +17,19 @@ class PeopleController < ApplicationController end def show - @person = current_user.visible_person_by_id(params[:id]) + begin + @person = current_user.visible_person_by_id(params[:id]) + rescue BSON::InvalidObjectId + flash[:error] = "Person not found." + redirect_to people_path + return + end + unless @person + flash[:error] = "Person not found." + redirect_to people_path + return + end + @profile = @person.profile @aspects_with_person = current_user.aspects_with_person(@person) @aspects_dropdown_array = current_user.aspects.collect{|x| [x.to_s, x.id]} diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index c2af4cc93..ab15625d0 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -22,4 +22,12 @@ describe PeopleController do it 'should go to the current_user show page' do get :show, :id => @user.person.id end + + it "doesn't error out on an invalid id" do + get :show, :id => 'delicious' + end + + it "doesn't error out on a nonexistent person" do + get :show, :id => @user.id + end end From 36321439592046e6c05b1c609fa7bc3d69d87bea Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 7 Oct 2010 17:54:26 -0700 Subject: [PATCH 3/4] Take out pending on spec that exposes issue 150 --- spec/models/user/user_friending_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/models/user/user_friending_spec.rb b/spec/models/user/user_friending_spec.rb index fa4dd53b6..e72409d52 100644 --- a/spec/models/user/user_friending_spec.rb +++ b/spec/models/user/user_friending_spec.rb @@ -218,7 +218,6 @@ describe User do @user.raw_visible_posts.include?(@message.id).should be_false end it "deletes the unfriended user's posts from the aspect's posts" do - pending "We need to implement this" @aspect2.posts.include?(@message).should be_false end end From 2e73104d6f67afa717d68fc98b68d0e0d60f869d Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 7 Oct 2010 18:17:26 -0700 Subject: [PATCH 4/4] DG MS; updated BSON gems, added devise-mongomapper gem fix, using unforked devise 1.1.2 --- Gemfile | 7 +-- Gemfile.lock | 79 +++++++++++++++-------------- app/models/user.rb | 1 + config/initializers/secret_token.rb | 2 +- config/routes.rb | 9 ++-- 5 files changed, 51 insertions(+), 47 deletions(-) diff --git a/Gemfile b/Gemfile index df245a480..d87d93cf5 100644 --- a/Gemfile +++ b/Gemfile @@ -4,12 +4,13 @@ gem 'rails', '3.0.0' gem 'bundler', '>= 1.0.0' #Security -gem 'devise', :git => 'http://github.com/BadMinus/devise.git' +gem 'devise', '1.1.2' +gem 'devise-mongo_mapper', :git => 'git://github.com/collectiveidea/devise-mongo_mapper' #Mongo gem 'mongo_mapper', :branch => 'rails3', :git => 'http://github.com/jnunemaker/mongomapper.git' -gem 'bson_ext', '1.0.7' -gem 'bson', '1.0.7' +gem 'bson_ext', '1.1' +gem 'bson', '1.1' #Views gem 'haml' diff --git a/Gemfile.lock b/Gemfile.lock index f7f234783..88238b6d0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,10 +7,17 @@ GIT nokogiri (>= 1.3.3) GIT - remote: git://github.com/igrigorik/em-http-request.git - revision: 6f66010cda90991863669ca52fd4c320dd931a06 + remote: git://github.com/collectiveidea/devise-mongo_mapper + revision: fa2f20310e0988295adc192255d3b1cedee1b412 specs: - em-http-request (0.2.12) + devise-mongo_mapper (0.0.1) + devise (~> 1.1.0) + +GIT + remote: git://github.com/igrigorik/em-http-request.git + revision: f069bb9b68335496c8f32475b79e448847befdae + specs: + em-http-request (0.2.14) addressable (>= 2.0.0) eventmachine (>= 0.12.9) @@ -23,7 +30,7 @@ GIT GIT remote: git://github.com/rsofaer/redfinger.git - revision: 605edbb2b3b4bd0e7befb6963a3ada3f5d3ca76c + revision: 07721f46d02b9d3aa04880788fecb0b4c1b284d7 specs: redfinger (0.0.6) hashie @@ -39,14 +46,6 @@ GIT capistrano (>= 2.5.5) highline (>= 1.4.0) -GIT - remote: http://github.com/BadMinus/devise.git - revision: 88ab2fe14e88dc45d5b969328a5e52e9011a1d7b - specs: - devise (1.1.rc1) - bcrypt-ruby (~> 2.1.2) - warden (~> 0.10.7) - GIT remote: http://github.com/dcu/magent.git revision: 06513f3dac812469a55f2e365c349af4d2abc92a @@ -57,7 +56,7 @@ GIT GIT remote: http://github.com/jnunemaker/mongomapper.git - revision: b0eac421ef5b3bee782e15d391eca372a189d414 + revision: 5a3328244b641fa4f6a3743e9e0b4dd6a1ac2700 branch: rails3 specs: mongo_mapper (0.8.4) @@ -103,8 +102,8 @@ GEM uuidtools xml-simple bcrypt-ruby (2.1.2) - bson (1.0.7) - bson_ext (1.0.7) + bson (1.1) + bson_ext (1.1) builder (2.1.2) capistrano (2.5.19) highline @@ -121,10 +120,10 @@ GEM selenium-webdriver (>= 0.0.3) columnize (0.3.1) crack (0.1.8) - cucumber (0.9.0) + cucumber (0.9.2) builder (~> 2.1.2) diff-lcs (~> 1.1.2) - gherkin (~> 2.2.2) + gherkin (~> 2.2.5) json (~> 1.4.6) term-ansicolor (~> 1.0.5) cucumber-rails (0.3.2) @@ -132,6 +131,9 @@ GEM culerity (0.2.12) daemons (1.1.0) database_cleaner (0.5.2) + devise (1.1.2) + bcrypt-ruby (~> 2.1.2) + warden (~> 0.10.7) diff-lcs (1.1.2) em-websocket (0.1.4) addressable (>= 2.1.1) @@ -145,11 +147,10 @@ GEM rails (>= 3.0.0.beta4) ffi (0.6.3) rake (>= 0.8.7) - gherkin (2.2.4) + gherkin (2.2.8) json (~> 1.4.6) term-ansicolor (~> 1.0.5) - trollop (~> 1.16.2) - haml (3.0.18) + haml (3.0.21) hashie (0.4.0) highline (1.6.1) http_connection (1.3.1) @@ -157,7 +158,7 @@ GEM json (1.4.6) json_pure (1.4.6) linecache (0.43) - mail (2.2.6.1) + mail (2.2.7) activesupport (>= 2.3.6) mime-types treetop (>= 1.4.5) @@ -169,9 +170,9 @@ GEM subexec (~> 0.0.4) mocha (0.9.8) rake - mongo (1.0.8) + mongo (1.0.9) bson (>= 1.0.5) - net-scp (1.0.3) + net-scp (1.0.4) net-ssh (>= 1.99.1) net-sftp (2.0.5) net-ssh (>= 2.0.9) @@ -188,7 +189,7 @@ GEM rack (1.2.1) rack-mount (0.6.13) rack (>= 1.0.0) - rack-test (0.5.4) + rack-test (0.5.6) rack (>= 1.0) rails (3.0.0) actionmailer (= 3.0.0) @@ -206,16 +207,16 @@ GEM rake (0.8.7) rest-client (1.6.1) mime-types (>= 1.16) - rspec (2.0.0.beta.22) - rspec-core (= 2.0.0.beta.22) - rspec-expectations (= 2.0.0.beta.22) - rspec-mocks (= 2.0.0.beta.22) - rspec-core (2.0.0.beta.22) - rspec-expectations (2.0.0.beta.22) + rspec (2.0.0.rc) + rspec-core (= 2.0.0.rc) + rspec-expectations (= 2.0.0.rc) + rspec-mocks (= 2.0.0.rc) + rspec-core (2.0.0.rc) + rspec-expectations (2.0.0.rc) diff-lcs (>= 1.1.2) - rspec-mocks (2.0.0.beta.22) - rspec-core (= 2.0.0.beta.22) - rspec-expectations (= 2.0.0.beta.22) + rspec-mocks (2.0.0.rc) + rspec-core (= 2.0.0.rc) + rspec-expectations (= 2.0.0.rc) rspec-rails (2.0.0.beta.17) rspec (>= 2.0.0.beta.14) webrat (>= 0.7.0) @@ -235,10 +236,9 @@ GEM daemons (>= 1.0.9) eventmachine (>= 0.12.6) rack (>= 1.0.0) - thor (0.14.0) + thor (0.14.3) treetop (1.4.8) polyglot (>= 0.3.1) - trollop (1.16.2) tzinfo (0.3.23) uuidtools (2.1.1) warden (0.10.7) @@ -246,7 +246,7 @@ GEM webmock (1.3.5) addressable (>= 2.1.1) crack (>= 0.1.7) - webrat (0.7.2.beta.1) + webrat (0.7.1) nokogiri (>= 1.2.0) rack (>= 1.0) rack-test (>= 0.5.3) @@ -259,14 +259,15 @@ PLATFORMS DEPENDENCIES addressable aws - bson (= 1.0.7) - bson_ext (= 1.0.7) + bson (= 1.1) + bson_ext (= 1.1) bundler (>= 1.0.0) capybara (~> 0.3.9) carrierwave! cucumber-rails (= 0.3.2) database_cleaner - devise! + devise (= 1.1.2) + devise-mongo_mapper! em-http-request! em-websocket factory_girl_rails diff --git a/app/models/user.rb b/app/models/user.rb index 01094d219..817d0a71a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -9,6 +9,7 @@ require File.expand_path('../../../lib/salmon/salmon', __FILE__) class User include MongoMapper::Document + plugin MongoMapper::Devise include Diaspora::UserModules::Friending include Diaspora::UserModules::Querying include Diaspora::UserModules::Receiving diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index f7864e187..15c3597fb 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -8,4 +8,4 @@ # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. -Rails.application.config.secret_token = '3484b78b0f9d88f40cd44a20cf647140e5900632d0c9b85e1fd91dc539811d243f2f0756f791019c' +Rails.application.config.secret_token = 'b1347247976a6c5fba55f3f81faba1c8b6777e556015824405f06b4dbcea65b433535f7ad747ce36' diff --git a/config/routes.rb b/config/routes.rb index a51670449..2d043682d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -33,13 +33,14 @@ Diaspora::Application.routes.draw do match 'zombiefriendaccept', :to => "dev_utilities#zombiefriendaccept" match 'set_backer_number', :to => "dev_utilities#set_backer_number" match 'set_profile_photo', :to => "dev_utilities#set_profile_photo" + #routes for devise, not really sure you will need to mess with this in the future, lets put default, #non mutable stuff in anohter file - match 'login', :to => 'devise/sessions#new', :as => "new_user_session" - match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session" - match 'signup', :to => 'registrations#new', :as => "new_user_registration" + #match 'login', :to => 'devise/sessions#new', :as => "new_user_session" + #match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session" + #match 'signup', :to => 'registrations#new', :as => "new_user_registration" - match 'get_to_the_choppa', :to => redirect("/signup") + #match 'get_to_the_choppa', :to => redirect("/signup") #public routes #