jekyll-date-localization 0.0.8 → 0.0.9

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
  SHA256:
3
- metadata.gz: 7a3a5345e524fe213d477ae293ad0c1a18a9fa4d2e31e722af6bf2bf8f3c01cf
4
- data.tar.gz: 816c972056e7f1004c82560cabd39a5fb74bf70e394e89b9d8b12f7a0f3a849c
3
+ metadata.gz: 45670a887f36bda1dd69b7bbf087331b2ec7dfc1d11fe5b8c18250628fdc0aea
4
+ data.tar.gz: 86b58d608f2de5ab59ae8452da1ac4991e0b65f4080f3af00306a2f225ddc846
5
5
  SHA512:
6
- metadata.gz: 9f3415bf45e0139663c772f9c11e634a6d812b87499623625d4f0c819d810764b5e2c5d19bbf4c27ba41d38b8ab68c711b61933ec751d932363b76650af0fa90
7
- data.tar.gz: 1aba39a8cedd407eb4cbadf2a0b0c90214661f2ec9c907ae6e454076b717f65d56f629747a59dc26140d9e59d3f58ce1946e8199c3dc227f82fa4d1f068bfa6e
6
+ metadata.gz: 26efb836c6fa1bfe09debd6e429d656df78e751584507998423ecb1d119360251fce9a1a05850b9b3056047051b874ff04772105ba81f292c35a139be41a18c7
7
+ data.tar.gz: c4ebea4f5613ba541def88e1ae6e07031eebde19c14d3729945b4e2fe1eb8b908fd73204538080e156c13cc7f7254f22bb4297c6b7d7d97468fef1c589791c58
data/README.md CHANGED
@@ -22,10 +22,11 @@ And then execute the `bundle` command to install the gem.
22
22
 
23
23
  ## Configuration
24
24
 
25
- You can configure the default locale in your `config.yml` file:
25
+ You can configure the default locale and the path to your custom language files in your `_config.yml` file:
26
26
 
27
- ```
27
+ ```yml
28
28
  date_locale: cs
29
+ locales_path: src/_locales
29
30
  ```
30
31
 
31
32
  ## Usage
@@ -46,7 +47,7 @@ For details about the formatting string, see [strftime](https://ruby-doc.org/std
46
47
 
47
48
  ## Additional languages
48
49
 
49
- There are a couple of built-in languages in this repository in the [lib/locales](https://github.com/krupkat/jekyll-date-localization/tree/main/lib/locales) directory. If you want to add your own language file or override one of the included languages, create a new `*.yml` language definition file and put it in the `_locales` directory of your project.
50
+ There are a couple of built-in languages in this repository in the [lib/locales](https://github.com/krupkat/jekyll-date-localization/tree/main/lib/locales) directory. If you want to add your own language file or override one of the included languages, create a new `*.yml` language definition file and put it in the `_locales` directory of your project. This path can be customized by setting the `locales_path` option in your `_config.yml`.
50
51
 
51
52
  # Contribute
52
53
 
@@ -5,7 +5,7 @@ module Jekyll
5
5
  module I18nFilter
6
6
  def localize(input, format=nil, locale=nil)
7
7
  load_translations
8
- locale = locale || @context.registers[:site].config["date_locale"]
8
+ locale = locale || @context.registers[:site].config['date_locale']
9
9
  if input.is_a?(String)
10
10
  input = DateTime.parse(input)
11
11
  end
@@ -14,8 +14,9 @@ module Jekyll
14
14
 
15
15
  def load_translations
16
16
  unless I18n::backend.instance_variable_get(:@translations)
17
+ locales_path = @context.registers[:site].config['locales_path'] || '_locales'
17
18
  I18n.backend.load_translations \
18
- Dir[File.join(File.dirname(__FILE__),'locales/*.yml')] + Dir['_locales/*.yml']
19
+ Dir[File.join(File.dirname(__FILE__),'locales/*.yml')] + Dir[File.join(locales_path, '*.yml')]
19
20
  end
20
21
  end
21
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-date-localization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - krupkat
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 1980-01-01 00:00:00.000000000 Z
11
+ date: 2025-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -24,8 +24,8 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
- description:
28
- email:
27
+ description:
28
+ email:
29
29
  executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files:
@@ -48,7 +48,7 @@ homepage: https://github.com/krupkat/jekyll-date-localization
48
48
  licenses:
49
49
  - MIT
50
50
  metadata: {}
51
- post_install_message:
51
+ post_install_message:
52
52
  rdoc_options: []
53
53
  require_paths:
54
54
  - lib
@@ -63,8 +63,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  requirements: []
66
- rubygems_version: 3.5.21
67
- signing_key:
66
+ rubygems_version: 3.3.5
67
+ signing_key:
68
68
  specification_version: 4
69
69
  summary: Liquid filter for custom locale date formatting.
70
70
  test_files: []