-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AO3-6553 Bonus i18n for media on homepage
This is not strictly related to the a11y issue, but we're trying to add i18n if we can when we touch a file. The presence of `ts` in the original shows that we always intended to translate media names. We don't usually translate tags, but the media tags are a special case, because they're heavily used in site navigation The locale preference is not transmitted at the moment, so we don't risk caching the navigation in a non-English language for the entire site. When we know what the parameters or settings look like, we should be able to do something like add the locale key to the cache key, to have one cache per locale.
- Loading branch information
1 parent
2d19c4e
commit 473e3f4
Showing
4 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require "spec_helper" | ||
|
||
describe Media do | ||
describe "#translation_key" do | ||
it "returns a parameterized version of the media name using underscore as a separator" do | ||
media = create(:media, name: "Widgets; Tools & Doodads") | ||
expect(media.translation_key).to eql("widgets_tools_doodads") | ||
end | ||
end | ||
end |