File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
app/assets/javascripts/discourse/app/components Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ export default class TopicLocalizedContentToggle extends Component {
35
35
36
36
get title () {
37
37
return this .showingOriginal
38
- ? " translator.content_not_translated "
39
- : " translator.content_translated " ;
38
+ ? " content_localization.toggle_localized.not_translated "
39
+ : " content_localization.toggle_localized.translated " ;
40
40
}
41
41
42
42
<template >
Original file line number Diff line number Diff line change @@ -5580,6 +5580,10 @@ en:
5580
5580
default : " %{filter} topics in %{category} without tags"
5581
5581
5582
5582
categories : " All categories"
5583
+ content_localization :
5584
+ toggle_localized :
5585
+ translated : " Page is machine-translated. Click to view original."
5586
+ not_translated : " Page is not translated. Click to translate."
5583
5587
5584
5588
# This section is exported to the javascript for i18n in the admin section
5585
5589
admin_js :
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
3
describe "Content Localization" do
4
+ TOGGLE_LOCALIZE_BUTTON_SELECTOR = "button.btn-toggle-localized-content"
5
+
4
6
fab! ( :japanese_user ) { Fabricate ( :user , locale : "ja" ) }
5
7
fab! ( :site_local_user ) { Fabricate ( :user , locale : "en" ) }
6
8
fab! ( :admin )
68
70
topic_list . visit_topic_with_title ( "孫子兵法からの人生戦略" )
69
71
70
72
expect ( topic_page . has_topic_title? ( "孫子兵法からの人生戦略" ) ) . to eq ( true )
71
- page . find ( "button.btn-toggle-localized-content" ) . click
73
+
74
+ expect ( page . find ( TOGGLE_LOCALIZE_BUTTON_SELECTOR ) [ "title" ] ) . to eq (
75
+ I18n . t ( "js.content_localization.toggle_localized.translated" ) ,
76
+ )
77
+ page . find ( TOGGLE_LOCALIZE_BUTTON_SELECTOR ) . click
72
78
73
79
expect ( topic_page . has_topic_title? ( "Life strategies from The Art of War" ) ) . to eq ( true )
80
+ expect ( page . find ( TOGGLE_LOCALIZE_BUTTON_SELECTOR ) [ "title" ] ) . to eq (
81
+ I18n . t ( "js.content_localization.toggle_localized.not_translated" ) ,
82
+ )
74
83
75
84
visit ( "/" )
76
85
topic_list . visit_topic_with_title ( "Life strategies from The Art of War" )
You can’t perform that action at this time.
0 commit comments