internationalize 0.2.3 → 0.2.4
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 +12 -0
- data/README.md +13 -0
- data/context/model-api.md +33 -0
- data/lib/internationalize/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: bfc56411ee42ac5d8377fe409418e1692acc4cb0c5cd60899acd70003f0d4dd7
|
|
4
|
+
data.tar.gz: 9a437ba5771695b1d84b7d95e61d4df4e342725501df6dc947809245750054a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4354ea3355e467ebfc465feacdb707189b5981f6df04e8620e8b72dbf4c84f4df8e2d454e3a405f0ffd7c923ec4c8c946f119241b99ddf978d700fbeebb1ecbf
|
|
7
|
+
data.tar.gz: 82e139593ed3296be30e601376b147cfaf2690255f25c2be69b7add169568b388ad721bd14a0f6244489987e4bbf9fc4a89f303a8c87a1f94eca99f5e524b8b0
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.4] - 2024-11-29
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Fixtures documentation and tests demonstrating YAML format for translation columns
|
|
15
|
+
|
|
16
|
+
## [0.2.3] - 2024-11-29
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Auto-load RichText via Rails Railtie (fixes load order issue)
|
|
21
|
+
|
|
10
22
|
## [0.2.2] - 2024-11-29
|
|
11
23
|
|
|
12
24
|
### Added
|
data/README.md
CHANGED
|
@@ -196,6 +196,19 @@ article.content.body # ActionText::Content object
|
|
|
196
196
|
article.content.embeds # Attachments work per-locale
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
+
### Fixtures
|
|
200
|
+
|
|
201
|
+
Use the `*_translations` column name with nested locale keys:
|
|
202
|
+
|
|
203
|
+
```yaml
|
|
204
|
+
# test/fixtures/articles.yml
|
|
205
|
+
hello_world:
|
|
206
|
+
title_translations:
|
|
207
|
+
en: "Hello World"
|
|
208
|
+
de: "Hallo Welt"
|
|
209
|
+
status: published
|
|
210
|
+
```
|
|
211
|
+
|
|
199
212
|
## Configuration
|
|
200
213
|
|
|
201
214
|
```ruby
|
data/context/model-api.md
CHANGED
|
@@ -113,3 +113,36 @@ article.content # Gets for current locale (with fallback)
|
|
|
113
113
|
article.content.body # ActionText::Content object
|
|
114
114
|
article.content.embeds # Attachments work per-locale
|
|
115
115
|
```
|
|
116
|
+
|
|
117
|
+
## Fixtures
|
|
118
|
+
|
|
119
|
+
Use the actual column name (`*_translations`) in fixtures, not the virtual accessor:
|
|
120
|
+
|
|
121
|
+
### Nested Format
|
|
122
|
+
|
|
123
|
+
```yaml
|
|
124
|
+
# test/fixtures/articles.yml
|
|
125
|
+
hello_world:
|
|
126
|
+
title_translations:
|
|
127
|
+
en: "Hello World"
|
|
128
|
+
de: "Hallo Welt"
|
|
129
|
+
description_translations:
|
|
130
|
+
en: "A greeting"
|
|
131
|
+
de: "Eine Begrüßung"
|
|
132
|
+
status: published
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Inline Hash Format
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
japanese_post:
|
|
139
|
+
title_translations: { en: "Hello", ja: "こんにちは" }
|
|
140
|
+
status: published
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Important Notes
|
|
144
|
+
|
|
145
|
+
- Use `title_translations:` (column name), NOT `title:`
|
|
146
|
+
- Keys can be symbols (`:en`) or strings (`"en"`) - YAML converts them
|
|
147
|
+
- Both nested and inline hash formats work identically
|
|
148
|
+
- Missing locales are simply not set (no error)
|