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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/tensaku/i18n.rb +10 -0
- data/lib/tensaku/railtie.rb +1 -0
- data/lib/tensaku/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b85e25c0908ff926f34990959e4cf539a65723a1d817be76bdfdfeec67634eea
|
|
4
|
+
data.tar.gz: 0fa2be4e5a165a65b4d42e3b04cbad682548d6ec592589a11cc940837cfb6fab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/tensaku/railtie.rb
CHANGED
|
@@ -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}")
|
data/lib/tensaku/version.rb
CHANGED