jekyll-date-localization 0.0.8 → 0.0.10

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: b48f4b8e85831bde796a16a203aaaaa5fd21c3c3d23cfd7e56cd4ce397b3f4c8
4
+ data.tar.gz: 9ce8376fda11b562625a832cc147be3d5fbe078c0c0fa27340f8a4621c9862d9
5
5
  SHA512:
6
- metadata.gz: 9f3415bf45e0139663c772f9c11e634a6d812b87499623625d4f0c819d810764b5e2c5d19bbf4c27ba41d38b8ab68c711b61933ec751d932363b76650af0fa90
7
- data.tar.gz: 1aba39a8cedd407eb4cbadf2a0b0c90214661f2ec9c907ae6e454076b717f65d56f629747a59dc26140d9e59d3f58ce1946e8199c3dc227f82fa4d1f068bfa6e
6
+ metadata.gz: 5e8e7dbb182632430704ca1bdda5476e6d5a719f118a9fbad475e51dd7d95c8c25323c2875a3700ccac18e21275b0cd1e0f725301efd35d1dfa3e23d526dcf39
7
+ data.tar.gz: 2f5c8b7a7148e9a40f7c14e49b84aad67700bdbde655c023adc09639089c84dd783e8d79034635171764ac714784a4b9a3ab90aa642133effa781cbb59a0c3e3
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
@@ -0,0 +1,47 @@
1
+ ---
2
+ nl:
3
+ date:
4
+ abbr_day_names:
5
+ - zo
6
+ - ma
7
+ - di
8
+ - wo
9
+ - do
10
+ - vr
11
+ - za
12
+ abbr_month_names:
13
+ -
14
+ - jan
15
+ - feb
16
+ - mrt
17
+ - apr
18
+ - mei
19
+ - jun
20
+ - jul
21
+ - aug
22
+ - sep
23
+ - okt
24
+ - nov
25
+ - dec
26
+ day_names:
27
+ - zondag
28
+ - maandag
29
+ - dinsdag
30
+ - woensdag
31
+ - donderdag
32
+ - vrijdag
33
+ - zaterdag
34
+ month_names:
35
+ -
36
+ - januari
37
+ - februari
38
+ - maart
39
+ - april
40
+ - mei
41
+ - juni
42
+ - juli
43
+ - augustus
44
+ - september
45
+ - oktober
46
+ - november
47
+ - december
@@ -0,0 +1,48 @@
1
+ ---
2
+ ru:
3
+ date:
4
+ abbr_day_names:
5
+ - Вс
6
+ - Пн
7
+ - Вт
8
+ - Ср
9
+ - Чт
10
+ - Пт
11
+ - Сб
12
+ abbr_month_names:
13
+ -
14
+ - янв.
15
+ - февр.
16
+ - мар.
17
+ - апр.
18
+ - мая
19
+ - июн.
20
+ - июл.
21
+ - авг.
22
+ - сент.
23
+ - окт.
24
+ - нояб.
25
+ - дек.
26
+ day_names:
27
+ - воскресенье
28
+ - понедельник
29
+ - вторник
30
+ - среда
31
+ - четверг
32
+ - пятница
33
+ - суббота
34
+ month_names:
35
+ -
36
+ - января
37
+ - февраля
38
+ - марта
39
+ - апреля
40
+ - мая
41
+ - июня
42
+ - июля
43
+ - августа
44
+ - сентября
45
+ - октября
46
+ - ноября
47
+ - декабря
48
+
metadata CHANGED
@@ -1,11 +1,10 @@
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.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - krupkat
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
10
  date: 1980-01-01 00:00:00.000000000 Z
@@ -24,8 +23,6 @@ dependencies:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
25
  version: '1.0'
27
- description:
28
- email:
29
26
  executables: []
30
27
  extensions: []
31
28
  extra_rdoc_files:
@@ -41,14 +38,15 @@ files:
41
38
  - lib/locales/fr.yml
42
39
  - lib/locales/id.yml
43
40
  - lib/locales/it.yml
41
+ - lib/locales/nl.yml
44
42
  - lib/locales/pt.yml
45
43
  - lib/locales/ro.yml
44
+ - lib/locales/ru.yml
46
45
  - lib/locales/tr.yml
47
46
  homepage: https://github.com/krupkat/jekyll-date-localization
48
47
  licenses:
49
48
  - MIT
50
49
  metadata: {}
51
- post_install_message:
52
50
  rdoc_options: []
53
51
  require_paths:
54
52
  - lib
@@ -63,8 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
61
  - !ruby/object:Gem::Version
64
62
  version: '0'
65
63
  requirements: []
66
- rubygems_version: 3.5.21
67
- signing_key:
64
+ rubygems_version: 3.6.6
68
65
  specification_version: 4
69
66
  summary: Liquid filter for custom locale date formatting.
70
67
  test_files: []