seeds multiple language localization fix #314

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants

sunbeta commented Jan 14, 2013

No description provided.

@ugisozols ugisozols commented on the diff Jan 14, 2013

db/seeds.rb
- user.plugins.create(:name => "refinerycms_blog",
- :position => (user.plugins.maximum(:position) || -1) +1)
- end
-end if defined?(Refinery::User)
-
-if defined?(Refinery::Page) and !Refinery::Page.exists?(:link_url => '/blog')
- page = Refinery::Page.create(
- :title => "Blog",
- :link_url => "/blog",
- :deletable => false,
- :menu_match => "^/blogs?(\/|\/.+?|)$"
- )
-
- Refinery::Pages.default_parts.each do |default_page_part|
- page.parts.create(:title => default_page_part, :body => nil)
+(Refinery.i18n_enabled? ? Refinery::I18n.frontend_locales : [:en]).each do |lang|
@ugisozols

ugisozols Jan 14, 2013

Owner

In 2.1.x Refinery::I18n is a dependency of core so you don't need to check if i18n_enabled? anymore. You can simplify that line to:

Refinery::I18n.frontend_locales.each do |lang|
@parndt

parndt Jan 14, 2013

Owner

This fails CI because Refinery doesn't know about i18n_enabled? anymore so the fix proposed by @ugisozols seems best.

@keram keram commented on the diff Jan 18, 2013

db/seeds.rb
+ user.plugins.create(:name => "refinerycms_blog",
+ :position => (user.plugins.maximum(:position) || -1) +1)
+ end
+ end if defined?(Refinery::User)
+
+ if defined?(Refinery::Page) and !Refinery::Page.exists?(:link_url => '/blog')
+ page = Refinery::Page.create(
+ :title => "Blog",
+ :link_url => "/blog",
+ :deletable => false,
+ :menu_match => "^/blogs?(\/|\/.+?|)$"
+ )
+
+ Refinery::Pages.default_parts.each do |default_page_part|
+ page.parts.create(:title => default_page_part, :body => nil)
+ end
@keram

keram Jan 18, 2013

Contributor

and here should come:
I18n.locale = I18n.default_locale
because we want clean up after us, don't we? :)

Owner

ugisozols commented Jan 29, 2013

@sunbeta are you keen to fix this PR or should we close it?

Owner

parndt commented May 12, 2013

Any interest in this?

Owner

ugisozols commented May 26, 2013

Closing due to inactivity.

ugisozols closed this May 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment