Commit 21aea18e9f0c5c6c959ce03244930a84fd455ea5
Exists in
master
and in
29 other branches
Merge branch 'stable' of gitorious.org:noosfero/noosfero into stable
Conflicts: debian/changelog lib/noosfero.rb
Showing
529 changed files
with
29947 additions
and
8230 deletions
Show diff stats
Too many changes.
To preserve performance only 100 of 529 files displayed.
AUTHORS
@@ -6,17 +6,27 @@ noosfero, that's not a problem). | @@ -6,17 +6,27 @@ noosfero, that's not a problem). | ||
6 | Developers | 6 | Developers |
7 | ========== | 7 | ========== |
8 | 8 | ||
9 | +Antonio Terceiro + Carlos Morais <terceiro@colivre.coop.br> | ||
10 | +Antonio Terceiro + Paulo Meirelles <terceiro@colivre.coop.br> | ||
9 | Antonio Terceiro <terceiro@colivre.coop.br> | 11 | Antonio Terceiro <terceiro@colivre.coop.br> |
10 | Aurelio A. Heckert <aurelio@colivre.coop.br> | 12 | Aurelio A. Heckert <aurelio@colivre.coop.br> |
11 | Braulio Bhavamitra <brauliobo@gmail.com> | 13 | Braulio Bhavamitra <brauliobo@gmail.com> |
12 | Bráulio Bhavamitra <brauliobo@gmail.com> | 14 | Bráulio Bhavamitra <brauliobo@gmail.com> |
13 | Caio SBA <caio@colivre.coop.br> | 15 | Caio SBA <caio@colivre.coop.br> |
16 | +Carlos Morais <carlos88morais@gmail.com> | ||
17 | +Carlos Morais + Diego Araújo <diegoamc90@gmail.com> | ||
18 | +Carlos Morais + Paulo Meirelles <carlos88morais@gmail.com> | ||
14 | Daniela Soares Feitosa <danielafeitosa@colivre.coop.br> | 19 | Daniela Soares Feitosa <danielafeitosa@colivre.coop.br> |
15 | Daniel Cunha <daniel@colivre.coop.br> | 20 | Daniel Cunha <daniel@colivre.coop.br> |
21 | +Diego Araújo <diegoamc90@gmail.com> | ||
22 | +Diego Araújo + João M. M. da Silva <diegoamc90@gmail.com> | ||
16 | Fernanda Lopes <nanda.listas+psl@gmail.com> | 23 | Fernanda Lopes <nanda.listas+psl@gmail.com> |
17 | Grazieno Pellegrino <grazieno@gmail.com> | 24 | Grazieno Pellegrino <grazieno@gmail.com> |
18 | Italo Valcy <italo@dcc.ufba.br> | 25 | Italo Valcy <italo@dcc.ufba.br> |
19 | João da Silva <jaodsilv@linux.ime.usp.br> | 26 | João da Silva <jaodsilv@linux.ime.usp.br> |
27 | +João M. M. da Silva + Carlos Morais <jaodsilv@linux.ime.usp.br> | ||
28 | +João M. M. da Silva + Diego Araújo <diegoamc90@gmail.com> | ||
29 | +João M. M. da Silva + Diego Araújo <jaodsilv@linux.ime.usp.br> | ||
20 | João M. M. da Silva + Paulo Meirelles <jaodsilv@linux.ime.usp.br> | 30 | João M. M. da Silva + Paulo Meirelles <jaodsilv@linux.ime.usp.br> |
21 | Joenio Costa <joenio@colivre.coop.br> | 31 | Joenio Costa <joenio@colivre.coop.br> |
22 | Josef Spillner <josef.spillner@tu-dresden.de> | 32 | Josef Spillner <josef.spillner@tu-dresden.de> |
@@ -28,6 +38,7 @@ LinguÁgil 2010 <linguagil.bahia@gmail.com> | @@ -28,6 +38,7 @@ LinguÁgil 2010 <linguagil.bahia@gmail.com> | ||
28 | Martín Olivera <molivera@solar.org.ar> | 38 | Martín Olivera <molivera@solar.org.ar> |
29 | Moises Machado <moises@colivre.coop.br> | 39 | Moises Machado <moises@colivre.coop.br> |
30 | Nanda Lopes <nanda.listas+psl@gmail.com> | 40 | Nanda Lopes <nanda.listas+psl@gmail.com> |
41 | +Paulo Meirelles + Carlos Morais <paulo@softwarelivre.org> | ||
31 | Paulo Meirelles <paulo@softwarelivre.org> | 42 | Paulo Meirelles <paulo@softwarelivre.org> |
32 | Rafael Gomes <rafaelgomes@techfree.com.br> | 43 | Rafael Gomes <rafaelgomes@techfree.com.br> |
33 | Rafael Martins <rmmartins@gmail.com> | 44 | Rafael Martins <rmmartins@gmail.com> |
@@ -0,0 +1,19 @@ | @@ -0,0 +1,19 @@ | ||
1 | +source :rubygems | ||
2 | +gem 'cucumber', '0.4.0' | ||
3 | +gem 'webrat', '0.5.1' | ||
4 | +gem 'rspec', '1.2.9' | ||
5 | +gem 'rspec-rails', '1.2.9' | ||
6 | +gem 'Selenium', '>= 1.1.14' | ||
7 | +gem 'selenium-client', '>= 1.2.17' | ||
8 | +gem 'database_cleaner' | ||
9 | +gem 'exception_notification', '1.0.20090728' | ||
10 | +gem 'system_timer' | ||
11 | + | ||
12 | +def program(name) | ||
13 | + unless system("which #{name} > /dev/null") | ||
14 | + puts "W: Program #{name} is needed, but was not found in your PATH" | ||
15 | + end | ||
16 | +end | ||
17 | + | ||
18 | +program 'java' | ||
19 | +program 'firefox' |
@@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
1 | +GEM | ||
2 | + remote: http://rubygems.org/ | ||
3 | + specs: | ||
4 | + Selenium (1.1.14) | ||
5 | + builder (3.0.0) | ||
6 | + cucumber (0.4.0) | ||
7 | + builder (>= 2.1.2) | ||
8 | + diff-lcs (>= 1.1.2) | ||
9 | + polyglot (>= 0.2.9) | ||
10 | + term-ansicolor (>= 1.0.3) | ||
11 | + treetop (>= 1.4.2) | ||
12 | + database_cleaner (0.7.0) | ||
13 | + diff-lcs (1.1.3) | ||
14 | + exception_notification (1.0.20090728) | ||
15 | + nokogiri (1.5.0) | ||
16 | + polyglot (0.3.3) | ||
17 | + rack (1.3.5) | ||
18 | + rspec (1.2.9) | ||
19 | + rspec-rails (1.2.9) | ||
20 | + rack (>= 1.0.0) | ||
21 | + rspec (>= 1.2.9) | ||
22 | + selenium-client (1.2.18) | ||
23 | + system_timer (1.2.4) | ||
24 | + term-ansicolor (1.0.7) | ||
25 | + treetop (1.4.10) | ||
26 | + polyglot | ||
27 | + polyglot (>= 0.3.1) | ||
28 | + webrat (0.5.1) | ||
29 | + nokogiri (>= 1.2.0) | ||
30 | + rack (>= 1.0) | ||
31 | + | ||
32 | +PLATFORMS | ||
33 | + ruby | ||
34 | + | ||
35 | +DEPENDENCIES | ||
36 | + Selenium (>= 1.1.14) | ||
37 | + cucumber (= 0.4.0) | ||
38 | + database_cleaner | ||
39 | + exception_notification (= 1.0.20090728) | ||
40 | + rspec (= 1.2.9) | ||
41 | + rspec-rails (= 1.2.9) | ||
42 | + selenium-client (>= 1.2.17) | ||
43 | + system_timer | ||
44 | + webrat (= 0.5.1) |
@@ -0,0 +1,14 @@ | @@ -0,0 +1,14 @@ | ||
1 | +This is a draft of how to create a environment to Rails 2.3.5 to Noosfero | ||
2 | +development. | ||
3 | + | ||
4 | +Install dependencies: | ||
5 | + | ||
6 | +gem install rails -v 2.3.5 | ||
7 | +gem install ferret | ||
8 | +gem install i18n | ||
9 | +gem install will_paginate -v 2.3.12 | ||
10 | +gem install cucumber | ||
11 | + | ||
12 | +Creating initial environment: | ||
13 | + | ||
14 | +rake db:schema:load |
INSTALL
@@ -13,7 +13,7 @@ You need to install some packages Noosfero depends on. On Debian GNU/Linux or | @@ -13,7 +13,7 @@ You need to install some packages Noosfero depends on. On Debian GNU/Linux or | ||
13 | Debian-based systems, all of these packages are available through the Debian | 13 | Debian-based systems, all of these packages are available through the Debian |
14 | archive. You can install them with the following command: | 14 | archive. You can install them with the following command: |
15 | 15 | ||
16 | - # apt-get install ruby rake po4a libgettext-ruby-util libgettext-ruby-data libgettext-ruby1.8 libsqlite3-ruby rcov librmagick-ruby libredcloth-ruby libwill-paginate-ruby iso-codes libfeedparser-ruby libferret-ruby libdaemons-ruby mongrel mongrel-cluster tango-icon-theme libhpricot-ruby | 16 | + # apt-get install ruby rake po4a libgettext-ruby-util libgettext-ruby-data libgettext-ruby1.8 libsqlite3-ruby rcov librmagick-ruby libredcloth-ruby libwill-paginate-ruby iso-codes libfeedparser-ruby libferret-ruby libdaemons-ruby thin tango-icon-theme libhpricot-ruby |
17 | 17 | ||
18 | On other systems, they may or may not be available through your regular package | 18 | On other systems, they may or may not be available through your regular package |
19 | management system. Below are the links to their homepages. | 19 | management system. Below are the links to their homepages. |
@@ -31,7 +31,7 @@ management system. Below are the links to their homepages. | @@ -31,7 +31,7 @@ management system. Below are the links to their homepages. | ||
31 | * iso-codes: http://pkg-isocodes.alioth.debian.org/ | 31 | * iso-codes: http://pkg-isocodes.alioth.debian.org/ |
32 | * feedparser: http://packages.debian.org/sid/libfeedparser-ruby | 32 | * feedparser: http://packages.debian.org/sid/libfeedparser-ruby |
33 | * Daemons - http://daemons.rubyforge.org/ | 33 | * Daemons - http://daemons.rubyforge.org/ |
34 | -* Mongrel: http://mongrel.rubyforge.org/ | 34 | +* Thin: http://code.macournoyer.com/thin/ |
35 | * tango-icon-theme: http://tango.freedesktop.org/Tango_Icon_Library | 35 | * tango-icon-theme: http://tango.freedesktop.org/Tango_Icon_Library |
36 | * Hpricot: http://hpricot.com/ | 36 | * Hpricot: http://hpricot.com/ |
37 | 37 | ||
@@ -118,13 +118,13 @@ $ cd current | @@ -118,13 +118,13 @@ $ cd current | ||
118 | Copy config/ferret_server.yml.dist to config/ferret_server.yml. You will | 118 | Copy config/ferret_server.yml.dist to config/ferret_server.yml. You will |
119 | probably not need to customize this configuration, but have a look at it. | 119 | probably not need to customize this configuration, but have a look at it. |
120 | 120 | ||
121 | -Create the mongrel configuration file: | 121 | +Create the thin configuration file: |
122 | 122 | ||
123 | -$ mongrel_rails cluster::configure | 123 | +$ thin -C config/thin.yml config |
124 | 124 | ||
125 | -Edit config/mongrel_cluster.yml to suit your needs. Make sure your apache | ||
126 | -configuration matches the mongrel cluster configuration, specially in respect | ||
127 | -to the ports and numbers of mongrel instances. | 125 | +Edit config/thin.yml to suit your needs. Make sure your apache |
126 | +configuration matches the thin cluster configuration, specially in respect | ||
127 | +to the ports and numbers of thin instances. | ||
128 | 128 | ||
129 | Note: currently Noosfero only supports Rails 2.1.0, which is the version in | 129 | Note: currently Noosfero only supports Rails 2.1.0, which is the version in |
130 | Debian Lenny. If you have a Rails version newer than that, Noosfero will | 130 | Debian Lenny. If you have a Rails version newer than that, Noosfero will |
@@ -316,7 +316,7 @@ In other systems the way by which you enable apache modules may be different. | @@ -316,7 +316,7 @@ In other systems the way by which you enable apache modules may be different. | ||
316 | Now with the Apache configuration. You can use the template below, replacing | 316 | Now with the Apache configuration. You can use the template below, replacing |
317 | /var/lib/noosfero/current with the directory in which your noosfero | 317 | /var/lib/noosfero/current with the directory in which your noosfero |
318 | installation is, your.domain.com with the domain name of your noosfero site. | 318 | installation is, your.domain.com with the domain name of your noosfero site. |
319 | -We are assuming that you are running two mongrel instances on ports 3000 and | 319 | +We are assuming that you are running two thin instances on ports 3000 and |
320 | 3001. If your setup is different you'll need to adjust <Proxy> section. If you | 320 | 3001. If your setup is different you'll need to adjust <Proxy> section. If you |
321 | don't understand something in the configuration, please refer to the apache | 321 | don't understand something in the configuration, please refer to the apache |
322 | documentation. | 322 | documentation. |
INSTALL.awstats
@@ -5,11 +5,11 @@ streaming, ftp or mail server statistics, graphically. | @@ -5,11 +5,11 @@ streaming, ftp or mail server statistics, graphically. | ||
5 | 5 | ||
6 | See http://awstats.sourceforge.net/ | 6 | See http://awstats.sourceforge.net/ |
7 | 7 | ||
8 | -This guide supposes that the Noosfero server is running GNU/Linux Debian Lenny. | 8 | +This guide supposes that the Noosfero server is running GNU/Linux Debian Squeeze. |
9 | 9 | ||
10 | 1. Install AWStats | 10 | 1. Install AWStats |
11 | 11 | ||
12 | -# apt-get install awstats libgeo-ip-perl | 12 | +# apt-get install awstats libgeo-ip-perl geoip-database |
13 | 13 | ||
14 | 2. Basic setup | 14 | 2. Basic setup |
15 | 15 |
app/controllers/admin_controller.rb
app/controllers/application.rb
1 | -# his is the application's main controller. Features defined here are | ||
2 | -# available in all controllers. | ||
3 | -class ApplicationController < ActionController::Base | ||
4 | - | ||
5 | - before_filter :change_pg_schema | ||
6 | - | ||
7 | - include ApplicationHelper | ||
8 | - layout :get_layout | ||
9 | - def get_layout | ||
10 | - prepend_view_path('public/' + theme_path) | ||
11 | - theme_option(:layout) || 'application' | ||
12 | - end | ||
13 | - | ||
14 | - filter_parameter_logging :password | ||
15 | - | ||
16 | - def log_processing | ||
17 | - super | ||
18 | - return unless ENV['RAILS_ENV'] == 'production' | ||
19 | - if logger && logger.info? | ||
20 | - logger.info(" HTTP Referer: #{request.referer}") | ||
21 | - logger.info(" User Agent: #{request.user_agent}") | ||
22 | - logger.info(" Accept-Language: #{request.headers['HTTP_ACCEPT_LANGUAGE']}") | ||
23 | - end | ||
24 | - end | ||
25 | - | ||
26 | - helper :document | ||
27 | - helper :language | ||
28 | - | ||
29 | - def self.no_design_blocks | ||
30 | - @no_design_blocks = true | ||
31 | - end | ||
32 | - def self.uses_design_blocks? | ||
33 | - !@no_design_blocks | ||
34 | - end | ||
35 | - def uses_design_blocks? | ||
36 | - !@no_design_blocks && self.class.uses_design_blocks? | ||
37 | - end | ||
38 | - | ||
39 | - # Be sure to include AuthenticationSystem in Application Controller instead | ||
40 | - include AuthenticatedSystem | ||
41 | - include PermissionCheck | ||
42 | - | ||
43 | - def self.require_ssl(*options) | ||
44 | - before_filter :check_ssl, *options | ||
45 | - end | ||
46 | - def check_ssl | ||
47 | - return true if (request.ssl? || ENV['RAILS_ENV'] == 'development') | ||
48 | - redirect_to_ssl | ||
49 | - end | ||
50 | - def redirect_to_ssl | ||
51 | - if environment.enable_ssl | ||
52 | - redirect_to(params.merge(:protocol => 'https://', :host => ssl_hostname)) | ||
53 | - true | ||
54 | - else | ||
55 | - false | ||
56 | - end | ||
57 | - end | ||
58 | - | ||
59 | - def self.refuse_ssl(*options) | ||
60 | - before_filter :avoid_ssl, *options | ||
61 | - end | ||
62 | - def avoid_ssl | ||
63 | - if (!request.ssl? || ENV['RAILS_ENV'] == 'development') | ||
64 | - true | ||
65 | - else | ||
66 | - redirect_to(params.merge(:protocol => 'http://')) | ||
67 | - false | ||
68 | - end | ||
69 | - end | ||
70 | - | ||
71 | - before_filter :set_locale | ||
72 | - def set_locale | ||
73 | - FastGettext.available_locales = Noosfero.available_locales | ||
74 | - FastGettext.default_locale = Noosfero.default_locale | ||
75 | - FastGettext.set_locale(params[:lang] || session[:lang] || Noosfero.default_locale || request.env['HTTP_ACCEPT_LANGUAGE'] || 'en') | ||
76 | - if params[:lang] | ||
77 | - session[:lang] = params[:lang] | ||
78 | - end | ||
79 | - end | ||
80 | - | ||
81 | - include NeedsProfile | ||
82 | - | ||
83 | - before_filter :detect_stuff_by_domain | ||
84 | - before_filter :init_noosfero_plugins | ||
85 | - attr_reader :environment | ||
86 | - | ||
87 | - before_filter :load_terminology | ||
88 | - | ||
89 | - # declares that the given <tt>actions</tt> cannot be accessed by other HTTP | ||
90 | - # method besides POST. | ||
91 | - def self.post_only(actions, redirect = { :action => 'index'}) | ||
92 | - verify :method => :post, :only => actions, :redirect_to => redirect | ||
93 | - end | ||
94 | - | ||
95 | - helper_method :current_person, :current_person | ||
96 | - | ||
97 | - def change_pg_schema | ||
98 | - if Noosfero::MultiTenancy.on? and ActiveRecord::Base.postgresql? | ||
99 | - Noosfero::MultiTenancy.db_by_host = request.host | ||
100 | - end | ||
101 | - end | ||
102 | - | ||
103 | - protected | ||
104 | - | ||
105 | - def boxes_editor? | ||
106 | - false | ||
107 | - end | ||
108 | - | ||
109 | - def content_editor? | ||
110 | - false | ||
111 | - end | ||
112 | - | ||
113 | - def user | ||
114 | - current_user.person if logged_in? | ||
115 | - end | ||
116 | - | ||
117 | - alias :current_person :user | ||
118 | - | ||
119 | - # TODO: move this logic somewhere else (Domain class?) | ||
120 | - def detect_stuff_by_domain | ||
121 | - @domain = Domain.find_by_name(request.host) | ||
122 | - if @domain.nil? | ||
123 | - @environment = Environment.default | ||
124 | - else | ||
125 | - @environment = @domain.environment | ||
126 | - @profile = @domain.profile | ||
127 | - end | ||
128 | - end | ||
129 | - | ||
130 | - def init_noosfero_plugins | ||
131 | - @plugins = Noosfero::Plugin::Manager.new(self) | ||
132 | - @plugins.enabled_plugins.map(&:class).each do |plugin| | ||
133 | - prepend_view_path(plugin.view_path) | ||
134 | - end | ||
135 | - init_noosfero_plugins_controller_filters | ||
136 | - end | ||
137 | - | ||
138 | - # This is a generic method that initialize any possible filter defined by a | ||
139 | - # plugin to the current controller being initialized. | ||
140 | - def init_noosfero_plugins_controller_filters | ||
141 | - @plugins.enabled_plugins.each do |plugin| | ||
142 | - plugin.send(self.class.name.underscore + '_filters').each do |plugin_filter| | ||
143 | - self.class.send(plugin_filter[:type], plugin.class.name.underscore + '_' + plugin_filter[:method_name], (plugin_filter[:options] || {})) | ||
144 | - self.class.send(:define_method, plugin.class.name.underscore + '_' + plugin_filter[:method_name], plugin_filter[:block]) | ||
145 | - end | ||
146 | - end | ||
147 | - end | ||
148 | - | ||
149 | - def load_terminology | ||
150 | - # cache terminology for performance | ||
151 | - @@terminology_cache ||= {} | ||
152 | - @@terminology_cache[environment.id] ||= environment.terminology | ||
153 | - Noosfero.terminology = @@terminology_cache[environment.id] | ||
154 | - end | ||
155 | - | ||
156 | - def render_not_found(path = nil) | ||
157 | - @no_design_blocks = true | ||
158 | - @path ||= request.path | ||
159 | - render :template => 'shared/not_found.rhtml', :status => 404, :layout => get_layout | ||
160 | - end | ||
161 | - alias :render_404 :render_not_found | ||
162 | - | ||
163 | - def render_access_denied(message = nil, title = nil) | ||
164 | - @no_design_blocks = true | ||
165 | - @message = message | ||
166 | - @title = title | ||
167 | - render :template => 'shared/access_denied.rhtml', :status => 403 | ||
168 | - end | ||
169 | - | ||
170 | - def load_category | ||
171 | - unless params[:category_path].blank? | ||
172 | - path = params[:category_path].join('/') | ||
173 | - @category = environment.categories.find_by_path(path) | ||
174 | - if @category.nil? | ||
175 | - render_not_found(path) | ||
176 | - end | ||
177 | - end | ||
178 | - end | ||
179 | - | ||
180 | -end | 1 | +require 'application_controller' |
@@ -0,0 +1,155 @@ | @@ -0,0 +1,155 @@ | ||
1 | +class ApplicationController < ActionController::Base | ||
2 | + | ||
3 | + before_filter :change_pg_schema | ||
4 | + | ||
5 | + include ApplicationHelper | ||
6 | + layout :get_layout | ||
7 | + def get_layout | ||
8 | + prepend_view_path('public/' + theme_path) | ||
9 | + theme_option(:layout) || 'application' | ||
10 | + end | ||
11 | + | ||
12 | + filter_parameter_logging :password | ||
13 | + | ||
14 | + def log_processing | ||
15 | + super | ||
16 | + return unless ENV['RAILS_ENV'] == 'production' | ||
17 | + if logger && logger.info? | ||
18 | + logger.info(" HTTP Referer: #{request.referer}") | ||
19 | + logger.info(" User Agent: #{request.user_agent}") | ||
20 | + logger.info(" Accept-Language: #{request.headers['HTTP_ACCEPT_LANGUAGE']}") | ||
21 | + end | ||
22 | + end | ||
23 | + | ||
24 | + helper :document | ||
25 | + helper :language | ||
26 | + | ||
27 | + def self.no_design_blocks | ||
28 | + @no_design_blocks = true | ||
29 | + end | ||
30 | + def self.uses_design_blocks? | ||
31 | + !@no_design_blocks | ||
32 | + end | ||
33 | + def uses_design_blocks? | ||
34 | + !@no_design_blocks && self.class.uses_design_blocks? | ||
35 | + end | ||
36 | + | ||
37 | + # Be sure to include AuthenticationSystem in Application Controller instead | ||
38 | + include AuthenticatedSystem | ||
39 | + include PermissionCheck | ||
40 | + | ||
41 | + before_filter :set_locale | ||
42 | + def set_locale | ||
43 | + FastGettext.available_locales = Noosfero.available_locales | ||
44 | + FastGettext.default_locale = Noosfero.default_locale | ||
45 | + I18n.locale = FastGettext.locale = (params[:lang] || session[:lang] || Noosfero.default_locale || request.env['HTTP_ACCEPT_LANGUAGE'] || 'en') | ||
46 | + if params[:lang] | ||
47 | + session[:lang] = params[:lang] | ||
48 | + end | ||
49 | + end | ||
50 | + | ||
51 | + include NeedsProfile | ||
52 | + | ||
53 | + before_filter :detect_stuff_by_domain | ||
54 | + before_filter :init_noosfero_plugins | ||
55 | + attr_reader :environment | ||
56 | + | ||
57 | + before_filter :load_terminology | ||
58 | + | ||
59 | + # declares that the given <tt>actions</tt> cannot be accessed by other HTTP | ||
60 | + # method besides POST. | ||
61 | + def self.post_only(actions, redirect = { :action => 'index'}) | ||
62 | + verify :method => :post, :only => actions, :redirect_to => redirect | ||
63 | + end | ||
64 | + | ||
65 | + helper_method :current_person, :current_person | ||
66 | + | ||
67 | + protected | ||
68 | + | ||
69 | + def change_pg_schema | ||
70 | + if Noosfero::MultiTenancy.on? and ActiveRecord::Base.postgresql? | ||
71 | + Noosfero::MultiTenancy.db_by_host = request.host | ||
72 | + end | ||
73 | + end | ||
74 | + | ||
75 | + def boxes_editor? | ||
76 | + false | ||
77 | + end | ||
78 | + | ||
79 | + def content_editor? | ||
80 | + false | ||
81 | + end | ||
82 | + | ||
83 | + | ||
84 | + def user | ||
85 | + current_user.person if logged_in? | ||
86 | + end | ||
87 | + | ||
88 | + alias :current_person :user | ||
89 | + | ||
90 | + # TODO: move this logic somewhere else (Domain class?) | ||
91 | + def detect_stuff_by_domain | ||
92 | + @domain = Domain.find_by_name(request.host) | ||
93 | + if @domain.nil? | ||
94 | + @environment = Environment.default | ||
95 | + if @environment.nil? && Rails.env.development? | ||
96 | + # This should only happen in development ... | ||
97 | + @environment = Environment.create!(:name => "Noosfero", :is_default => true) | ||
98 | + end | ||
99 | + else | ||
100 | + @environment = @domain.environment | ||
101 | + @profile = @domain.profile | ||
102 | + end | ||
103 | + end | ||
104 | + | ||
105 | + def init_noosfero_plugins | ||
106 | + @plugins = Noosfero::Plugin::Manager.new(self) | ||
107 | + @plugins.each do |plugin| | ||
108 | + prepend_view_path(plugin.class.view_path) | ||
109 | + end | ||
110 | + init_noosfero_plugins_controller_filters | ||
111 | + end | ||
112 | + | ||
113 | + # This is a generic method that initialize any possible filter defined by a | ||
114 | + # plugin to the current controller being initialized. | ||
115 | + def init_noosfero_plugins_controller_filters | ||
116 | + @plugins.each do |plugin| | ||
117 | + plugin.send(self.class.name.underscore + '_filters').each do |plugin_filter| | ||
118 | + self.class.send(plugin_filter[:type], plugin.class.name.underscore + '_' + plugin_filter[:method_name], (plugin_filter[:options] || {})) | ||
119 | + self.class.send(:define_method, plugin.class.name.underscore + '_' + plugin_filter[:method_name], plugin_filter[:block]) | ||
120 | + end | ||
121 | + end | ||
122 | + end | ||
123 | + | ||
124 | + def load_terminology | ||
125 | + # cache terminology for performance | ||
126 | + @@terminology_cache ||= {} | ||
127 | + @@terminology_cache[environment.id] ||= environment.terminology | ||
128 | + Noosfero.terminology = @@terminology_cache[environment.id] | ||
129 | + end | ||
130 | + | ||
131 | + def render_not_found(path = nil) | ||
132 | + @no_design_blocks = true | ||
133 | + @path ||= request.path | ||
134 | + render :template => 'shared/not_found.rhtml', :status => 404, :layout => get_layout | ||
135 | + end | ||
136 | + alias :render_404 :render_not_found | ||
137 | + | ||
138 | + def render_access_denied(message = nil, title = nil) | ||
139 | + @no_design_blocks = true | ||
140 | + @message = message | ||
141 | + @title = title | ||
142 | + render :template => 'shared/access_denied.rhtml', :status => 403 | ||
143 | + end | ||
144 | + | ||
145 | + def load_category | ||
146 | + unless params[:category_path].blank? | ||
147 | + path = params[:category_path].join('/') | ||
148 | + @category = environment.categories.find_by_path(path) | ||
149 | + if @category.nil? | ||
150 | + render_not_found(path) | ||
151 | + end | ||
152 | + end | ||
153 | + end | ||
154 | + | ||
155 | +end |
app/controllers/box_organizer_controller.rb
@@ -82,7 +82,6 @@ class BoxOrganizerController < ApplicationController | @@ -82,7 +82,6 @@ class BoxOrganizerController < ApplicationController | ||
82 | def save | 82 | def save |
83 | @block = boxes_holder.blocks.find(params[:id]) | 83 | @block = boxes_holder.blocks.find(params[:id]) |
84 | @block.update_attributes(params[:block]) | 84 | @block.update_attributes(params[:block]) |
85 | - expire_timeout_fragment(@block.cache_key) | ||
86 | redirect_to :action => 'index' | 85 | redirect_to :action => 'index' |
87 | end | 86 | end |
88 | 87 | ||
@@ -93,7 +92,6 @@ class BoxOrganizerController < ApplicationController | @@ -93,7 +92,6 @@ class BoxOrganizerController < ApplicationController | ||
93 | def remove | 92 | def remove |
94 | @block = Block.find(params[:id]) | 93 | @block = Block.find(params[:id]) |
95 | if @block.destroy | 94 | if @block.destroy |
96 | - expire_timeout_fragment(@block.cache_key) | ||
97 | redirect_to :action => 'index' | 95 | redirect_to :action => 'index' |
98 | else | 96 | else |
99 | session[:notice] = _('Failed to remove block') | 97 | session[:notice] = _('Failed to remove block') |
app/controllers/my_profile/cms_controller.rb
@@ -23,15 +23,6 @@ class CmsController < MyProfileController | @@ -23,15 +23,6 @@ class CmsController < MyProfileController | ||
23 | profile.articles.find(c.params[:id]).allow_post_content?(user) | 23 | profile.articles.find(c.params[:id]).allow_post_content?(user) |
24 | end | 24 | end |
25 | 25 | ||
26 | - alias :check_ssl_orig :check_ssl | ||
27 | - # Redefines the SSL checking to avoid requiring SSL when creating the "New | ||
28 | - # publication" button on article's public view. | ||
29 | - def check_ssl | ||
30 | - if ((params[:action] == 'new') && (!request.xhr?)) || (params[:action] != 'new') | ||
31 | - check_ssl_orig | ||
32 | - end | ||
33 | - end | ||
34 | - | ||
35 | def boxes_holder | 26 | def boxes_holder |
36 | profile | 27 | profile |
37 | end | 28 | end |
@@ -59,7 +50,7 @@ class CmsController < MyProfileController | @@ -59,7 +50,7 @@ class CmsController < MyProfileController | ||
59 | end | 50 | end |
60 | 51 | ||
61 | def special_article_types | 52 | def special_article_types |
62 | - [Folder, Blog, UploadedFile, Forum, Gallery, RssFeed] | 53 | + [Folder, Blog, UploadedFile, Forum, Gallery, RssFeed] + @plugins.dispatch(:content_types) |
63 | end | 54 | end |
64 | 55 | ||
65 | def view | 56 | def view |
@@ -320,10 +311,6 @@ class CmsController < MyProfileController | @@ -320,10 +311,6 @@ class CmsController < MyProfileController | ||
320 | end | 311 | end |
321 | end | 312 | end |
322 | 313 | ||
323 | - def maybe_ssl(url) | ||
324 | - [url, url.sub('https:', 'http:')] | ||
325 | - end | ||
326 | - | ||
327 | def valid_article_type?(type) | 314 | def valid_article_type?(type) |
328 | (available_article_types + special_article_types).map {|item| item.name}.include?(type) | 315 | (available_article_types + special_article_types).map {|item| item.name}.include?(type) |
329 | end | 316 | end |
@@ -366,7 +353,7 @@ class CmsController < MyProfileController | @@ -366,7 +353,7 @@ class CmsController < MyProfileController | ||
366 | } | 353 | } |
367 | end.to_json | 354 | end.to_json |
368 | end | 355 | end |
369 | - | 356 | + |
370 | def content_editor? | 357 | def content_editor? |
371 | true | 358 | true |
372 | end | 359 | end |
app/controllers/my_profile/tasks_controller.rb
@@ -33,12 +33,14 @@ class TasksController < MyProfileController | @@ -33,12 +33,14 @@ class TasksController < MyProfileController | ||
33 | end | 33 | end |
34 | end | 34 | end |
35 | 35 | ||
36 | + url = { :action => 'index' } | ||
36 | if failed.blank? | 37 | if failed.blank? |
37 | session[:notice] = _("All decisions were applied successfully.") | 38 | session[:notice] = _("All decisions were applied successfully.") |
38 | else | 39 | else |
39 | session[:notice] = _("Some decisions couldn't be applied.") | 40 | session[:notice] = _("Some decisions couldn't be applied.") |
41 | + url[:failed] = failed | ||
40 | end | 42 | end |
41 | - redirect_to params.merge!(:action => 'index', :failed => failed) | 43 | + redirect_to url |
42 | end | 44 | end |
43 | 45 | ||
44 | def new | 46 | def new |
app/controllers/my_profile_controller.rb
app/controllers/public/account_controller.rb
@@ -2,8 +2,6 @@ class AccountController < ApplicationController | @@ -2,8 +2,6 @@ class AccountController < ApplicationController | ||
2 | 2 | ||
3 | no_design_blocks | 3 | no_design_blocks |
4 | 4 | ||
5 | - require_ssl :except => [ :login_popup, :logout_popup, :profile_details ] | ||
6 | - | ||
7 | before_filter :login_required, :only => [:activation_question, :accept_terms, :activate_enterprise] | 5 | before_filter :login_required, :only => [:activation_question, :accept_terms, :activate_enterprise] |
8 | before_filter :redirect_if_logged_in, :only => [:login, :signup] | 6 | before_filter :redirect_if_logged_in, :only => [:login, :signup] |
9 | 7 | ||
@@ -95,7 +93,6 @@ class AccountController < ApplicationController | @@ -95,7 +93,6 @@ class AccountController < ApplicationController | ||
95 | if logged_in? | 93 | if logged_in? |
96 | self.current_user.forget_me | 94 | self.current_user.forget_me |
97 | end | 95 | end |
98 | - cookies.delete :auth_token | ||
99 | reset_session | 96 | reset_session |
100 | session[:notice] = _("You have been logged out.") | 97 | session[:notice] = _("You have been logged out.") |
101 | redirect_to :controller => 'home', :action => 'index' | 98 | redirect_to :controller => 'home', :action => 'index' |
@@ -245,7 +242,7 @@ class AccountController < ApplicationController | @@ -245,7 +242,7 @@ class AccountController < ApplicationController | ||
245 | session[:notice] = nil # consume the notice | 242 | session[:notice] = nil # consume the notice |
246 | end | 243 | end |
247 | 244 | ||
248 | - @plugins.enabled_plugins.each { |plugin| user_data.merge!(plugin.user_data_extras) } | 245 | + @plugins.each { |plugin| user_data.merge!(plugin.user_data_extras) } |
249 | 246 | ||
250 | render :text => user_data.to_json, :layout => false, :content_type => "application/javascript" | 247 | render :text => user_data.to_json, :layout => false, :content_type => "application/javascript" |
251 | end | 248 | end |
app/controllers/public/content_viewer_controller.rb
@@ -31,14 +31,6 @@ class ContentViewerController < ApplicationController | @@ -31,14 +31,6 @@ class ContentViewerController < ApplicationController | ||
31 | end | 31 | end |
32 | end | 32 | end |
33 | 33 | ||
34 | - if !@page.public? && !request.ssl? | ||
35 | - return if redirect_to_ssl | ||
36 | - end | ||
37 | - | ||
38 | - if @page.public? | ||
39 | - return unless avoid_ssl | ||
40 | - end | ||
41 | - | ||
42 | if !@page.display_to?(user) | 34 | if !@page.display_to?(user) |
43 | if profile.display_info_to?(user) || !profile.visible? | 35 | if profile.display_info_to?(user) || !profile.visible? |
44 | message = _('You are not allowed to view this content. You can contact the owner of this profile to request access then.') | 36 | message = _('You are not allowed to view this content. You can contact the owner of this profile to request access then.') |
@@ -119,7 +111,11 @@ class ContentViewerController < ApplicationController | @@ -119,7 +111,11 @@ class ContentViewerController < ApplicationController | ||
119 | def add_comment | 111 | def add_comment |
120 | @comment.author = user if logged_in? | 112 | @comment.author = user if logged_in? |
121 | @comment.article = @page | 113 | @comment.article = @page |
114 | + @comment.ip_address = request.remote_ip | ||
115 | + plugins_filter_comment(@comment) | ||
116 | + return if @comment.rejected? | ||
122 | if (pass_without_comment_captcha? || verify_recaptcha(:model => @comment, :message => _('Please type the words correctly'))) && @comment.save | 117 | if (pass_without_comment_captcha? || verify_recaptcha(:model => @comment, :message => _('Please type the words correctly'))) && @comment.save |
118 | + plugins_comment_saved(@comment) | ||
123 | @page.touch | 119 | @page.touch |
124 | @comment = nil # clear the comment form | 120 | @comment = nil # clear the comment form |
125 | redirect_to :action => 'view_page', :profile => params[:profile], :page => @page.explode_path, :view => params[:view] | 121 | redirect_to :action => 'view_page', :profile => params[:profile], :page => @page.explode_path, :view => params[:view] |
@@ -128,6 +124,18 @@ class ContentViewerController < ApplicationController | @@ -128,6 +124,18 @@ class ContentViewerController < ApplicationController | ||
128 | end | 124 | end |
129 | end | 125 | end |
130 | 126 | ||
127 | + def plugins_filter_comment(comment) | ||
128 | + @plugins.each do |plugin| | ||
129 | + plugin.filter_comment(comment) | ||
130 | + end | ||
131 | + end | ||
132 | + | ||
133 | + def plugins_comment_saved(comment) | ||
134 | + @plugins.each do |plugin| | ||
135 | + plugin.comment_saved(comment) | ||
136 | + end | ||
137 | + end | ||
138 | + | ||
131 | def pass_without_comment_captcha? | 139 | def pass_without_comment_captcha? |
132 | logged_in? && !environment.enabled?('captcha_for_logged_users') | 140 | logged_in? && !environment.enabled?('captcha_for_logged_users') |
133 | end | 141 | end |
app/controllers/public/enterprise_registration_controller.rb
app/controllers/public/profile_controller.rb
@@ -23,7 +23,7 @@ class ProfileController < PublicController | @@ -23,7 +23,7 @@ class ProfileController < PublicController | ||
23 | 23 | ||
24 | def tags | 24 | def tags |
25 | @tags_cache_key = "tags_profile_#{profile.id.to_s}" | 25 | @tags_cache_key = "tags_profile_#{profile.id.to_s}" |
26 | - if is_cache_expired?(@tags_cache_key, true) | 26 | + if is_cache_expired?(@tags_cache_key) |
27 | @tags = profile.article_tags | 27 | @tags = profile.article_tags |
28 | end | 28 | end |
29 | end | 29 | end |
@@ -31,7 +31,7 @@ class ProfileController < PublicController | @@ -31,7 +31,7 @@ class ProfileController < PublicController | ||
31 | def content_tagged | 31 | def content_tagged |
32 | @tag = params[:id] | 32 | @tag = params[:id] |
33 | @tag_cache_key = "tag_#{CGI.escape(@tag.to_s)}_#{profile.id.to_s}_page_#{params[:npage]}" | 33 | @tag_cache_key = "tag_#{CGI.escape(@tag.to_s)}_#{profile.id.to_s}_page_#{params[:npage]}" |
34 | - if is_cache_expired?(@tag_cache_key, true) | 34 | + if is_cache_expired?(@tag_cache_key) |
35 | @tagged = profile.find_tagged_with(@tag).paginate(:per_page => 20, :page => params[:npage]) | 35 | @tagged = profile.find_tagged_with(@tag).paginate(:per_page => 20, :page => params[:npage]) |
36 | end | 36 | end |
37 | end | 37 | end |
app/controllers/public/search_controller.rb
@@ -207,7 +207,7 @@ class SearchController < PublicController | @@ -207,7 +207,7 @@ class SearchController < PublicController | ||
207 | 207 | ||
208 | def tags | 208 | def tags |
209 | @tags_cache_key = "tags_env_#{environment.id.to_s}" | 209 | @tags_cache_key = "tags_env_#{environment.id.to_s}" |
210 | - if is_cache_expired?(@tags_cache_key, true) | 210 | + if is_cache_expired?(@tags_cache_key) |
211 | @tags = environment.tag_counts | 211 | @tags = environment.tag_counts |
212 | end | 212 | end |
213 | end | 213 | end |
@@ -215,7 +215,7 @@ class SearchController < PublicController | @@ -215,7 +215,7 @@ class SearchController < PublicController | ||
215 | def tag | 215 | def tag |
216 | @tag = params[:tag] | 216 | @tag = params[:tag] |
217 | @tag_cache_key = "tag_#{CGI.escape(@tag.to_s)}_env_#{environment.id.to_s}_page_#{params[:npage]}" | 217 | @tag_cache_key = "tag_#{CGI.escape(@tag.to_s)}_env_#{environment.id.to_s}_page_#{params[:npage]}" |
218 | - if is_cache_expired?(@tag_cache_key, true) | 218 | + if is_cache_expired?(@tag_cache_key) |
219 | @tagged = environment.articles.find_tagged_with(@tag).paginate(:per_page => 10, :page => params[:npage]) | 219 | @tagged = environment.articles.find_tagged_with(@tag).paginate(:per_page => 10, :page => params[:npage]) |
220 | end | 220 | end |
221 | end | 221 | end |
app/controllers/public_controller.rb
app/helpers/application_helper.rb
1 | +require 'redcloth' | ||
2 | + | ||
1 | # Methods added to this helper will be available to all templates in the | 3 | # Methods added to this helper will be available to all templates in the |
2 | # application. | 4 | # application. |
3 | module ApplicationHelper | 5 | module ApplicationHelper |
@@ -95,7 +97,7 @@ module ApplicationHelper | @@ -95,7 +97,7 @@ module ApplicationHelper | ||
95 | text = content_tag('div', button + content_tag('div', content_tag('div', content) + close_button, :class => 'help_message', :id => help_id, :style => 'display: none;'), :class => 'help_box') | 97 | text = content_tag('div', button + content_tag('div', content_tag('div', content) + close_button, :class => 'help_message', :id => help_id, :style => 'display: none;'), :class => 'help_box') |
96 | 98 | ||
97 | unless block.nil? | 99 | unless block.nil? |
98 | - concat(text, block.binding) | 100 | + concat(text) |
99 | end | 101 | end |
100 | 102 | ||
101 | text | 103 | text |
@@ -256,7 +258,7 @@ module ApplicationHelper | @@ -256,7 +258,7 @@ module ApplicationHelper | ||
256 | end | 258 | end |
257 | 259 | ||
258 | def button_bar(options = {}, &block) | 260 | def button_bar(options = {}, &block) |
259 | - concat(content_tag('div', capture(&block) + tag('br', :style => 'clear: left;'), { :class => 'button-bar' }.merge(options)), block.binding) | 261 | + concat(content_tag('div', capture(&block) + tag('br', :style => 'clear: left;'), { :class => 'button-bar' }.merge(options))) |
260 | end | 262 | end |
261 | 263 | ||
262 | VIEW_EXTENSIONS = %w[.rhtml .html.erb] | 264 | VIEW_EXTENSIONS = %w[.rhtml .html.erb] |
@@ -758,7 +760,7 @@ module ApplicationHelper | @@ -758,7 +760,7 @@ module ApplicationHelper | ||
758 | 760 | ||
759 | # Should be on the forms_helper file but when its there the translation of labels doesn't work | 761 | # Should be on the forms_helper file but when its there the translation of labels doesn't work |
760 | class NoosferoFormBuilder < ActionView::Helpers::FormBuilder | 762 | class NoosferoFormBuilder < ActionView::Helpers::FormBuilder |
761 | - extend ActionView::Helpers::TagHelper | 763 | + extend ActionView::Helpers::TagHelper |
762 | 764 | ||
763 | def self.output_field(text, field_html, field_id = nil) | 765 | def self.output_field(text, field_html, field_id = nil) |
764 | # try to guess an id if none given | 766 | # try to guess an id if none given |
@@ -780,7 +782,7 @@ module ApplicationHelper | @@ -780,7 +782,7 @@ module ApplicationHelper | ||
780 | (field_helpers - %w(hidden_field)).each do |selector| | 782 | (field_helpers - %w(hidden_field)).each do |selector| |
781 | src = <<-END_SRC | 783 | src = <<-END_SRC |
782 | def #{selector}(field, *args, &proc) | 784 | def #{selector}(field, *args, &proc) |
783 | - text = object.class.human_attribute_name(field.to_s) | 785 | + text = object.class.respond_to?(:human_attribute_name) && object.class.human_attribute_name(field.to_s) || field.to_s.humanize |
784 | NoosferoFormBuilder::output_field(text, super) | 786 | NoosferoFormBuilder::output_field(text, super) |
785 | end | 787 | end |
786 | END_SRC | 788 | END_SRC |
@@ -882,7 +884,7 @@ module ApplicationHelper | @@ -882,7 +884,7 @@ module ApplicationHelper | ||
882 | end | 884 | end |
883 | 885 | ||
884 | if block | 886 | if block |
885 | - concat(result, block.binding) | 887 | + concat(result) |
886 | end | 888 | end |
887 | 889 | ||
888 | result | 890 | result |
@@ -914,18 +916,11 @@ module ApplicationHelper | @@ -914,18 +916,11 @@ module ApplicationHelper | ||
914 | 916 | ||
915 | def login_url | 917 | def login_url |
916 | options = Noosfero.url_options.merge({ :controller => 'account', :action => 'login' }) | 918 | options = Noosfero.url_options.merge({ :controller => 'account', :action => 'login' }) |
917 | - if environment.enable_ssl && (ENV['RAILS_ENV'] != 'development') | ||
918 | - options.merge!(:protocol => 'https://', :host => ssl_hostname) | ||
919 | - end | ||
920 | url_for(options) | 919 | url_for(options) |
921 | end | 920 | end |
922 | 921 | ||
923 | - def ssl_hostname | ||
924 | - environment.default_hostname | ||
925 | - end | ||
926 | - | ||
927 | def base_url | 922 | def base_url |
928 | - environment.top_url(request.ssl?) | 923 | + environment.top_url |
929 | end | 924 | end |
930 | 925 | ||
931 | def helper_for_article(article) | 926 | def helper_for_article(article) |
@@ -1025,7 +1020,7 @@ module ApplicationHelper | @@ -1025,7 +1020,7 @@ module ApplicationHelper | ||
1025 | options.merge!(:page => params[:npage]) | 1020 | options.merge!(:page => params[:npage]) |
1026 | content = article.to_html(options) | 1021 | content = article.to_html(options) |
1027 | content = content.kind_of?(Proc) ? self.instance_eval(&content) : content | 1022 | content = content.kind_of?(Proc) ? self.instance_eval(&content) : content |
1028 | - @plugins && @plugins.enabled_plugins.each do |plugin| | 1023 | + @plugins && @plugins.each do |plugin| |
1029 | content = plugin.parse_content(content) | 1024 | content = plugin.parse_content(content) |
1030 | end | 1025 | end |
1031 | content | 1026 | content |
@@ -1147,7 +1142,7 @@ module ApplicationHelper | @@ -1147,7 +1142,7 @@ module ApplicationHelper | ||
1147 | end | 1142 | end |
1148 | 1143 | ||
1149 | def pagination_links(collection, options={}) | 1144 | def pagination_links(collection, options={}) |
1150 | - options = {:prev_label => '« ' + _('Previous'), :next_label => _('Next') + ' »'}.merge(options) | 1145 | + options = {:previous_label => '« ' + _('Previous'), :next_label => _('Next') + ' »'}.merge(options) |
1151 | will_paginate(collection, options) | 1146 | will_paginate(collection, options) |
1152 | end | 1147 | end |
1153 | 1148 | ||
@@ -1238,7 +1233,7 @@ module ApplicationHelper | @@ -1238,7 +1233,7 @@ module ApplicationHelper | ||
1238 | wrapper = content_tag(:div, capture(&block), :class => 'comment-balloon-content') | 1233 | wrapper = content_tag(:div, capture(&block), :class => 'comment-balloon-content') |
1239 | (1..8).to_a.reverse.each { |i| wrapper = content_tag(:div, wrapper, :class => "comment-wrapper-#{i}") } | 1234 | (1..8).to_a.reverse.each { |i| wrapper = content_tag(:div, wrapper, :class => "comment-wrapper-#{i}") } |
1240 | classes = options.delete(:class) || options.delete("class") || '' | 1235 | classes = options.delete(:class) || options.delete("class") || '' |
1241 | - concat(content_tag('div', wrapper + tag('br', :style => 'clear: both;'), { :class => 'comment-balloon ' + classes.to_s }.merge(options)), block.binding) | 1236 | + concat(content_tag('div', wrapper + tag('br', :style => 'clear: both;'), { :class => 'comment-balloon ' + classes.to_s }.merge(options))) |
1242 | end | 1237 | end |
1243 | 1238 | ||
1244 | def display_source_info(page) | 1239 | def display_source_info(page) |
@@ -1318,6 +1313,14 @@ module ApplicationHelper | @@ -1318,6 +1313,14 @@ module ApplicationHelper | ||
1318 | end | 1313 | end |
1319 | end | 1314 | end |
1320 | 1315 | ||
1316 | + def cache_timeout(key, timeout, &block) | ||
1317 | + cache(key, { :expires_in => timeout }, &block) | ||
1318 | + end | ||
1319 | + | ||
1320 | + def is_cache_expired?(key) | ||
1321 | + !cache_store.fetch(ActiveSupport::Cache.expand_cache_key(key, :controller)) | ||
1322 | + end | ||
1323 | + | ||
1321 | def render_tabs(tabs) | 1324 | def render_tabs(tabs) |
1322 | titles = tabs.inject(''){ |result, tab| result << content_tag(:li, link_to(tab[:title], '#'+tab[:id]), :class => 'tab') } | 1325 | titles = tabs.inject(''){ |result, tab| result << content_tag(:li, link_to(tab[:title], '#'+tab[:id]), :class => 'tab') } |
1323 | contents = tabs.inject(''){ |result, tab| result << content_tag(:div, tab[:content], :id => tab[:id]) } | 1326 | contents = tabs.inject(''){ |result, tab| result << content_tag(:div, tab[:content], :id => tab[:id]) } |
app/helpers/blog_helper.rb
@@ -17,7 +17,7 @@ module BlogHelper | @@ -17,7 +17,7 @@ module BlogHelper | ||
17 | def list_posts(articles, format = 'full') | 17 | def list_posts(articles, format = 'full') |
18 | pagination = will_paginate(articles, { | 18 | pagination = will_paginate(articles, { |
19 | :param_name => 'npage', | 19 | :param_name => 'npage', |
20 | - :prev_label => _('« Newer posts'), | 20 | + :previous_label => _('« Newer posts'), |
21 | :next_label => _('Older posts »') | 21 | :next_label => _('Older posts »') |
22 | }) | 22 | }) |
23 | content = [] | 23 | content = [] |
app/helpers/boxes_helper.rb
@@ -99,7 +99,7 @@ module BoxesHelper | @@ -99,7 +99,7 @@ module BoxesHelper | ||
99 | unless block.visible? | 99 | unless block.visible? |
100 | options[:title] = _("This block is invisible. Your visitors will not see it.") | 100 | options[:title] = _("This block is invisible. Your visitors will not see it.") |
101 | end | 101 | end |
102 | - @controller.send(:content_editor?) || @plugins.enabled_plugins.each do |plugin| | 102 | + @controller.send(:content_editor?) || @plugins.each do |plugin| |
103 | result = plugin.parse_content(result) | 103 | result = plugin.parse_content(result) |
104 | end | 104 | end |
105 | box_decorator.block_target(block.box, block) + | 105 | box_decorator.block_target(block.box, block) + |
app/helpers/cms_helper.rb
@@ -16,7 +16,7 @@ module CmsHelper | @@ -16,7 +16,7 @@ module CmsHelper | ||
16 | end | 16 | end |
17 | 17 | ||
18 | def pagination_links(collection, options={}) | 18 | def pagination_links(collection, options={}) |
19 | - options = {:prev_label => '« ', :next_label => ' »', :page_links => false}.merge(options) | 19 | + options = {:previous_label => '« ', :next_label => ' »', :page_links => false}.merge(options) |
20 | will_paginate(collection, options) | 20 | will_paginate(collection, options) |
21 | end | 21 | end |
22 | 22 |
app/helpers/content_viewer_helper.rb
@@ -55,7 +55,7 @@ module ContentViewerHelper | @@ -55,7 +55,7 @@ module ContentViewerHelper | ||
55 | "http://www.facebook.com/sharer.php?s=100&p[title]=%{title}&p[summary]=%{summary}&p[url]=%{url}&p[images][0]=%{image}" % { | 55 | "http://www.facebook.com/sharer.php?s=100&p[title]=%{title}&p[summary]=%{summary}&p[url]=%{url}&p[images][0]=%{image}" % { |
56 | :title => CGI.escape(article.title), | 56 | :title => CGI.escape(article.title), |
57 | :url => CGI.escape(url_for(article.url)), | 57 | :url => CGI.escape(url_for(article.url)), |
58 | - :summary => CGI.escape(truncate(strip_tags(article.body.to_s), 300)), | 58 | + :summary => CGI.escape(truncate(strip_tags(article.body.to_s), :length => 300)), |
59 | :image => CGI.escape(article.body_images_paths.first.to_s) | 59 | :image => CGI.escape(article.body_images_paths.first.to_s) |
60 | } | 60 | } |
61 | end | 61 | end |
app/helpers/forms_helper.rb
@@ -14,9 +14,9 @@ module FormsHelper | @@ -14,9 +14,9 @@ module FormsHelper | ||
14 | 14 | ||
15 | def labelled_check_box( human_name, name, value = "1", checked = false, options = {} ) | 15 | def labelled_check_box( human_name, name, value = "1", checked = false, options = {} ) |
16 | options[:id] ||= 'checkbox-' + FormsHelper.next_id_number | 16 | options[:id] ||= 'checkbox-' + FormsHelper.next_id_number |
17 | - check_box_tag( name, value, checked, options ) + | ||
18 | - content_tag( 'label', human_name, :for => options[:id] ) + | ||
19 | - hidden_field_tag(name, '0') | 17 | + hidden_field_tag(name, '0') + |
18 | + check_box_tag( name, value, checked, options ) + | ||
19 | + content_tag( 'label', human_name, :for => options[:id] ) | ||
20 | end | 20 | end |
21 | 21 | ||
22 | def labelled_text_field( human_name, name, value=nil, options={} ) | 22 | def labelled_text_field( human_name, name, value=nil, options={} ) |
app/helpers/forum_helper.rb
@@ -11,7 +11,7 @@ module ForumHelper | @@ -11,7 +11,7 @@ module ForumHelper | ||
11 | def list_forum_posts(articles) | 11 | def list_forum_posts(articles) |
12 | pagination = will_paginate(articles, { | 12 | pagination = will_paginate(articles, { |
13 | :param_name => 'npage', | 13 | :param_name => 'npage', |
14 | - :prev_label => _('« Newer posts'), | 14 | + :previous_label => _('« Newer posts'), |
15 | :next_label => _('Older posts »') | 15 | :next_label => _('Older posts »') |
16 | }) | 16 | }) |
17 | content = [content_tag('tr', | 17 | content = [content_tag('tr', |
app/helpers/manage_products_helper.rb
@@ -55,7 +55,7 @@ module ManageProductsHelper | @@ -55,7 +55,7 @@ module ManageProductsHelper | ||
55 | def options_for_select_categories(categories, selected = nil) | 55 | def options_for_select_categories(categories, selected = nil) |
56 | categories.sort_by{|cat| cat.name.transliterate}.map do |category| | 56 | categories.sort_by{|cat| cat.name.transliterate}.map do |category| |
57 | selected_attribute = selected.nil? ? '' : (category == selected ? "selected='selected'" : '') | 57 | selected_attribute = selected.nil? ? '' : (category == selected ? "selected='selected'" : '') |
58 | - "<option value='#{category.id}' title='#{category.name}' #{selected_attribute}>#{truncate(category.name, 33) + (category.leaf? ? '': ' »')}</option>" | 58 | + "<option value='#{category.id}' title='#{category.name}' #{selected_attribute}>#{truncate(category.name, :length => 33) + (category.leaf? ? '': ' »')}</option>" |
59 | end.join("\n") | 59 | end.join("\n") |
60 | end | 60 | end |
61 | 61 |
app/helpers/profile_editor_helper.rb
@@ -137,8 +137,8 @@ module ProfileEditorHelper | @@ -137,8 +137,8 @@ module ProfileEditorHelper | ||
137 | content_tag( | 137 | content_tag( |
138 | 'div', | 138 | 'div', |
139 | capture(&block) + '<br style="clear:left;"/> ', | 139 | capture(&block) + '<br style="clear:left;"/> ', |
140 | - :class => 'control-panel'), | ||
141 | - block.binding) | 140 | + :class => 'control-panel') |
141 | + ) | ||
142 | end | 142 | end |
143 | 143 | ||
144 | def control_panel_button(title, icon, url) | 144 | def control_panel_button(title, icon, url) |
app/helpers/sweeper_helper.rb
@@ -4,9 +4,7 @@ module SweeperHelper | @@ -4,9 +4,7 @@ module SweeperHelper | ||
4 | ActionController::Base.new().expire_fragment(*args) | 4 | ActionController::Base.new().expire_fragment(*args) |
5 | end | 5 | end |
6 | 6 | ||
7 | - def expire_timeout_fragment(*args) | ||
8 | - ActionController::Base.new().expire_timeout_fragment(*args) | ||
9 | - end | 7 | + alias :expire_timeout_fragment :expire_fragment |
10 | 8 | ||
11 | def expire_friends(profile) | 9 | def expire_friends(profile) |
12 | # public friends page | 10 | # public friends page |
app/helpers/tags_helper.rb
@@ -50,7 +50,7 @@ module TagsHelper | @@ -50,7 +50,7 @@ module TagsHelper | ||
50 | style = ""+ | 50 | style = ""+ |
51 | "font-size: #{ (v * delta).round + min_size }px;"+ | 51 | "font-size: #{ (v * delta).round + min_size }px;"+ |
52 | "top: #{ -(delta/2) - (v * (delta/2)).round }px;" | 52 | "top: #{ -(delta/2) - (v * (delta/2)).round }px;" |
53 | - destination = url.kind_of?(Hash) ? url_for(url.merge(tagname_option => tag)) : (url.to_s + tag) | 53 | + destination = url.merge(tagname_option => tag) |
54 | 54 | ||
55 | if options[:show_count] | 55 | if options[:show_count] |
56 | display_count = options[:show_count] ? "<small><sup>(#{count})</sup></small>" : "" | 56 | display_count = options[:show_count] ? "<small><sup>(#{count})</sup></small>" : "" |
app/models/article.rb
@@ -13,7 +13,7 @@ class Article < ActiveRecord::Base | @@ -13,7 +13,7 @@ class Article < ActiveRecord::Base | ||
13 | validates_presence_of :profile_id, :name | 13 | validates_presence_of :profile_id, :name |
14 | validates_presence_of :slug, :path, :if => lambda { |article| !article.name.blank? } | 14 | validates_presence_of :slug, :path, :if => lambda { |article| !article.name.blank? } |
15 | 15 | ||
16 | - validates_uniqueness_of :slug, :scope => ['profile_id', 'parent_id'], :message => N_('<!-- %{fn} -->The title (article name) is already being used by another article, please use another title.'), :if => lambda { |article| !article.slug.blank? } | 16 | + validates_uniqueness_of :slug, :scope => ['profile_id', 'parent_id'], :message => N_('The title (article name) is already being used by another article, please use another title.'), :if => lambda { |article| !article.slug.blank? } |
17 | 17 | ||
18 | belongs_to :last_changed_by, :class_name => 'Person', :foreign_key => 'last_changed_by_id' | 18 | belongs_to :last_changed_by, :class_name => 'Person', :foreign_key => 'last_changed_by_id' |
19 | 19 | ||
@@ -34,7 +34,7 @@ class Article < ActiveRecord::Base | @@ -34,7 +34,7 @@ class Article < ActiveRecord::Base | ||
34 | before_destroy :rotate_translations | 34 | before_destroy :rotate_translations |
35 | 35 | ||
36 | before_create do |article| | 36 | before_create do |article| |
37 | - article.published_at = article.created_at if article.published_at.nil? | 37 | + article.published_at ||= Time.now |
38 | if article.reference_article && !article.parent | 38 | if article.reference_article && !article.parent |
39 | parent = article.reference_article.parent | 39 | parent = article.reference_article.parent |
40 | if parent && parent.blog? && article.profile.has_blog? | 40 | if parent && parent.blog? && article.profile.has_blog? |
@@ -233,7 +233,7 @@ class Article < ActiveRecord::Base | @@ -233,7 +233,7 @@ class Article < ActiveRecord::Base | ||
233 | 233 | ||
234 | include ActionView::Helpers::TextHelper | 234 | include ActionView::Helpers::TextHelper |
235 | def short_title | 235 | def short_title |
236 | - truncate self.title, 15, '...' | 236 | + truncate self.title, :length => 15, :omission => '...' |
237 | end | 237 | end |
238 | 238 | ||
239 | def belongs_to_blog? | 239 | def belongs_to_blog? |
@@ -514,7 +514,7 @@ class Article < ActiveRecord::Base | @@ -514,7 +514,7 @@ class Article < ActiveRecord::Base | ||
514 | end | 514 | end |
515 | 515 | ||
516 | def short_lead | 516 | def short_lead |
517 | - truncate sanitize_html(self.lead), 170, '...' | 517 | + truncate sanitize_html(self.lead), :length => 170, :omission => '...' |
518 | end | 518 | end |
519 | 519 | ||
520 | def creator | 520 | def creator |
app/models/blog.rb
@@ -68,7 +68,7 @@ class Blog < Folder | @@ -68,7 +68,7 @@ class Blog < Folder | ||
68 | settings_items :visualization_format, :type => :string, :default => 'full' | 68 | settings_items :visualization_format, :type => :string, :default => 'full' |
69 | validates_inclusion_of :visualization_format, :in => [ 'full', 'short' ], :if => :visualization_format | 69 | validates_inclusion_of :visualization_format, :in => [ 'full', 'short' ], :if => :visualization_format |
70 | 70 | ||
71 | - settings_items :display_posts_in_current_language, :type => :boolean, :default => true | 71 | + settings_items :display_posts_in_current_language, :type => :boolean, :default => false |
72 | 72 | ||
73 | alias :display_posts_in_current_language? :display_posts_in_current_language | 73 | alias :display_posts_in_current_language? :display_posts_in_current_language |
74 | 74 |
app/models/category.rb
1 | class Category < ActiveRecord::Base | 1 | class Category < ActiveRecord::Base |
2 | 2 | ||
3 | - validates_exclusion_of :slug, :in => [ 'index' ], :message => N_('%{fn} cannot be like that.') | 3 | + validates_exclusion_of :slug, :in => [ 'index' ], :message => N_('%{fn} cannot be like that.').fix_i18n |
4 | validates_presence_of :name, :environment_id | 4 | validates_presence_of :name, :environment_id |
5 | - validates_uniqueness_of :slug,:scope => [ :environment_id, :parent_id ], :message => N_('%{fn} is already being used by another category.') | 5 | + validates_uniqueness_of :slug,:scope => [ :environment_id, :parent_id ], :message => N_('%{fn} is already being used by another category.').fix_i18n |
6 | belongs_to :environment | 6 | belongs_to :environment |
7 | 7 | ||
8 | validates_inclusion_of :display_color, :in => [ 1, 2, 3, 4, nil ] | 8 | validates_inclusion_of :display_color, :in => [ 1, 2, 3, 4, nil ] |
9 | - validates_uniqueness_of :display_color, :scope => :environment_id, :if => (lambda { |cat| ! cat.display_color.nil? }), :message => N_('%{fn} was already assigned to another category.') | 9 | + validates_uniqueness_of :display_color, :scope => :environment_id, :if => (lambda { |cat| ! cat.display_color.nil? }), :message => N_('%{fn} was already assigned to another category.').fix_i18n |
10 | 10 | ||
11 | # Finds all top level categories for a given environment. | 11 | # Finds all top level categories for a given environment. |
12 | named_scope :top_level_for, lambda { |environment| | 12 | named_scope :top_level_for, lambda { |environment| |
app/models/change_password.rb
@@ -30,10 +30,10 @@ class ChangePassword < Task | @@ -30,10 +30,10 @@ class ChangePassword < Task | ||
30 | unless data.login.blank? || data.email.blank? | 30 | unless data.login.blank? || data.email.blank? |
31 | user = User.find_by_login_and_environment_id(data.login, data.environment_id) | 31 | user = User.find_by_login_and_environment_id(data.login, data.environment_id) |
32 | if user.nil? | 32 | if user.nil? |
33 | - data.errors.add(:login, _('%{fn} is not a valid username.')) | 33 | + data.errors.add(:login, _('%{fn} is not a valid username.').fix_i18n) |
34 | else | 34 | else |
35 | if user.email != data.email | 35 | if user.email != data.email |
36 | - data.errors.add(:email, _('%{fn} is invalid.')) | 36 | + data.errors.add(:email) |
37 | end | 37 | end |
38 | end | 38 | end |
39 | end | 39 | end |
app/models/comment.rb
@@ -17,7 +17,7 @@ class Comment < ActiveRecord::Base | @@ -17,7 +17,7 @@ class Comment < ActiveRecord::Base | ||
17 | validates_presence_of :author_id, :if => (lambda { |rec| rec.name.blank? && rec.email.blank? }) | 17 | validates_presence_of :author_id, :if => (lambda { |rec| rec.name.blank? && rec.email.blank? }) |
18 | validates_each :name do |rec,attribute,value| | 18 | validates_each :name do |rec,attribute,value| |
19 | if rec.author_id && (!rec.name.blank? || !rec.email.blank?) | 19 | if rec.author_id && (!rec.name.blank? || !rec.email.blank?) |
20 | - rec.errors.add(:name, _('%{fn} can only be informed for unauthenticated authors')) | 20 | + rec.errors.add(:name, _('%{fn} can only be informed for unauthenticated authors').fix_i18n) |
21 | end | 21 | end |
22 | end | 22 | end |
23 | 23 | ||
@@ -126,4 +126,12 @@ class Comment < ActiveRecord::Base | @@ -126,4 +126,12 @@ class Comment < ActiveRecord::Base | ||
126 | end | 126 | end |
127 | end | 127 | end |
128 | 128 | ||
129 | + def rejected? | ||
130 | + @rejected | ||
131 | + end | ||
132 | + | ||
133 | + def reject! | ||
134 | + @rejected = true | ||
135 | + end | ||
136 | + | ||
129 | end | 137 | end |
app/models/community.rb
@@ -34,7 +34,7 @@ class Community < Organization | @@ -34,7 +34,7 @@ class Community < Organization | ||
34 | super | 34 | super |
35 | self.required_fields.each do |field| | 35 | self.required_fields.each do |field| |
36 | if self.send(field).blank? | 36 | if self.send(field).blank? |
37 | - self.errors.add(field, _('%{fn} can\'t be blank')) | 37 | + self.errors.add_on_blank(field) |
38 | end | 38 | end |
39 | end | 39 | end |
40 | end | 40 | end |
app/models/create_community.rb
@@ -16,7 +16,7 @@ class CreateCommunity < Task | @@ -16,7 +16,7 @@ class CreateCommunity < Task | ||
16 | def validate | 16 | def validate |
17 | self.environment.required_community_fields.each do |field| | 17 | self.environment.required_community_fields.each do |field| |
18 | if self.send(field).blank? | 18 | if self.send(field).blank? |
19 | - self.errors.add(field, _('%{fn} can\'t be blank')) | 19 | + self.errors.add_on_blank(field) |
20 | end | 20 | end |
21 | end | 21 | end |
22 | end | 22 | end |
app/models/create_enterprise.rb
@@ -40,12 +40,12 @@ class CreateEnterprise < Task | @@ -40,12 +40,12 @@ class CreateEnterprise < Task | ||
40 | 40 | ||
41 | if self.region && self.target | 41 | if self.region && self.target |
42 | unless self.region.validators.include?(self.target) || self.target_type == "Environment" | 42 | unless self.region.validators.include?(self.target) || self.target_type == "Environment" |
43 | - self.errors.add(:target, '%{fn} is not a validator for the chosen region') | 43 | + self.errors.add(:target, _('%{fn} is not a validator for the chosen region').fix_i18n) |
44 | end | 44 | end |
45 | end | 45 | end |
46 | 46 | ||
47 | if self.status != Task::Status::CANCELLED && self.identifier && Profile.exists?(:identifier => self.identifier) | 47 | if self.status != Task::Status::CANCELLED && self.identifier && Profile.exists?(:identifier => self.identifier) |
48 | - self.errors.add(:identifier, '%{fn} is already being as identifier by another enterprise, organization or person.') | 48 | + self.errors.add(:identifier, _('%{fn} is already being as identifier by another enterprise, organization or person.').fix_i18n) |
49 | end | 49 | end |
50 | end | 50 | end |
51 | 51 |
app/models/domain.rb
@@ -10,14 +10,14 @@ class Domain < ActiveRecord::Base | @@ -10,14 +10,14 @@ class Domain < ActiveRecord::Base | ||
10 | 10 | ||
11 | # <tt>name</tt> must be a sequence of word characters (a to z, plus 0 to 9, | 11 | # <tt>name</tt> must be a sequence of word characters (a to z, plus 0 to 9, |
12 | # plus '_'). Letters must be lowercase | 12 | # plus '_'). Letters must be lowercase |
13 | - validates_format_of :name, :with => /^([a-z0-9_-]+\.)+[a-z0-9_-]+$/, :message => N_('%{fn} must be composed only of lowercase latters (a to z), numbers (0 to 9), "_" and "-"') | 13 | + validates_format_of :name, :with => /^([a-z0-9_-]+\.)+[a-z0-9_-]+$/, :message => N_('%{fn} must be composed only of lowercase latters (a to z), numbers (0 to 9), "_" and "-"').fix_i18n |
14 | 14 | ||
15 | # checks validations that could not be expressed using Rails' predefined | 15 | # checks validations that could not be expressed using Rails' predefined |
16 | # validations. In particular: | 16 | # validations. In particular: |
17 | # * <tt>name</tt> must not start with 'www.' | 17 | # * <tt>name</tt> must not start with 'www.' |
18 | def validate | 18 | def validate |
19 | if self.name =~ /^www\./ | 19 | if self.name =~ /^www\./ |
20 | - self.errors.add(:name, _('%{fn} must not start with www.')) | 20 | + self.errors.add(:name, _('%{fn} must not start with www.').fix_i18n) |
21 | end | 21 | end |
22 | end | 22 | end |
23 | 23 |
app/models/enterprise.rb
@@ -46,7 +46,7 @@ class Enterprise < Organization | @@ -46,7 +46,7 @@ class Enterprise < Organization | ||
46 | super | 46 | super |
47 | self.required_fields.each do |field| | 47 | self.required_fields.each do |field| |
48 | if self.send(field).blank? | 48 | if self.send(field).blank? |
49 | - self.errors.add(field, _("%{fn} can't be blank")) | 49 | + self.errors.add_on_blank(field) |
50 | end | 50 | end |
51 | end | 51 | end |
52 | end | 52 | end |
@@ -76,7 +76,11 @@ class Enterprise < Organization | @@ -76,7 +76,11 @@ class Enterprise < Organization | ||
76 | end | 76 | end |
77 | 77 | ||
78 | after_save do |e| | 78 | after_save do |e| |
79 | - e.products.each{ |p| p.enterprise_updated(e) } | 79 | + e.delay.update_products_position |
80 | + end | ||
81 | + | ||
82 | + def update_products_position | ||
83 | + products.each{ |p| p.enterprise_updated(self) } | ||
80 | end | 84 | end |
81 | 85 | ||
82 | def closed? | 86 | def closed? |
app/models/environment.rb
@@ -223,7 +223,6 @@ class Environment < ActiveRecord::Base | @@ -223,7 +223,6 @@ class Environment < ActiveRecord::Base | ||
223 | settings_items :layout_template, :type => String, :default => 'default' | 223 | settings_items :layout_template, :type => String, :default => 'default' |
224 | settings_items :homepage, :type => String | 224 | settings_items :homepage, :type => String |
225 | settings_items :description, :type => String, :default => '<div style="text-align: center"><a href="http://noosfero.org/"><img src="/images/noosfero-network.png" alt="Noosfero"/></a></div>' | 225 | settings_items :description, :type => String, :default => '<div style="text-align: center"><a href="http://noosfero.org/"><img src="/images/noosfero-network.png" alt="Noosfero"/></a></div>' |
226 | - settings_items :enable_ssl | ||
227 | settings_items :local_docs, :type => Array, :default => [] | 226 | settings_items :local_docs, :type => Array, :default => [] |
228 | settings_items :news_amount_by_folder, :type => Integer, :default => 4 | 227 | settings_items :news_amount_by_folder, :type => Integer, :default => 4 |
229 | settings_items :help_message_to_add_enterprise, :type => String, :default => '' | 228 | settings_items :help_message_to_add_enterprise, :type => String, :default => '' |
@@ -564,8 +563,8 @@ class Environment < ActiveRecord::Base | @@ -564,8 +563,8 @@ class Environment < ActiveRecord::Base | ||
564 | domain | 563 | domain |
565 | end | 564 | end |
566 | 565 | ||
567 | - def top_url(ssl = false) | ||
568 | - protocol = (ssl ? 'https' : 'http') | 566 | + def top_url |
567 | + protocol = 'http' | ||
569 | result = "#{protocol}://#{default_hostname}" | 568 | result = "#{protocol}://#{default_hostname}" |
570 | if Noosfero.url_options.has_key?(:port) | 569 | if Noosfero.url_options.has_key?(:port) |
571 | result << ':' << Noosfero.url_options[:port].to_s | 570 | result << ':' << Noosfero.url_options[:port].to_s |
app/models/environment_finder.rb
@@ -53,7 +53,7 @@ class EnvironmentFinder | @@ -53,7 +53,7 @@ class EnvironmentFinder | ||
53 | # SECURITY no risk of SQL injection, since product_category_ids comes from trusted source | 53 | # SECURITY no risk of SQL injection, since product_category_ids comes from trusted source |
54 | @environment.send(asset).find_by_contents(query, ferret_options, options.merge({:include => 'product_categorizations', :conditions => 'product_categorizations.category_id = (%s)' % product_category.id })) | 54 | @environment.send(asset).find_by_contents(query, ferret_options, options.merge({:include => 'product_categorizations', :conditions => 'product_categorizations.category_id = (%s)' % product_category.id })) |
55 | elsif product_category && asset == :enterprises | 55 | elsif product_category && asset == :enterprises |
56 | - @environment.send(asset).find_by_contents(query, ferret_options, options.merge(:joins => 'inner join product_categorizations on (product_categorizations.product_id = products.id)', :include => 'products', :conditions => "product_categorizations.category_id = (#{product_category.id})")) | 56 | + @environment.send(asset).find_by_contents(query, ferret_options, options.merge(:joins => 'inner join products on products.enterprise_id = profiles.id inner join product_categorizations on (product_categorizations.product_id = products.id)', :conditions => "product_categorizations.category_id = (#{product_category.id})")) |
57 | else | 57 | else |
58 | @environment.send(asset).find_by_contents(query, ferret_options, options) | 58 | @environment.send(asset).find_by_contents(query, ferret_options, options) |
59 | end | 59 | end |
app/models/event.rb
@@ -22,7 +22,7 @@ class Event < Article | @@ -22,7 +22,7 @@ class Event < Article | ||
22 | 22 | ||
23 | validates_each :start_date do |event,field,value| | 23 | validates_each :start_date do |event,field,value| |
24 | if event.end_date && event.start_date && event.start_date > event.end_date | 24 | if event.end_date && event.start_date && event.start_date > event.end_date |
25 | - event.errors.add(:start_date, _('%{fn} cannot come before end date.')) | 25 | + event.errors.add(:start_date, _('%{fn} cannot come before end date.').fix_i18n) |
26 | end | 26 | end |
27 | end | 27 | end |
28 | 28 |
app/models/image.rb
@@ -17,7 +17,7 @@ class Image < ActiveRecord::Base | @@ -17,7 +17,7 @@ class Image < ActiveRecord::Base | ||
17 | :icon => '20x20!' }, | 17 | :icon => '20x20!' }, |
18 | :max_size => 5.megabytes # remember to update validate message below | 18 | :max_size => 5.megabytes # remember to update validate message below |
19 | 19 | ||
20 | - validates_attachment :size => N_("%{fn} of uploaded file was larger than the maximum size of 5.0 MB") | 20 | + validates_attachment :size => N_("%{fn} of uploaded file was larger than the maximum size of 5.0 MB").fix_i18n |
21 | 21 | ||
22 | delay_attachment_fu_thumbnails | 22 | delay_attachment_fu_thumbnails |
23 | 23 |
app/models/person.rb
@@ -121,6 +121,12 @@ class Person < Profile | @@ -121,6 +121,12 @@ class Person < Profile | ||
121 | 121 | ||
122 | validates_multiparameter_assignments | 122 | validates_multiparameter_assignments |
123 | 123 | ||
124 | + validates_each :birth_date do |record,attr,value| | ||
125 | + if value && value.year == 1 | ||
126 | + record.errors.add(attr) | ||
127 | + end | ||
128 | + end | ||
129 | + | ||
124 | def self.fields | 130 | def self.fields |
125 | FIELDS | 131 | FIELDS |
126 | end | 132 | end |
@@ -130,7 +136,7 @@ class Person < Profile | @@ -130,7 +136,7 @@ class Person < Profile | ||
130 | self.required_fields.each do |field| | 136 | self.required_fields.each do |field| |
131 | if self.send(field).blank? | 137 | if self.send(field).blank? |
132 | unless (field == 'custom_area_of_study' && self.area_of_study != 'Others') || (field == 'custom_formation' && self.formation != 'Others') | 138 | unless (field == 'custom_area_of_study' && self.area_of_study != 'Others') || (field == 'custom_formation' && self.formation != 'Others') |
133 | - self.errors.add(field, _('%{fn} is mandatory')) | 139 | + self.errors.add_on_blank(field) |
134 | end | 140 | end |
135 | end | 141 | end |
136 | end | 142 | end |
@@ -192,7 +198,7 @@ class Person < Profile | @@ -192,7 +198,7 @@ class Person < Profile | ||
192 | 198 | ||
193 | validates_each :email, :on => :update do |record,attr,value| | 199 | validates_each :email, :on => :update do |record,attr,value| |
194 | if User.find(:first, :conditions => ['email = ? and id != ? and environment_id = ?', value, record.user.id, record.environment.id]) | 200 | if User.find(:first, :conditions => ['email = ? and id != ? and environment_id = ?', value, record.user.id, record.environment.id]) |
195 | - record.errors.add(attr, _('%{fn} is already used by other user')) | 201 | + record.errors.add(attr, _('%{fn} is already used by other user').fix_i18n) |
196 | end | 202 | end |
197 | end | 203 | end |
198 | 204 |
app/models/profile.rb
@@ -611,7 +611,7 @@ private :generate_url, :url_options | @@ -611,7 +611,7 @@ private :generate_url, :url_options | ||
611 | include ActionView::Helpers::TextHelper | 611 | include ActionView::Helpers::TextHelper |
612 | def short_name(chars = 40) | 612 | def short_name(chars = 40) |
613 | if self[:nickname].blank? | 613 | if self[:nickname].blank? |
614 | - truncate self.name, chars, '...' | 614 | + truncate self.name, :length => chars, :omission => '...' |
615 | else | 615 | else |
616 | self[:nickname] | 616 | self[:nickname] |
617 | end | 617 | end |
app/models/uploaded_file.rb
@@ -50,7 +50,7 @@ class UploadedFile < Article | @@ -50,7 +50,7 @@ class UploadedFile < Article | ||
50 | :thumbnail_class => Thumbnail, | 50 | :thumbnail_class => Thumbnail, |
51 | :max_size => 5.megabytes # remember to update validate message below | 51 | :max_size => 5.megabytes # remember to update validate message below |
52 | 52 | ||
53 | - validates_attachment :size => N_("%{fn} of uploaded file was larger than the maximum size of 5.0 MB") | 53 | + validates_attachment :size => N_("%{fn} of uploaded file was larger than the maximum size of 5.0 MB").fix_i18n |
54 | 54 | ||
55 | delay_attachment_fu_thumbnails | 55 | delay_attachment_fu_thumbnails |
56 | 56 |
app/models/user.rb
@@ -100,7 +100,7 @@ class User < ActiveRecord::Base | @@ -100,7 +100,7 @@ class User < ActiveRecord::Base | ||
100 | before_save :encrypt_password | 100 | before_save :encrypt_password |
101 | validates_format_of :email, :with => Noosfero::Constants::EMAIL_FORMAT, :if => (lambda {|user| !user.email.blank?}) | 101 | validates_format_of :email, :with => Noosfero::Constants::EMAIL_FORMAT, :if => (lambda {|user| !user.email.blank?}) |
102 | 102 | ||
103 | - validates_inclusion_of :terms_accepted, :in => [ '1' ], :if => lambda { |u| ! u.terms_of_use.blank? }, :message => N_('%{fn} must be checked in order to signup.') | 103 | + validates_inclusion_of :terms_accepted, :in => [ '1' ], :if => lambda { |u| ! u.terms_of_use.blank? }, :message => N_('%{fn} must be checked in order to signup.').fix_i18n |
104 | 104 | ||
105 | # Authenticates a user by their login name and unencrypted password. Returns the user or nil. | 105 | # Authenticates a user by their login name and unencrypted password. Returns the user or nil. |
106 | def self.authenticate(login, password, environment = nil) | 106 | def self.authenticate(login, password, environment = nil) |
app/sweepers/article_sweeper.rb
@@ -15,7 +15,7 @@ protected | @@ -15,7 +15,7 @@ protected | ||
15 | def expire_caches(article) | 15 | def expire_caches(article) |
16 | article.hierarchy.each do |a| | 16 | article.hierarchy.each do |a| |
17 | if a != article | 17 | if a != article |
18 | - a.touch | 18 | + a.update_attribute(:updated_at, Time.now) |
19 | end | 19 | end |
20 | end | 20 | end |
21 | blocks = article.profile.blocks | 21 | blocks = article.profile.blocks |
app/views/account/signup.rhtml
1 | <% if @register_pending %> | 1 | <% if @register_pending %> |
2 | <div id='thanks-for-signing'> | 2 | <div id='thanks-for-signing'> |
3 | - <%= _("<h1>Welcome to %s!</h1> | ||
4 | - <h3>Thanks for signing up, we're thrilled to have you on our social network!</h3> | ||
5 | - <p>Firstly, some tips for getting started:</p> | ||
6 | - <h4>Confirm your account!</h4> | ||
7 | - <p>You should receive a welcome email from us shortly. Please take a second to follow the link within to confirm your account.</p> | ||
8 | - <p>You won't appear as a <a href=\"%s\" target=\"_blank\">user</a> until your account is confirmed.</p> | ||
9 | - <h4>What to do next?</h4> | ||
10 | - <p><a href=\"/doc/user/editing-person-info\" target=\"_blank\">Customize your profile</a>. Upload an avatar and let your friends find you easily :)</p> | ||
11 | - <p>Learn the guidelines. Read the <a href=\"/doc\" target=\"_blank\">Documentation</a> for more details on how to use new social network!</p> | ||
12 | - <p><a href=\"/doc/user/invite-contacts\" target=\"_blank\">Invite and find</a> your Gmail, Yahoo and Hotmail contacts!</p> | ||
13 | - <p>Start exploring and Have fun!</p>" % [environment.name, url_for(:controller => :browse, :action => :people, :filter => 'more_recent')]) %> | 3 | + <h1><%= _("Welcome to %s!") % environment.name %></h1> |
4 | + <h3><%= _("Thanks for signing up, we're thrilled to have you on our social network!") %></h3> | ||
5 | + <p><%= _("Firstly, some tips for getting started:") %></p> | ||
6 | + <h4><%= _("Confirm your account!") %></h4> | ||
7 | + <p><%= _("You should receive a welcome email from us shortly. Please take a second to follow the link within to confirm your account.") %></p> | ||
8 | + <p><%= _("You won't appear as %s until your account is confirmed.") % link_to(_('user'), {:controller => :browse, :action => :people, :filter => 'more_recent'}, :target => '_blank') %></p> | ||
9 | + <h4><%= _("What to do next?") %></h4> | ||
10 | + <p><%= _("%s. Upload an avatar and let your friends find you easily :)") % link_to(_('Customize your profile'), {:controller => 'doc', :section => 'user', :topic => 'editing-person-info'}, :target => '_blank') %></p> | ||
11 | + <p><%= _("Learn the guidelines. Read the %s for more details on how to use this social network!") % link_to(_('Documentation'), {:controller => 'doc'}, :target => '_blank') %></p> | ||
12 | + <p><%= _("%s your Gmail, Yahoo and Hotmail contacts!") % link_to(_('Invite and find'), {:controller => 'doc', :section => 'user', :topic => 'invite-contacts'}, :target => '_blank') %></p> | ||
13 | + <p><%= _("Start exploring and have fun!") %></p> | ||
14 | </div> | 14 | </div> |
15 | <% else %> | 15 | <% else %> |
16 | <h1><%= _('Sign up for %s!') % environment.name %></h1> | 16 | <h1><%= _('Sign up for %s!') % environment.name %></h1> |
app/views/admin_panel/index.rhtml
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | <tr><td><%= link_to _('Edit Templates'), :action => 'edit_templates' %></td></tr> | 15 | <tr><td><%= link_to _('Edit Templates'), :action => 'edit_templates' %></td></tr> |
16 | <tr><td><%= link_to _('Manage Fields'), :controller => 'features', :action => 'manage_fields' %></td></tr> | 16 | <tr><td><%= link_to _('Manage Fields'), :controller => 'features', :action => 'manage_fields' %></td></tr> |
17 | <tr><td><%= link_to _('Set Portal'), :action => 'set_portal_community' %></td></tr> | 17 | <tr><td><%= link_to _('Set Portal'), :action => 'set_portal_community' %></td></tr> |
18 | - <% @plugins.map(:admin_panel_links).each do |link| %> | 18 | + <% @plugins.dispatch(:admin_panel_links).each do |link| %> |
19 | <tr><td><%= link_to link[:title], link[:url] %></td></tr> | 19 | <tr><td><%= link_to link[:title], link[:url] %></td></tr> |
20 | <% end %> | 20 | <% end %> |
21 | </table> | 21 | </table> |
app/views/catalog/index.rhtml
@@ -5,8 +5,8 @@ | @@ -5,8 +5,8 @@ | ||
5 | <li><h1><%= _('Products/Services') %></h1></li> | 5 | <li><h1><%= _('Products/Services') %></h1></li> |
6 | 6 | ||
7 | <% @products.each do |product| %> | 7 | <% @products.each do |product| %> |
8 | - <% extra_content = @plugins.map(:catalog_item_extras, product).collect { |content| instance_eval(&content) } %> | ||
9 | - <% extra_content_list = @plugins.map(:catalog_list_item_extras, product).collect { |content| instance_eval(&content) } %> | 8 | + <% extra_content = @plugins.dispatch(:catalog_item_extras, product).collect { |content| instance_eval(&content) } %> |
9 | + <% extra_content_list = @plugins.dispatch(:catalog_list_item_extras, product).collect { |content| instance_eval(&content) } %> | ||
10 | 10 | ||
11 | <li class="product <%= "not-available" unless product.available %>"> | 11 | <li class="product <%= "not-available" unless product.available %>"> |
12 | <ul> | 12 | <ul> |
app/views/cms/_blog.rhtml
@@ -68,7 +68,6 @@ | @@ -68,7 +68,6 @@ | ||
68 | <% enabled = @article.external_feed && @article.external_feed.enabled %> | 68 | <% enabled = @article.external_feed && @article.external_feed.enabled %> |
69 | <% only_once = @article.external_feed ? @article.external_feed.only_once : true %> | 69 | <% only_once = @article.external_feed ? @article.external_feed.only_once : true %> |
70 | <%= labelled_check_box(_('Fetch posts from an external feed'), 'article[external_feed_builder][enabled]', 'true', enabled, {:onchange => "$('external-feed-options').toggle()"}) %> | 70 | <%= labelled_check_box(_('Fetch posts from an external feed'), 'article[external_feed_builder][enabled]', 'true', enabled, {:onchange => "$('external-feed-options').toggle()"}) %> |
71 | - <%= hidden_field_tag 'article[external_feed_builder][enabled]', 'false' %> | ||
72 | <div id='external-feed-options' style="display: <%= enabled ? 'block' : 'none' %>"> | 71 | <div id='external-feed-options' style="display: <%= enabled ? 'block' : 'none' %>"> |
73 | <%= efeed.hidden_field(:id) %> | 72 | <%= efeed.hidden_field(:id) %> |
74 | <%= labelled_form_field( _('Feed address'), efeed.text_field(:address) ) %> | 73 | <%= labelled_form_field( _('Feed address'), efeed.text_field(:address) ) %> |
app/views/cms/view.rhtml
@@ -62,4 +62,4 @@ | @@ -62,4 +62,4 @@ | ||
62 | 62 | ||
63 | </table> | 63 | </table> |
64 | 64 | ||
65 | -<%= pagination_links @articles, {:param_name => 'npage', :prev_label => '« ' + _('Previous'), :next_label => _('Next') + ' »', :page_links => true} %> | 65 | +<%= pagination_links @articles, {:param_name => 'npage', :page_links => true} %> |
app/views/content_viewer/view_page.rhtml
@@ -70,23 +70,29 @@ | @@ -70,23 +70,29 @@ | ||
70 | <%= display_source_info(@page) %> | 70 | <%= display_source_info(@page) %> |
71 | 71 | ||
72 | <div class="comments" id="comments_list"> | 72 | <div class="comments" id="comments_list"> |
73 | - <% if @page.accept_comments? %> | ||
74 | - <h3 <%= 'class="no-comments-yet"' if @comments.size == 0 %>> | ||
75 | - <%= number_of_comments(@page) %> | ||
76 | - </h3> | ||
77 | - <% if @comments_count > 1 %> | ||
78 | - <p class="post-comment-button"><a href="#comment_form" onclick="jQuery('#page-comment-form h4').first().trigger('click')"><%= _('Post a comment') %></a></p> | 73 | + |
74 | + <% if @page.accept_comments? || @comments_count > 0 %> | ||
75 | + <h3 <%= 'class="no-comments-yet"' if @comments_count == 0 %>> | ||
76 | + <%= number_of_comments(@page) %> | ||
77 | + </h3> | ||
78 | + <% end %> | ||
79 | + | ||
80 | + <% if @page.accept_comments? && @comments_count > 1 %> | ||
81 | + <p class="post-comment-button"><a href="#comment_form" onclick="jQuery('#page-comment-form h4').first().trigger('click')"><%= _('Post a comment') %></a></p> | ||
79 | <% end %> | 82 | <% end %> |
83 | + | ||
80 | <ul class="article-comments-list"> | 84 | <ul class="article-comments-list"> |
81 | <%= render :partial => 'comment', :collection => @comments %> | 85 | <%= render :partial => 'comment', :collection => @comments %> |
82 | </ul> | 86 | </ul> |
83 | - <div id="page-comment-form"><%= render :partial => 'comment_form' %></div> | ||
84 | - <script type="text/javascript"> | ||
85 | - jQuery( function() { | ||
86 | - jQuery('.article-comment').live('mouseover', function() { jQuery(this).find('.icon-delete:first').show(); }); | ||
87 | - jQuery('.article-comment').live('mouseout', function() { jQuery(this).find('.icon-delete').hide(); }); | ||
88 | - }); | ||
89 | - </script> | 87 | + |
88 | + <% if @page.accept_comments? %> | ||
89 | + <div id="page-comment-form"><%= render :partial => 'comment_form' %></div> | ||
90 | + <script type="text/javascript"> | ||
91 | + jQuery( function() { | ||
92 | + jQuery('.article-comment').live('mouseover', function() { jQuery(this).find('.icon-delete:first').show(); }); | ||
93 | + jQuery('.article-comment').live('mouseout', function() { jQuery(this).find('.icon-delete').hide(); }); | ||
94 | + }); | ||
95 | + </script> | ||
90 | <% end %> | 96 | <% end %> |
91 | </div><!-- end class="comments" --> | 97 | </div><!-- end class="comments" --> |
92 | 98 |
app/views/features/_manage_community_fields.rhtml
@@ -14,16 +14,16 @@ | @@ -14,16 +14,16 @@ | ||
14 | <td><label for="community_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td> | 14 | <td><label for="community_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td> |
15 | 15 | ||
16 | <td> | 16 | <td> |
17 | - <%= check_box_tag "community_fields[#{field}][active]", true, environment.custom_community_field(field, 'active'), :onclick => "$('community_fields[#{field}][required]').disabled=$('community_fields[#{field}][signup]').disabled=!this.checked;" %> | ||
18 | <%= hidden_field_tag "community_fields[#{field}][active]", false %> | 17 | <%= hidden_field_tag "community_fields[#{field}][active]", false %> |
18 | + <%= check_box_tag "community_fields[#{field}][active]", true, environment.custom_community_field(field, 'active'), :onclick => "$('community_fields[#{field}][required]').disabled=$('community_fields[#{field}][signup]').disabled=!this.checked;" %> | ||
19 | </td> | 19 | </td> |
20 | <td> | 20 | <td> |
21 | - <%= check_box_tag "community_fields[#{field}][required]", true, environment.custom_community_field(field, 'required'), :onclick => "if(this.checked) $('community_fields[#{field}][signup]').checked = true;" %> | ||
22 | <%= hidden_field_tag "community_fields[#{field}][required]", false %> | 21 | <%= hidden_field_tag "community_fields[#{field}][required]", false %> |
22 | + <%= check_box_tag "community_fields[#{field}][required]", true, environment.custom_community_field(field, 'required'), :onclick => "if(this.checked) $('community_fields[#{field}][signup]').checked = true;" %> | ||
23 | </td> | 23 | </td> |
24 | <td> | 24 | <td> |
25 | - <%= check_box_tag "community_fields[#{field}][signup]", true, environment.custom_community_field(field, 'signup'), :onclick => "if(!this.checked) $('community_fields[#{field}][required]').checked = false;" %> | ||
26 | <%= hidden_field_tag "community_fields[#{field}][signup]", false %> | 25 | <%= hidden_field_tag "community_fields[#{field}][signup]", false %> |
26 | + <%= check_box_tag "community_fields[#{field}][signup]", true, environment.custom_community_field(field, 'signup'), :onclick => "if(!this.checked) $('community_fields[#{field}][required]').checked = false;" %> | ||
27 | </td> | 27 | </td> |
28 | 28 | ||
29 | </tr> | 29 | </tr> |
app/views/features/_manage_enterprise_fields.rhtml
@@ -14,16 +14,16 @@ | @@ -14,16 +14,16 @@ | ||
14 | 14 | ||
15 | <td><label for="enterprise_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td> | 15 | <td><label for="enterprise_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td> |
16 | <td> | 16 | <td> |
17 | - <%= check_box_tag "enterprise_fields[#{field}][active]", true, environment.custom_enterprise_field(field, 'active'), :onclick => "$('enterprise_fields[#{field}][required]').disabled=$('enterprise_fields[#{field}][signup]').disabled=!this.checked;" %> | ||
18 | <%= hidden_field_tag "enterprise_fields[#{field}][active]", false %> | 17 | <%= hidden_field_tag "enterprise_fields[#{field}][active]", false %> |
18 | + <%= check_box_tag "enterprise_fields[#{field}][active]", true, environment.custom_enterprise_field(field, 'active'), :onclick => "$('enterprise_fields[#{field}][required]').disabled=$('enterprise_fields[#{field}][signup]').disabled=!this.checked;" %> | ||
19 | </td> | 19 | </td> |
20 | <td> | 20 | <td> |
21 | - <%= check_box_tag "enterprise_fields[#{field}][required]", true, environment.custom_enterprise_field(field, 'required'), :onclick => "if(this.checked) $('enterprise_fields[#{field}][signup]').checked = true;" %> | ||
22 | <%= hidden_field_tag "enterprise_fields[#{field}][required]", false %> | 21 | <%= hidden_field_tag "enterprise_fields[#{field}][required]", false %> |
22 | + <%= check_box_tag "enterprise_fields[#{field}][required]", true, environment.custom_enterprise_field(field, 'required'), :onclick => "if(this.checked) $('enterprise_fields[#{field}][signup]').checked = true;" %> | ||
23 | </td> | 23 | </td> |
24 | <td> | 24 | <td> |
25 | - <%= check_box_tag "enterprise_fields[#{field}][signup]", true, environment.custom_enterprise_field(field, 'signup'), :onclick => "if(!this.checked) $('enterprise_fields[#{field}][required]').checked = false;" %> | ||
26 | <%= hidden_field_tag "enterprise_fields[#{field}][signup]", false %> | 25 | <%= hidden_field_tag "enterprise_fields[#{field}][signup]", false %> |
26 | + <%= check_box_tag "enterprise_fields[#{field}][signup]", true, environment.custom_enterprise_field(field, 'signup'), :onclick => "if(!this.checked) $('enterprise_fields[#{field}][required]').checked = false;" %> | ||
27 | </td> | 27 | </td> |
28 | 28 | ||
29 | </tr> | 29 | </tr> |
app/views/features/_manage_person_fields.rhtml
@@ -13,16 +13,16 @@ | @@ -13,16 +13,16 @@ | ||
13 | <tr> | 13 | <tr> |
14 | <td><label for="person_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td> | 14 | <td><label for="person_fields[<%= field %>][active]"><%= _(field.humanize) %></label></td> |
15 | <td> | 15 | <td> |
16 | - <%= check_box_tag "person_fields[#{field}][active]", true, environment.custom_person_field(field, 'active'), :onclick => "$('person_fields[#{field}][required]').disabled=$('person_fields[#{field}][signup]').disabled=!this.checked;" %> | ||
17 | <%= hidden_field_tag "person_fields[#{field}][active]", false %> | 16 | <%= hidden_field_tag "person_fields[#{field}][active]", false %> |
17 | + <%= check_box_tag "person_fields[#{field}][active]", true, environment.custom_person_field(field, 'active'), :onclick => "$('person_fields[#{field}][required]').disabled=$('person_fields[#{field}][signup]').disabled=!this.checked;" %> | ||
18 | </td> | 18 | </td> |
19 | <td> | 19 | <td> |
20 | - <%= check_box_tag "person_fields[#{field}][required]", true, environment.custom_person_field(field, 'required'), :onclick => "if(this.checked) $('person_fields[#{field}][signup]').checked = true;" %> | ||
21 | <%= hidden_field_tag "person_fields[#{field}][required]", false %> | 20 | <%= hidden_field_tag "person_fields[#{field}][required]", false %> |
21 | + <%= check_box_tag "person_fields[#{field}][required]", true, environment.custom_person_field(field, 'required'), :onclick => "if(this.checked) $('person_fields[#{field}][signup]').checked = true;" %> | ||
22 | </td> | 22 | </td> |
23 | <td> | 23 | <td> |
24 | - <%= check_box_tag "person_fields[#{field}][signup]", true, environment.custom_person_field(field, 'signup'), :onclick => "if(!this.checked) $('person_fields[#{field}][required]').checked = false;" %> | ||
25 | <%= hidden_field_tag "person_fields[#{field}][signup]", false %> | 24 | <%= hidden_field_tag "person_fields[#{field}][signup]", false %> |
25 | + <%= check_box_tag "person_fields[#{field}][signup]", true, environment.custom_person_field(field, 'signup'), :onclick => "if(!this.checked) $('person_fields[#{field}][required]').checked = false;" %> | ||
26 | </td> | 26 | </td> |
27 | </tr> | 27 | </tr> |
28 | <% end %> | 28 | <% end %> |
app/views/friends/index.rhtml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | 2 | ||
3 | <h1><%= __("%s's friends") % profile.name %></h1> | 3 | <h1><%= __("%s's friends") % profile.name %></h1> |
4 | 4 | ||
5 | -<% cache_timeout(profile.manage_friends_cache_key(params), 4.hours.from_now) do %> | 5 | +<% cache_timeout(profile.manage_friends_cache_key(params), 4.hours) do %> |
6 | <% if @friends.empty? %> | 6 | <% if @friends.empty? %> |
7 | <p> | 7 | <p> |
8 | <em> | 8 | <em> |
app/views/layouts/application-ng.rhtml
@@ -12,23 +12,21 @@ | @@ -12,23 +12,21 @@ | ||
12 | <%= stylesheet_link_tag template_stylesheet_path %> | 12 | <%= stylesheet_link_tag template_stylesheet_path %> |
13 | <%= stylesheet_link_tag icon_theme_stylesheet_path %> | 13 | <%= stylesheet_link_tag icon_theme_stylesheet_path %> |
14 | <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %> | 14 | <%= stylesheet_link_tag jquery_ui_theme_stylesheet_path %> |
15 | - <% @plugins.enabled_plugins.each do |plugin| %> | ||
16 | - <% if plugin.stylesheet? %> | ||
17 | - <%= stylesheet_tag plugin.class.public_path('style.css'), {} %> | ||
18 | - <% end %> | ||
19 | - <% end %> | 15 | + <% |
16 | + plugins_stylesheets = @plugins.select(&:stylesheet?).map { |plugin| plugin.class.public_path('style.css') } | ||
17 | + %> | ||
18 | + <%= stylesheet_link_tag(plugins_stylesheets, :cache => 'cache/plugins-' + Digest::MD5.hexdigest(plugins_stylesheets.to_s)) unless plugins_stylesheets.empty? %> | ||
20 | <%= stylesheet_link_tag theme_stylesheet_path %> | 19 | <%= stylesheet_link_tag theme_stylesheet_path %> |
21 | 20 | ||
22 | <%# Add custom tags/styles/etc via content_for %> | 21 | <%# Add custom tags/styles/etc via content_for %> |
23 | <%= yield :head %> | 22 | <%= yield :head %> |
24 | <%= javascript_tag('render_all_jquery_ui_widgets()') %> | 23 | <%= javascript_tag('render_all_jquery_ui_widgets()') %> |
25 | - <% @plugins.enabled_plugins.each do |plugin| %> | ||
26 | - <% plugin.js_files.each do |js_file| %> | ||
27 | - <%= javascript_src_tag plugin.class.public_path(js_file), {} %> | ||
28 | - <% end %> | ||
29 | - <% end %> | 24 | + <% |
25 | + plugins_javascripts = @plugins.map { |plugin| plugin.js_files.map { |js| plugin.class.public_path(js) } }.flatten | ||
26 | + %> | ||
27 | + <%= javascript_include_tag(plugins_javascripts, :cache => 'cache/plugins-' + Digest::MD5.hexdigest(plugins_javascripts.to_s)) unless plugins_javascripts.empty? %> | ||
30 | <%= | 28 | <%= |
31 | - @plugins.map(:head_ending).collect do |content| | 29 | + @plugins.dispatch(:head_ending).collect do |content| |
32 | content.respond_to?(:call) ? content.call : content | 30 | content.respond_to?(:call) ? content.call : content |
33 | end.join("\n") | 31 | end.join("\n") |
34 | %> | 32 | %> |
@@ -43,7 +41,7 @@ | @@ -43,7 +41,7 @@ | ||
43 | 41 | ||
44 | <a href="#content" id="link-go-content"><span><%= _("Go to the content") %></span></a> | 42 | <a href="#content" id="link-go-content"><span><%= _("Go to the content") %></span></a> |
45 | <%= | 43 | <%= |
46 | - @plugins.map(:body_beginning).collect do |content| | 44 | + @plugins.dispatch(:body_beginning).collect do |content| |
47 | content.respond_to?(:call) ? content.call : content | 45 | content.respond_to?(:call) ? content.call : content |
48 | end.join("\n") | 46 | end.join("\n") |
49 | %> | 47 | %> |
app/views/layouts/application.rhtml
@@ -38,6 +38,7 @@ | @@ -38,6 +38,7 @@ | ||
38 | %>' onload='noosfero_init();' | 38 | %>' onload='noosfero_init();' |
39 | onresize="registerDocumentSize()"> | 39 | onresize="registerDocumentSize()"> |
40 | <script type="text/javascript"> | 40 | <script type="text/javascript"> |
41 | + // <!-- | ||
41 | function registerDocumentSize() { | 42 | function registerDocumentSize() { |
42 | document.body.className = document.body.className.replace(/docSize-(G|L)T-\d+/g, ""); | 43 | document.body.className = document.body.className.replace(/docSize-(G|L)T-\d+/g, ""); |
43 | for ( var x=100; x<=1500; x+=100 ) { | 44 | for ( var x=100; x<=1500; x+=100 ) { |
@@ -49,6 +50,7 @@ | @@ -49,6 +50,7 @@ | ||
49 | } | 50 | } |
50 | } | 51 | } |
51 | registerDocumentSize(); | 52 | registerDocumentSize(); |
53 | + // --> | ||
52 | </script> | 54 | </script> |
53 | 55 | ||
54 | <div id="accessibility_menu"> | 56 | <div id="accessibility_menu"> |
app/views/manage_products/show.rhtml
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | <%= render :partial => 'manage_products/display_image' %> | 13 | <%= render :partial => 'manage_products/display_image' %> |
14 | </div> | 14 | </div> |
15 | <div id='product-extra-content'> | 15 | <div id='product-extra-content'> |
16 | - <% extra_content = @plugins.map(:product_info_extras, @product).collect { |content| instance_eval(&content) } %> | 16 | + <% extra_content = @plugins.dispatch(:product_info_extras, @product).collect { |content| instance_eval(&content) } %> |
17 | <%= extra_content.join("\n") %> | 17 | <%= extra_content.join("\n") %> |
18 | </div> | 18 | </div> |
19 | <div id='product-info'> | 19 | <div id='product-info'> |
app/views/memberships/index.rhtml
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | <%= _('Role: %s') % rolename_for(profile, membership) %> <br/> | 19 | <%= _('Role: %s') % rolename_for(profile, membership) %> <br/> |
20 | <%= _('Type: %s') % getterm(membership.class.identification) %> <br/> | 20 | <%= _('Type: %s') % getterm(membership.class.identification) %> <br/> |
21 | <%= _('Description: %s') % membership.description + '<br/>' if membership.community? %> | 21 | <%= _('Description: %s') % membership.description + '<br/>' if membership.community? %> |
22 | - <%= _('Members: %s') % membership.members.size.to_s %> <br/> | 22 | + <%= _('Members: %s') % membership.members_count.to_s %> <br/> |
23 | <%= _('Created at: %s') % show_date(membership.created_at) unless membership.enterprise? %> <br/> | 23 | <%= _('Created at: %s') % show_date(membership.created_at) unless membership.enterprise? %> <br/> |
24 | <% button_bar do %> | 24 | <% button_bar do %> |
25 | <%= button 'menu-ctrl-panel', _('Control panel of this group'), membership.admin_url %> | 25 | <%= button 'menu-ctrl-panel', _('Control panel of this group'), membership.admin_url %> |
app/views/profile/_common.rhtml
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | </script> | 9 | </script> |
10 | 10 | ||
11 | <% unless @action %> | 11 | <% unless @action %> |
12 | - <% cache_timeout(profile.cache_key + '-profile-general-info', 4.hours.from_now) do %> | 12 | + <% cache_timeout(profile.cache_key + '-profile-general-info', 4.hours) do %> |
13 | <tr> | 13 | <tr> |
14 | <th colspan='2'> | 14 | <th colspan='2'> |
15 | <%= _('Content') %> | 15 | <%= _('Content') %> |
app/views/profile/_person_profile.rhtml
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | <%= display_field(_('e-Mail:'), profile, :email, true) { |email| link_to_email(email) } %> | 23 | <%= display_field(_('e-Mail:'), profile, :email, true) { |email| link_to_email(email) } %> |
24 | <% end %> | 24 | <% end %> |
25 | 25 | ||
26 | - <% cache_timeout(profile.relationships_cache_key, 4.hours.from_now) do %> | 26 | + <% cache_timeout(profile.relationships_cache_key, 4.hours) do %> |
27 | <% if !(profile.organization.blank? && profile.organization_website.blank?) && (profile.active_fields.include?('organization') || profile.active_fields.include?('organization_website')) %> | 27 | <% if !(profile.organization.blank? && profile.organization_website.blank?) && (profile.active_fields.include?('organization') || profile.active_fields.include?('organization_website')) %> |
28 | <tr> | 28 | <tr> |
29 | <th colspan='2'><%= _('Work')%></th> | 29 | <th colspan='2'><%= _('Work')%></th> |
app/views/profile/_profile.rhtml
1 | <tr> | 1 | <tr> |
2 | <td colspan='2'> | 2 | <td colspan='2'> |
3 | 3 | ||
4 | - <% plugins_tabs = @plugins.map(:profile_tabs). | 4 | + <% plugins_tabs = @plugins.dispatch(:profile_tabs). |
5 | map { |tab| {:title => tab[:title], :id => tab[:id], :content => instance_eval(&tab[:content]), :start => tab[:title]} }%> | 5 | map { |tab| {:title => tab[:title], :id => tab[:id], :content => instance_eval(&tab[:content]), :start => tab[:title]} }%> |
6 | 6 | ||
7 | <% tabs = plugins_tabs.select { |tab| tab[:start] } %> | 7 | <% tabs = plugins_tabs.select { |tab| tab[:start] } %> |
app/views/profile/communities.rhtml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | 2 | ||
3 | <h1><%= _("%s's communities") % profile.name %></h1> | 3 | <h1><%= _("%s's communities") % profile.name %></h1> |
4 | 4 | ||
5 | -<% cache_timeout(profile.communities_cache_key(params), 4.hour.from_now) do %> | 5 | +<% cache_timeout(profile.communities_cache_key(params), 4.hour) do %> |
6 | <ul class='profile-list'> | 6 | <ul class='profile-list'> |
7 | <% @communities.each do |community| %> | 7 | <% @communities.each do |community| %> |
8 | <li><%= profile_image_link(community)%></li> | 8 | <li><%= profile_image_link(community)%></li> |
app/views/profile/content_tagged.rhtml
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | <%= link_to image_tag('icons-mime/rss-feed.png', :alt => _('Feed for this tag'), :title => _('Feed for this tag')), tag_feed_path, :class => 'blog-feed-link'%> | 6 | <%= link_to image_tag('icons-mime/rss-feed.png', :alt => _('Feed for this tag'), :title => _('Feed for this tag')), tag_feed_path, :class => 'blog-feed-link'%> |
7 | </p> | 7 | </p> |
8 | 8 | ||
9 | -<% cache_timeout(@tag_cache_key, 4.hour.from_now) do %> | 9 | +<% cache_timeout(@tag_cache_key, 4.hour) do %> |
10 | <div class='search-tagged-items'> | 10 | <div class='search-tagged-items'> |
11 | <ul> | 11 | <ul> |
12 | <% for doc in @tagged %> | 12 | <% for doc in @tagged %> |
app/views/profile/friends.rhtml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | 2 | ||
3 | <h1><%= __("%s's friends") % profile.name %></h1> | 3 | <h1><%= __("%s's friends") % profile.name %></h1> |
4 | 4 | ||
5 | -<% cache_timeout(profile.friends_cache_key(params), 4.hours.from_now) do %> | 5 | +<% cache_timeout(profile.friends_cache_key(params), 4.hours) do %> |
6 | <ul class='profile-list'> | 6 | <ul class='profile-list'> |
7 | <% @friends.each do |friend| %> | 7 | <% @friends.each do |friend| %> |
8 | <%= profile_image_link(friend) %> | 8 | <%= profile_image_link(friend) %> |
app/views/profile/members.rhtml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | 2 | ||
3 | <h1><%= _("%s's members") % profile.name %></h1> | 3 | <h1><%= _("%s's members") % profile.name %></h1> |
4 | 4 | ||
5 | -<% cache_timeout(profile.members_cache_key(params), 4.hours.from_now) do %> | 5 | +<% cache_timeout(profile.members_cache_key(params), 4.hours) do %> |
6 | <ul class='profile-list'> | 6 | <ul class='profile-list'> |
7 | <% @members.each do |member| %> | 7 | <% @members.each do |member| %> |
8 | <%= profile_image_link(member) %> | 8 | <%= profile_image_link(member) %> |
app/views/profile/tags.rhtml
1 | <h1><%= _("%s's tags") % @profile.name %></h1> | 1 | <h1><%= _("%s's tags") % @profile.name %></h1> |
2 | 2 | ||
3 | <div class='tag_cloud'> | 3 | <div class='tag_cloud'> |
4 | -<% cache_timeout(@tags_cache_key, 4.hour.from_now) do %> | 4 | +<% cache_timeout(@tags_cache_key, 4.hour) do %> |
5 | <%= tag_cloud @tags, :id, { :action => :tags }, {:show_count => true} %> | 5 | <%= tag_cloud @tags, :id, { :action => :tags }, {:show_count => true} %> |
6 | <% end %> | 6 | <% end %> |
7 | </div> | 7 | </div> |
app/views/profile_editor/edit.rhtml
@@ -82,7 +82,7 @@ | @@ -82,7 +82,7 @@ | ||
82 | )%> | 82 | )%> |
83 | 83 | ||
84 | <%= | 84 | <%= |
85 | - @plugins.map(:profile_editor_extras).each do |content| | 85 | + @plugins.dispatch(:profile_editor_extras).each do |content| |
86 | content.respond_to?(:call) ? content.call : content | 86 | content.respond_to?(:call) ? content.call : content |
87 | end.join("\n") | 87 | end.join("\n") |
88 | %> | 88 | %> |
app/views/profile_editor/index.rhtml
@@ -66,7 +66,7 @@ | @@ -66,7 +66,7 @@ | ||
66 | 66 | ||
67 | <%= control_panel_button(_('Manage my groups'), 'groups', :controller => 'memberships') if profile.person? %> | 67 | <%= control_panel_button(_('Manage my groups'), 'groups', :controller => 'memberships') if profile.person? %> |
68 | 68 | ||
69 | - <% @plugins.map(:control_panel_buttons).each do |button| %> | 69 | + <% @plugins.dispatch(:control_panel_buttons).each do |button| %> |
70 | <%= control_panel_button(button[:title], button[:icon], button[:url]) %> | 70 | <%= control_panel_button(button[:title], button[:icon], button[:url]) %> |
71 | <% end %> | 71 | <% end %> |
72 | 72 |
app/views/profile_members/_index_buttons.rhtml
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | <%= button :search, _('Invite your friends to join %s') % profile.short_name, :controller => 'invite', :action => 'select_address_book' %> | 5 | <%= button :search, _('Invite your friends to join %s') % profile.short_name, :controller => 'invite', :action => 'select_address_book' %> |
6 | <% end %> | 6 | <% end %> |
7 | <%= button :send, _('Send e-mail to members'), :action => 'send_mail' %> | 7 | <%= button :send, _('Send e-mail to members'), :action => 'send_mail' %> |
8 | - <% @plugins.map(:manage_members_extra_buttons).each do |plugin_button| %> | 8 | + <% @plugins.dispatch(:manage_members_extra_buttons).each do |plugin_button| %> |
9 | <%= button plugin_button[:icon], plugin_button[:title], plugin_button[:url] %> | 9 | <%= button plugin_button[:icon], plugin_button[:title], plugin_button[:url] %> |
10 | <% end %> | 10 | <% end %> |
11 | <% end %> | 11 | <% end %> |
app/views/profile_members/_members_list.rhtml
1 | <% collection = @collection == :profile_admins ? profile.admins : profile.members %> | 1 | <% collection = @collection == :profile_admins ? profile.admins : profile.members %> |
2 | -<% title = @title ? @title : "Current members" %> | 2 | +<% title = @title ? @title : _('Current members') %> |
3 | <% remove_action = @remove_action ? @remove_action : {:action => 'unassociate'} %> | 3 | <% remove_action = @remove_action ? @remove_action : {:action => 'unassociate'} %> |
4 | 4 | ||
5 | -<h3><%= _(title) %></h3> | 5 | +<h3><%= title %></h3> |
6 | 6 | ||
7 | <table> | 7 | <table> |
8 | <tr> | 8 | <tr> |
app/views/search/_product.rhtml
@@ -5,8 +5,8 @@ product_item_pos = 0 if ! product_item_pos | @@ -5,8 +5,8 @@ product_item_pos = 0 if ! product_item_pos | ||
5 | product_item_pos += 1 | 5 | product_item_pos += 1 |
6 | %> | 6 | %> |
7 | 7 | ||
8 | -<% extra_content = @plugins.map(:asset_product_extras, product, product.enterprise).collect { |content| instance_eval(&content) } %> | ||
9 | -<% extra_properties = @plugins.map(:asset_product_properties, product)%> | 8 | +<% extra_content = @plugins.dispatch(:asset_product_extras, product, product.enterprise).collect { |content| instance_eval(&content) } %> |
9 | +<% extra_properties = @plugins.dispatch(:asset_product_properties, product)%> | ||
10 | 10 | ||
11 | <li class="product-item <%= ( pos % 2 == 0 ) ? 'odd' : 'even' %>"> | 11 | <li class="product-item <%= ( pos % 2 == 0 ) ? 'odd' : 'even' %>"> |
12 | <%= link_to_product product, :class => 'product-pic', :style => 'background-image:url(%s)' % product.default_image(:minor) %> | 12 | <%= link_to_product product, :class => 'product-pic', :style => 'background-image:url(%s)' % product.default_image(:minor) %> |
app/views/search/tag.rhtml
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | <%= button('back', _('Back to tag cloud'), :action => 'tags') %> | 6 | <%= button('back', _('Back to tag cloud'), :action => 'tags') %> |
7 | <% end %> | 7 | <% end %> |
8 | 8 | ||
9 | -<% cache_timeout(@tag_cache_key, 4.hour.from_now) do %> | 9 | +<% cache_timeout(@tag_cache_key, 4.hour) do %> |
10 | <div class='search-tagged-items'> | 10 | <div class='search-tagged-items'> |
11 | <% @tagged.each do |hit| %> | 11 | <% @tagged.each do |hit| %> |
12 | <ul class="clean-list"> | 12 | <ul class="clean-list"> |
app/views/search/tags.rhtml
1 | <h1><%= _('Tag cloud') %></h1> | 1 | <h1><%= _('Tag cloud') %></h1> |
2 | 2 | ||
3 | <div class='tag_cloud'> | 3 | <div class='tag_cloud'> |
4 | -<% cache_timeout(@tags_cache_key, 4.hour.from_now) do %> | 4 | +<% cache_timeout(@tags_cache_key, 4.hour) do %> |
5 | <%= tag_cloud @tags, :tag, {:action => 'tag'}, {:show_count => true} %> | 5 | <%= tag_cloud @tags, :tag, {:action => 'tag'}, {:show_count => true} %> |
6 | <% end %> | 6 | <% end %> |
7 | </div> | 7 | </div> |
app/views/shared/articles_list.rhtml
@@ -11,4 +11,4 @@ | @@ -11,4 +11,4 @@ | ||
11 | <% end %> | 11 | <% end %> |
12 | </table> | 12 | </table> |
13 | 13 | ||
14 | -<p><%= pagination_links(articles, {:param_name => 'npage', :prev_label => '« ' + _('Previous'), :next_label => _('Next') + ' »', :page_links => true}) %></p> | 14 | +<p><%= pagination_links(articles, {:param_name => 'npage', :page_links => true}) %></p> |
app/views/shared/block.rhtml
1 | <% if block.cacheable? && use_cache %> | 1 | <% if block.cacheable? && use_cache %> |
2 | - <% cache_timeout(block.cache_key, block.timeout.from_now) do %> | 2 | + <% cache_timeout(block.cache_key, block.timeout) do %> |
3 | <%= display_block_content(block, user, main_content) %> | 3 | <%= display_block_content(block, user, main_content) %> |
4 | <% end %> | 4 | <% end %> |
5 | <% else %> | 5 | <% else %> |
config/boot.rb
@@ -108,8 +108,9 @@ end | @@ -108,8 +108,9 @@ end | ||
108 | # yeah, I know, I shouldn't change this file. But ... | 108 | # yeah, I know, I shouldn't change this file. But ... |
109 | def install_debian_rails | 109 | def install_debian_rails |
110 | local_rails = File.dirname(__FILE__) + '/../vendor/rails' | 110 | local_rails = File.dirname(__FILE__) + '/../vendor/rails' |
111 | - debian_rails = '/usr/share/rails' | 111 | + debian_rails = ['/usr/share/rails-ruby1.8', '/usr/lib/ruby/vendor_ruby/rails'].find { |d| File.exists?(d) } |
112 | if !File.exist?(local_rails) && File.exists?(debian_rails) | 112 | if !File.exist?(local_rails) && File.exists?(debian_rails) |
113 | + File.delete(local_rails) if File.symlink?(local_rails) # remove dangling symlink | ||
113 | puts "I: Installing Debian-installed Rails from /usr/share/rails into vendor/rails." | 114 | puts "I: Installing Debian-installed Rails from /usr/share/rails into vendor/rails." |
114 | recommended_rails_version = Rails::GemBoot.gem_version | 115 | recommended_rails_version = Rails::GemBoot.gem_version |
115 | puts "I: Please note that the recommended Rails version is #{recommended_rails_version}, and that other versions might not work" | 116 | puts "I: Please note that the recommended Rails version is #{recommended_rails_version}, and that other versions might not work" |
config/environment.rb
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | #ENV['RAILS_ENV'] ||= 'production' | 5 | #ENV['RAILS_ENV'] ||= 'production' |
6 | 6 | ||
7 | # Specifies gem version of Rails to use when vendor/rails is not present | 7 | # Specifies gem version of Rails to use when vendor/rails is not present |
8 | -RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION | 8 | +RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION |
9 | 9 | ||
10 | # Bootstrap the Rails environment, frameworks, and default configuration | 10 | # Bootstrap the Rails environment, frameworks, and default configuration |
11 | require File.join(File.dirname(__FILE__), 'boot') | 11 | require File.join(File.dirname(__FILE__), 'boot') |
@@ -19,7 +19,10 @@ extra_controller_dirs = %w[ | @@ -19,7 +19,10 @@ extra_controller_dirs = %w[ | ||
19 | ].map {|item| File.join(RAILS_ROOT, item) } | 19 | ].map {|item| File.join(RAILS_ROOT, item) } |
20 | 20 | ||
21 | def noosfero_session_secret | 21 | def noosfero_session_secret |
22 | - file = File.join(File.dirname(__FILE__), '/../tmp/session.secret') | 22 | + require 'fileutils' |
23 | + target_dir = File.join(File.dirname(__FILE__), '/../tmp') | ||
24 | + FileUtils.mkdir_p(target_dir) | ||
25 | + file = File.join(target_dir, 'session.secret') | ||
23 | if !File.exists?(file) | 26 | if !File.exists?(file) |
24 | secret = (1..128).map { %w[0 1 2 3 4 5 6 7 8 9 a b c d e f][rand(16)] }.join('') | 27 | secret = (1..128).map { %w[0 1 2 3 4 5 6 7 8 9 a b c d e f][rand(16)] }.join('') |
25 | File.open(file, 'w') do |f| | 28 | File.open(file, 'w') do |f| |
@@ -63,8 +66,11 @@ Rails::Initializer.run do |config| | @@ -63,8 +66,11 @@ Rails::Initializer.run do |config| | ||
63 | noosfero:translations:compile | 66 | noosfero:translations:compile |
64 | makemo | 67 | makemo |
65 | ] | 68 | ] |
66 | - unless $PROGRAM_NAME =~ /rake$/ && (ignore_rake_commands.include?(ARGV.first)) | ||
67 | - config.active_record.observers = :article_sweeper, :role_assignment_sweeper, :friendship_sweeper, :category_sweeper | 69 | + if $PROGRAM_NAME =~ /rake$/ && (ignore_rake_commands.include?(ARGV.first)) |
70 | + $NOOSFERO_LOAD_PLUGINS = false | ||
71 | + else | ||
72 | + $NOOSFERO_LOAD_PLUGINS = true | ||
73 | + config.active_record.observers = :article_sweeper, :role_assignment_sweeper, :friendship_sweeper, :category_sweeper, :block_sweeper | ||
68 | end | 74 | end |
69 | # Make Active Record use UTC-base instead of local time | 75 | # Make Active Record use UTC-base instead of local time |
70 | # config.active_record.default_timezone = :utc | 76 | # config.active_record.default_timezone = :utc |
@@ -92,7 +98,7 @@ Rails::Initializer.run do |config| | @@ -92,7 +98,7 @@ Rails::Initializer.run do |config| | ||
92 | end | 98 | end |
93 | end | 99 | end |
94 | extra_controller_dirs.each do |item| | 100 | extra_controller_dirs.each do |item| |
95 | - Dependencies.load_paths << item | 101 | + (ActiveSupport.const_defined?('Dependencies') ? ActiveSupport::Dependencies : ::Dependencies).load_paths << item |
96 | end | 102 | end |
97 | 103 | ||
98 | # Add new inflection rules using the following format | 104 | # Add new inflection rules using the following format |
@@ -108,16 +114,6 @@ end | @@ -108,16 +114,6 @@ end | ||
108 | 114 | ||
109 | ActiveRecord::Base.store_full_sti_class = true | 115 | ActiveRecord::Base.store_full_sti_class = true |
110 | 116 | ||
111 | -Noosfero.locales = { | ||
112 | - 'en' => 'English', | ||
113 | - 'pt' => 'Português', | ||
114 | - 'fr' => 'Français', | ||
115 | - 'hy' => 'հայերեն լեզու', | ||
116 | - 'de' => 'Deutsch', | ||
117 | - 'ru' => 'русский язык', | ||
118 | - 'es' => 'Español', | ||
119 | - 'eo' => 'Esperanto' | ||
120 | -} | ||
121 | # if you want to override this, do it in config/local.rb ! | 117 | # if you want to override this, do it in config/local.rb ! |
122 | Noosfero.default_locale = nil | 118 | Noosfero.default_locale = nil |
123 | 119 |
config/environments/cucumber.rb
@@ -18,12 +18,3 @@ config.action_controller.allow_forgery_protection = false | @@ -18,12 +18,3 @@ config.action_controller.allow_forgery_protection = false | ||
18 | # The :test delivery method accumulates sent emails in the | 18 | # The :test delivery method accumulates sent emails in the |
19 | # ActionMailer::Base.deliveries array. | 19 | # ActionMailer::Base.deliveries array. |
20 | config.action_mailer.delivery_method = :test | 20 | config.action_mailer.delivery_method = :test |
21 | - | ||
22 | -config.gem 'cucumber', :lib => false, :version => '0.4.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber')) | ||
23 | -config.gem 'webrat', :lib => false, :version => '0.5.1' unless File.directory?(File.join(Rails.root, 'vendor/plugins/webrat')) | ||
24 | -config.gem 'rspec', :lib => 'spec', :version => '1.2.9' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec')) | ||
25 | -config.gem 'rspec-rails', :lib => 'spec/rails', :version => '1.2.9' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec-rails')) | ||
26 | -config.gem 'Selenium', :lib => 'selenium', :version => '>= 1.1.14' unless File.directory?(File.join(Rails.root, 'vendor/plugins/selenium')) | ||
27 | -config.gem 'selenium-client', :lib => 'selenium/client', :version => '>= 1.2.17' unless File.directory?(File.join(Rails.root, 'vendor/plugins/selenium-client')) | ||
28 | -config.gem 'database_cleaner', :lib => 'database_cleaner' | ||
29 | - |
config/environments/test.rb
@@ -20,5 +20,3 @@ config.action_controller.allow_forgery_protection = false | @@ -20,5 +20,3 @@ config.action_controller.allow_forgery_protection = false | ||
20 | # The :test delivery method accumulates sent emails in the | 20 | # The :test delivery method accumulates sent emails in the |
21 | # ActionMailer::Base.deliveries array. | 21 | # ActionMailer::Base.deliveries array. |
22 | config.action_mailer.delivery_method = :test | 22 | config.action_mailer.delivery_method = :test |
23 | - | ||
24 | -config.gem 'exception_notification', :lib => 'exception_notification', :version => '1.0.20090728' |
config/initializers/delayed_job_config.rb
config/initializers/image_uploads.rb
1 | if File.writable?(Rails.root) | 1 | if File.writable?(Rails.root) |
2 | - misplaced_directories = Dir.glob(Rails.root + '/public/images/[0-9]*') | 2 | + misplaced_directories = Dir.glob(Rails.root.join('public/images/[0-9]*')) |
3 | unless misplaced_directories.empty? | 3 | unless misplaced_directories.empty? |
4 | - new_location = Rails.root + '/public/image_uploads' | 4 | + new_location = Rails.root.join('public/image_uploads') |
5 | if !File.exists?(new_location) | 5 | if !File.exists?(new_location) |
6 | FileUtils.mkdir(new_location) | 6 | FileUtils.mkdir(new_location) |
7 | end | 7 | end |
config/initializers/plugins.rb
@@ -3,4 +3,4 @@ require 'noosfero/plugin/manager' | @@ -3,4 +3,4 @@ require 'noosfero/plugin/manager' | ||
3 | require 'noosfero/plugin/context' | 3 | require 'noosfero/plugin/context' |
4 | require 'noosfero/plugin/active_record' | 4 | require 'noosfero/plugin/active_record' |
5 | require 'noosfero/plugin/mailer_base' | 5 | require 'noosfero/plugin/mailer_base' |
6 | -Noosfero::Plugin.init_system | 6 | +Noosfero::Plugin.init_system if $NOOSFERO_LOAD_PLUGINS |
@@ -0,0 +1,224 @@ | @@ -0,0 +1,224 @@ | ||
1 | +# Arabic translations for Ruby on Rails | ||
2 | +# by Rida Al Barazi (me@rida.me) | ||
3 | +# updated by Ahmed Hazem (nardgo@gmail.com) | ||
4 | +# Rails 3 edit by rbjarnason | ||
5 | + | ||
6 | +"ar": | ||
7 | + date: | ||
8 | + formats: | ||
9 | + default: "%Y-%m-%d" | ||
10 | + short: "%e %b" | ||
11 | + long: "%B %e, %Y" | ||
12 | + | ||
13 | + day_names: | ||
14 | + - الأحد | ||
15 | + - الإثنين | ||
16 | + - الثلاثاء | ||
17 | + - الأربعاء | ||
18 | + - الخميس | ||
19 | + - الجمعة | ||
20 | + - السبت | ||
21 | + abbr_day_names: | ||
22 | + - الأحد | ||
23 | + - الإثنين | ||
24 | + - الثلاثاء | ||
25 | + - الأربعاء | ||
26 | + - الخميس | ||
27 | + - الجمعة | ||
28 | + - السبت | ||
29 | + | ||
30 | + month_names: | ||
31 | + - ~ | ||
32 | + - يناير | ||
33 | + - فبراير | ||
34 | + - مارس | ||
35 | + - ابريل | ||
36 | + - مايو | ||
37 | + - يونيو | ||
38 | + - يوليو | ||
39 | + - اغسطس | ||
40 | + - سبتمبر | ||
41 | + - اكتوبر | ||
42 | + - نوفمبر | ||
43 | + - ديسمبر | ||
44 | + abbr_month_names: | ||
45 | + - ~ | ||
46 | + - يناير | ||
47 | + - فبراير | ||
48 | + - مارس | ||
49 | + - ابريل | ||
50 | + - مايو | ||
51 | + - يونيو | ||
52 | + - يوليو | ||
53 | + - اغسطس | ||
54 | + - سبتمبر | ||
55 | + - اكتوبر | ||
56 | + - نوفمبر | ||
57 | + - ديسمبر | ||
58 | + order: | ||
59 | + - :day | ||
60 | + - :month | ||
61 | + - :year | ||
62 | + | ||
63 | + time: | ||
64 | + formats: | ||
65 | + default: "%a %b %d %H:%M:%S %Z %Y" | ||
66 | + short: "%d %b %H:%M" | ||
67 | + long: "%B %d, %Y %H:%M" | ||
68 | + am: 'صباحا' | ||
69 | + pm: 'مساءا' | ||
70 | + | ||
71 | + support: | ||
72 | + array: | ||
73 | + words_connector: ", " | ||
74 | + two_words_connector: " و " | ||
75 | + last_word_connector: ", و " | ||
76 | + | ||
77 | + select: | ||
78 | + prompt: "الرجاء اختيار" | ||
79 | + | ||
80 | + number: | ||
81 | + format: | ||
82 | + separator: "." | ||
83 | + delimiter: "," | ||
84 | + precision: 3 | ||
85 | + significant: false | ||
86 | + strip_insignificant_zeros: false | ||
87 | + | ||
88 | + currency: | ||
89 | + format: | ||
90 | + format: "%u%n" | ||
91 | + unit: "$" | ||
92 | + separator: "." | ||
93 | + delimiter: "," | ||
94 | + precision: 2 | ||
95 | + significant: false | ||
96 | + strip_insignificant_zeros: false | ||
97 | + | ||
98 | + percentage: | ||
99 | + format: | ||
100 | + delimiter: "" | ||
101 | + | ||
102 | + precision: | ||
103 | + format: | ||
104 | + delimiter: "" | ||
105 | + | ||
106 | + human: | ||
107 | + format: | ||
108 | + delimiter: "" | ||
109 | + precision: 3 | ||
110 | + significant: true | ||
111 | + strip_insignificant_zeros: true | ||
112 | + storage_units: | ||
113 | + format: "%n %u" | ||
114 | + units: | ||
115 | + byte: | ||
116 | + one: "Byte" | ||
117 | + other: "Bytes" | ||
118 | + kb: "KB" | ||
119 | + mb: "MB" | ||
120 | + gb: "GB" | ||
121 | + tb: "TB" | ||
122 | + decimal_units: | ||
123 | + format: "%n %u" | ||
124 | + units: | ||
125 | + unit: "" | ||
126 | + thousand: ألف | ||
127 | + million: مليون | ||
128 | + billion: مليار | ||
129 | + trillion: تريليون | ||
130 | + quadrillion: الكدريليون رقم | ||
131 | + | ||
132 | + datetime: | ||
133 | + distance_in_words: | ||
134 | + half_a_minute: 'نصف دقيقة' | ||
135 | + less_than_x_seconds: | ||
136 | + one: 'أقل من ثانية' | ||
137 | + other: '%{count} ثوان' | ||
138 | + x_seconds: | ||
139 | + one: 'ثانية واحدة' | ||
140 | + other: '%{count} ثوان' | ||
141 | + less_than_x_minutes: | ||
142 | + one: 'أقل من دقيقة' | ||
143 | + other: '%{count} دقائق' | ||
144 | + x_minutes: | ||
145 | + one: 'دقيقة واحدة' | ||
146 | + other: '%{count} دقائق' | ||
147 | + about_x_hours: | ||
148 | + one: 'حوالي ساعة واحدة' | ||
149 | + other: '%{count} ساعات' | ||
150 | + x_days: | ||
151 | + one: 'يوم واحد' | ||
152 | + other: '%{count} أيام' | ||
153 | + about_x_months: | ||
154 | + one: 'حوالي شهر واحد' | ||
155 | + other: '%{count} أشهر' | ||
156 | + x_months: | ||
157 | + one: 'شهر واحد' | ||
158 | + other: '%{count} أشهر' | ||
159 | + about_x_years: | ||
160 | + one: 'حوالي سنة' | ||
161 | + other: '%{count} سنوات' | ||
162 | + over_x_years: | ||
163 | + one: 'أكثر من سنة' | ||
164 | + other: '%{count} سنوات' | ||
165 | + almost_x_years: | ||
166 | + one: "تقريبا سنة واحدة" | ||
167 | + other: "ما يقرب من %{count} سنة" | ||
168 | + prompts: | ||
169 | + year: "السنة" | ||
170 | + month: "الشهر" | ||
171 | + day: "اليوم" | ||
172 | + hour: "ساعة" | ||
173 | + minute: "دقيقة" | ||
174 | + second: "ثانية" | ||
175 | + | ||
176 | + helpers: | ||
177 | + select: | ||
178 | + prompt: "الرجاء اختيار" | ||
179 | + | ||
180 | + submit: | ||
181 | + create: "%{model} إنشاء" | ||
182 | + update: "%{model} نموذج" | ||
183 | + submit: "%{model} حفظ" | ||
184 | + | ||
185 | + errors: | ||
186 | + format: "%{attribute} %{message}" | ||
187 | + | ||
188 | + messages: &errors_messages | ||
189 | + inclusion: "ليس خيارا مقبولا" | ||
190 | + exclusion: "محجوز" | ||
191 | + invalid: "غير معرف أو محدد" | ||
192 | + confirmation: "لا تتوافق مع التأكيد" | ||
193 | + accepted: "يجب أن تقبل" | ||
194 | + empty: "فارغ، يرجى ملء الحقل" | ||
195 | + blank: "فارغ، يرجى ملء الحقل" | ||
196 | + too_long: "أطول من اللازم (الحد الأقصى هو %{count})" | ||
197 | + too_short: "أقصر من اللازم (الحد الأدنى هو %{count})" | ||
198 | + wrong_length: "بطول غير مناسب (يجب أن يكون %{count})" | ||
199 | + not_an_integer: "يجب أن يكون صحيحا" | ||
200 | + not_a_number: "ليس رقما" | ||
201 | + greater_than: "يجب أن يكون أكبر من %{count}" | ||
202 | + greater_than_or_equal_to: "يجب أن يكون أكبر من أو يساوي %{count}" | ||
203 | + equal_to: "يجب أن يساوي %{count}" | ||
204 | + less_than: "يجب أن يكون أصغر من %{count}" | ||
205 | + less_than_or_equal_to: "يجب أن يكون أصغر من أو يساوي %{count}" | ||
206 | + odd: "يجب أن يكون فردي" | ||
207 | + even: "يجب أن يكون زوجي" | ||
208 | + taken: "غير متوفر (مستخدم)" | ||
209 | + record_invalid: "%{errors} فشل التحقق من صحة" | ||
210 | + template: &errors_template | ||
211 | + header: | ||
212 | + one: "ليس بالامكان حفظ %{model}: خطأ واحد." | ||
213 | + other: "ليس بالامكان حفظ %{model}: %{count} أخطاء." | ||
214 | + body: "يرجى التحقق من الحقول التالية:" | ||
215 | + | ||
216 | + activerecord: | ||
217 | + errors: | ||
218 | + messages: | ||
219 | + <<: *errors_messages | ||
220 | + template: | ||
221 | + <<: *errors_template | ||
222 | + | ||
223 | + full_messages: | ||
224 | + format: "%{attribute} %{message}" |
@@ -0,0 +1,222 @@ | @@ -0,0 +1,222 @@ | ||
1 | +# Azerbaijani translations for Ruby on Rails | ||
2 | +# by Nihad Abbasov (mail@narkoz.me) | ||
3 | + | ||
4 | +az: | ||
5 | + date: | ||
6 | + formats: | ||
7 | + default: "%d.%m.%Y" | ||
8 | + short: "%d %b" | ||
9 | + long: "%d %B %Y" | ||
10 | + | ||
11 | + day_names: | ||
12 | + - Bazar | ||
13 | + - Bazar ertəsi | ||
14 | + - Çərşənbə axşamı | ||
15 | + - Çərşənbə | ||
16 | + - Cümə axşamı | ||
17 | + - Cümə | ||
18 | + - Şənbə | ||
19 | + abbr_day_names: | ||
20 | + - B. | ||
21 | + - B.E. | ||
22 | + - Ç.A. | ||
23 | + - Ç. | ||
24 | + - C.A. | ||
25 | + - C. | ||
26 | + - Ş. | ||
27 | + | ||
28 | + month_names: | ||
29 | + - ~ | ||
30 | + - Yanvar | ||
31 | + - Fevral | ||
32 | + - Mart | ||
33 | + - Aprel | ||
34 | + - May | ||
35 | + - İyun | ||
36 | + - İyul | ||
37 | + - Avqust | ||
38 | + - Sentyabr | ||
39 | + - Oktyabr | ||
40 | + - Noyabr | ||
41 | + - Dekabr | ||
42 | + abbr_month_names: | ||
43 | + - ~ | ||
44 | + - Yan | ||
45 | + - Fev | ||
46 | + - Mar | ||
47 | + - Apr | ||
48 | + - May | ||
49 | + - İyn | ||
50 | + - İyl | ||
51 | + - Avq | ||
52 | + - Sen | ||
53 | + - Okt | ||
54 | + - Noy | ||
55 | + - Dek | ||
56 | + order: | ||
57 | + - :day | ||
58 | + - :month | ||
59 | + - :year | ||
60 | + | ||
61 | + time: | ||
62 | + formats: | ||
63 | + default: "%a, %d %b %Y, %H:%M:%S %z" | ||
64 | + short: "%d %b, %H:%M" | ||
65 | + long: "%d %B %Y, %H:%M" | ||
66 | + am: "günortaya qədər" | ||
67 | + pm: "günortadan sonra" | ||
68 | + | ||
69 | + support: | ||
70 | + array: | ||
71 | + words_connector: ", " | ||
72 | + two_words_connector: " və " | ||
73 | + last_word_connector: " və " | ||
74 | + | ||
75 | + select: | ||
76 | + prompt: "Seçin" | ||
77 | + | ||
78 | + number: | ||
79 | + format: | ||
80 | + separator: "." | ||
81 | + delimiter: " " | ||
82 | + precision: 3 | ||
83 | + significant: false | ||
84 | + strip_insignificant_zeros: false | ||
85 | + | ||
86 | + currency: | ||
87 | + format: | ||
88 | + format: "%n %u" | ||
89 | + unit: "AZN" | ||
90 | + separator: "." | ||
91 | + delimiter: " " | ||
92 | + precision: 2 | ||
93 | + significant: false | ||
94 | + strip_insignificant_zeros: false | ||
95 | + | ||
96 | + percentage: | ||
97 | + format: | ||
98 | + delimiter: "" | ||
99 | + | ||
100 | + precision: | ||
101 | + format: | ||
102 | + delimiter: "" | ||
103 | + | ||
104 | + human: | ||
105 | + format: | ||
106 | + delimiter: "" | ||
107 | + precision: 1 | ||
108 | + significant: false | ||
109 | + strip_insignificant_zeros: false | ||
110 | + storage_units: | ||
111 | + format: "%n %u" | ||
112 | + units: | ||
113 | + byte: | ||
114 | + one: "Bayt" | ||
115 | + other: "Bayt" | ||
116 | + kb: "KB" | ||
117 | + mb: "MB" | ||
118 | + gb: "GB" | ||
119 | + tb: "TB" | ||
120 | + decimal_units: | ||
121 | + format: "%n %u" | ||
122 | + units: | ||
123 | + unit: "" | ||
124 | + thousand: Min | ||
125 | + million: Milyon | ||
126 | + billion: Milyard | ||
127 | + trillion: Trilyon | ||
128 | + quadrillion: Katrilyon | ||
129 | + | ||
130 | + datetime: | ||
131 | + distance_in_words: | ||
132 | + half_a_minute: "yarım dəqiqə" | ||
133 | + less_than_x_seconds: | ||
134 | + one: "1 saniyədən az" | ||
135 | + other: "%{count} saniyədən az" | ||
136 | + x_seconds: | ||
137 | + one: "1 saniyə" | ||
138 | + other: "%{count} saniyə" | ||
139 | + less_than_x_minutes: | ||
140 | + one: "1 dəqiqədən az" | ||
141 | + other: "%{count} dəqiqədən az" | ||
142 | + x_minutes: | ||
143 | + one: "1 dəqiqə" | ||
144 | + other: "%{count} dəqiqə" | ||
145 | + about_x_hours: | ||
146 | + one: "təxminən 1 saat" | ||
147 | + other: "təxminən %{count} saat" | ||
148 | + x_days: | ||
149 | + one: "1 gün" | ||
150 | + other: "%{count} gün" | ||
151 | + about_x_months: | ||
152 | + one: "təxminən 1 ay" | ||
153 | + other: "təxminən %{count} ay" | ||
154 | + x_months: | ||
155 | + one: "1 ay" | ||
156 | + other: "%{count} ay" | ||
157 | + about_x_years: | ||
158 | + one: "təxminən 1 il" | ||
159 | + other: "təxminən %{count} il" | ||
160 | + over_x_years: | ||
161 | + one: "1 ildən çox" | ||
162 | + other: "%{count} ildən çox" | ||
163 | + almost_x_years: | ||
164 | + one: "təqribən 1 il" | ||
165 | + other: "təqribən %{count} il" | ||
166 | + prompts: | ||
167 | + year: "İl" | ||
168 | + month: "Ay" | ||
169 | + day: "Gün" | ||
170 | + hour: "Saat" | ||
171 | + minute: "Dəqiqə" | ||
172 | + second: "Saniyə" | ||
173 | + | ||
174 | + helpers: | ||
175 | + select: | ||
176 | + prompt: "Seçin" | ||
177 | + | ||
178 | + submit: | ||
179 | + create: '%{model} yarat' | ||
180 | + update: '%{model} yenilə' | ||
181 | + submit: '%{model} saxla' | ||
182 | + | ||
183 | + errors: | ||
184 | + format: "%{attribute} %{message}" | ||
185 | + | ||
186 | + messages: &errors_messages | ||
187 | + inclusion: "siyahiyə daxil deyil" | ||
188 | + exclusion: "qorunur" | ||
189 | + invalid: "yalnışdır" | ||
190 | + confirmation: "təsdiqə uygun deyil" | ||
191 | + accepted: "qəbul olunmalıdır" | ||
192 | + empty: "boş ola bilməz" | ||
193 | + blank: "boş ola bilməz" | ||
194 | + too_long: "çox uzundur (%{count} simvoldan çox olmalı deyil)" | ||
195 | + too_short: "çox qısadır (%{count} simvoldan az olmalı deyil)" | ||
196 | + wrong_length: "uzunluqu səhvdir (%{count} simvol olmalıdır)" | ||
197 | + not_a_number: "rəqəm deyil" | ||
198 | + not_an_integer: "tam rəqəm olmalıdır" | ||
199 | + greater_than: "%{count}-dən böyük olmalıdır" | ||
200 | + greater_than_or_equal_to: "böyük və ya %{count}-ə bərabər olmalıdır" | ||
201 | + equal_to: "%{count}-ə bərabər olmalıdır" | ||
202 | + less_than: "%{count}-dən kiçik olmalıdır" | ||
203 | + less_than_or_equal_to: "kiçik və ya %{count}-ə bərabər olmalıdır" | ||
204 | + odd: "tək olmalıdır" | ||
205 | + even: "cüt olmalıdır" | ||
206 | + taken: "artıq mövcuddur" | ||
207 | + record_invalid: "Yoxlama uğursuz oldu: %{errors}" | ||
208 | + template: &errors_template | ||
209 | + header: | ||
210 | + one: "%{model} saxlanmadı: 1 səhv" | ||
211 | + other: "%{model} saxlanmadı: %{count} səhv" | ||
212 | + body: "Aşağıdaki səhvlər üzə çıxdı:" | ||
213 | + | ||
214 | + activerecord: | ||
215 | + errors: | ||
216 | + messages: | ||
217 | + <<: *errors_messages | ||
218 | + template: | ||
219 | + <<: *errors_template | ||
220 | + | ||
221 | + full_messages: | ||
222 | + format: "%{attribute} %{message}" |
@@ -0,0 +1,232 @@ | @@ -0,0 +1,232 @@ | ||
1 | +# Full Bulgarian localization for Ruby on Rails 3+ | ||
2 | +# | ||
3 | +# extracted from www.termo.bg | ||
4 | +# supported by Samson Behar <master.webmaster.master@gmail.com> | ||
5 | +# supported by Yavor Ivanov, http://github.com/YavorIvanov | ||
6 | +# supported by Andrew Radev, http://github.com/AndrewRadev | ||
7 | +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. | ||
8 | + | ||
9 | +bg: | ||
10 | + | ||
11 | + # ===== Rails Specific =========================================================================== | ||
12 | + | ||
13 | + date: | ||
14 | + formats: | ||
15 | + default: "%d.%m.%Y" | ||
16 | + short: "%d %b" | ||
17 | + long: "%d %B %Y" | ||
18 | + | ||
19 | + day_names: | ||
20 | + - неделя | ||
21 | + - понеделник | ||
22 | + - вторник | ||
23 | + - сряда | ||
24 | + - четвъртък | ||
25 | + - петък | ||
26 | + - събота | ||
27 | + abbr_day_names: | ||
28 | + - нед | ||
29 | + - пон | ||
30 | + - вт | ||
31 | + - ср | ||
32 | + - чет | ||
33 | + - пет | ||
34 | + - съб | ||
35 | + | ||
36 | + # should start with nil cause there is no 0-th month | ||
37 | + month_names: | ||
38 | + - ~ | ||
39 | + - януари | ||
40 | + - февруари | ||
41 | + - март | ||
42 | + - април | ||
43 | + - май | ||
44 | + - юни | ||
45 | + - юли | ||
46 | + - август | ||
47 | + - септември | ||
48 | + - октомври | ||
49 | + - ноември | ||
50 | + - декември | ||
51 | + abbr_month_names: | ||
52 | + - ~ | ||
53 | + - яну. | ||
54 | + - фев. | ||
55 | + - март | ||
56 | + - апр. | ||
57 | + - май | ||
58 | + - юни | ||
59 | + - юли | ||
60 | + - авг. | ||
61 | + - сеп. | ||
62 | + - окт. | ||
63 | + - ноем. | ||
64 | + - дек. | ||
65 | + order: | ||
66 | + - :day | ||
67 | + - :month | ||
68 | + - :year | ||
69 | + | ||
70 | + time: | ||
71 | + formats: | ||
72 | + default: "%a, %d %b %Y, %H:%M:%S %z" | ||
73 | + short: "%d %b, %H:%M" | ||
74 | + long: "%d %B %Y, %H:%M" | ||
75 | + am: "преди обяд" | ||
76 | + pm: "следобед" | ||
77 | + | ||
78 | + support: | ||
79 | + array: | ||
80 | + words_connector: ", " | ||
81 | + two_words_connector: " и " | ||
82 | + last_word_connector: " и " | ||
83 | + | ||
84 | + select: | ||
85 | + prompt: "Моля отбележете" | ||
86 | + | ||
87 | + number: | ||
88 | + format: | ||
89 | + separator: "," | ||
90 | + delimiter: " " | ||
91 | + precision: 3 | ||
92 | + significant: false | ||
93 | + strip_insignificant_zeros: false | ||
94 | + | ||
95 | + currency: | ||
96 | + format: | ||
97 | + format: "%n %u" | ||
98 | + unit: "лв." | ||
99 | + separator: "," | ||
100 | + delimiter: " " | ||
101 | + precision: 2 | ||
102 | + significant: false | ||
103 | + strip_insignificant_zeros: false | ||
104 | + | ||
105 | + percentage: | ||
106 | + format: | ||
107 | + delimiter: "" | ||
108 | + | ||
109 | + precision: | ||
110 | + format: | ||
111 | + delimiter: "" | ||
112 | + | ||
113 | + human: | ||
114 | + format: | ||
115 | + delimiter: "" | ||
116 | + precision: 1 | ||
117 | + significant: true | ||
118 | + strip_insignificant_zeros: true | ||
119 | + storage_units: | ||
120 | + # Storage units output formatting. | ||
121 | + # %u is the storage unit, %n is the number (default: 2 MB) | ||
122 | + format: "%n %u" | ||
123 | + units: | ||
124 | + byte: | ||
125 | + one: "Байт" | ||
126 | + other: "Байта" | ||
127 | + kb: "КБ" | ||
128 | + mb: "МБ" | ||
129 | + gb: "ГБ" | ||
130 | + tb: "ТБ" | ||
131 | + decimal_units: | ||
132 | + format: "%n %u" | ||
133 | + units: | ||
134 | + unit: "" | ||
135 | + thousand: хиляди | ||
136 | + million: милиона | ||
137 | + billion: милиарда | ||
138 | + trillion: трилиона | ||
139 | + quadrillion: квадрилиона | ||
140 | + | ||
141 | + datetime: | ||
142 | + distance_in_words: | ||
143 | + half_a_minute: "половин минута" | ||
144 | + less_than_x_seconds: | ||
145 | + one: "по-малко от 1 секунда" | ||
146 | + other: "по-малко от %{count} секунди" | ||
147 | + x_seconds: | ||
148 | + one: "1 секунда" | ||
149 | + other: "%{count} секунди" | ||
150 | + less_than_x_minutes: | ||
151 | + one: "по-малко от 1 минута" | ||
152 | + other: "по-малко от %{count} минути" | ||
153 | + x_minutes: | ||
154 | + one: "1 минута" | ||
155 | + other: "%{count} минути" | ||
156 | + about_x_hours: | ||
157 | + one: "около 1 час" | ||
158 | + other: "около %{count} часа" | ||
159 | + x_days: | ||
160 | + one: "1 ден" | ||
161 | + other: "%{count} дни" | ||
162 | + about_x_months: | ||
163 | + one: "около 1 месец" | ||
164 | + other: "около %{count} месеца" | ||
165 | + x_months: | ||
166 | + one: "1 месец" | ||
167 | + other: "%{count} месеца" | ||
168 | + about_x_years: | ||
169 | + one: "около 1 година" | ||
170 | + other: "около %{count} години" | ||
171 | + over_x_years: | ||
172 | + one: "над 1 година" | ||
173 | + other: "над %{count} години" | ||
174 | + almost_x_years: | ||
175 | + one: "почти 1 година" | ||
176 | + other: "почти %{count} години" | ||
177 | + prompts: | ||
178 | + year: "Година" | ||
179 | + month: "Месец" | ||
180 | + day: "Ден" | ||
181 | + hour: "Час" | ||
182 | + minute: "Минута" | ||
183 | + second: "Секунда" | ||
184 | + | ||
185 | + helpers: | ||
186 | + select: | ||
187 | + prompt: "Моля отбележете" | ||
188 | + | ||
189 | + submit: | ||
190 | + create: 'Създай %{model}' | ||
191 | + update: 'Обнови %{model}' | ||
192 | + submit: 'Запази %{model}' | ||
193 | + | ||
194 | + errors: | ||
195 | + format: "%{attribute} %{message}" | ||
196 | + | ||
197 | + messages: &errors_messages | ||
198 | + inclusion: "съдържа непредвидена стойност" | ||
199 | + exclusion: "съдържа предварително зададена стойност" | ||
200 | + invalid: "съдържа невярна стойност" | ||
201 | + confirmation: "не съответства на потвърждението" | ||
202 | + accepted: "трябва да се потвърди" | ||
203 | + empty: "не може да е празно" | ||
204 | + blank: "не може да е без стойност" | ||
205 | + too_long: "е прекаленo дълго (не може да е повече от %{count} символа)" | ||
206 | + too_short: "е прекалено късо (не може да бъде по-малко от %{count} символа)" | ||
207 | + wrong_length: "е с грешна дължина (трябва да е с дължина, равна на %{count} символа)" | ||
208 | + not_a_number: "не е число" | ||
209 | + not_an_integer: "не е цяло число" | ||
210 | + greater_than: "трябва да има стойност, по-голяма от %{count}" | ||
211 | + greater_than_or_equal_to: "трябва да има стойност, по-голяма или равна на %{count}" | ||
212 | + equal_to: "трябва да има стойност, равна на %{count}" | ||
213 | + less_than: "трябва да има стойност, по-малка от %{count}" | ||
214 | + less_than_or_equal_to: "трябва да има стойност, по-голяма или равна на %{count}" | ||
215 | + odd: "трябва да е четно" | ||
216 | + even: "трябва да е нечетно" | ||
217 | + taken: "вече съществува" | ||
218 | + record_invalid: "имаше грешки: %{errors}" | ||
219 | + template: &errors_template | ||
220 | + header: | ||
221 | + one: "%{model}: записа е неуспешен заради 1 грешка" | ||
222 | + other: "%{model}: записа е неуспешен заради %{count} грешки" | ||
223 | + body: "Възникнаха проблеми със следните полета:" | ||
224 | + | ||
225 | + activerecord: | ||
226 | + errors: | ||
227 | + messages: | ||
228 | + <<: *errors_messages | ||
229 | + template: | ||
230 | + <<: *errors_template | ||
231 | + full_messages: | ||
232 | + format: "%{attribute} %{message}" | ||
0 | \ No newline at end of file | 233 | \ No newline at end of file |
@@ -0,0 +1,239 @@ | @@ -0,0 +1,239 @@ | ||
1 | +# Benagli (India) translations for Rails | ||
2 | +# by Arindam Ghosh (makghosh@gmail.com) | ||
3 | + | ||
4 | +bn-IN: | ||
5 | + number: | ||
6 | + # Used in number_with_delimiter() | ||
7 | + # These are also the defaults for 'currency', 'percentage', 'precision', and 'human' | ||
8 | + format: | ||
9 | + # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5) | ||
10 | + separator: "." | ||
11 | + # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three) | ||
12 | + delimiter: "," | ||
13 | + # Number of decimals, behind the separator (1 with a precision of 2 gives: 1.00) | ||
14 | + precision: 2 | ||
15 | + significant: false | ||
16 | + strip_insignificant_zeros: false | ||
17 | + | ||
18 | + # Used in number_to_currency() | ||
19 | + currency: | ||
20 | + format: | ||
21 | + # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00) | ||
22 | + format: "%u %n" | ||
23 | + unit: "₹" | ||
24 | + # These three are to override number.format and are optional | ||
25 | + separator: "." | ||
26 | + delimiter: "," | ||
27 | + precision: 2 | ||
28 | + significant: false | ||
29 | + strip_insignificant_zeros: false | ||
30 | + | ||
31 | + # Used in number_to_percentage() | ||
32 | + percentage: | ||
33 | + format: | ||
34 | + # These three are to override number.format and are optional | ||
35 | + # separator: | ||
36 | + delimiter: "" | ||
37 | + # precision: | ||
38 | + | ||
39 | + # Used in number_to_precision() | ||
40 | + precision: | ||
41 | + format: | ||
42 | + # These three are to override number.format and are optional | ||
43 | + # separator: | ||
44 | + delimiter: "" | ||
45 | + # precision: | ||
46 | + | ||
47 | + # Used in number_to_human_size() | ||
48 | + human: | ||
49 | + format: | ||
50 | + # These three are to override number.format and are optional | ||
51 | + # separator: | ||
52 | + delimiter: "" | ||
53 | + precision: 1 | ||
54 | + significant: true | ||
55 | + strip_insignificant_zeros: true | ||
56 | + # Rails <= v2.2.2 | ||
57 | + # storage_units: [Bytes, KB, MB, GB, TB] | ||
58 | + # Rails >= v2.3 | ||
59 | + storage_units: | ||
60 | + format: "%n %u" | ||
61 | + units: | ||
62 | + byte: | ||
63 | + one: "Byte" | ||
64 | + other: "Bytes" | ||
65 | + kb: "KB" | ||
66 | + mb: "MB" | ||
67 | + gb: "GB" | ||
68 | + tb: "TB" | ||
69 | + decimal_units: | ||
70 | + format: "%n %u" | ||
71 | + units: | ||
72 | + unit: "" | ||
73 | + | ||
74 | + # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words() | ||
75 | + datetime: | ||
76 | + distance_in_words: | ||
77 | + half_a_minute: "অার্ধেক মিনিট" | ||
78 | + less_than_x_seconds: | ||
79 | + one: "১ সেকেন্ডর কম " | ||
80 | + other: "%{count} সেকেন্ডের কম" | ||
81 | + x_seconds: | ||
82 | + one: "১ সেকেন্ড" | ||
83 | + other: "%{count} সেকেন্ড" | ||
84 | + less_than_x_minutes: | ||
85 | + one: "১ মিনিটের কম" | ||
86 | + other: "%{count} মিনিটের কম" | ||
87 | + x_minutes: | ||
88 | + one: "১ মিনিট" | ||
89 | + other: "%{count} মিনিট" | ||
90 | + about_x_hours: | ||
91 | + one: "প্রায় ১ ঘন্টা" | ||
92 | + other: "প্রায় %{count} ঘন্টা" | ||
93 | + x_days: | ||
94 | + one: "১ দিন" | ||
95 | + other: "%{count} দিন" | ||
96 | + about_x_months: | ||
97 | + one: "প্রায় ১ মাস" | ||
98 | + other: "প্রায় %{count} মাস" | ||
99 | + x_months: | ||
100 | + one: "১ মাস" | ||
101 | + other: "%{count} মাস" | ||
102 | + about_x_years: | ||
103 | + one: "প্রায় ১ বছর" | ||
104 | + other: "প্রায় %{count} বছর" | ||
105 | + over_x_years: | ||
106 | + one: "১ বছরের বেশি" | ||
107 | + other: "%{count} বছরের বেশি" | ||
108 | + prompts: | ||
109 | + year: "বছর" | ||
110 | + month: "মাস" | ||
111 | + day: "দিন" | ||
112 | + hour: "ঘন্টা" | ||
113 | + minute: "মিনিট" | ||
114 | + second: "সেকেন্ড" | ||
115 | + | ||
116 | + errors: | ||
117 | + format: "%{attribute} %{message}" | ||
118 | + messages: &errors_messages | ||
119 | + inclusion: "লিস্টে অন্তর্ভুক্ত নয়" | ||
120 | + exclusion: "রিসার্ভ করা অাছে" | ||
121 | + invalid: "সঠিক নয়" | ||
122 | + confirmation: "অনুমোদনের সঙ্গে মিলছে না" | ||
123 | + accepted: "গ্রাহ্য করতে হবে" | ||
124 | + empty: "খালি রাখা যাবে না" | ||
125 | + blank: "ফাঁকা রাখা যাবে না" | ||
126 | + too_long: "খুব বড়ো (সর্বোচ্চ %{count} অক্ষর)" | ||
127 | + too_short: "খুব ছোটো (সর্বনিম্ন %{count} অক্ষর)" | ||
128 | + wrong_length: "দৈর্ঘ্যটি সঠিক নয় (%{count} অক্ষর হতে হবে)" | ||
129 | + taken: "অাগেই নিয়ে নেওয়া হয়েছে" | ||
130 | + not_a_number: "নম্বর নয়" | ||
131 | + greater_than: "%{count} থেকে বড়ো হতে হবে" | ||
132 | + greater_than_or_equal_to: "%{count} থেকে বড়ো অথবা তার সমান হতে হবে" | ||
133 | + equal_to: "%{count} এর সঙ্গে সমান হতে হবে" | ||
134 | + less_than: "%{count} থেকে ছোটো হতে হবে" | ||
135 | + less_than_or_equal_to: "%{count} থেকে ছোটো অথবা তার সমান হতে হবে" | ||
136 | + odd: "বেজোড় হতে হবে" | ||
137 | + even: "জোড় হতে হবে" | ||
138 | + template: &errors_template | ||
139 | + header: | ||
140 | + one: "১ টি ত্রুটির কারনে %{model} সংরক্ষন করা সম্ভব হয়নি" | ||
141 | + other: "%{count} টি ত্রুটির কারনে %{model} সংরক্ষন করা সম্ভব হয়নি" | ||
142 | + body: "এই ফিল্ডগুলোতে কিছু সমস্যা দেখা দিয়েছে:" | ||
143 | + | ||
144 | + activerecord: | ||
145 | + errors: | ||
146 | + messages: | ||
147 | + <<: *errors_messages | ||
148 | + template: | ||
149 | + <<: *errors_template | ||
150 | + full_messages: | ||
151 | + format: "%{attribute} %{message}" | ||
152 | + | ||
153 | + # The values :model, :attribute and :value are always available for interpolation | ||
154 | + # The value :count is available when applicable. Can be used for pluralization. | ||
155 | + | ||
156 | + | ||
157 | + # Append your own errors here or at the model/attributes scope. | ||
158 | + | ||
159 | + # models: | ||
160 | + # Overrides default messages | ||
161 | + | ||
162 | + # attributes: | ||
163 | + # Overrides model and default messages. | ||
164 | + | ||
165 | + date: | ||
166 | + formats: | ||
167 | + # Use the strftime parameters for formats. | ||
168 | + # When no format has been given, it uses default. | ||
169 | + # You can provide other formats here if you like! | ||
170 | + default: "%e/%m/%Y" | ||
171 | + short: "%e de %b" | ||
172 | + long: "%e de %B de %Y" | ||
173 | + | ||
174 | + day_names: | ||
175 | + - রবিবার | ||
176 | + - সোমবার | ||
177 | + - মঙ্গলবার | ||
178 | + - বুধবার | ||
179 | + - বৃহস্পতিবার | ||
180 | + - শুক্রবার | ||
181 | + - শনিবার | ||
182 | + abbr_day_names: | ||
183 | + - রবিবার | ||
184 | + - সোমবার | ||
185 | + - মঙ্গলবার | ||
186 | + - বুধবার | ||
187 | + - বৃহস্পতিবার | ||
188 | + - শুক্রবার | ||
189 | + - শনিবার | ||
190 | + | ||
191 | + # Don't forget the nil at the beginning; there's no such thing as a 0th month | ||
192 | + month_names: | ||
193 | + - ~ | ||
194 | + - জানুয়ারি | ||
195 | + - ফেব্রুয়ারি | ||
196 | + - মার্চ | ||
197 | + - এপ্রিল | ||
198 | + - মে | ||
199 | + - জুন | ||
200 | + - জুলাই | ||
201 | + - অগাস্ট | ||
202 | + - সেপ্টেমবার | ||
203 | + - অক্টোবার | ||
204 | + - নভেম্বার | ||
205 | + - ডিসেম্বার | ||
206 | + abbr_month_names: | ||
207 | + - ~ | ||
208 | + - জানুয়ারি | ||
209 | + - ফেব্রুয়ারি | ||
210 | + - মার্চ | ||
211 | + - এপ্রিল | ||
212 | + - মে | ||
213 | + - জুন | ||
214 | + - জুলাই | ||
215 | + - অগাস্ট | ||
216 | + - সেপ্টেমবার | ||
217 | + - অক্টোবার | ||
218 | + - নভেম্বার | ||
219 | + - ডিসেম্বার | ||
220 | + # Used in date_select and datime_select. | ||
221 | + order: | ||
222 | + - :year | ||
223 | + - :month | ||
224 | + - :day | ||
225 | + | ||
226 | + time: | ||
227 | + formats: | ||
228 | + default: "%A, %e de %B de %Y %H:%M:%S %z" | ||
229 | + short: "%e de %b %H:%M" | ||
230 | + long: "%e de %B de %Y %H:%M" | ||
231 | + am: "am" | ||
232 | + pm: "pm" | ||
233 | + | ||
234 | +# Used in array.to_sentence. | ||
235 | + support: | ||
236 | + array: | ||
237 | + words_connector: ", " | ||
238 | + two_words_connector: " এবং " | ||
239 | + last_word_connector: ", এবং " |
@@ -0,0 +1,250 @@ | @@ -0,0 +1,250 @@ | ||
1 | +# Bosnia and Herzegovina (Bosnian) translations for rails | ||
2 | +# by Armin Pašalić (armin [at] pasalic [dot] com [dot] ba, http://pasalic.com.ba) | ||
3 | + | ||
4 | +# Please take a look at /rails/pluralization/bs.rb for pluralization instructions. | ||
5 | + | ||
6 | +bs: | ||
7 | + date: | ||
8 | + formats: | ||
9 | + default: "%d.%m.%Y." | ||
10 | + short: "%e. %b. %Y." | ||
11 | + long: "%e. %B %Y." | ||
12 | + day_names: | ||
13 | + - nedjelja | ||
14 | + - ponedjeljak | ||
15 | + - utorak | ||
16 | + - srijeda | ||
17 | + - četvrtak | ||
18 | + - petak | ||
19 | + abbr_day_names: | ||
20 | + - ned | ||
21 | + - pon | ||
22 | + - uto | ||
23 | + - sri | ||
24 | + - čet | ||
25 | + - pet | ||
26 | + - sub | ||
27 | + month_names: | ||
28 | + - januar | ||
29 | + - februar | ||
30 | + - mart | ||
31 | + - april | ||
32 | + - maj | ||
33 | + - juni | ||
34 | + - juli | ||
35 | + - august | ||
36 | + - septembar | ||
37 | + - oktobar | ||
38 | + - novembar | ||
39 | + - decembar | ||
40 | + abbr_month_names: | ||
41 | + - jan | ||
42 | + - feb | ||
43 | + - mar | ||
44 | + - apr | ||
45 | + - maj | ||
46 | + - jun | ||
47 | + - jul | ||
48 | + - aug | ||
49 | + - sep | ||
50 | + - okt | ||
51 | + - nov | ||
52 | + - dec | ||
53 | + order: | ||
54 | + - :day | ||
55 | + - :month | ||
56 | + - :year | ||
57 | + time: | ||
58 | + formats: | ||
59 | + default: "%H:%M:%S" | ||
60 | + short: "%d. %b %Y. %H:%M" | ||
61 | + long: "%d. %B %Y. - %H:%M:%S" | ||
62 | + am: '' | ||
63 | + pm: '' | ||
64 | + support: | ||
65 | + array: | ||
66 | + words_connector: ", " | ||
67 | + two_words_connector: " i " | ||
68 | + last_word_connector: " i " | ||
69 | + select: | ||
70 | + prompt: "Molimo odaberite" | ||
71 | + number: | ||
72 | + format: | ||
73 | + separator: "," | ||
74 | + delimiter: "." | ||
75 | + precision: 3 | ||
76 | + significant: false | ||
77 | + strip_insignificant_zeros: true | ||
78 | + currency: | ||
79 | + format: | ||
80 | + format: "%n%u" | ||
81 | + unit: "KM" | ||
82 | + separator: "," | ||
83 | + delimiter: "." | ||
84 | + precision: 2 | ||
85 | + significant: false | ||
86 | + strip_insignificant_zeros: true | ||
87 | + percentage: | ||
88 | + format: | ||
89 | + delimiter: "," | ||
90 | + precision: | ||
91 | + format: | ||
92 | + delimiter: "" | ||
93 | + human: | ||
94 | + format: | ||
95 | + delimiter: "," | ||
96 | + precision: 0 | ||
97 | + significant: true | ||
98 | + strip_insignificant_zeros: true | ||
99 | + storage_units: | ||
100 | + format: "%n %u" | ||
101 | + units: | ||
102 | + byte: | ||
103 | + one: "bajt" | ||
104 | + few: "bajta" | ||
105 | + many: "bajtova" | ||
106 | + other: "bajtova" | ||
107 | + kb: "KB" | ||
108 | + mb: "MB" | ||
109 | + gb: "GB" | ||
110 | + tb: "TB" | ||
111 | + decimal_units: | ||
112 | + format: "%n %u" | ||
113 | + units: | ||
114 | + unit: "" | ||
115 | + thousand: | ||
116 | + one: "hiljada" | ||
117 | + few: "hiljade" | ||
118 | + many: "hiljada" | ||
119 | + other: 'hiljada' | ||
120 | + million: | ||
121 | + one: "milion" | ||
122 | + few: "miliona" | ||
123 | + many: "miliona" | ||
124 | + other: "miliona" | ||
125 | + billion: | ||
126 | + one: "milijarda" | ||
127 | + few: "milijarde" | ||
128 | + many: "milijardi" | ||
129 | + other: "milijardi" | ||
130 | + trillion: | ||
131 | + one: "bilion" | ||
132 | + few: "biliona" | ||
133 | + many: "biliona" | ||
134 | + other: "biliona" | ||
135 | + quadrillion: | ||
136 | + one: "bilijarda" | ||
137 | + few: "bilijarde" | ||
138 | + many: "bilijardi" | ||
139 | + other: "bilijardi" | ||
140 | + datetime: | ||
141 | + distance_in_words: | ||
142 | + half_a_minute: "pola minute" | ||
143 | + less_than_x_seconds: | ||
144 | + one: "manje od sekunde" | ||
145 | + few: "manje od %{count} sekunde" | ||
146 | + many: "manje od %{count} sekundi" | ||
147 | + x_seconds: | ||
148 | + one: "1 sekund" | ||
149 | + few: "%{count} sekunde" | ||
150 | + many: "%{count} sekundi" | ||
151 | + other: "%{count} sekundi" | ||
152 | + less_than_x_minutes: | ||
153 | + one: "manje od minute" | ||
154 | + few: "manje od %{count} minute" | ||
155 | + many: "manje od %{count} minuta" | ||
156 | + other: "manje od %{count} minuta" | ||
157 | + x_minutes: | ||
158 | + one: "1 minut" | ||
159 | + few: "%{count} minute" | ||
160 | + many: "%{count} minuta" | ||
161 | + other: "%{count} minuta" | ||
162 | + about_x_hours: | ||
163 | + one: "oko sat" | ||
164 | + few: "oko %{count} sata" | ||
165 | + many: "oko %{count} sati" | ||
166 | + other: "oko %{count} sati" | ||
167 | + x_days: | ||
168 | + one: "1 dan" | ||
169 | + few: "%{count} dana" | ||
170 | + many: "%{count} dana" | ||
171 | + other: "%{count} dana" | ||
172 | + x_months: | ||
173 | + one: "1 mjesec" | ||
174 | + few: "%{count} mjeseca" | ||
175 | + many: "%{count} mjeseci" | ||
176 | + other: "%{count} mjeseci" | ||
177 | + about_x_months: | ||
178 | + one: "oko mjesec" | ||
179 | + few: "oko %{count} mjeseca" | ||
180 | + many: "oko %{count} mjeseci" | ||
181 | + other: "oko %{count} mjeseci" | ||
182 | + about_x_years: | ||
183 | + one: "oko godine" | ||
184 | + few: "oko %{count} godine" | ||
185 | + many: "oko %{count} godina" | ||
186 | + other: "oko %{count} godina" | ||
187 | + over_x_years: | ||
188 | + one: "preko godine" | ||
189 | + few: "preko %{count} godine" | ||
190 | + many: "preko %{count} godina" | ||
191 | + other: "preko %{count} godina" | ||
192 | + almost_x_years: | ||
193 | + one: "skoro 1 godina" | ||
194 | + few: "skoro %{count} godine" | ||
195 | + many: "skoro %{count} godina" | ||
196 | + other: "skoro %{count} godina" | ||
197 | + prompts: | ||
198 | + year: "godina" | ||
199 | + month: "mjesec" | ||
200 | + day: "dan" | ||
201 | + hour: "sat" | ||
202 | + minute: "minut" | ||
203 | + second: "sekundi" | ||
204 | + helpers: | ||
205 | + select: | ||
206 | + prompt: "Molimo odaberite" | ||
207 | + submit: | ||
208 | + create: "Kreiraj %{model}" | ||
209 | + update: "Osviježi %{model}" | ||
210 | + submit: "Sačuvaj %{model}" | ||
211 | + errors: | ||
212 | + format: "%{attribute} %{message}" | ||
213 | + messages: &errors_messages | ||
214 | + inclusion: "nije uključeno u listu" | ||
215 | + exclusion: "je rezervisano" | ||
216 | + invalid: "nije validno" | ||
217 | + confirmation: "se ne poklapa sa potvrdom" | ||
218 | + accepted: "mora biti prihvaćeno" | ||
219 | + empty: "ne smije biti prazno" | ||
220 | + blank: "ne smije biti prazno" | ||
221 | + too_long: "je predugo (maksimalno je dozvoljeno %{count} karaktera)" | ||
222 | + too_short: "je prekratko (predviđeno je minimalno %{count} karaktera)" | ||
223 | + wrong_length: "je pogrešne dužine (trebalo bi biti tačno %{count} karaktera)" | ||
224 | + not_a_number: "nije broj" | ||
225 | + not_an_integer: "mora biti cijeli broj" | ||
226 | + greater_than: "mora biti veće od %{count}" | ||
227 | + greater_than_or_equal_to: "mora biti veće ili jednako %{count}" | ||
228 | + equal_to: "mora biti %{count}" | ||
229 | + less_than: "mora biti manje od %{count}" | ||
230 | + less_than_or_equal_to: "mora biti manje ili jednako %{count}" | ||
231 | + odd: "mora biti neparno" | ||
232 | + even: "mora biti parno" | ||
233 | + taken: "je već zauzet" | ||
234 | + record_invalid: "Validacija nije uspjela: %{errors}" | ||
235 | + template: &errors_template | ||
236 | + header: | ||
237 | + one: "1 greška je spriječila da se ovaj %{model} snimi" | ||
238 | + few: "%{count} greške su spriječile da se ovaj %{model} snimi" | ||
239 | + many: "%{count} grešaka je spriječilo da se ovaj %{model} snimi" | ||
240 | + other: "%{count} grešaka je spriječilo da se ovaj %{model} snimi" | ||
241 | + body: "Desili su se problemi sa slijedećim poljima:" | ||
242 | + | ||
243 | + activerecord: | ||
244 | + errors: | ||
245 | + messages: | ||
246 | + <<: *errors_messages | ||
247 | + template: | ||
248 | + <<: *errors_template | ||
249 | + full_messages: | ||
250 | + format: "%{attribute} %{message}" |
@@ -0,0 +1,252 @@ | @@ -0,0 +1,252 @@ | ||
1 | +# Catalan translations for Rails | ||
2 | +# by Emili Parreño (emili@eparreno.com - www.eparreno.com) | ||
3 | + | ||
4 | +ca: | ||
5 | + date: | ||
6 | + formats: | ||
7 | + # Use the strftime parameters for formats. | ||
8 | + # When no format has been given, it uses default. | ||
9 | + # You can provide other formats here if you like! | ||
10 | + default: "%d-%m-%Y" | ||
11 | + short: "%d de %b" | ||
12 | + long: "%d de %B de %Y" | ||
13 | + | ||
14 | + day_names: | ||
15 | + - Diumenge | ||
16 | + - Dilluns | ||
17 | + - Dimarts | ||
18 | + - Dimecres | ||
19 | + - Dijous | ||
20 | + - Divendres | ||
21 | + - Dissabte | ||
22 | + abbr_day_names: | ||
23 | + - Dg | ||
24 | + - Dl | ||
25 | + - Dm | ||
26 | + - Dc | ||
27 | + - Dj | ||
28 | + - Dv | ||
29 | + - Ds | ||
30 | + | ||
31 | + # Don't forget the nil at the beginning; there's no such thing as a 0th month | ||
32 | + month_names: | ||
33 | + - ~ | ||
34 | + - Gener | ||
35 | + - Febrer | ||
36 | + - Març | ||
37 | + - Abril | ||
38 | + - Maig | ||
39 | + - Juny | ||
40 | + - Juliol | ||
41 | + - Agost | ||
42 | + - Setembre | ||
43 | + - Octubre | ||
44 | + - Novembre | ||
45 | + - Desembre | ||
46 | + abbr_month_names: | ||
47 | + - ~, | ||
48 | + - Gen | ||
49 | + - Feb | ||
50 | + - Mar | ||
51 | + - Abr | ||
52 | + - Mai | ||
53 | + - Jun | ||
54 | + - Jul | ||
55 | + - Ago | ||
56 | + - Set | ||
57 | + - Oct | ||
58 | + - Nov | ||
59 | + - Des | ||
60 | + # Used in date_select and datime_select. | ||
61 | + order: | ||
62 | + - :day | ||
63 | + - :month | ||
64 | + - :year | ||
65 | + | ||
66 | + time: | ||
67 | + formats: | ||
68 | + default: "%A, %d de %B de %Y %H:%M:%S %z" | ||
69 | + short: "%d de %b %H:%M" | ||
70 | + long: "%d de %B de %Y %H:%M" | ||
71 | + am: "am" | ||
72 | + pm: "pm" | ||
73 | + | ||
74 | +# Used in array.to_sentence. | ||
75 | + support: | ||
76 | + array: | ||
77 | + words_connector: ", " | ||
78 | + two_words_connector: " i " | ||
79 | + last_word_connector: ", i " | ||
80 | + | ||
81 | + select: | ||
82 | + prompt: "Si us plau tria" | ||
83 | + | ||
84 | + number: | ||
85 | + # Used in number_with_delimiter() | ||
86 | + # These are also the defaults for 'currency', 'percentage', 'precision', and 'human' | ||
87 | + format: | ||
88 | + # Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5) | ||
89 | + separator: "," | ||
90 | + # Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three) | ||
91 | + delimiter: "." | ||
92 | + # Number of decimals, behind the separator (1 with a precision of 2 gives: 1.00) | ||
93 | + precision: 3 | ||
94 | + significant: false | ||
95 | + strip_insignificant_zeros: false | ||
96 | + | ||
97 | + # Used in number_to_currency() | ||
98 | + currency: | ||
99 | + format: | ||
100 | + # Where is the currency sign? %u is the currency unit, %n the number (default: $5.00) | ||
101 | + format: "%n %u" | ||
102 | + unit: "€" | ||
103 | + # These three are to override number.format and are optional | ||
104 | + separator: "," | ||
105 | + delimiter: "." | ||
106 | + precision: 2 | ||
107 | + significant: false | ||
108 | + strip_insignificant_zeros: false | ||
109 | + | ||
110 | + # Used in number_to_percentage() | ||
111 | + percentage: | ||
112 | + format: | ||
113 | + # These three are to override number.format and are optional | ||
114 | + # separator: | ||
115 | + delimiter: "" | ||
116 | + # precision: | ||
117 | + | ||
118 | + # Used in number_to_precision() | ||
119 | + precision: | ||
120 | + format: | ||
121 | + # These three are to override number.format and are optional | ||
122 | + # separator: | ||
123 | + delimiter: "" | ||
124 | + # precision: | ||
125 | + | ||
126 | + # Used in number_to_human_size() | ||
127 | + human: | ||
128 | + format: | ||
129 | + # These three are to override number.format and are optional | ||
130 | + # separator: | ||
131 | + delimiter: "" | ||
132 | + precision: 1 | ||
133 | + significant: true | ||
134 | + strip_insignificant_zeros: true | ||
135 | + storage_units: | ||
136 | + # Storage units output formatting. | ||
137 | + # %u is the storage unit, %n is the number (default: 2 MB) | ||
138 | + format: "%n %u" | ||
139 | + units: | ||
140 | + byte: | ||
141 | + one: "Byte" | ||
142 | + other: "Bytes" | ||
143 | + kb: "KB" | ||
144 | + mb: "MB" | ||
145 | + gb: "GB" | ||
146 | + tb: "TB" | ||
147 | + decimal_units: | ||
148 | + format: "%n %u" | ||
149 | + units: | ||
150 | + unit: "" | ||
151 | + thousand: "Mil" | ||
152 | + million: "Milió" | ||
153 | + billion: "Bilió" | ||
154 | + trillion: "Trilió" | ||
155 | + quadrillion: "Quatrilió" | ||
156 | + | ||
157 | + # Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words() | ||
158 | + datetime: | ||
159 | + distance_in_words: | ||
160 | + half_a_minute: "mig minut" | ||
161 | + less_than_x_seconds: | ||
162 | + one: "menys d'1 segon" | ||
163 | + other: "menys de %{count} segons" | ||
164 | + x_seconds: | ||
165 | + one: "1 segon" | ||
166 | + other: "%{count} segons" | ||
167 | + less_than_x_minutes: | ||
168 | + one: "menys d'1 minut" | ||
169 | + other: "menys de %{count} minuts" | ||
170 | + x_minutes: | ||
171 | + one: "1 minut" | ||
172 | + other: "%{count} minuts" | ||
173 | + about_x_hours: | ||
174 | + one: "aproximadament 1 hora" | ||
175 | + other: "aproximadament %{count} hores" | ||
176 | + x_days: | ||
177 | + one: "1 dia" | ||
178 | + other: "%{count} dies" | ||
179 | + about_x_months: | ||
180 | + one: "aproximadament 1 mes" | ||
181 | + other: "aproximadament %{count} mesos" | ||
182 | + x_months: | ||
183 | + one: "1 mes" | ||
184 | + other: "%{count} mesos" | ||
185 | + about_x_years: | ||
186 | + one: "aproximadament 1 any" | ||
187 | + other: "aproximadament %{count} anys" | ||
188 | + over_x_years: | ||
189 | + one: "més d'1 any" | ||
190 | + other: "més de %{count} anys" | ||
191 | + almost_x_years: | ||
192 | + one: "casi 1 any" | ||
193 | + other: "casi %{count} anys" | ||
194 | + prompts: | ||
195 | + year: "Any" | ||
196 | + month: "Mes" | ||
197 | + day: "Dia" | ||
198 | + hour: "Hora" | ||
199 | + minute: "Minut" | ||
200 | + second: "Segun" | ||
201 | + | ||
202 | + helpers: | ||
203 | + select: | ||
204 | + prompt: "Si us plau tria" | ||
205 | + | ||
206 | + submit: | ||
207 | + create: 'Crear %{model}' | ||
208 | + update: 'Actualizar %{model}' | ||
209 | + submit: 'Guardar %{model}' | ||
210 | + | ||
211 | + | ||
212 | + errors: | ||
213 | + format: "%{attribute} %{message}" | ||
214 | + | ||
215 | + messages: &errors_messages | ||
216 | + inclusion: "no està inclós a la llista" | ||
217 | + exclusion: "està reservat" | ||
218 | + invalid: "no és vàlid" | ||
219 | + confirmation: "no coincideix" | ||
220 | + accepted: "ha de ser acceptat" | ||
221 | + empty: "no pot estar buit" | ||
222 | + blank: "no pot estar en blanc" | ||
223 | + too_long: "és massa llarg (%{count} caràcters màxim)" | ||
224 | + too_short: "és massa curt (%{count} caràcters mínim)" | ||
225 | + wrong_length: "no té la longitud correcte (%{count} caràcters exactament)" | ||
226 | + not_a_number: "no és un número" | ||
227 | + not_an_integer: "ha de ser un enter" | ||
228 | + taken: "no està disponible" | ||
229 | + not_a_number: "no és un número" | ||
230 | + greater_than: "ha de ser més gran que %{count}" | ||
231 | + greater_than_or_equal_to: "ha de ser més gran o igual a %{count}" | ||
232 | + equal_to: "ha de ser igual a %{count}" | ||
233 | + less_than: "ha de ser menor que %{count}" | ||
234 | + less_than_or_equal_to: "ha de ser menor o igual a %{count}" | ||
235 | + odd: "ha de ser imparell" | ||
236 | + even: "ha de ser parell" | ||
237 | + record_invalid: "La validació ha fallat: %{errors}" | ||
238 | + template: &errors_template | ||
239 | + header: | ||
240 | + one: "No s'ha pogut desar aquest/a %{model} perquè hi ha 1 error" | ||
241 | + other: "No s'ha pogut desar aquest/a %{model} perquè hi ha hagut %{count} errors" | ||
242 | + body: "Hi ha hagut problemes amb els següents camps:" | ||
243 | + | ||
244 | + activerecord: | ||
245 | + errors: | ||
246 | + messages: | ||
247 | + <<: *errors_messages | ||
248 | + template: | ||
249 | + <<: *errors_template | ||
250 | + | ||
251 | + full_messages: | ||
252 | + format: "%{attribute} %{message}" |
@@ -0,0 +1,213 @@ | @@ -0,0 +1,213 @@ | ||
1 | +# Czech translations for Ruby on Rails | ||
2 | +# by Karel Minařík (karmi@karmi.cz) | ||
3 | +# contributors: | ||
4 | +# - Vít Krchov - http://github.com/vita - Rails 3 update | ||
5 | + | ||
6 | +cs: | ||
7 | + support: | ||
8 | + array: | ||
9 | + two_words_connector: ' a ' | ||
10 | + last_word_connector: ' a ' | ||
11 | + words_connector: ', ' | ||
12 | + select: | ||
13 | + prompt: 'Prosím vyberte si' | ||
14 | + | ||
15 | + date: | ||
16 | + formats: | ||
17 | + default: "%d. %m. %Y" | ||
18 | + short: "%d %b" | ||
19 | + long: "%d. %B %Y" | ||
20 | + day_names: | ||
21 | + - Neděle | ||
22 | + - Pondělí | ||
23 | + - Úterý | ||
24 | + - Středa | ||
25 | + - Čtvrtek | ||
26 | + - Pátek | ||
27 | + - Sobota | ||
28 | + abbr_day_names: | ||
29 | + - Ne | ||
30 | + - Po | ||
31 | + - Út | ||
32 | + - St | ||
33 | + - Čt | ||
34 | + - Pá | ||
35 | + - So | ||
36 | + month_names: | ||
37 | + - ~ | ||
38 | + - Leden | ||
39 | + - Únor | ||
40 | + - Březen | ||
41 | + - Duben | ||
42 | + - Květen | ||
43 | + - Červen | ||
44 | + - Červenec | ||
45 | + - Srpen | ||
46 | + - Září | ||
47 | + - Říjen | ||
48 | + - Listopad | ||
49 | + - Prosinec | ||
50 | + abbr_month_names: | ||
51 | + - ~ | ||
52 | + - Led | ||
53 | + - Úno | ||
54 | + - Bře | ||
55 | + - Dub | ||
56 | + - Kvě | ||
57 | + - Čvn | ||
58 | + - Čvc | ||
59 | + - Srp | ||
60 | + - Zář | ||
61 | + - Říj | ||
62 | + - Lis | ||
63 | + - Pro | ||
64 | + order: | ||
65 | + - :day | ||
66 | + - :month | ||
67 | + - :year | ||
68 | + | ||
69 | + time: | ||
70 | + formats: | ||
71 | + default: "%a %d. %B %Y %H:%M %z" | ||
72 | + short: "%d. %m. %H:%M" | ||
73 | + long: "%A %d. %B %Y %H:%M" | ||
74 | + am: 'am' | ||
75 | + pm: 'pm' | ||
76 | + | ||
77 | + number: | ||
78 | + format: | ||
79 | + precision: 3 | ||
80 | + separator: '.' | ||
81 | + delimiter: ',' | ||
82 | + significant: false | ||
83 | + strip_insignificant_zeros: false | ||
84 | + currency: | ||
85 | + format: | ||
86 | + unit: 'Kč' | ||
87 | + precision: 2 | ||
88 | + format: '%n %u' | ||
89 | + separator: "," | ||
90 | + delimiter: " " | ||
91 | + significant: false | ||
92 | + strip_insignificant_zeros: false | ||
93 | + human: | ||
94 | + format: | ||
95 | + precision: 1 | ||
96 | + delimiter: '' | ||
97 | + significant: false | ||
98 | + strip_insignificant_zeros: false | ||
99 | + storage_units: | ||
100 | + format: "%n %u" | ||
101 | + units: | ||
102 | + byte: "B" | ||
103 | + kb: "KB" | ||
104 | + mb: "MB" | ||
105 | + gb: "GB" | ||
106 | + tb: "TB" | ||
107 | + decimal_units: | ||
108 | + format: "%n %u" | ||
109 | + units: | ||
110 | + unit: "" | ||
111 | + thousand: "Tisíc" | ||
112 | + million: "Milion" | ||
113 | + billion: "Miliarda" | ||
114 | + trillion: "Bilion" | ||
115 | + quadrillion: "Kvadrilion" | ||
116 | + percentage: | ||
117 | + format: | ||
118 | + delimiter: '' | ||
119 | + precision: | ||
120 | + format: | ||
121 | + delimiter: '' | ||
122 | + | ||
123 | + datetime: | ||
124 | + prompts: | ||
125 | + second: "Sekunda" | ||
126 | + minute: "Minuta" | ||
127 | + hour: "Hodina" | ||
128 | + day: "Den" | ||
129 | + month: "Měsíc" | ||
130 | + year: "Rok" | ||
131 | + distance_in_words: | ||
132 | + half_a_minute: 'půl minutou' | ||
133 | + less_than_x_seconds: | ||
134 | + one: 'necelou sekundou' | ||
135 | + other: 'ani ne %{count} sekundami' | ||
136 | + x_seconds: | ||
137 | + one: 'sekundou' | ||
138 | + other: '%{count} sekundami' | ||
139 | + less_than_x_minutes: | ||
140 | + one: 'necelou minutou' | ||
141 | + other: 'ani ne %{count} minutami' | ||
142 | + x_minutes: | ||
143 | + one: 'minutou' | ||
144 | + other: '%{count} minutami' | ||
145 | + about_x_hours: | ||
146 | + one: 'asi hodinou' | ||
147 | + other: 'asi %{count} hodinami' | ||
148 | + x_days: | ||
149 | + one: '24 hodinami' | ||
150 | + other: '%{count} dny' | ||
151 | + about_x_months: | ||
152 | + one: 'asi měsícem' | ||
153 | + other: 'asi %{count} měsíci' | ||
154 | + x_months: | ||
155 | + one: 'měsícem' | ||
156 | + other: '%{count} měsíci' | ||
157 | + about_x_years: | ||
158 | + one: 'asi rokem' | ||
159 | + other: 'asi %{count} roky' | ||
160 | + over_x_years: | ||
161 | + one: 'více než rokem' | ||
162 | + other: 'více než %{count} roky' | ||
163 | + almost_x_years: | ||
164 | + one: 'téměř rokem' | ||
165 | + other: 'téměř %{count} roky' | ||
166 | + | ||
167 | + helpers: | ||
168 | + select: | ||
169 | + prompt: "Prosím vyberte si" | ||
170 | + | ||
171 | + submit: | ||
172 | + create: "Vytvořit %{model}" | ||
173 | + update: "Aktualizovat %{model}" | ||
174 | + submit: "Uložit %{model}" | ||
175 | + | ||
176 | + errors: | ||
177 | + format: "%{attribute} %{message}" | ||
178 | + messages: &errors_messages | ||
179 | + inclusion: "není v seznamu povolených hodnot" | ||
180 | + exclusion: "je vyhrazeno pro jiný účel" | ||
181 | + invalid: "není platná hodnota" | ||
182 | + confirmation: "nebylo potvrzeno" | ||
183 | + accepted: "musí být potvrzeno" | ||
184 | + empty: "nesmí být prázdný/á/é" | ||
185 | + blank: "je povinná položka" | ||
186 | + too_long: "je příliš dlouhý/á/é (max. %{count} znaků)" | ||
187 | + too_short: "je příliš krátký/á/é (min. %{count} znaků)" | ||
188 | + wrong_length: "nemá správnou délku (očekáváno %{count} znaků)" | ||
189 | + not_a_number: "není číslo" | ||
190 | + greater_than: "musí být větší než %{count}" | ||
191 | + greater_than_or_equal_to: "musí být větší nebo rovno %{count}" | ||
192 | + equal_to: "musí být rovno %{count}" | ||
193 | + less_than: "musí být méně než %{count}" | ||
194 | + less_than_or_equal_to: "musí být méně nebo rovno %{count}" | ||
195 | + odd: "musí být liché číslo" | ||
196 | + even: "musí být sudé číslo" | ||
197 | + not_an_integer: "musí být celé číslo" | ||
198 | + taken: "již databáze obsahuje" | ||
199 | + record_invalid: "Validace je neúspešná: %{errors}" | ||
200 | + template: &errors_template | ||
201 | + header: | ||
202 | + one: "Při ukládání objektu %{model} došlo k chybám a nebylo jej možné uložit" | ||
203 | + other: "Při ukládání objektu %{model} došlo ke %{count} chybám a nebylo možné jej uložit" | ||
204 | + body: "Následující pole obsahují chybně vyplněné údaje: " | ||
205 | + | ||
206 | + activerecord: | ||
207 | + errors: | ||
208 | + messages: | ||
209 | + <<: *errors_messages | ||
210 | + template: | ||
211 | + <<: *errors_template | ||
212 | + full_messages: | ||
213 | + format: "%{attribute} %{message}" | ||
0 | \ No newline at end of file | 214 | \ No newline at end of file |
@@ -0,0 +1,233 @@ | @@ -0,0 +1,233 @@ | ||
1 | +# Kashubian translations for Ruby on Rails | ||
2 | +# by Michôł Òstrowsczi (ostrowski.michal@gmail.com, http://github.com/espresse) | ||
3 | + | ||
4 | +csb: | ||
5 | + date: | ||
6 | + formats: | ||
7 | + default: "%d-%m-%Y" | ||
8 | + short: "%d %b" | ||
9 | + long: "%B %d, %Y" | ||
10 | + | ||
11 | + day_names: | ||
12 | + - niedzela | ||
13 | + - pòniedzôłk | ||
14 | + - wtórk | ||
15 | + - strzoda | ||
16 | + - czwiôrtk | ||
17 | + - piątk | ||
18 | + - sobòta | ||
19 | + abbr_day_names: | ||
20 | + - nie | ||
21 | + - pòn | ||
22 | + - wtó | ||
23 | + - str | ||
24 | + - czw | ||
25 | + - pią | ||
26 | + - sob | ||
27 | + | ||
28 | + month_names: | ||
29 | + - ~ | ||
30 | + - stëcznik | ||
31 | + - gromicznik | ||
32 | + - strëmiannik | ||
33 | + - łżëkwiôt | ||
34 | + - môj | ||
35 | + - czerwińc | ||
36 | + - lëpińc | ||
37 | + - zélnik | ||
38 | + - séwnik | ||
39 | + - rujan | ||
40 | + - lëstopadnik | ||
41 | + - gòdnik | ||
42 | + abbr_month_names: | ||
43 | + - ~ | ||
44 | + - stë | ||
45 | + - gro | ||
46 | + - str | ||
47 | + - łżë | ||
48 | + - môj | ||
49 | + - cze | ||
50 | + - lëp | ||
51 | + - zél | ||
52 | + - séw | ||
53 | + - ruj | ||
54 | + - lës | ||
55 | + - gòd | ||
56 | + order: | ||
57 | + - :day | ||
58 | + - :month | ||
59 | + - :year | ||
60 | + | ||
61 | + time: | ||
62 | + formats: | ||
63 | + default: "%a, %d %b %Y %H:%M:%S %z" | ||
64 | + short: "%d %b %H:%M" | ||
65 | + long: "%B %d, %Y %H:%M" | ||
66 | + am: "przed pôłnim" | ||
67 | + pm: "pò pôłnim" | ||
68 | + | ||
69 | + support: | ||
70 | + array: | ||
71 | + words_connector: ", " | ||
72 | + two_words_connector: " ë " | ||
73 | + last_word_connector: " a téż " | ||
74 | + | ||
75 | + select: | ||
76 | + prompt: "Proszã wëbrac" | ||
77 | + | ||
78 | + number: | ||
79 | + format: | ||
80 | + separator: "," | ||
81 | + delimiter: " " | ||
82 | + precision: 3 | ||
83 | + significant: false | ||
84 | + strip_insignificant_zeros: false | ||
85 | + | ||
86 | + currency: | ||
87 | + format: | ||
88 | + format: "%u %n" | ||
89 | + unit: "PLN" | ||
90 | + separator: "," | ||
91 | + delimiter: " " | ||
92 | + precision: 2 | ||
93 | + significant: false | ||
94 | + strip_insignificant_zeros: true | ||
95 | + | ||
96 | + percentage: | ||
97 | + format: | ||
98 | + delimiter: "" | ||
99 | + | ||
100 | + precision: | ||
101 | + format: | ||
102 | + delimiter: "" | ||
103 | + | ||
104 | + human: | ||
105 | + format: | ||
106 | + delimiter: "" | ||
107 | + precision: 3 | ||
108 | + significant: true | ||
109 | + strip_insignificant_zeros: true | ||
110 | + storage_units: | ||
111 | + format: "%n %u" | ||
112 | + units: | ||
113 | + byte: | ||
114 | + one: "bajt" | ||
115 | + other: "bajtë" | ||
116 | + kb: "KB" | ||
117 | + mb: "MB" | ||
118 | + gb: "GB" | ||
119 | + tb: "TB" | ||
120 | + decimal_units: | ||
121 | + format: "%n %u" | ||
122 | + units: | ||
123 | + unit: "" | ||
124 | + thousand: Tësąc | ||
125 | + million: Milión | ||
126 | + billion: Miliard | ||
127 | + trillion: Bilión | ||
128 | + quadrillion: Biliard | ||
129 | + | ||
130 | + datetime: | ||
131 | + distance_in_words: | ||
132 | + half_a_minute: "pół minutë" | ||
133 | + less_than_x_seconds: | ||
134 | + one: "mni jak sekùnda" | ||
135 | + few: "mni jak %{count} sekùndë" | ||
136 | + other: "mni jak %{count} sekùndów" | ||
137 | + x_seconds: | ||
138 | + one: "1 sekùnda" | ||
139 | + few: "%{count} sekùndë" | ||
140 | + other: "%{count} sekùndów" | ||
141 | + less_than_x_minutes: | ||
142 | + one: "mni jak minuta" | ||
143 | + few: "mni jak %{count} minutë" | ||
144 | + other: "mni jak %{count} minutów" | ||
145 | + x_minutes: | ||
146 | + one: "1 minuta" | ||
147 | + few: "%{count} minutë" | ||
148 | + other: "%{count} minutów" | ||
149 | + about_x_hours: | ||
150 | + one: "kòle gòdzënë" | ||
151 | + few: "kòle %{count} gòdzën" | ||
152 | + other: "kòle %{count} gòdzën" | ||
153 | + x_days: | ||
154 | + one: "1 dzéń" | ||
155 | + few: "%{count} dni" | ||
156 | + other: "%{count} dniów" | ||
157 | + about_x_months: | ||
158 | + one: "kòle miesąca" | ||
159 | + few: "kòle %{count} miesąców" | ||
160 | + other: "kòle %{count} miesąców" | ||
161 | + x_months: | ||
162 | + one: "1 miesąc" | ||
163 | + few: "%{count} miesiące" | ||
164 | + other: "%{count} miesięców" | ||
165 | + about_x_years: | ||
166 | + one: "kòle rokù" | ||
167 | + few: "kòle %{count} lat" | ||
168 | + other: "kòle %{count} lat" | ||
169 | + over_x_years: | ||
170 | + one: "wicy jak rok" | ||
171 | + few: "wicy jak %{count} lata" | ||
172 | + other: "wicy jak %{count} lat" | ||
173 | + almost_x_years: | ||
174 | + one: "wnet rok" | ||
175 | + few: "wnet %{count} lata" | ||
176 | + other: "wnet %{count} lat" | ||
177 | + prompts: | ||
178 | + year: "Rok" | ||
179 | + month: "Miesiąc" | ||
180 | + day: "Dzéń" | ||
181 | + hour: "Gòdzëna" | ||
182 | + minute: "Minuta" | ||
183 | + second: "Sekunda" | ||
184 | + | ||
185 | + helpers: | ||
186 | + select: | ||
187 | + prompt: "Proszã wëbrac" | ||
188 | + | ||
189 | + submit: | ||
190 | + create: 'Ùsôdzë %{model}' | ||
191 | + update: 'Aktualizëjë %{model}' | ||
192 | + submit: 'Zapiszë %{model}' | ||
193 | + | ||
194 | + errors: | ||
195 | + format: "%{attribute} %{message}" | ||
196 | + | ||
197 | + messages: &errors_messages | ||
198 | + inclusion: "ni ma na lësce dopùszczalnëch wôrtnotów" | ||
199 | + exclusion: "je zarezerwowóné" | ||
200 | + invalid: "je zmiłkòwé" | ||
201 | + confirmation: "nie zgòdzô sã z pòcwierdzenim" | ||
202 | + accepted: "mùszi bëc zaakceptowóné" | ||
203 | + empty: "ni mòżé bëc pùsté" | ||
204 | + blank: "ni mòże bëc pùsté" | ||
205 | + too_long: "je za dłëdżé (maksymalno %{count} znaków)" | ||
206 | + too_short: "je za krótczé (przënômni %{count} znaków)" | ||
207 | + wrong_length: "mô lëchą długòtã (bë mùsza miec %{count} znaków)" | ||
208 | + not_a_number: "nie je lëczbą" | ||
209 | + not_an_integer: "muszi bëc całowną lëczbą" | ||
210 | + greater_than: "mùszi bëc wikszé òd %{count}" | ||
211 | + greater_than_or_equal_to: "mùszi bëc wikszé abò równé %{count}" | ||
212 | + equal_to: "mùszi bëc równe %{count}" | ||
213 | + less_than: "mùszi bëc mniszé òd %{count}" | ||
214 | + less_than_or_equal_to: "mùszi bëc mniszé abò równé %{count}" | ||
215 | + odd: "mùszi bëc nieparzësté" | ||
216 | + even: "mùszé bëc parzësté" | ||
217 | + taken: "je ju zajãté" | ||
218 | + record_invalid: "Negatiwné sprôwdzenié pòprawnoscë: %{errors}" | ||
219 | + template: &errors_template | ||
220 | + header: | ||
221 | + one: "%{model} nie òstôł zachòwóny przez jedną felã" | ||
222 | + other: "%{model} nie òstôł zachòwóny przez %{count} felów" | ||
223 | + body: "Fele tikają sã nëch pól:" | ||
224 | + | ||
225 | + activerecord: | ||
226 | + errors: | ||
227 | + messages: | ||
228 | + <<: *errors_messages | ||
229 | + template: | ||
230 | + <<: *errors_template | ||
231 | + | ||
232 | + full_messages: | ||
233 | + format: "%{attribute} %{message}" |
@@ -0,0 +1,221 @@ | @@ -0,0 +1,221 @@ | ||
1 | +# Welsh translations for Ruby on Rails | ||
2 | +# by Aran Jones (aranjones@gmail.com) | ||
3 | + | ||
4 | +cy: | ||
5 | + date: | ||
6 | + formats: | ||
7 | + default: "%d-%m-%Y" | ||
8 | + short: "%b %d" | ||
9 | + long: "%B %d, %Y" | ||
10 | + | ||
11 | + day_names: | ||
12 | + - Dydd Sul | ||
13 | + - Dydd Llun | ||
14 | + - Dydd Mawrth | ||
15 | + - Dydd Mercher | ||
16 | + - Dydd Iau | ||
17 | + - Dydd Gwener | ||
18 | + - Dydd Sadwrn | ||
19 | + abbr_day_names: | ||
20 | + - Sul | ||
21 | + - Llun | ||
22 | + - Maw | ||
23 | + - Mer | ||
24 | + - Iau | ||
25 | + - Gwe | ||
26 | + - Sad | ||
27 | + | ||
28 | + month_names: | ||
29 | + - ~ | ||
30 | + - mis Ionawr | ||
31 | + - mis Chwefror | ||
32 | + - mis Mawrth | ||
33 | + - mis Ebrill | ||
34 | + - mis Mai | ||
35 | + - mis Mehefin | ||
36 | + - mis Gorffennaf | ||
37 | + - mis Awst | ||
38 | + - mis Medi | ||
39 | + - mis Hydref | ||
40 | + - mis Tachwedd | ||
41 | + - mis Rhagfyr | ||
42 | + abbr_month_names: | ||
43 | + - ~ | ||
44 | + - Ion | ||
45 | + - Chw | ||
46 | + - Maw | ||
47 | + - Ebr | ||
48 | + - Mai | ||
49 | + - Meh | ||
50 | + - Gor | ||
51 | + - Awst | ||
52 | + - Med | ||
53 | + - Hyd | ||
54 | + - Tach | ||
55 | + - Rha | ||
56 | + order: | ||
57 | + - :year | ||
58 | + - :month | ||
59 | + - :day | ||
60 | + | ||
61 | + time: | ||
62 | + formats: | ||
63 | + default: "%a, %d %b %Y %H:%M:%S %z" | ||
64 | + short: "%d %b %H:%M" | ||
65 | + long: "%B %d, %Y %H:%M" | ||
66 | + am: "yb" | ||
67 | + pm: "yh" | ||
68 | + | ||
69 | + support: | ||
70 | + array: | ||
71 | + words_connector: ", " | ||
72 | + two_words_connector: " a " | ||
73 | + last_word_connector: ", a " | ||
74 | + | ||
75 | + select: | ||
76 | + prompt: "Dewiswch" | ||
77 | + | ||
78 | + number: | ||
79 | + format: | ||
80 | + separator: "." | ||
81 | + delimiter: "," | ||
82 | + precision: 3 | ||
83 | + significant: false | ||
84 | + strip_insignificant_zeros: false | ||
85 | + | ||
86 | + currency: | ||
87 | + format: | ||
88 | + format: "%u%n" | ||
89 | + unit: "£" | ||
90 | + separator: "." | ||
91 | + delimiter: "," | ||
92 | + precision: 2 | ||
93 | + significant: false | ||
94 | + strip_insignificant_zeros: false | ||
95 | + | ||
96 | + percentage: | ||
97 | + format: | ||
98 | + delimiter: "" | ||
99 | + | ||
100 | + precision: | ||
101 | + format: | ||
102 | + delimiter: "" | ||
103 | + | ||
104 | + human: | ||
105 | + format: | ||
106 | + delimiter: "" | ||
107 | + precision: 3 | ||
108 | + significant: true | ||
109 | + strip_insignificant_zeros: true | ||
110 | + storage_units: | ||
111 | + format: "%n %u" | ||
112 | + units: | ||
113 | + byte: | ||
114 | + one: "Byte" | ||
115 | + other: "Bytes" | ||
116 | + kb: "KB" | ||
117 | + mb: "MB" | ||
118 | + gb: "GB" | ||
119 | + tb: "TB" | ||
120 | + decimal_units: | ||
121 | + format: "%n %u" | ||
122 | + units: | ||
123 | + unit: "" | ||
124 | + thousand: Mil | ||
125 | + million: Miliwn | ||
126 | + billion: Biliwn | ||
127 | + trillion: Triliwn | ||
128 | + quadrillion: Cwadriliwn | ||
129 | + | ||
130 | + datetime: | ||
131 | + distance_in_words: | ||
132 | + half_a_minute: "hanner munud" | ||
133 | + less_than_x_seconds: | ||
134 | + one: "llai nag eiliad" | ||
135 | + other: "llai na %{count} eiliad" | ||
136 | + x_seconds: | ||
137 | + one: "1 eiliad" | ||
138 | + other: "%{count} o eiliadau" | ||
139 | + less_than_x_minutes: | ||
140 | + one: "llai na munud" | ||
141 | + other: "llai na %{count} munud" | ||
142 | + x_minutes: | ||
143 | + one: "1 munud" | ||
144 | + other: "%{count} o funudau" | ||
145 | + about_x_hours: | ||
146 | + one: "tuag awr" | ||
147 | + other: "tua %{count} awr" | ||
148 | + x_days: | ||
149 | + one: "1 diwrnod" | ||
150 | + other: "%{count} diwrnod" | ||
151 | + about_x_months: | ||
152 | + one: "tua mis" | ||
153 | + other: "tua %{count} mis" | ||
154 | + x_months: | ||
155 | + one: "1 mis" | ||
156 | + other: "%{count} mis" | ||
157 | + about_x_years: | ||
158 | + one: "tua blwyddyn" | ||
159 | + other: "tua %{count} blynedd" | ||
160 | + over_x_years: | ||
161 | + one: "dros flwyddyn" | ||
162 | + other: "dros %{count} blynedd" | ||
163 | + almost_x_years: | ||
164 | + one: "bron yn flwyddyn" | ||
165 | + other: "bron yn %{count} blynedd" | ||
166 | + prompts: | ||
167 | + year: "Blwyddyn" | ||
168 | + month: "Mis" | ||
169 | + day: "Diwrnod" | ||
170 | + hour: "Awr" | ||
171 | + minute: "Munud" | ||
172 | + second: "Eiliad" | ||
173 | + | ||
174 | + helpers: | ||
175 | + select: | ||
176 | + prompt: "Dewiswch" | ||
177 | + | ||
178 | + submit: | ||
179 | + create: 'Creu %{model}' | ||
180 | + update: 'Diweddaru %{model}' | ||
181 | + submit: 'Cadw %{model}' | ||
182 | + | ||
183 | + errors: | ||
184 | + format: "%{attribute} %{message}" | ||
185 | + | ||
186 | + messages: &errors_messages | ||
187 | + inclusion: "heb fod yn y rhestr" | ||
188 | + exclusion: "wedi cadw" | ||
189 | + invalid: "heb fod yn nheilwng" | ||
190 | + confirmation: "heb fod yn gyfateb" | ||
191 | + accepted: "angen ei dderbyn" | ||
192 | + empty: "methu bod yn wag" | ||
193 | + blank: "methu bod yn wag" | ||
194 | + too_long: "yn rhy hir (cewch %{count} llythyren ar y fwyaf)" | ||
195 | + too_short: "yn rhy fyr (rhaid am o leiaf %{count} llythyren)" | ||
196 | + wrong_length: "gyda maint anghywir o lythrennau (dylai fod yn %{count} llythyren)" | ||
197 | + not_a_number: "heb fod yn rhif" | ||
198 | + not_an_integer: "heb fod yn rhif llawn" | ||
199 | + greater_than: "angen bod yn fwy na %{count}" | ||
200 | + greater_than_or_equal_to: "angen bod yr un maint neu fwy na %{count}" | ||
201 | + equal_to: "angen bod yn %{count}" | ||
202 | + less_than: "angen bod yn llai na %{count}" | ||
203 | + less_than_or_equal_to: "angen bod yr un maint neu lai na %{count}" | ||
204 | + odd: "rhaid bod yn odrif" | ||
205 | + even: "rhaid bod yn eilrif" | ||
206 | + taken: "wedi'i gymryd yn barod" | ||
207 | + record_invalid: "Gwirio wedi methu: %{errors}" | ||
208 | + template: &errors_template | ||
209 | + header: | ||
210 | + one: "Atalwyd y %{model} hwn rhag ei gadw gan 1 nam" | ||
211 | + other: "Atalwyd y %{model} hwn rhag ei gadw gan %{count} nam" | ||
212 | + body: "Cafwyd broblemau gyda'r meysydd canlynol:" | ||
213 | + | ||
214 | + activerecord: | ||
215 | + errors: | ||
216 | + messages: | ||
217 | + <<: *errors_messages | ||
218 | + template: | ||
219 | + <<: *errors_template | ||
220 | + full_messages: | ||
221 | + format: "%{attribute} %{message}" |
@@ -0,0 +1,236 @@ | @@ -0,0 +1,236 @@ | ||
1 | +# Danish translation file for standard Ruby on Rails internationalization | ||
2 | +# by Lars Hoeg (larshoeg@gmail.com, http://www.lenio.dk/) | ||
3 | +# redigeret af sprogekvilibrist og grammatisk facist Rasmus Malver (rasmus@malver.dk, http://malver.dk) | ||
4 | + | ||
5 | +# Danish translation file for standard Ruby on Rails internationalization | ||
6 | +# by Lars Hoeg (larshoeg@gmail.com, http://www.lenio.dk/) | ||
7 | + | ||
8 | +da: | ||
9 | + # active_support | ||
10 | + date: | ||
11 | + # See http://sproget.dk/svarbase/SV00000046/ and http://en.wikipedia.org/wiki/Date_formats | ||
12 | + # either use traditional (2.10.03, 2. oktober 2003): "%e.%m.%y", "%e. %B %Y" | ||
13 | + # or international ISO 8601 format (2003-10-20): "%Y-%m-%d" | ||
14 | + # Note: some Windows distributions do not support %e - you may have to use %d instead | ||
15 | + formats: | ||
16 | + default: "%d.%m.%Y" | ||
17 | + short: "%e. %b %Y" | ||
18 | + long: "%e. %B %Y" | ||
19 | + | ||
20 | + day_names: | ||
21 | + - søndag | ||
22 | + - mandag | ||
23 | + - tirsdag | ||
24 | + - onsdag | ||
25 | + - torsdag | ||
26 | + - fredag | ||
27 | + - lørdag | ||
28 | + abbr_day_names: | ||
29 | + - søn | ||
30 | + - man | ||
31 | + - tir | ||
32 | + - ons | ||
33 | + - tor | ||
34 | + - fre | ||
35 | + - lør | ||
36 | + month_names: | ||
37 | + - ~ | ||
38 | + - januar | ||
39 | + - februar | ||
40 | + - marts | ||
41 | + - april | ||
42 | + - maj | ||
43 | + - juni | ||
44 | + - juli | ||
45 | + - august | ||
46 | + - september | ||
47 | + - oktober | ||
48 | + - november | ||
49 | + - december | ||
50 | + abbr_month_names: | ||
51 | + - ~ | ||
52 | + - jan | ||
53 | + - feb | ||
54 | + - mar | ||
55 | + - apr | ||
56 | + - maj | ||
57 | + - jun | ||
58 | + - jul | ||
59 | + - aug | ||
60 | + - sep | ||
61 | + - okt | ||
62 | + - nov | ||
63 | + - dec | ||
64 | + order: | ||
65 | + - :day | ||
66 | + - :month | ||
67 | + - :year | ||
68 | + | ||
69 | + time: | ||
70 | + formats: | ||
71 | + default: "%e. %B %Y, %H.%M" | ||
72 | + short: "%e. %b %Y, %H.%M" | ||
73 | + long: "%A d. %e. %B %Y, %H.%M" | ||
74 | + am: "" | ||
75 | + pm: "" | ||
76 | + | ||
77 | + support: | ||
78 | + array: | ||
79 | + words_connector: ", " | ||
80 | + two_words_connector: " og " | ||
81 | + last_word_connector: " og " | ||
82 | + select: | ||
83 | + # default value for :prompt => true in FormOptionsHelper | ||
84 | + prompt: "Vælg..." | ||
85 | + | ||
86 | + # action_view | ||
87 | + number: | ||
88 | + format: | ||
89 | + separator: "," | ||
90 | + delimiter: "." | ||
91 | + precision: 3 | ||
92 | + significant: false | ||
93 | + strip_insignificant_zeros: false | ||
94 | + | ||
95 | + currency: | ||
96 | + format: | ||
97 | + format: "%u %n" | ||
98 | + unit: "DKK" | ||
99 | + separator: "," | ||
100 | + delimiter: "." | ||
101 | + precision: 2 | ||
102 | + significant: false | ||
103 | + strip_insignificant_zeros: false | ||
104 | + | ||
105 | + percentage: | ||
106 | + format: | ||
107 | + delimiter: "" | ||
108 | + | ||
109 | + precision: | ||
110 | + format: | ||
111 | + delimiter: "" | ||
112 | + | ||
113 | + human: | ||
114 | + format: | ||
115 | + delimiter: "" | ||
116 | + precision: 3 | ||
117 | + significant: true | ||
118 | + strip_insignificant_zeros: true | ||
119 | + # Rails 2.2 | ||
120 | + #storage_units: [Bytes, KB, MB, GB, TB] | ||
121 | + # Rails 2.3 | ||
122 | + storage_units: | ||
123 | + # Storage units output formatting. | ||
124 | + # %u is the storage unit, %n is the number (default: 2 MB) | ||
125 | + format: "%n %u" | ||
126 | + units: | ||
127 | + byte: | ||
128 | + one: "Byte" | ||
129 | + other: "Bytes" | ||
130 | + kb: "KB" | ||
131 | + mb: "MB" | ||
132 | + gb: "GB" | ||
133 | + tb: "TB" | ||
134 | + decimal_units: | ||
135 | + format: "%n %u" | ||
136 | + units: | ||
137 | + unit: "" | ||
138 | + thousand: Tusind | ||
139 | + million: Million | ||
140 | + billion: Milliard | ||
141 | + trillion: Billion | ||
142 | + quadrillion: Billiard | ||
143 | + | ||
144 | + datetime: | ||
145 | + distance_in_words: | ||
146 | + half_a_minute: "et halvt minut" | ||
147 | + less_than_x_seconds: | ||
148 | + one: "mindre end et sekund" | ||
149 | + other: "mindre end %{count} sekunder" | ||
150 | + x_seconds: | ||
151 | + one: "et sekund" | ||
152 | + other: "%{count} sekunder" | ||
153 | + less_than_x_minutes: | ||
154 | + one: "mindre end et minut" | ||
155 | + other: "mindre end %{count} minutter" | ||
156 | + x_minutes: | ||
157 | + one: "et minut" | ||
158 | + other: "%{count} minutter" | ||
159 | + about_x_hours: | ||
160 | + one: "cirka en time" | ||
161 | + other: "cirka %{count} timer" | ||
162 | + x_days: | ||
163 | + one: "en dag" | ||
164 | + other: "%{count} dage" | ||
165 | + about_x_months: | ||
166 | + one: "cirka en måned" | ||
167 | + other: "cirka %{count} måneder" | ||
168 | + x_months: | ||
169 | + one: "en måned" | ||
170 | + other: "%{count} måneder" | ||
171 | + about_x_years: | ||
172 | + one: "cirka et år" | ||
173 | + other: "cirka %{count} år" | ||
174 | + over_x_years: | ||
175 | + one: "mere end et år" | ||
176 | + other: "mere end %{count} år" | ||
177 | + almost_x_years: | ||
178 | + one: "næsten et år" | ||
179 | + other: "næsten %{count} år" | ||
180 | + prompts: | ||
181 | + year: "År" | ||
182 | + month: "Måned" | ||
183 | + day: "Dag" | ||
184 | + hour: "Time" | ||
185 | + minute: "Minut" | ||
186 | + second: "Sekund" | ||
187 | + | ||
188 | + helpers: | ||
189 | + select: | ||
190 | + prompt: "Vælg..." | ||
191 | + | ||
192 | + submit: | ||
193 | + create: "Opret %{model}" | ||
194 | + update: "Opdater %{model}" | ||
195 | + submit: "Gem %{model}" | ||
196 | + | ||
197 | + errors: | ||
198 | + format: "%{attribute} %{message}" | ||
199 | + | ||
200 | + messages: &errors_messages | ||
201 | + inclusion: "er ikke på listen" | ||
202 | + exclusion: "er reserveret" | ||
203 | + invalid: "er ikke gyldig" | ||
204 | + confirmation: "stemmer ikke overens med bekræftelse" | ||
205 | + accepted: "skal accepteres" | ||
206 | + empty: "må ikke udelades" | ||
207 | + blank: "skal udfyldes" | ||
208 | + too_long: "er for lang (højest %{count} tegn)" | ||
209 | + too_short: "er for kort (mindst %{count} tegn)" | ||
210 | + wrong_length: "har forkert længde (skulle være %{count} tegn)" | ||
211 | + not_a_number: "er ikke et tal" | ||
212 | + not_an_integer: "er ikke et heltal" | ||
213 | + greater_than: "skal være større end %{count}" | ||
214 | + greater_than_or_equal_to: "skal være større end, eller lig med, %{count}" | ||
215 | + equal_to: "skal være %{count}" | ||
216 | + less_than: "skal være mindre end %{count}" | ||
217 | + less_than_or_equal_to: "skal være mindre end, eller lig med, %{count}" | ||
218 | + odd: "skal være et ulige tal" | ||
219 | + even: "skal være et lige tal" | ||
220 | + taken: "er allerede brugt" | ||
221 | + record_invalid: "Godkendelse gik galt: %{errors}" | ||
222 | + template: &errors_template | ||
223 | + header: | ||
224 | + one: "En fejl forhindrede %{model} i at blive gemt" | ||
225 | + other: "%{count} fejl forhindrede %{model} i at blive gemt" | ||
226 | + body: "Der var problemer med følgende felter:" | ||
227 | + | ||
228 | + activerecord: | ||
229 | + errors: | ||
230 | + messages: | ||
231 | + <<: *errors_messages | ||
232 | + template: | ||
233 | + <<: *errors_template | ||
234 | + | ||
235 | + full_messages: | ||
236 | + format: "%{attribute} %{message}" | ||
0 | \ No newline at end of file | 237 | \ No newline at end of file |
@@ -0,0 +1,221 @@ | @@ -0,0 +1,221 @@ | ||
1 | +# German translations for Ruby on Rails | ||
2 | +# by Clemens Kofler (clemens@railway.at) | ||
3 | + | ||
4 | +de-AT: | ||
5 | + date: | ||
6 | + formats: | ||
7 | + default: "%d.%m.%Y" | ||
8 | + short: "%e. %b" | ||
9 | + long: "%e. %B %Y" | ||
10 | + day_names: | ||
11 | + - Sonntag | ||
12 | + - Montag | ||
13 | + - Dienstag | ||
14 | + - Mittwoch | ||
15 | + - Donnerstag | ||
16 | + - Freitag | ||
17 | + - Samstag | ||
18 | + abbr_day_names: | ||
19 | + - So | ||
20 | + - Mo | ||
21 | + - Di | ||
22 | + - Mi | ||
23 | + - Do | ||
24 | + - Fr | ||
25 | + - Sa | ||
26 | + month_names: | ||
27 | + - ~ | ||
28 | + - Jänner | ||
29 | + - Februar | ||
30 | + - März | ||
31 | + - April | ||
32 | + - Mai | ||
33 | + - Juni | ||
34 | + - Juli | ||
35 | + - August | ||
36 | + - September | ||
37 | + - Oktober | ||
38 | + - November | ||
39 | + - Dezember | ||
40 | + abbr_month_names: | ||
41 | + - ~ | ||
42 | + - Jän | ||
43 | + - Feb | ||
44 | + - Mär | ||
45 | + - Apr | ||
46 | + - Mai | ||
47 | + - Jun | ||
48 | + - Jul | ||
49 | + - Aug | ||
50 | + - Sep | ||
51 | + - Okt | ||
52 | + - Nov | ||
53 | + - Dez | ||
54 | + order: | ||
55 | + - :day | ||
56 | + - :month | ||
57 | + - :year | ||
58 | + | ||
59 | + time: | ||
60 | + formats: | ||
61 | + default: "%A, %d. %B %Y, %H:%M Uhr" | ||
62 | + short: "%d. %B, %H:%M Uhr" | ||
63 | + long: "%A, %d. %B %Y, %H:%M Uhr" | ||
64 | + am: "vormittags" | ||
65 | + pm: "nachmittags" | ||
66 | + | ||
67 | + datetime: | ||
68 | + distance_in_words: | ||
69 | + half_a_minute: 'eine halbe Minute' | ||
70 | + less_than_x_seconds: | ||
71 | + one: 'weniger als eine Sekunde' | ||
72 | + other: 'weniger als %{count} Sekunden' | ||
73 | + x_seconds: | ||
74 | + one: 'eine Sekunde' | ||
75 | + other: '%{count} Sekunden' | ||
76 | + less_than_x_minutes: | ||
77 | + one: 'weniger als eine Minute' | ||
78 | + other: 'weniger als %{count} Minuten' | ||
79 | + x_minutes: | ||
80 | + one: 'eine Minute' | ||
81 | + other: '%{count} Minuten' | ||
82 | + about_x_hours: | ||
83 | + one: 'etwa eine Stunde' | ||
84 | + other: 'etwa %{count} Stunden' | ||
85 | + x_days: | ||
86 | + one: 'ein Tag' | ||
87 | + other: '%{count} Tage' | ||
88 | + about_x_months: | ||
89 | + one: 'etwa ein Monat' | ||
90 | + other: 'etwa %{count} Monate' | ||
91 | + x_months: | ||
92 | + one: 'ein Monat' | ||
93 | + other: '%{count} Monate' | ||
94 | + almost_x_years: | ||
95 | + one: 'fast ein Jahr' | ||
96 | + other: 'fast %{count} Jahre' | ||
97 | + about_x_years: | ||
98 | + one: 'etwa ein Jahr' | ||
99 | + other: 'etwa %{count} Jahre' | ||
100 | + over_x_years: | ||
101 | + one: 'mehr als ein Jahr' | ||
102 | + other: 'mehr als %{count} Jahre' | ||
103 | + prompts: | ||
104 | + second: "Sekunden" | ||
105 | + minute: "Minuten" | ||
106 | + hour: "Stunden" | ||
107 | + day: "Tag" | ||
108 | + month: "Monat" | ||
109 | + year: "Jahr" | ||
110 | + | ||
111 | + number: | ||
112 | + format: | ||
113 | + precision: 2 | ||
114 | + separator: ',' | ||
115 | + delimiter: '.' | ||
116 | + significant: false | ||
117 | + strip_insignificant_zeros: false | ||
118 | + currency: | ||
119 | + format: | ||
120 | + unit: '€' | ||
121 | + format: '%u %n' | ||
122 | + separator: ',' | ||
123 | + delimiter: '.' | ||
124 | + precision: 2 | ||
125 | + significant: false | ||
126 | + strip_insignificant_zeros: false | ||
127 | + percentage: | ||
128 | + format: | ||
129 | + delimiter: "" | ||
130 | + precision: | ||
131 | + format: | ||
132 | + delimiter: "" | ||
133 | + human: | ||
134 | + format: | ||
135 | + delimiter: "" | ||
136 | + precision: 1 | ||
137 | + significant: true | ||
138 | + strip_insignificant_zeros: true | ||
139 | + storage_units: | ||
140 | + # Storage units output formatting. | ||
141 | + # %u is the storage unit, %n is the number (default: 2 MB) | ||
142 | + format: "%n %u" | ||
143 | + units: | ||
144 | + byte: | ||
145 | + one: "Byte" | ||
146 | + other: "Bytes" | ||
147 | + kb: "KB" | ||
148 | + mb: "MB" | ||
149 | + gb: "GB" | ||
150 | + tb: "TB" | ||
151 | + decimal_units: | ||
152 | + format: "%n %u" | ||
153 | + units: | ||
154 | + unit: "" | ||
155 | + thousand: Tausend | ||
156 | + million: Millionen | ||
157 | + billion: | ||
158 | + one: Milliarde | ||
159 | + other: Milliarden | ||
160 | + trillion: Billionen | ||
161 | + quadrillion: | ||
162 | + one: Billiarde | ||
163 | + other: Billiarden | ||
164 | + | ||
165 | + support: | ||
166 | + array: | ||
167 | + words_connector: ", " | ||
168 | + two_words_connector: " und " | ||
169 | + last_word_connector: " und " | ||
170 | + select: | ||
171 | + prompt: "Bitte wählen:" | ||
172 | + | ||
173 | + helpers: | ||
174 | + select: | ||
175 | + prompt: "Bitte wählen" | ||
176 | + | ||
177 | + submit: | ||
178 | + create: '%{model} erstellen' | ||
179 | + update: '%{model} aktualisieren' | ||
180 | + submit: '%{model} speichern' | ||
181 | + | ||
182 | + errors: | ||
183 | + format: "%{attribute} %{message}" | ||
184 | + | ||
185 | + messages: &errors_messages | ||
186 | + inclusion: "ist kein gültiger Wert" | ||
187 | + exclusion: "ist nicht verfügbar" | ||
188 | + invalid: "ist nicht gültig" | ||
189 | + confirmation: "stimmt nicht mit der Bestätigung überein" | ||
190 | + accepted: "muss akzeptiert werden" | ||
191 | + empty: "muss ausgefüllt werden" | ||
192 | + blank: "muss ausgefüllt werden" | ||
193 | + too_long: "ist zu lang (nicht mehr als %{count} Zeichen)" | ||
194 | + too_short: "ist zu kurz (nicht weniger als %{count} Zeichen)" | ||
195 | + wrong_length: "hat die falsche Länge (muss genau %{count} Zeichen haben)" | ||
196 | + not_a_number: "ist keine Zahl" | ||
197 | + greater_than: "muss größer als %{count} sein" | ||
198 | + greater_than_or_equal_to: "muss größer oder gleich %{count} sein" | ||
199 | + equal_to: "muss genau %{count} sein" | ||
200 | + less_than: "muss kleiner als %{count} sein" | ||
201 | + less_than_or_equal_to: "muss kleiner oder gleich %{count} sein" | ||
202 | + odd: "muss ungerade sein" | ||
203 | + even: "muss gerade sein" | ||
204 | + not_an_integer: "muss ganzzahlig sein" | ||
205 | + taken: "ist bereits vergeben" | ||
206 | + record_invalid: "Gültigkeitsprüfung ist fehlgeschlagen: %{errors}" | ||
207 | + template: &errors_template | ||
208 | + header: | ||
209 | + one: "Konnte %{model} nicht speichern: ein Fehler." | ||
210 | + other: "Konnte %{model} nicht speichern: %{count} Fehler." | ||
211 | + body: "Bitte überprüfen Sie die folgenden Felder:" | ||
212 | + | ||
213 | + activerecord: | ||
214 | + errors: | ||
215 | + messages: | ||
216 | + <<: *errors_messages | ||
217 | + template: | ||
218 | + <<: *errors_template | ||
219 | + | ||
220 | + full_messages: | ||
221 | + format: "%{attribute} %{message}" |