forked from bryanlarsen/agility-gitorial-patches
-
Notifications
You must be signed in to change notification settings - Fork 1
/
75-translating.patch
48 lines (37 loc) · 1.9 KB
/
75-translating.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
translating
From: Bryan Larsen <[email protected]>
# Translating the Application
A lot of Hobos speak languages other than English, so let's translate our application so they feel at home.
First we'll make a couple of temporary tweaks to our configuration.
SHOW_PATCH
The tweak to `config/application.rb` shows you where to change the default locale. Normally you want to set the locale dynamically, perhaps based on the domain name. However, that's outside the scope of this tutorial. See [the Rails guide to i18n](http://guides.rubyonrails.org/i18n.html) for more information.
The tweak to `config/environments/development.rb` tells Hobo to show
the keys used to generate each string. This makes the application
look like a mess, so you'll want to turn this off as soon as you have
a handle on your translation.
---
config/application.rb | 2 +-
config/environments/development.rb | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/config/application.rb b/config/application.rb
index c2516d1..ed035a0 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -44,7 +44,7 @@ module Agility
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
- # config.i18n.default_locale = :de
+ config.i18n.default_locale = :en
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
diff --git a/config/environments/development.rb b/config/environments/development.rb
index a9d6741..3d77ba5 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -36,4 +36,7 @@ Agility::Application.configure do
# Expands the lines which load the assets
config.assets.debug = true
+
+ # turn this off after you're done translating
+ config.hobo.show_translation_keys = true
end