0

我有一個德語名稱爲'kontakt'的頁面,但訪問是與/ contact。 我開始飛翔的這個bug,在翻譯思維和我做的變化:不重定向。該頁面沒有正確重定向。翻譯在Refinerycms

(控制器)查詢-controller.rb:改變

def find_page 
    @page = ::Refinery::Page.find_by_link_url("/kontakt") 
    end 

的i18n.rb:

config.enabled = true 
config.default_locale = :de 
config.current_locale = :de 
config.default_frontend_locale = :de 
config.frontend_locales = [:en, :de] 
config.locales = { :en => 'English', :de => 'Deutsch' } 

我改變了(模型)setting.rb:

def confirmation_subject(locale="de")... 

而不是'en'。

我將refinerycms中的重定向更改爲/ kontakt。

我在瀏覽器中收到錯誤「頁面沒有正確重定向」。

控制檯:

開始GET 「/ KONTAKT」 爲127.0.0.1,在2013年2月19日17時07分27秒+0100 處理由煉油廠:: PagesController#顯示爲HTML參數: 煉油廠::角色負荷(0.2毫秒)選擇 「煉油廠」。*從「煉油廠」在哪裏 「煉油廠」。「」標題「='煉油廠'LIMIT 1 Refinery :: User Load (0.2ms)SELECT「refinery_users」。* FROM「refinery_users」INNER JOIN 「refinery_roles_users」ON「refinery_users」。「id」= 「refinery_roles_users」。「user_id 「WHERE 」refinery_roles_users「。」 ROLE_ID 「= 1個煉油廠::頁面加載(0.4ms) SELECT 」refinery_pages「。* FROM 」refinery_pages「 INNER JOIN 」refinery_page_translations「 ON 」refinery_page_translations「。 」refinery_page_id「= 」 refinery_pages「。」id「WHERE」refinery_page_translations「。」locale「IN ('en','de')AND」refinery_page_translations「。」slug「='kontakt'AND 」refinery_pages「。」parent_id「IS NULL LIMIT 1重定向到 ../kontakt煉油廠::用戶負荷(0.1ms)選擇 「煉油廠用戶」。*從「煉油廠用戶」哪裏「煉油廠用戶」。「id」= 3極限1煉油廠::角色負荷(0.1ms)SELECT 「refinery_roles」* FROM 「refinery_roles」INNER JOIN「refinery_roles_users」 ON 「refinery_roles」。「id」=「refinery_roles_users」。「role_id」其中 「refinery_roles_users」。「user_id」= 3已完成302已在8ms中找到 (ActiveRecord:1.1ms)cache:[GET/kontakt] miss cache: [GET/KONTAKT] 小姐

development.log的日誌:

開始GET 「/ KONTAKT」 爲127.0.0.1,在2013年2月19日17時07分27秒+0100 Refinery處理:: PagesController#顯示爲HTML參數: {「path」=>「kontakt」,「locale」=>:de} [1m [35mRefinery :: Role Load (0.1毫秒)[0米SELECT 「refinery_roles」。* FROM 「refinery_roles」 WHERE 「refinery_roles」。 「標題」= '煉油廠' LIMIT 1
[1分[36mRefinery ::用戶負載(在0.2ms)[0米[1mSELECT 「煉油廠用戶」。* FROM 「refinery_users」 INNER JOIN 「refinery_roles_users」 ON 「refinery_users」。 「ID」= 「refinery_roles_users」。 「USER_ID」 WHERE 「refinery_roles_users」。 「ROLE_ID」= 1 [0米[1分[35mRefinery ::頁 負載(在0.2ms)[0米SELECT 「refinery_pages」。* FROM 「refinery_pages」 INNER JOIN 「refinery_page_translations」 ON 「refinery_page_translations」。 「refinery_page_id」= 「refinery_pages」。 「ID」 WHERE 「refinery_page_translations」。 「區域」 IN ('en','de')和「refinery_page_translations」。「slug」='kontakt'AND 「refinery_pages」。「parent_id」IS NULL LIMIT 1重定向到 //../kontakt [1m [36mRefinery :: User加載 (0.1ms)[0m [1mSELECT「refinery_users」。* FROM「refinery_users」WHERE 「refinery_users」。 「ID」= 3 LIMIT 1 [0米[1分[35mRefinery ::角色負載 (0.1毫秒)[0米SELECT 「refinery_roles」。* FROM 「refinery_roles」 INNER JOIN 「refinery_roles_users」 ON 「refinery_roles」。 「ID」= 「refinery_roles_users」 「ROLE_ID」 WHERE 「refinery_roles_users」 「USER_ID」= 3完成302在6ms的 。實測值(ActiveRecord的:爲0.8ms)

我在文件中的翻譯: en.yml and de.yml

我看過http://refinerycms.com/edge-guides/translate-refinery 中的信息,但我無法找到解決方案。

如果我嘗試輸入/ contact,即使進行了所有更改,效果也不錯。

此外,在頁面的形式中,驗證正在讀取英文值。

+0

難道是:'@page = :: Refinery :: Page.find_by_link_url(t.contact)'? – 2013-02-19 16:23:31

回答

0

我在我的網站上遇到了同樣的問題,並嘗試了很多不同的方法來解決它。最後,簡單的解決方案奏效了。嘗試這樣做:

轉到插件。 全選 - 勾選每個複選框 選擇取消激活 測試網站 - 它可能會或可能不會工作 在這之後「重新激活」所有插件。

希望能解決它。我嘗試過很多其他的事情之後做這個,它運行良好!我希望我會先這樣做。

+0

「轉到插件」是什麼意思?你在使用一些IDE嗎? – 2013-03-19 16:37:32

相關問題