2012-03-15 8 views
0

のために、私は私のWebアプリを翻訳して、このガイドに従うことをしようと行方不明:Ruby on Rails Guides国際化の翻訳のみ管理

私は私の言語のための私のel.yml(ギリシャ)作り、私のGemfileは宝石「レール-I18N」を持っていると私application_controllerのコードは、私が

<%= l(Time.now, :format => :short) %></p 

を使用し、すべてはギリシャ語で時間を見て、私のユーザーと大丈夫です私application.html.erbで

before_filter :set_locale 

def set_locale 
    I18n.locale = params[:locale] || I18n.default_locale 
end 

def default_url_options(options={}) 
    logger.debug "default_url_options is passed options: #{options.inspect}\n" 
{ :locale => I18n.locale } 
end 

を持っています。しかし、ユーザーの最初の5つのidsはadminsとadmins_controllerが記事を処理します。管理者は、時間を見てみると、このエラーを取る:

I18n::MissingTranslationData in Admin#articles 
Showing /home/panagiotis/projects/diplomatiki/app/views/layouts/application.html.erb where line #43 raised: 
translation missing: el?state=4.time.formats.short 

-

class AdminController < ApplicationController 

class ApplicationController < ActionController::Base 

AdminController(継承)していけない理由はApplicationControllerにしてすべての作業を?私の問題のため

答えて

0

最終的な解決策は、すべてのリンクはエルのような拡張子を持って、このコードをフォローコード

before_filter :set_locale 

def set_locale 
    I18n.locale = params[:locale] || I18n.default_locale 
end 

def default_url_options(options={}) 
    logger.debug "default_url_options is passed options: #{options.inspect}\n" 
    { :locale => I18n.locale } 
end 

を削除しますか?私の既定のリンクは機能しませんでした 今、私はギリシャ語でl(Time.now、:format =>:short)を使っています。

関連する問題