smart_locales 0.1.1 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e02830221b9199cd65600555c1ccdbaa7b333eb8
4
- data.tar.gz: f76ce6b8cd3cb9eaa8710bf8780da38bbdb00fdb
3
+ metadata.gz: bcf6a300c0cf6389b99822b14a15358a4e42b637
4
+ data.tar.gz: 9a44fe4b93a41366e0f4379e54e965c6076153a1
5
5
  SHA512:
6
- metadata.gz: 31948aa66896b63fc14c397b1c3fe7953f42a529ae3655913ed6cbb9735c59c88613011f9d9b890f62be477c7e062f3e32c5c9464241c3460fc41e365b79c2e8
7
- data.tar.gz: a5aad9649f509e6bd2966c1a159370d07dfb90bb6cc7072e4202b0bcc69bfe65832de19c0ad7f7cb44a3c215bc052b0231f8c1a817e2a77af6effebaded1f882
6
+ metadata.gz: f2118ed297758528bcb49f8ae39bd4e001c634a443091d79f57ef957db4e83817fabb542ab9e58b60e22fa003aed96ec931b444171964dc9c96d107e75a1ffb4
7
+ data.tar.gz: 9244a86e02546da06b4925e1dfc17e797ce7bbf21ad328a42812ffd1ad86358e74f4ff698a281dc6dc08273d21eee7ad6a996670d8ca5f011ade4fd64b757656
data/README.md CHANGED
@@ -1,9 +1,5 @@
1
1
  # SmartLocales
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/smart_locales`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
3
  ## Installation
8
4
 
9
5
  Add this line to your application's Gemfile:
@@ -22,7 +18,21 @@ Or install it yourself as:
22
18
 
23
19
  ## Usage
24
20
 
25
- TODO: Write usage instructions here
21
+ ### Helpers
22
+
23
+ * page_title
24
+ * default_title
25
+ * title
26
+
27
+ Using `page_title`
28
+
29
+ ```ruby
30
+ page_title(action_name, genitive_model_name)
31
+
32
+ # FOR EXAMPLE
33
+
34
+ page_title(:create, 'пользователя') => 'Создать пользователя'
35
+ ```
26
36
 
27
37
  ## Development
28
38
 
@@ -1,4 +1,4 @@
1
- module SmartLocales::Title::Helper
1
+ module SmartLocales::Title::Helpers
2
2
  def title(page_title = default_title, area = :default)
3
3
  if area != :default
4
4
  title_text = "#{page_title} | #{t("area.#{area}")} | #{t('application.name')}"
@@ -0,0 +1,8 @@
1
+ ru:
2
+ helpers:
3
+ actions:
4
+ create: Создать
5
+ new: Создать
6
+ edit: Редактировать
7
+ update: Редактировать
8
+ delete: Удалить
@@ -1,3 +1,3 @@
1
1
  module SmartLocales
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/smart_locales.rb CHANGED
@@ -1,7 +1,9 @@
1
1
  require "smart_locales/version"
2
2
  require "smart_locales/title"
3
- require "smart_locales/title/helper"
3
+ require "smart_locales/title/helpers"
4
4
 
5
5
  module SmartLocales
6
- ActionView::Base.send :include, SmartLocales::Title::Helper
6
+ gem_root = Gem::Specification.find_by_name('smart_locales').gem_dir
7
+ I18n.load_path << gem_root + '/lib/smart_locales/title/helpers.yml'
8
+ ActionView::Base.send :include, SmartLocales::Title::Helpers
7
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_locales
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
@@ -54,7 +54,8 @@ files:
54
54
  - bin/setup
55
55
  - lib/smart_locales.rb
56
56
  - lib/smart_locales/title.rb
57
- - lib/smart_locales/title/helper.rb
57
+ - lib/smart_locales/title/helpers.rb
58
+ - lib/smart_locales/title/helpers.yml
58
59
  - lib/smart_locales/version.rb
59
60
  - smart_locales.gemspec
60
61
  homepage: https://github.com/kalashnikovisme/smart_locales