buddy_translatable 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -1
- data/lib/buddy_translatable/core.rb +1 -1
- data/lib/buddy_translatable/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e189cdc05da2e42b02d5863d2b936003417be87ec79076a111c7c96278fab31
|
4
|
+
data.tar.gz: 3cc54ac8f488cdb2318fcc624b1a2719c7db976b8b270d274788eae73ab25dd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d83e39ffa2db864154bb58cbebef361034c20c9f7388b6191bbce7b0fcd030b3250f608e0ed8dd5cb66262fad941e5bc6b758b7358cb18e5b3207b8bd1124415
|
7
|
+
data.tar.gz: 7b97f4bdce0772d5fd170bc195110b445eb211754e18fbd99edac3ad6a34795ca6632ffa892f10d594497a2aee99702ae8ae43c3bbae7e6bd625d8e9b26b2ea9
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -11,7 +11,10 @@ Allows you to store text data in multiple languages. Based on [translateable](ht
|
|
11
11
|
```ruby
|
12
12
|
class Post < ActiveRecord::Base
|
13
13
|
include BuddyTranslatable
|
14
|
-
translatable :title
|
14
|
+
translatable :title
|
15
|
+
# translatable :title, default_key: :de, available_locales: [:de, :en]
|
16
|
+
# default_key: by default use `I18n.default_locale`
|
17
|
+
# available_locales: by default `I18n.available_locales`
|
15
18
|
end
|
16
19
|
|
17
20
|
post = Post.create(title: { de: 'Hallo', en: 'Hello' })
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module BuddyTranslatable
|
4
4
|
module Core
|
5
|
-
def translatable(*attrs, default_key:
|
5
|
+
def translatable(*attrs, default_key: I18n.default_locale, available_locales: nil)
|
6
6
|
available_locales ||= I18n.available_locales
|
7
7
|
attrs.each do |attr|
|
8
8
|
define_translatable_methods(attr, default_key.to_sym)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buddy_translatable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|