magic_locales 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +20 -0
- data/lib/generators/magic_locales/install_generator.rb +4 -3
- data/lib/magic_locales/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29afe049a24c62e057bd1ea689aef47a83d3a87b
|
4
|
+
data.tar.gz: b920d3dce09ae628af9188497775d28b91671cfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54e7e55f58b17ae4bfce5f6cdff0c4c8236229cb2fb8cb91e4ad6d52cb9dc4c839895621f82a0ce118a999f07f58c0226012052578f2cd94f9ad6b0251741774
|
7
|
+
data.tar.gz: f9134956a0191a2655981d52b9ecba5330c0e7db4bd41ffc1bfc6ad09af82bd22fa0e06480871ccb8c2fbffa97faa8d6722bb9e14abb9f1fd6138ac7a6fd9b9a
|
data/README.md
CHANGED
@@ -37,6 +37,26 @@ The gem includes a seed file with most common european locales.
|
|
37
37
|
|
38
38
|
|
39
39
|
|
40
|
+
#### Features
|
41
|
+
|
42
|
+
- Seed-file for this languages
|
43
|
+
```ruby
|
44
|
+
bg, cs, da, nl, en, fi, fr, de, el, hr, hu, it, pl, pt, ru, es, sv, uk
|
45
|
+
```
|
46
|
+
- each translated in:
|
47
|
+
```ruby
|
48
|
+
cs, de, en, es, fr, it, pl, ru
|
49
|
+
```
|
50
|
+
- locale switch helper (only visible, if more than 1 locale is live)
|
51
|
+
```ruby
|
52
|
+
<%= render "magic_locales/locale_switch" %>
|
53
|
+
```
|
54
|
+
- helper to show fields for each active language (globalize helper)
|
55
|
+
```ruby
|
56
|
+
<%= f.globalize_fields_for lc do |g| %>
|
57
|
+
# ..
|
58
|
+
<% end %>
|
59
|
+
```
|
40
60
|
|
41
61
|
#### License
|
42
62
|
This project rocks and uses MIT-LICENSE.
|
@@ -5,8 +5,9 @@ module MagicLocales
|
|
5
5
|
class InstallGenerator < ::Rails::Generators::Base
|
6
6
|
include Rails::Generators::Migration
|
7
7
|
source_root File.expand_path('../templates', __FILE__)
|
8
|
-
desc "add magic_locales migrations"
|
9
8
|
|
9
|
+
|
10
|
+
desc "add magic_locales migrations"
|
10
11
|
def self.next_migration_number(path)
|
11
12
|
unless @prev_migration_nr
|
12
13
|
@prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
|
@@ -24,7 +25,7 @@ module MagicLocales
|
|
24
25
|
empty_directory( "db/seeds" )
|
25
26
|
end
|
26
27
|
|
27
|
-
desc "add
|
28
|
+
desc "add locale-seed file"
|
28
29
|
def copy_country_seeds
|
29
30
|
copy_file( "locale_seeds.rb", "db/seeds/locales.rb" )
|
30
31
|
end
|
@@ -34,7 +35,7 @@ module MagicLocales
|
|
34
35
|
# => copy_file( "magic_initializer.rb", "config/initializers/magic_addresses.rb" )
|
35
36
|
# => end
|
36
37
|
|
37
|
-
desc "add
|
38
|
+
desc "add magic_locales routes"
|
38
39
|
def copy_mgca_routes
|
39
40
|
route <<-ROUTE
|
40
41
|
|