[Logilogi-svn] SF.net SVN: logilogi:[1664] trunk
Status: Beta
Brought to you by:
wybow
|
From: <wy...@us...> - 2010-01-26 17:51:09
|
Revision: 1664
http://logilogi.svn.sourceforge.net/logilogi/?rev=1664&view=rev
Author: wybow
Date: 2010-01-26 17:51:00 +0000 (Tue, 26 Jan 2010)
Log Message:
-----------
Made LogiLogi ready to be translated.
Modified Paths:
--------------
trunk/app/controllers/annotations_controller.rb
trunk/app/controllers/application_controller.rb
trunk/app/controllers/cache_controller.rb
trunk/app/controllers/changes_controller.rb
trunk/app/controllers/comments_controller.rb
trunk/app/controllers/external_links_controller.rb
trunk/app/controllers/invitations_controller.rb
trunk/app/controllers/linked_logis_controller.rb
trunk/app/controllers/links_controller.rb
trunk/app/controllers/logi_settings_controller.rb
trunk/app/controllers/logis_controller.rb
trunk/app/controllers/main_page_controller.rb
trunk/app/controllers/password_resets_controller.rb
trunk/app/controllers/peer_group_admin_memberships_controller.rb
trunk/app/controllers/peer_group_memberships_controller.rb
trunk/app/controllers/peer_groups_controller.rb
trunk/app/controllers/perma_links_controller.rb
trunk/app/controllers/remarks_controller.rb
trunk/app/controllers/searches_controller.rb
trunk/app/controllers/user_sessions_controller.rb
trunk/app/controllers/users_controller.rb
trunk/app/helpers/application_helper.rb
trunk/app/models/annotation.rb
trunk/app/models/commenting.rb
trunk/app/models/const/logi.rb
trunk/app/models/const/rating.rb
trunk/app/models/external_link.rb
trunk/app/models/global_config.rb
trunk/app/models/invitation.rb
trunk/app/models/link.rb
trunk/app/models/logi.rb
trunk/app/models/logi_version.rb
trunk/app/models/notifier.rb
trunk/app/models/peer_group.rb
trunk/app/models/rating.rb
trunk/app/models/remark.rb
trunk/app/models/tag.rb
trunk/app/models/used_tag.rb
trunk/app/models/user.rb
trunk/app/models/user_group.rb
trunk/app/models/vote.rb
trunk/app/views/annotations/_listing.html.erb
trunk/app/views/annotations/_new.html.erb
trunk/app/views/annotations/edit.html.erb
trunk/app/views/application/_confirm_delete.html.erb
trunk/app/views/application/_flash.html.erb
trunk/app/views/application/_header.html.erb
trunk/app/views/application/_panel_with_header.html.erb
trunk/app/views/application/_panel_with_tabs.html.erb
trunk/app/views/application/_panel_with_tabs_core.html.erb
trunk/app/views/application/_submit.html.erb
trunk/app/views/changes/_changes_pagination.html.erb
trunk/app/views/changes/_list.html.erb
trunk/app/views/changes/_recent_or_new_logis.html.erb
trunk/app/views/comments/_new.html.erb
trunk/app/views/external_links/_listing.html.erb
trunk/app/views/external_links/_new.html.erb
trunk/app/views/external_links/edit.html.erb
trunk/app/views/invitations/edit.html.erb
trunk/app/views/invitations/new.html.erb
trunk/app/views/layouts/_de_footer.html.erb
trunk/app/views/layouts/_de_header.html.erb
trunk/app/views/layouts/_footer.html.erb
trunk/app/views/layouts/_head.html.erb
trunk/app/views/layouts/_header.html.erb
trunk/app/views/layouts/_lirmm_header.html.erb
trunk/app/views/links/_listing.html.erb
trunk/app/views/links/edit.html.erb
trunk/app/views/logi_inserts/_deletion_list.html.erb
trunk/app/views/logi_inserts/_insert_bar_remove.html.erb
trunk/app/views/logi_inserts/_remove_bar.html.erb
trunk/app/views/logi_inserts/new.html.erb
trunk/app/views/logi_settings/edit.html.erb
trunk/app/views/logi_tags/_edit.html.erb
trunk/app/views/logi_tags/_toggle.html.erb
trunk/app/views/logis/_check.html.erb
trunk/app/views/logis/_cloud.html.erb
trunk/app/views/logis/_commenting_logis.html.erb
trunk/app/views/logis/_comments_on.html.erb
trunk/app/views/logis/_contending_logis.html.erb
trunk/app/views/logis/_created_by_user.html.erb
trunk/app/views/logis/_edit.html.erb
trunk/app/views/logis/_edit_bar.html.erb
trunk/app/views/logis/_edit_with_tags.html.erb
trunk/app/views/logis/_found_logis.html.erb
trunk/app/views/logis/_incoming_links.html.erb
trunk/app/views/logis/_incoming_links_to_tags.html.erb
trunk/app/views/logis/_insert_bar.html.erb
trunk/app/views/logis/_list.html.erb
trunk/app/views/logis/_logi.html.erb
trunk/app/views/logis/_navigation_bar_browse_header.html.erb
trunk/app/views/logis/_navigation_bar_edit_header.html.erb
trunk/app/views/logis/_navigation_bar_new_header.html.erb
trunk/app/views/logis/_navigation_bar_peer_group_select.html.erb
trunk/app/views/logis/_navigation_bar_user_group_select.html.erb
trunk/app/views/logis/_navigation_bar_view_header.html.erb
trunk/app/views/logis/_rated_by_peer_group.html.erb
trunk/app/views/logis/_rating_current.html.erb
trunk/app/views/logis/_recent_votes.html.erb
trunk/app/views/logis/_remarks.html.erb
trunk/app/views/logis/_remarks_errors.html.erb
trunk/app/views/logis/_small_snippet.html.erb
trunk/app/views/logis/_snippet.html.erb
trunk/app/views/logis/_snippets_list.html.erb
trunk/app/views/logis/_snippets_pagination.html.erb
trunk/app/views/logis/_steps.html.erb
trunk/app/views/logis/_tag_list.html.erb
trunk/app/views/logis/_tag_sets.html.erb
trunk/app/views/logis/_tag_sets_list.html.erb
trunk/app/views/logis/_tiny_snippet.html.erb
trunk/app/views/logis/edit.html.erb
trunk/app/views/logis/show.html.erb
trunk/app/views/main_page/_cloud.html.erb
trunk/app/views/main_page/_new_users_or_groups.html.erb
trunk/app/views/main_page/_recent_or_new_logis.html.erb
trunk/app/views/notifier/for_log.erb
trunk/app/views/notifier/invitation.erb
trunk/app/views/notifier/password_reset_instructions.erb
trunk/app/views/notifier/welcome.erb
trunk/app/views/password_resets/edit.html.erb
trunk/app/views/password_resets/new.html.erb
trunk/app/views/peer_group_admin_memberships/index.html.erb
trunk/app/views/peer_group_memberships/index.html.erb
trunk/app/views/peer_groups/_activity.html.erb
trunk/app/views/peer_groups/_list.html.erb
trunk/app/views/peer_groups/edit.html.erb
trunk/app/views/peer_groups/index.html.erb
trunk/app/views/peer_groups/new.html.erb
trunk/app/views/perma_links/_new.html.erb
trunk/app/views/ratings/_show.html.erb
trunk/app/views/remarks/_new.html.erb
trunk/app/views/remarks/edit.html.erb
trunk/app/views/searches/_navigation_bar_search_header.html.erb
trunk/app/views/searches/create.html.erb
trunk/app/views/tags/_edit.html.erb
trunk/app/views/user_sessions/_method.html.erb
trunk/app/views/user_sessions/new.html.erb
trunk/app/views/users/_activity.html.erb
trunk/app/views/users/_method.html.erb
trunk/app/views/users/edit.html.erb
trunk/app/views/users/index.html.erb
trunk/app/views/users/new.html.erb
trunk/app/views/votes/_list.html.erb
trunk/app/views/votes/_new.html.erb
trunk/app/views/votes/_show.html.erb
trunk/config/environment.rb
trunk/config/initializers/action_mailer.rb
trunk/config/initializers/active_record.rb
trunk/lib/logi_form_builder.rb
trunk/public/stylesheets/logilogi.css
Added Paths:
-----------
trunk/config/locales/
trunk/config/locales/controllers/
trunk/config/locales/controllers/en.yml
trunk/config/locales/defaults/
trunk/config/locales/defaults/en.yml
trunk/config/locales/helpers/
trunk/config/locales/helpers/en.yml
trunk/config/locales/models/
trunk/config/locales/models/en.yml
trunk/config/locales/views/
trunk/config/locales/views/annotations/
trunk/config/locales/views/annotations/en.yml
trunk/config/locales/views/application/
trunk/config/locales/views/application/en.yml
trunk/config/locales/views/changes/
trunk/config/locales/views/changes/en.yml
trunk/config/locales/views/comments/
trunk/config/locales/views/comments/en.yml
trunk/config/locales/views/external_links/
trunk/config/locales/views/external_links/en.yml
trunk/config/locales/views/invitations/
trunk/config/locales/views/invitations/en.yml
trunk/config/locales/views/layouts/
trunk/config/locales/views/layouts/en.yml
trunk/config/locales/views/links/
trunk/config/locales/views/links/en.yml
trunk/config/locales/views/logi_inserts/
trunk/config/locales/views/logi_inserts/en.yml
trunk/config/locales/views/logi_settings/
trunk/config/locales/views/logi_settings/en.yml
trunk/config/locales/views/logi_tags/
trunk/config/locales/views/logi_tags/en.yml
trunk/config/locales/views/logis/
trunk/config/locales/views/logis/en.yml
trunk/config/locales/views/main_page/
trunk/config/locales/views/main_page/en.yml
trunk/config/locales/views/notifier/
trunk/config/locales/views/notifier/en.yml
trunk/config/locales/views/password_resets/
trunk/config/locales/views/password_resets/en.yml
trunk/config/locales/views/peer_group_admin_memberships/
trunk/config/locales/views/peer_group_admin_memberships/en.yml
trunk/config/locales/views/peer_group_memberships/
trunk/config/locales/views/peer_group_memberships/en.yml
trunk/config/locales/views/peer_groups/
trunk/config/locales/views/peer_groups/en.yml
trunk/config/locales/views/perma_links/
trunk/config/locales/views/perma_links/en.yml
trunk/config/locales/views/ratings/
trunk/config/locales/views/ratings/en.yml
trunk/config/locales/views/remarks/
trunk/config/locales/views/remarks/en.yml
trunk/config/locales/views/searches/
trunk/config/locales/views/searches/en.yml
trunk/config/locales/views/tags/
trunk/config/locales/views/tags/en.yml
trunk/config/locales/views/user_sessions/
trunk/config/locales/views/user_sessions/en.yml
trunk/config/locales/views/users/
trunk/config/locales/views/users/en.yml
trunk/config/locales/views/votes/
trunk/config/locales/views/votes/en.yml
Removed Paths:
-------------
trunk/locale/
trunk/po/
Modified: trunk/app/controllers/annotations_controller.rb
===================================================================
--- trunk/app/controllers/annotations_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/annotations_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -16,7 +16,8 @@
### Filters
- before_filter :resolve_context, :page_name, :find_logi_and_logi_version, :except => :index
+ before_filter :resolve_context, :page_name, :find_logi_and_logi_version,
+ :except => :index
### Bodies
@@ -27,8 +28,7 @@
new_annotation_position_range_list = self.weave_out_annotations(
params[:body_with_inserts], @logi_version, @logi)
if new_annotation_position_range_list.empty?
- @logi.errors.add(:selection, 'needs to be made in the logi at the' +
- ' location where the annotation should be inserted and the annotation should not be empty')
+ @logi.errors.add(:selection, t('c.error_needs_selection'))
end
if @logi.errors.empty?
@@ -36,7 +36,8 @@
@annotation = new_annotation_position_range_list.first.annotation
@annotation.user = current_user
@annotation.logi = @logi
- @annotation.position_ranges = new_annotation_position_range_list.translate_from_view(
+ @annotation.position_ranges =
+ new_annotation_position_range_list.translate_from_view(
@logi_version.position_ranges)
else
@annotation = Annotation.new(:message => params[:annotation][:message])
@@ -44,10 +45,10 @@
if @logi.errors.empty? and @annotation.valid? and self.thorny_form_free_of_spam?
@annotation.save
- flash[:notice] = "Successfully added annotation"
+ flash[:notice] = t 'c.annotations.added'
redirect_to logi_url(@logi)
else
- flash.now[:error] = "Problem adding annotation"
+ flash.now[:error] = t 'c.annotations.error_adding'
@selected = 'annotation'
render :template => 'logi_inserts/new'
end
@@ -63,10 +64,10 @@
params[:deleted_inserts].each do |annotation_id|
@logi.annotations.find(annotation_id).destroy
end
- flash[:notice] = "Successfully removed annotations"
+ flash[:notice] = 'c.annotations.removed'
redirect_to logi_url(@logi.link)
else
- flash[:warning] = "No annotation selected"
+ flash[:warning] = 'c.annotations.no_selected'
self.edit
render :template => 'annotations/edit'
end
@@ -76,7 +77,8 @@
def listing
render :partial => 'listing', :locals => {
- :annotations => Annotation.find(:all, :conditions => ["id IN (?)", params[:ids].split(',')]) }
+ :annotations => Annotation.find(:all, :conditions => [
+ "id IN (?)", params[:ids].split(',')]) }
end
### Private methods
@@ -87,7 +89,8 @@
#
def weave_out_annotations(body_with_annotations, logi_version, logi)
annotation_pos_ranges = PositionRange::List.new
- self.weave_out(body_with_annotations, logi_version, logi) do |pos_range, inserted_string|
+ self.weave_out(body_with_annotations, logi_version,
+ logi) do |pos_range, inserted_string|
inserted_string.gsub!('__DOUBLE_QUOTES__','"')
pos_range.annotation = Annotation.new(:message => inserted_string)
annotation_pos_ranges.push(pos_range)
Modified: trunk/app/controllers/application_controller.rb
===================================================================
--- trunk/app/controllers/application_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/application_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -29,8 +29,9 @@
filter_parameter_logging :password, :password_confirmation
helper_method :current_user_session, :current_user
- before_filter :append_return_url, :redirect_if_wrong_subdomain,
- :current_prefs, :page_id_and_class
+ before_filter :set_locale, :append_return_url,
+ :redirect_if_wrong_subdomain, :current_prefs,
+ :page_id_and_class
### Bodies
@@ -56,17 +57,25 @@
return (session[:last_non_login_url] || root_url)
end
+ # Sets the locale from GlobalConfig
+ #
+ def set_locale
+ I18n.locale = GlobalConfig.language_code
+ end
+
# Keeps track of the last visited urls, like breadcrumbs, for
# back-buttons...
#
def append_return_url
session[:return_urls] ||= []
- if params[:action] != "create" and params[:action] != "update" and params[:action] != "destroy"
+ if params[:action] != "create" and params[:action] != "update" and
+ params[:action] != "destroy"
if session[:return_urls].last == request.url
session[:return_urls].pop
else
referrer = request.env["HTTP_REFERER"]
- if session[:return_urls].last != referrer and referrer =~ /\/\/[^\/]*#{request.host}(\/.*|)/ and
+ if session[:return_urls].last != referrer and
+ referrer =~ /\/\/[^\/]*#{request.host}(\/.*|)/ and
params[:controller] != "user_sessions"
session[:return_urls].push(referrer)
end
@@ -117,19 +126,23 @@
optional = " = {}"
end
eval <<FUN
- def #{action_suffixed}#{logi_s_p}_#{url_path}(options#{optional}, extra_options = {})
+ def #{action_suffixed}#{logi_s_p}_#{url_path}(options#{optional},
+ extra_options = {})
case options
when String
options = extra_options.merge(:ll_link_string => options)
when Link
- options = extra_options.merge(:ll_link_string => options.to_s(#{link_options}))
+ options = extra_options.merge(
+ :ll_link_string => options.to_s(#{link_options}))
when Logi
- options = extra_options.merge(:ll_link_string => options.link.to_s(#{link_options}))
+ options = extra_options.merge(
+ :ll_link_string => options.link.to_s(#{link_options}))
else
options = extra_options.merge(options)
end
if !current_context.nil?
- options[:ll_link_string] ||= current_context.link.to_s(#{link_options})
+ options[:ll_link_string] ||= current_context.link.to_s(
+ #{link_options})
else
options[:ll_link_string] ||= Tag.replace.to_s
end
@@ -161,7 +174,8 @@
links = Link.find(:all, :conditions => ["id IN (?)", ids.split(',')])
links.each do |link|
hash = {:link => link}
- logis = link.link_matches.collect {|l_m| l_m.logi}.order_by_rating_for(self.current_prefs.peer_group)
+ logis = link.link_matches.collect {|l_m| l_m.logi}.order_by_rating_for(
+ self.current_prefs.peer_group)
hash[:logi_links] = logis.collect {|logi|
l = Link.new(:requested_tags => link.requested_tags.dup,
:to_logi => logi)
@@ -226,7 +240,8 @@
end
def browse_ll_url(link, link_options = {}, options = {})
- browse_logis_url(options.merge(:ll_link_string => link.to_s({:step => -1}.merge(link_options))))
+ browse_logis_url(options.merge(:ll_link_string => link.to_s(
+ {:step => -1}.merge(link_options))))
end
def logi_ll_url(logi, options = {})
@@ -311,7 +326,8 @@
else
# PeerGroup from quick-settings
if session[:current_peer_group_id]
- self.current_prefs.peer_group = PeerGroup.find(session[:current_peer_group_id])
+ self.current_prefs.peer_group = PeerGroup.find(
+ session[:current_peer_group_id])
end
end
return @current_prefs
@@ -414,10 +430,10 @@
end
def insert_links(logi, logi_version, body_with_links, options = {})
- new_link_position_range_list = self.weave_out_links(body_with_links, logi_version, logi)
+ new_link_position_range_list = self.weave_out_links(body_with_links,
+ logi_version, logi)
if new_link_position_range_list.empty?
- logi.errors.add(:text, _('You need to select some text to add the link to' +
- ' and the link must not be empty'))
+ logi.errors.add(:text, t('c.application.error_select_text_link'))
end
old_link_list = logi.from_links.dup
@@ -435,7 +451,7 @@
added_link.resolve
added_link.quick_validate
if options[:require_to_logi] and added_link.to_logi.nil?
- added_link.errors.add(:link, 'needs to be to a specific logi')
+ added_link.errors.add(:link, t('c.application.error_specific_logi'))
end
transfer_errors(added_link, logi, :attribute => :link)
}
@@ -454,8 +470,7 @@
if link_string.empty?
if logi.comments_on_logis.empty?
# TODO fix better
- logi.errors.add(:tags, 'should not be empty if it is not a commenting' +
- ' logi')
+ logi.errors.add(:tags, t('c.application.error_empty'))
else
logi.untag
end
@@ -506,15 +521,14 @@
match = $~
insert_tag = match[0]
if insert_tag !~ Const::Logi::CHECK_INSERT_TAG_RE
- raise ParsingError.new(insert_tag), 'Invalid tag string'
+ raise ParsingError.new(insert_tag), t('c.application.error_tag_string')
end
insert_tag =~ Const::Logi::DISSECT_INSERT_TAG_RE
match = $~
inserted_string = match[1]
body_text_inserted_to = match[2]
if body_text_inserted_to =~ Const::LogiVersion::HTML_TAG
- err_obj.errors.add(:selection, 'should not overlap with html tags,' +
- ' like different styles or multiple lists')
+ err_obj.errors.add(:selection, t('c.application.error_overlap_html'))
end
begin_pos = global_clean_p
@@ -581,7 +595,8 @@
end
def auto_page_name
- return @page_id.tr('_',' ').gsub(/(^|\s)(.)/) { $1 + $2.upcase }
+ return t 'c.' + params[:controller] + '.page_name.' + params[:action],
+ :default => ''
end
def redirect_if_wrong_subdomain
@@ -589,7 +604,8 @@
subdomain = request.subdomains.first.to_s
if subdomain == 'www' or subdomain.empty?
# detect browser language
- language = ::BrowserLanguageCode.detect(request.env['HTTP_ACCEPT_LANGUAGE'])
+ language = ::BrowserLanguageCode.detect(
+ request.env['HTTP_ACCEPT_LANGUAGE'])
if GlobalConfig.available_subdomains.include?(language)
subdomain = language
else
@@ -598,7 +614,8 @@
end
# redirecting
domain = subdomain + '.' + GlobalConfig.domain.downcase
- host = (request.port == request.standard_port ? "#{domain}" : "#{domain}:#{request.port}")
+ host = (request.port == request.standard_port ? "#{domain}" :
+ "#{domain}:#{request.port}")
redirect_to url_for(params.merge(:host => host))
return false
end
@@ -644,7 +661,7 @@
#
def require_login
if self.current_user.anonymous?
- flash[:warning] = "You must be logged in to access this page"
+ flash[:warning] = t 'c.application.must_be_logged_in'
redirect_to new_user_session_url
return false
end
@@ -654,7 +671,7 @@
#
def require_no_login
if !self.current_user.anonymous?
- flash[:warning] = "You must NOT be logged in to access this page"
+ flash[:warning] = t 'c.application.must_not_be_logged_in'
redirect_to return_url_or_default(user_ll_url(current_user))
return false
end
Modified: trunk/app/controllers/cache_controller.rb
===================================================================
--- trunk/app/controllers/cache_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/cache_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -20,7 +20,8 @@
def source
self.regenerate_source_archive
- send_file "#{RAILS_ROOT}/public/do/code/source.zip", :filename => 'source.zip'
+ send_file "#{RAILS_ROOT}/public/do/code/source.zip",
+ :filename => 'source.zip'
end
### Sub-methods
@@ -29,7 +30,8 @@
def regenerate_source_archive
system "rm -f #{RAILS_ROOT}/tmp/source.zip"
- Zip::ZipFile.open("#{RAILS_ROOT}/tmp/source.zip", Zip::ZipFile::CREATE) {|zipfile|
+ Zip::ZipFile.open("#{RAILS_ROOT}/tmp/source.zip",
+ Zip::ZipFile::CREATE) {|zipfile|
globs = Array.new
files = Array.new
files.push("Rakefile",
Modified: trunk/app/controllers/changes_controller.rb
===================================================================
--- trunk/app/controllers/changes_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/changes_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -49,16 +49,20 @@
### Tabbed methods
def recently_changed_logis
- @recently_changed_logis_count = LogiVersion.count(:conditions => 'created_at > "' +
+ @recently_changed_logis_count = LogiVersion.count(
+ :conditions => 'created_at > "' +
1.week.ago.to_s(:db) + '"')
- @logis = Logi.paginate_recent_changes(:page => params[:page], :per_page => 30)
+ @logis = Logi.paginate_recent_changes(:page => params[:page],
+ :per_page => 30)
render_ajax_body :partial => 'recent_or_new_logis.html.erb',
:locals => {:selected => @selected}
end
def new_logis
- @new_logis_count = Logi.count(:conditions => 'created_at > "' + 1.week.ago.to_s(:db) + '"')
- @logis = Logi.recent.presentable.paginate(:page => params[:page], :per_page => 8)
+ @new_logis_count = Logi.count(:conditions => 'created_at > "' +
+ 1.week.ago.to_s(:db) + '"')
+ @logis = Logi.recent.presentable.paginate(:page => params[:page],
+ :per_page => 8)
render_ajax_body :partial => 'recent_or_new_logis.html.erb',
:locals => {:selected => @selected}
end
Modified: trunk/app/controllers/comments_controller.rb
===================================================================
--- trunk/app/controllers/comments_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/comments_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -16,7 +16,8 @@
### Filters
- before_filter :resolve_context, :find_logi_and_logi_version, :except => :index
+ before_filter :resolve_context, :find_logi_and_logi_version,
+ :except => :index
### Bodies
@@ -41,7 +42,7 @@
@link.resolve
if !@link.to_logi
- @link.errors.add(:link, 'must be to a specific logi')
+ @link.errors.add(:link, t('c.comments.error_specific_logi'))
end
if @link.errors.empty?
@@ -50,14 +51,14 @@
:to_logi => @link.volatile_to_logi, :user => current_user)
@commenting.save
- flash[:notice] = "Successfully added commenting logi" +
- " #{@link.volatile_to_logi.to_s(:for => :full_show)}"
+ flash[:notice] = t('c.comments.added_commenting',
+ :logi => @link.volatile_to_logi.to_s(:for => :full_show))
render :update do |page|
page.redirect_to logi_ll_url(@logi)
end
else
transfer_errors(@link, @logi, :attribute => :comment_link)
- flash[:error] = "Problem connecting commenting logi"
+ flash[:error] = t 'c.comments.error_connecting'
@selected = 'existing_logi'
end
else # new logi
@@ -75,8 +76,8 @@
@commenting_logi.save
@commenting.save
- flash[:notice] = "Successfully created commenting logi" +
- " #{@commenting_logi.to_s(:for => :full_show)}"
+ flash[:notice] = t 'c.comments.created_commenting_logi',
+ :logi => @commenting_logi.to_s(:for => :full_show)
render :update do |page|
page.redirect_to logi_ll_url(@logi)
@@ -84,7 +85,7 @@
else
transfer_errors(@commenting_logi_version, @logi_version)
- flash[:error] = "Problem creating commenting logi"
+ flash[:error] = t 'c.comments.error_creating'
@selected = 'new_logi'
end
end
Modified: trunk/app/controllers/external_links_controller.rb
===================================================================
--- trunk/app/controllers/external_links_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/external_links_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -30,13 +30,13 @@
new_external_link_position_range_list = self.weave_out_external_links(
params[:body_with_inserts], @logi_version, @logi)
if new_external_link_position_range_list.empty?
- @logi.errors.add(:text, 'You need to select some text for a positioned' +
- ' external_link and the external_link should not be empty')
+ @logi.errors.add(:text, t('c.external_links.error_select_text'))
end
if @logi.errors.empty?
# Only one at the same time for now
- @external_link = new_external_link_position_range_list.first.external_link
+ @external_link = new_external_link_position_range_list.first.
+ external_link
@external_link.user = current_user
@external_link.logi = @logi
@external_link.position_ranges = new_external_link_position_range_list.
@@ -45,15 +45,15 @@
@external_link = nil
end
- if @logi.errors.empty? and !@external_link.nil? and @external_link.valid? and
- self.thorny_form_free_of_spam?
+ if @logi.errors.empty? and !@external_link.nil? and
+ @external_link.valid? and self.thorny_form_free_of_spam?
@external_link.save
- flash[:notice] = "Successfully added external link"
+ flash[:notice] = t 'c.external_links.added'
redirect_to logi_url(@logi)
else
@external_link = ExternalLink.new(:url => params[:external_link][:url],
:text => params[:external_link][:text])
- flash[:error] = "Problem adding external link"
+ flash[:error] = t 'c.external_links.error_adding'
@selected = 'link'
@link_selected = 'external_link'
render :template => 'logi_inserts/new'
@@ -69,10 +69,10 @@
params[:deleted_inserts].each do |external_link_id|
@logi.external_links.find(external_link_id).destroy
end
- flash[:notice] = "Successfully removed external links"
+ flash[:notice] = t 'c.external_links.removed'
redirect_to logi_url(@logi.link)
else
- flash[:warning] = "No external link selected"
+ flash[:warning] = t 'c.external_links.no_selected'
self.edit
render :template => 'external_links/edit'
end
Modified: trunk/app/controllers/invitations_controller.rb
===================================================================
--- trunk/app/controllers/invitations_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/invitations_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -35,14 +35,16 @@
if @invitation.save
@invitation.deliver_invitation!
if @invitation.user.nil?
- flash[:notice] = "The invitation has been sent to " + @invitation.email
+ flash[:notice] = t 'c.invitations.sent_to',
+ :user => @invitation.email
else
- flash[:notice] = "The invitation has been sent to " + @invitation.user.name
+ flash[:notice] = t 'c.invitations.sent_to',
+ :user => @invitation.user.name
end
redirect_to return_url_or_default # same form again for another invite
else
@invitation = Invitation.new
- flash[:notice] = "Problem creating invitation"
+ flash[:error] = t 'c.invitations.error_creating'
render :action => :new
end
end
@@ -56,14 +58,14 @@
def update
if @invitation.admit(current_user)
if @invitation.role == Const::PeerGroupMembership::ADMIN
- flash[:notice] = "Successfully made co-founder of peergroup"
+ flash[:notice] = t 'c.invitations.became_co_founder'
else
- flash[:notice] = "Successfully joined peergroup"
+ flash[:notice] = t 'c.invitations.joined'
end
@invitation.destroy
redirect_to peer_group_ll_url(@invitation.peer_group)
else
- flash[:notice] = "Problem joining peergroup"
+ flash[:error] = t 'c.invitations.error_joining'
render :action => :edit
end
end
@@ -78,9 +80,7 @@
@invitation = Invitation.find_by_id(params[:id])
end
unless @invitation
- flash[:notice] = "We're sorry, but we could not find your invitation. " +
- "If you are having issues try copying and pasting the URL " +
- "from your email into your browser or ask for a new invitation."
+ flash[:notice] = t 'c.invitations.url_issues'
redirect_to return_url_or_default
end
end
Modified: trunk/app/controllers/linked_logis_controller.rb
===================================================================
--- trunk/app/controllers/linked_logis_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/linked_logis_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -16,7 +16,8 @@
### Filters
- before_filter :resolve_context, :find_logi_and_logi_version, :except => :index
+ before_filter :resolve_context, :find_logi_and_logi_version,
+ :except => :index
### Bodies
@@ -41,8 +42,7 @@
body_with_inserts = params[:body_with_inserts]
if body_with_inserts !~ /#{Const::Logi::INSERT_STRING}/
- @logi.errors.add(:text, ': at least some text needs to be selected' +
- ' to link the new logi to')
+ @logi.errors.add(:text, t('c.linked_logis.erro_select_text'))
end
transfer_errors(@new_logi, @logi)
@@ -56,14 +56,14 @@
body_with_inserts, @new_logi)
self.insert_links(@logi, @logi_version, body_with_comment_link)
- flash[:notice] = "Successfully created new logi and linked it" +
- " #{@new_logi.to_s(:for => :full_show)}"
+ flash[:notice] = t 'c.linked_logis.created',
+ :logi => @new_logi.to_s(:for => :full_show)
redirect_to logi_ll_url(@logi)
else
transfer_errors(@new_logi_version, @logi_version)
- flash[:error] = "Problem creating new, linked logi"
+ flash[:error] = t 'c.linked_logis.error_creating'
@selected = 'comment'
render :template => 'logi_inserts/new'
return
Modified: trunk/app/controllers/links_controller.rb
===================================================================
--- trunk/app/controllers/links_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/links_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -30,10 +30,10 @@
self.insert_links(@logi, @logi_version, params[:body_with_inserts])
if @logi.errors.empty? and self.thorny_form_free_of_spam?
- flash[:notice] = "Successfully added link"
+ flash[:notice] = t 'c.links.added'
redirect_to logi_url(@logi)
else
- flash[:error] = "Problem adding link"
+ flash[:error] = t 'c.links.error_adding'
@selected = 'link'
@link_selected = 'tags_link'
render :template => 'logi_inserts/new'
@@ -49,10 +49,10 @@
params[:deleted_inserts].each do |link_id|
@logi.from_links.find(link_id).destroy
end
- flash[:notice] = "Successfully removed links"
+ flash[:notice] = t 'c.links.removed'
redirect_to logi_url(@logi.link)
else
- flash[:warning] = "No link selected"
+ flash[:warning] = t 'c.links.no_selected'
self.edit
render :template => 'links/edit'
end
Modified: trunk/app/controllers/logi_settings_controller.rb
===================================================================
--- trunk/app/controllers/logi_settings_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/logi_settings_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -29,7 +29,7 @@
def edit
if !@logi.admin_rights?(current_user)
- flash[:warning] = "You are not allowed to edit settings for this logi"
+ flash[:warning] = t 'c.settings.error_permission'
redirect_to logi_ll_url(@logi)
return
end
@@ -38,23 +38,23 @@
def update
if @logi.admin_rights?(current_user)
if params[:logi][:delete]
- render_to_confirm_delete :text => 'Do you really want to delete this logi ?',
+ render_to_confirm_delete :text => t('c.settings.confirm_delete'),
:url => logi_url(@logi), :cancel_url => logi_url(@logi)
elsif !@logi.user_group.public?
@logi.restriction = params[:logi][:restriction]
if @logi.save
- flash[:notice] = "Successfully updated settings"
+ flash[:notice] = t 'c.settings.updated'
redirect_to logi_ll_url(@logi)
else
- flash[:warning] = "Could not update settings! Please retry"
+ flash[:warning] = t 'c.settings.error_updating'
render :action => 'edit'
end
else
- flash[:error] = "You don't have the permissions to change settings for this Logi"
+ flash[:error] = t 'c.settings.error_permission'
render :action => 'edit'
end
else
- flash[:error] = "You don't have the permissions to change settings for this Logi"
+ flash[:error] = t 'c.settings.error_permission'
render :action => 'edit'
end
end
Modified: trunk/app/controllers/logis_controller.rb
===================================================================
--- trunk/app/controllers/logis_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/logis_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -51,8 +51,10 @@
def auto_complete_for_logi_browse_list_input
re = Regexp.new("^#{params[:search]}", "i")
find_options = { :order => "string ASC" }
- @tags = UsedTag.find(:all, find_options).collect(&:string).select { |t| t.match re }
- render :inline => "<%= content_tag(:ul, @tags.map { |t| content_tag(:li, h(t)) }) %>"
+ @tags = UsedTag.find(:all, find_options).collect(&:string).select { |t|
+ t.match re }
+ render :inline =>
+ "<%= content_tag(:ul, @tags.map { |t| content_tag(:li, h(t)) }) %>"
end
def index
@@ -117,10 +119,11 @@
@logi, @logi_version = self.create_logi(params[:logi])
if self.thorny_form_free_of_spam? and @logi.save
- flash[:notice] = "Successfully created #{@logi.to_s(:for => :full_show)}"
+ flash[:notice] = t 'c.logis.created',
+ :logi => @logi.to_s(:for => :full_show)
redirect_to logi_ll_url(@logi)
else
- flash[:error] = "Problem creating logi"
+ flash[:error] = t 'c.logis.error_creating'
render :action => 'new', :layout => 'blank'
end
end
@@ -132,7 +135,8 @@
:link_string => entry.categories.collect {|c| c.term}.join('/'))
if !current_user.anonymous? and @logi.save
- render :partial => 'show.xml.erb', :status => :created, :location => @logi.link.to_s
+ render :partial => 'show.xml.erb', :status => :created,
+ :location => @logi.link.to_s
else
render :xml => @logi.errors, :status => :unprocessable_entity
end
@@ -143,7 +147,7 @@
def edit
@selected = params[:selected]
if !@logi.edit_rights?(current_user)
- flash[:warning] = "You have no permission to edit this logi"
+ flash[:warning] = t 'c.logis.error_permission'
redirect_to logi_ll_url(@logi)
return
end
@@ -152,7 +156,7 @@
def update
if !@logi.edit_rights?(current_user)
- flash[:warning] = "You have no permission to update this logi"
+ flash[:warning] = t 'c.logis.error_permission'
redirect_to logi_ll_url(@logi)
return
end
@@ -164,10 +168,12 @@
if @logi.errors.empty? and @logi.valid? and @logi_version.valid? and
self.thorny_form_free_of_spam?
@logi.update_if_changed(@logi_version)
- flash[:notice] = "Successfully saved #{@logi.to_s(:for => :full_show)}"
+ flash[:notice] = t 'c.logis.saved',
+ :logi => @logi.to_s(:for => :full_show)
redirect_to logi_ll_url(@logi)
else
- flash[:error] = "Unable to save #{@logi.to_s(:for => :full_show)}"
+ flash[:error] = t 'c.logis.error_save',
+ :logi => @logi.to_s(:for => :full_show)
render :action => 'edit', :layout => 'blank'
end
end
@@ -191,15 +197,16 @@
def destroy
if @logi.admin_rights?(current_user)
if @logi.destroy
- flash[:notice] = "Successfully deleted #{@logi.to_s(:for => :full_show)}"
+ flash[:notice] = t 'c.logis.deleted',
+ :logi => @logi.to_s(:for => :full_show)
@logi.reload
redirect_to root_url
else
- flash[:error] = "Could not delete logi"
+ flash[:error] = t 'c.logis.error_deleting'
redirect_to logi_url(@logi)
end
else
- flash[:warning] = "You don't have the permissions to delete this Logi"
+ flash[:warning] = t 'c.logis.error_admin_permission'
redirect_to logi_url(@logi)
end
end
@@ -240,7 +247,7 @@
def page_name
if params[:action] == "index"
- @page_name = 'Browsing'
+ @page_name = t 'c.logis.page_name.index'
if !self.current_context.nil?
@page_name += ' ' + self.current_context.link.to_s(
:for => :show, :direction => :requested)
Modified: trunk/app/controllers/main_page_controller.rb
===================================================================
--- trunk/app/controllers/main_page_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/main_page_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -67,44 +67,40 @@
end
def recently_changed_logis
- @recently_changed_logis_count = LogiVersion.count(:conditions => 'created_at > "' +
- 1.week.ago.to_s(:db) + '"')
- @logis = Logi.paginate_recent_changes(:page => params[:page], :per_page => 15)
+ @recently_changed_logis_count = LogiVersion.count(
+ :conditions => 'created_at > "' + 1.week.ago.to_s(:db) + '"')
+ @logis = Logi.paginate_recent_changes(:page => params[:page],
+ :per_page => 15)
render_ajax_body :partial => 'recent_or_new_logis.html.erb',
:locals => {:selected => @selected}
end
def new_logis
- @new_logis_count = Logi.count(:conditions => 'created_at > "' + 1.week.ago.to_s(:db) + '"')
- @logis = Logi.recent.presentable.paginate(:page => params[:page], :per_page => 7)
+ @new_logis_count = Logi.count(:conditions => 'created_at > "' +
+ 1.week.ago.to_s(:db) + '"')
+ @logis = Logi.recent.presentable.paginate(:page => params[:page],
+ :per_page => 7)
render_ajax_body :partial => 'recent_or_new_logis.html.erb',
:locals => {:selected => @selected}
end
def new_users
@users = User.find(:all, :order => 'created_at DESC', :limit => 15)
- @new_users_count = User.count(:conditions => 'created_at > "' + 1.week.ago.to_s(:db) + '"')
+ @new_users_count = User.count(:conditions => 'created_at > "' +
+ 1.week.ago.to_s(:db) + '"')
render_ajax_body :partial => 'new_users_or_groups.html.erb',
:locals => {:selected => @selected}
end
def new_groups
- @peer_groups = PeerGroup.find(:all, :order => 'created_at DESC', :limit => 10)
- @new_groups_count = PeerGroup.count(:conditions => 'created_at > "' + 1.month.ago.to_s(:db) + '"')
+ @peer_groups = PeerGroup.find(:all, :order => 'created_at DESC',
+ :limit => 10)
+ @new_groups_count = PeerGroup.count(:conditions => 'created_at > "' +
+ 1.month.ago.to_s(:db) + '"')
render_ajax_body :partial => 'new_users_or_groups.html.erb',
:locals => {:selected => @selected}
end
- ### Filter-methods
-
- def page_name
- if params[:action] == "index"
- @page_name = 'Welcome'
- else
- @page_name = self.auto_page_name
- end
- end
-
### Body-methods
protected
Modified: trunk/app/controllers/password_resets_controller.rb
===================================================================
--- trunk/app/controllers/password_resets_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/password_resets_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -32,12 +32,11 @@
@user = User.find_by_email(params[:user][:email])
if @user
@user.deliver_password_reset_instructions!
- flash[:notice] = "Instructions to reset your password have been emailed to you. " +
- "Please check your email."
+ flash[:notice] = t 'c.password_resets.instructions_emailed'
redirect_to return_url_or_default
else
@user = User.new
- flash[:notice] = "No user was found with that email address"
+ flash[:error] = t 'c.password_resets.error_not_found'
render :action => :new
end
end
@@ -49,7 +48,7 @@
@user.password = params[:user][:password]
@user.password_confirmation = params[:user][:password_confirmation]
if @user.save
- flash[:notice] = "Password successfully updated"
+ flash[:notice] = t 'c.password_resets.updated'
redirect_to user_ll_url(@user)
else
render :action => :edit
@@ -63,10 +62,7 @@
def load_user_using_perishable_token
@user = User.find_using_perishable_token(params[:id])
unless @user
- flash[:notice] = "We're sorry, but we could not locate your account. " +
- "If you are having issues try copying and pasting the URL " +
- "from your email into your browser or restarting the " +
- "reset password process."
+ flash[:notice] = t 'c.password_resets.url_issues'
redirect_to return_url_or_default
end
end
Modified: trunk/app/controllers/peer_group_admin_memberships_controller.rb
===================================================================
--- trunk/app/controllers/peer_group_admin_memberships_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/peer_group_admin_memberships_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -22,16 +22,12 @@
def index
if current_user.admin?
- @peer_groups = PeerGroup.find(:all, :conditions => 'id != ' + PeerGroup.public.id.to_s)
+ @peer_groups = PeerGroup.find(:all, :conditions => 'id != ' +
+ PeerGroup.public.id.to_s)
else
@peer_groups = current_user.peer_group_memberships.find_all_by_role(
- Const::PeerGroupMembership::ADMIN).collect {|p_g_a_m| p_g_a_m.peer_group}
+ Const::PeerGroupMembership::ADMIN).collect {|p_g_a_m|
+ p_g_a_m.peer_group}
end
end
-
- ### Filter functions
-
- def page_name
- @page_name = "Peer Groups Admin"
- end
end
Modified: trunk/app/controllers/peer_group_memberships_controller.rb
===================================================================
--- trunk/app/controllers/peer_group_memberships_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/peer_group_memberships_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -24,14 +24,9 @@
if current_user.admin?
@peer_groups = PeerGroup.find(:all)
else
- @peer_groups = current_user.peer_group_memberships.collect {|p_m| p_m.peer_group}
+ @peer_groups = current_user.peer_group_memberships.collect {|p_m|
+ p_m.peer_group}
# TODO put back to current_user.peer_groups when the rails-bug is fixed
end
end
-
- ### Filter functions
-
- def page_name
- @page_name = "Peer Groups Invites"
- end
end
Modified: trunk/app/controllers/peer_groups_controller.rb
===================================================================
--- trunk/app/controllers/peer_groups_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/peer_groups_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -40,10 +40,10 @@
@peer_group = PeerGroup.new(params[:peer_group])
@peer_group.memberships.build(:user => current_user, :admin_settings => true)
if @peer_group.save
- flash[:notice] = "Successfully created peergroup"
+ flash[:notice] = t 'c.peer_groups.created'
redirect_to peer_group_ll_url(@peer_group)
else
- flash[:notice] = "Problem creating peergroup"
+ flash[:error] = t 'c.peer_groups.error_creating'
render :action => 'new'
end
end
@@ -52,7 +52,7 @@
end
def update
- render_to_confirm_delete :text => 'Do you want to delete this Peergroup ?',
+ render_to_confirm_delete :text => t('c.peer_groups.confirm_delete'),
:url => peer_group_url(@peer_group),
:cancel_url => edit_user_url(current_user)
end
@@ -63,10 +63,10 @@
@peer_group != PeerGroup.public
@peer_group.destroy
session[:current_peer_group_id] = PeerGroup.public.id
- flash[:notice] = "Successfully deleted peergroup"
+ flash[:notice] = t 'c.peer_groups.deleted'
redirect_to root_url
else
- flash[:error] = "You don't have permission to destroy this peergroup"
+ flash[:error] = t 'c.peer_groups.error_deleting'
redirect_to peer_group_ll_url(@peer_group)
end
end
Modified: trunk/app/controllers/perma_links_controller.rb
===================================================================
--- trunk/app/controllers/perma_links_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/perma_links_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -31,10 +31,10 @@
:require_to_logi => true)
if @logi.errors.empty? and self.thorny_form_free_of_spam?
- flash[:notice] = "Successfully added link to specific logi"
+ flash[:notice] = t 'c.perma_links.added'
redirect_to logi_url(@logi)
else
- flash[:error] = "Problem adding link to specific logi. Are you sure it is on this server & language ?"
+ flash[:error] = t 'c.perma_links.error_adding'
@selected = 'link'
@link_selected = 'perma_link'
render :template => 'logi_inserts/new'
Modified: trunk/app/controllers/remarks_controller.rb
===================================================================
--- trunk/app/controllers/remarks_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/remarks_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -16,7 +16,8 @@
### Filters
- before_filter :resolve_context, :page_name, :find_logi_and_logi_version, :except => :index
+ before_filter :resolve_context, :page_name, :find_logi_and_logi_version,
+ :except => :index
### Bodies
@@ -29,7 +30,8 @@
@remark = Remark.new(:logi => @logi, :user => current_user,
:message => params[:remark][:message])
- if @logi.errors.empty? and @remark.valid? and self.thorny_form_free_of_spam?
+ if @logi.errors.empty? and @remark.valid? and
+ self.thorny_form_free_of_spam?
@remark.save
self.get_remarks
@remark = Remark.new
Modified: trunk/app/controllers/searches_controller.rb
===================================================================
--- trunk/app/controllers/searches_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/searches_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -35,7 +35,8 @@
def create
if !@query.nil?
- @logis = WillPaginate::Collection.create((params[:page] || 1), 8) do |pager|
+ @logis = WillPaginate::Collection.create(
+ (params[:page] || 1), 8) do |pager|
search = ActsAsXapian::Search.new([Logi], @query,
:offset => pager.offset, :limit => pager.per_page)
# inject the result array into the paginated collection:
@@ -55,7 +56,8 @@
# MAYDO: Can be optimized by having a special TagSet class in the
# search index
if !@query.nil?
- @tag_set_links = Context.extract_tag_set_links(LogiLogiXapian.search([Logi], @query))
+ @tag_set_links = Context.extract_tag_set_links(
+ LogiLogiXapian.search([Logi], @query))
render_body 'logis/tag_sets'
end
end
@@ -73,7 +75,7 @@
end
def page_name
- @page_name = 'Searching'
+ @page_name = t 'c.searches.page_name.index'
if params[:query]
@page_name += ': ' + params[:query]
end
Modified: trunk/app/controllers/user_sessions_controller.rb
===================================================================
--- trunk/app/controllers/user_sessions_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/user_sessions_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -41,15 +41,15 @@
@user_session.save do |result|
if result
if session[:invitation].nil?
- flash[:notice] = "Login successful!"
+ flash[:notice] = t 'c.user_sessions.logged_in'
shift_return_url
redirect_to return_url_or_default(user_ll_url(@user_session.user))
else
- flash[:notice] = "Logged you in! Now you can accept your invitation"
+ flash[:notice] = t 'c.user_sessions.logged_in_accept_invitation'
redirect_to edit_invitation_url(session[:invitation])
end
else
- flash[:warning] = "Problem logging you in"
+ flash[:warning] = t 'c.user_sessions.error_logging_in'
render :action => :new
end
end
@@ -57,7 +57,7 @@
def destroy
self.current_user_session.destroy
- flash[:notice] = "Logged you out"
+ flash[:notice] = t 'c.user_sessions.logged_out'
redirect_to root_url
end
Modified: trunk/app/controllers/users_controller.rb
===================================================================
--- trunk/app/controllers/users_controller.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/controllers/users_controller.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -53,15 +53,15 @@
if result
@user.deliver_welcome!
if session[:invitation].nil?
- flash[:notice] = "You just received an account!"
+ flash[:notice] = t 'c.users.created'
shift_return_url
redirect_to return_url_or_default
else
- flash[:notice] = "You just received an account! Now you can accept your invitation"
+ flash[:notice] = t 'c.users.created_accept_inviation'
redirect_to edit_invitation_url(session[:invitation])
end
else
- flash.now[:error] = "Could not create your account"
+ flash.now[:error] = t 'c.users.error_creating'
shift_return_url
if !@user.openid_identifier.nil?
@selected = "openid"
@@ -80,28 +80,29 @@
if params[:user]
if params[:user][:delete]
- render_to_confirm_delete :text => 'Are you sure you want to do this ?',
+ render_to_confirm_delete :text => t('c.users.confirm_delete'),
:url => user_url(@user), :cancel_url => edit_user_url(current_user)
return
end
@user.attributes = params[:user]
@user.save do |result|
if result
- flash[:notice] = "Account updated!"
+ flash[:notice] = t 'c.users.updated'
redirect_to return_url_or_default(user_ll_url(@user))
else
- flash[:error] = "Could not update account"
+ flash[:error] = t 'c.users.error_updating'
render :action => :edit
end
end
elsif params[:prefs_profile]
# For now prefs-profiles are edited here too
- @prefs_profile.default_peer_group = PeerGroup.find(params[:prefs_profile][:default_peer_group_id])
+ @prefs_profile.default_peer_group = PeerGroup.find(
+ params[:prefs_profile][:default_peer_group_id])
if @prefs_profile.save
- flash[:notice] = "User settings updated"
+ flash[:notice] = t 'c.users.settings_updated'
redirect_to return_url_or_default(user_ll_url(@user))
else
- flash[:error] = "Details could not be updated! Please retry"
+ flash[:error] = t 'c.users.error_updating_settings'
render :action => 'edit'
end
end
@@ -110,14 +111,14 @@
def destroy
if @user != User.admin
if @user.destroy
- flash[:notice] = "Your account was successfully deleted"
+ flash[:notice] = t 'c.users.deleted'
redirect_to root_url
else
- flash[:warning] = "Your account could not be destroyed! Please retry"
+ flash[:warning] = t 'c.users.error_deleting'
render :action => 'edit'
end
else
- flash[:error] = "The admin-user can't be destroyed"
+ flash[:error] = t 'c.users.error_deleting_admin'
redirect_to user_ll_url(@user)
end
end
@@ -141,7 +142,7 @@
def require_current
if self.current_user != @user
- flash[:error] = "You don't have permission to update this user"
+ flash[:error] = t 'c.users.error_permissions'
redirect_to user_ll_url(@user)
return false
end
Modified: trunk/app/helpers/application_helper.rb
===================================================================
--- trunk/app/helpers/application_helper.rb 2010-01-09 10:28:34 UTC (rev 1663)
+++ trunk/app/helpers/application_helper.rb 2010-01-26 17:51:00 UTC (rev 1664)
@@ -22,13 +22,16 @@
options = sources.extract_options!.stringify_keys
cache = options.delete("cache")
- js_path = File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js')
- if ActionController::Base.perform_caching && cache && !File.exists?(js_path + '.js')
+ js_path = File.join(
+ ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js')
+ if ActionController::Base.perform_caching && cache &&
+ !File.exists?(js_path + '.js')
raise "error compressing javascripts: '" + js_path +
"' doesn't exist!" unless (File.exists?(js_path))
%x[ruby lib/jsmin.rb < #{js_path} > #{js_path + '.tmp'}]
raise "error compressing javascripts: '" + js_path +
- ".tmp' doesn't exist or is empty!" unless (File.size?(js_path + '.tmp'))
+ ".tmp' doesn't exist or is empty!" unless (
+ File.size?(js_path + '.tmp'))
Zlib::GzipWriter.open(js_path + '.gz') do |gz|
gz.write File.read(js_path + '.tmp').to_s
gz.close
@@ -64,18 +67,18 @@
def perma_links(logi, logi_version)
return '<div class="perma_link">' +
- link_to(image_tag('perma.png') + ' Copy permanent link ',
+ link_to(image_tag('perma.png') + ' ' +
+ t('h.application.copy_perma_link'),
perma_logi_ll_url(logi),
: "copyPerma('" + perma_logi_ll_url(logi) + "'," +
- "'The following is the permalink of this logi." +
- " Hit Ctrl A followed by Ctrl C on your keyboard to" +
- " copy to your clipboard:'); return false;") +
- link_to('(to version)',
+ "'" + t('h.application.perma_link_label') +
+ "'); return false;") + ' ' +
+ link_to(t('h.application.to_version'),
perma_logi_version_ll_url(logi_version),
- : "copyPerma('" + perma_logi_version_ll_url(logi_version) + "'," +
- "'The following is the versioned permalink of this logi." +
- " Hit Ctrl A followed by Ctrl C on your keyboard to" +
- " copy to your clipboard:'); return false;") +
+ : "copyPerma('" +
+ perma_logi_version_ll_url(logi_version) + "'," +
+ "'" + t('h.application.versioned_perma_link_label') +
+ "'); return false;") +
'</div>'
end
@@ -87,48 +90,48 @@
if logi.home_page?
tabs.push(
- {:text => _("Home Logi"), :name => "home_page",
- :description => _("Logi that is a home page")})
+ {:text => t('h.application.home_logi'), :name => "home_page",
+ :description => t('h.application.logi_is_home')})
else
tabs.push(
- {:text => _("Contenders"), :name => "contending_logis",
- :description => _("Logis competing for the same tags")})
+ {:text => t('h.application.contenders'), :name => "contending_logis",
+ :description => t('h.application.competing_for')})
end
tabs.push(
- {:text => _("Incoming"), :name => "incoming_links",
- :description => _("Links to this logi"),
+ {:text => t('h.application.incoming'), :name => "incoming_links",
+ :description => t('h.application.links_to'),
:disabled => current_context.incoming_links_to_logi.empty?})
if !logi.home_page?
if !logi.comments_on_logis.empty?
tabs.push(
- {:text => _("Is comment on"), :name => "comments_on",
- :description => _("This logi comments on the following logis")})
+ {:text => t('h.application.is_comment'), :name => "comments_on",
+ :description => t('h.application.comments_on')})
end
if !logi.steps.empty?
tabs.push(
- {:text => _("Path"), :name => "paths",
- :description => _("This logi is part of a read-path")})
+ {:text => t('h.application.path'), :name => "paths",
+ :description => t('h.application.part_of_path')})
end
end
return tabs
end
def navigation_tabs
- tabs = [{:text => _("Search"), :name => "navigation_search",
+ tabs = [{:text => t('h.application.search'), :name => "navigation_search",
:url => searches_url(),
- :description => '<h2>' + _("Currently searching logis") + '</h2>'},
- {:text => _("Browse"), :name => "navigation_browse",
+ :description => '<h2>' + t('h.application.searching') + '</h2>'},
+ {:text => t('h.application.browse'), :name => "navigation_browse",
:url => browse_logis_url(:ll_link_string => ''),
- :description => '<h2>' + _("Currently browsing logis") + '</h2>'},
- {:text => _("View"), :name => "navigation_view",
- :description => '<h2>' + _("Currently viewing a logi about") + '</h2>'},
- {:text => _("Insert"), :name => "navigation_insert",
- :description => '<h2>' + _("Currently inserting things in a logi") + '</h2>'},
- {:text => _("Edit"), :name => "navigation_edit",
- :description => '<h2>' + _("Currently editing a logi") + '</h2>'},
- {:text => _("New"), :name => "navigation_new",
+ :description => '<h2>' + t('h.application.browsing') + '</h2>'},
+ {:text => t('h.application.view'), :name => "navigation_view",
+ ...
[truncated message content] |