Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
4dbfe18b
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4dbfe18b
编写于
10月 29, 2008
作者:
D
David Heinemeier Hansson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Proper API for reloading translations
上级
4ad5aa9a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
4 deletion
+16
-4
actionpack/lib/action_controller/dispatcher.rb
actionpack/lib/action_controller/dispatcher.rb
+4
-0
actionpack/test/template/translation_helper_test.rb
actionpack/test/template/translation_helper_test.rb
+2
-2
activesupport/CHANGELOG
activesupport/CHANGELOG
+1
-1
activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb
activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb
+7
-0
activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb
...b/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb
+2
-1
未找到文件。
actionpack/lib/action_controller/dispatcher.rb
浏览文件 @
4dbfe18b
...
...
@@ -28,6 +28,10 @@ def define_dispatcher_callbacks(cache_classes)
end
after_dispatch
:flush_logger
if
Base
.
logger
&&
Base
.
logger
.
respond_to?
(
:flush
)
to_prepare
do
I18n
.
reload!
end
end
# Backward-compatible class method takes CGI-specific args. Deprecated
...
...
actionpack/test/template/translation_helper_test.rb
浏览文件 @
4dbfe18b
...
...
@@ -10,8 +10,8 @@ def setup
end
def
test_delegates_to_i18n_setting_the_raise_option
I18n
.
expects
(
:translate
).
with
(
:foo
,
'en-US'
,
:raise
=>
true
)
translate
:foo
,
'en-US'
I18n
.
expects
(
:translate
).
with
(
:foo
,
:locale
=>
'en-US'
,
:raise
=>
true
)
translate
:foo
,
:locale
=>
'en-US'
end
def
test_returns_missing_translation_message_wrapped_into_span
...
...
activesupport/CHANGELOG
浏览文件 @
4dbfe18b
*2.2.1 [RC2 or 2.2 final]*
* Make I18n::Backend::Simple reload its translations in development mode [DHH]
* Make I18n::Backend::Simple reload its translations in development mode [DHH
/Sven Fuchs
]
*2.2.0 [RC1] (October 24th, 2008)*
...
...
activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb
浏览文件 @
4dbfe18b
...
...
@@ -67,6 +67,13 @@ def load_path
def
load_path
=
(
load_path
)
@@load_path
=
load_path
end
# Tells the backend to reload translations. Used in situations like the
# Rails development environment. Backends can implement whatever strategy
# is useful.
def
reload!
backend
.
reload!
end
# Translates, pluralizes and interpolates a given key using a given locale,
# scope, and default, as well as interpolation values.
...
...
activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb
浏览文件 @
4dbfe18b
...
...
@@ -69,8 +69,9 @@ def initialized?
@initialized
||=
false
end
def
reload
def
reload
!
@initialized
=
false
@translations
=
nil
end
protected
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录