Skip to content

Commit 0b3bea3

Browse files
author
Ackermann
committed
Adjust component names, changelog text and text assertion
1 parent 3ce83ca commit 0b3bea3

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

docs/CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ nav_order: 6
1010

1111
## main
1212

13+
* Add test to document the current behavior for resolving relative translation keys within partial blocks. When rendering a partial, relative translation keys are resolved relative to the partial’s own path rather than the caller’s path. This test ensures that this behavior remains consistent.
14+
15+
*Oussama Hilal*
16+
1317
* Add Consultport to list of companies using ViewComponent.
1418

1519
*Sebastian Nepote*
@@ -39,9 +43,6 @@ nav_order: 6
3943
* Declare `actionview` as a `view_component` gem dependency.
4044

4145
*Michal Cichra*
42-
* Add test documenting current behavior for resolving relative translation keys in partial blocks. The test expects translation keys to resolve relative to the caller's path, but currently they resolve relative to the partial's path, which is incorrect.
43-
44-
*Oussama Hilal*
4546

4647
## 4.0.2
4748

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<%= render "shared/partial" do %>
2+
<%= t(".title") %>
3+
<% end %>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# frozen_string_literal: true
2+
3+
class RelativeTranslationPartialBlockComponent < ViewComponent::Base
4+
end

test/sandbox/config/locales/en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ en:
2525
my_component:
2626
message: "OH NO! (you shouldn't see me)"
2727

28-
relative_translation_partial_parent_component:
28+
relative_translation_partial_block_component:
2929
title: Test Component Title
3030
shared:
3131
partial:

test/sandbox/test/components/relative_translation_partial_component_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
require "test_helper"
44

5-
class RelativeTranslationPartialComponentTest < ViewComponent::TestCase
5+
class RelativeTranslationPartialBlockComponentTest < ViewComponent::TestCase
66
def test_relative_translation_in_partial_block
7-
render_inline(RelativeTranslationPartialParentComponent.new)
7+
render_inline(RelativeTranslationPartialBlockComponent.new)
88

9-
assert_text "Test Component Title"
9+
assert_text "Partial Title"
1010
end
1111
end

0 commit comments

Comments
 (0)