tensaku 0.3.2 → 0.3.3

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: 92fbd2ab82b537296cc2edb2cbc618159a7dea15d583bf78393302d0d6c27e01
4
- data.tar.gz: 3074f2f9c8f83a8a36a0bc6d74e5ec5c545426266c7d48a477d66794b549ea5b
3
+ metadata.gz: b85e25c0908ff926f34990959e4cf539a65723a1d817be76bdfdfeec67634eea
4
+ data.tar.gz: 0fa2be4e5a165a65b4d42e3b04cbad682548d6ec592589a11cc940837cfb6fab
5
5
  SHA512:
6
- metadata.gz: abd981956fb9faecaa18b43e49bdb69cb32c5a16b4ab8d10dceb8c4a5ca6e18d4ef672b63f29e9360eb630765d8cebc1024fa148a8f5de2de64135e2c115addd
7
- data.tar.gz: 33aabacb80683ae4ad743883017353402189f4390204e14047316a12880c40ea3f8e044d20e3d3c3be59189840c0be62764b1132ef218fd91a4bbd188c6df082
6
+ metadata.gz: 63e73b513751d13bb6975a880b98502eddfc901f856ea672b8dc715b5cdfa22dff7b76cabd1fbdd0f55ed325c2e57ed360646380a018520ade94d356fb2aa9c0
7
+ data.tar.gz: 8e790a1f2f1296af9523ddcd32239cf09a0dfc6d694f1e2ad55c49b376b7830bb4e0d458c7e4a4804d292844a0fc4ce84a9c7f92ee3646bbd9ddf0facd6d6b0b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.3 (2026-11-15)
4
+
5
+ - With [meta-tags](https://github.com/kpumuk/meta-tags), pages keep their own title in development.
6
+ meta-tags counted translation markers toward its 70-character title limit, so a marked site name
7
+ used up the limit and every page showed only the site name. Titles, descriptions and keywords now
8
+ reach meta-tags without markers and are truncated as in production.
9
+
3
10
  ## 0.3.2 (2026-11-15)
4
11
 
5
12
  - A note on translated text is saved again. It failed with `NoMethodError: undefined method '[]'`
data/lib/tensaku/i18n.rb CHANGED
@@ -103,6 +103,16 @@ module Tensaku
103
103
  end
104
104
  end
105
105
 
106
+ # meta-tags measures titles, descriptions and keywords against character limits, and counts a
107
+ # marker (four characters per byte of "locale:key") as text. A marked site name alone can use up
108
+ # the 70-character title limit, so the page title was cut away. The overlay never edits the head,
109
+ # so meta-tags gets the text alone and truncates as it does in production.
110
+ module MetaTagsText
111
+ def cleanup_string(string, strip: true)
112
+ super(string.respond_to?(:to_str) ? I18nMarkers.strip(string.to_str) : string, strip:)
113
+ end
114
+ end
115
+
106
116
  def page?
107
117
  Thread.current[:tensaku_i18n_page] == true
108
118
  end
@@ -49,6 +49,7 @@ module Tensaku
49
49
  if defined?(ActiveModel::Type::String)
50
50
  [ ActiveModel::Type::ImmutableString, ActiveModel::Type::String ].each { it.prepend(Tensaku::I18nMarkers::ModelStrings) }
51
51
  end
52
+ MetaTags::TextNormalizer.prepend(Tensaku::I18nMarkers::MetaTagsText) if defined?(MetaTags::TextNormalizer)
52
53
 
53
54
  if (warning = Tensaku::Caches.fragment_cache_warning)
54
55
  Rails.logger.warn("[Tensaku] #{warning}")
@@ -1,3 +1,3 @@
1
1
  module Tensaku
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tensaku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Afonso