ckeditor5 1.17.2 → 1.17.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe514f6683b41d1fff1a64788a8ab4a608a567563fb904c7af684c9d24f94fe9
|
4
|
+
data.tar.gz: 411ce73542f83467ae713fbf8bd2976a3597b82f2df4b7cc8ee19ab93cc65ea2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3420f1f381e795d37416b0038dba3c60980a2038d959a267ab6c70cbaf883af7e12ee3bcdd9a3f80c2ff27edb38d01c2da1a98133aa08cd6736e01e8d6d25db
|
7
|
+
data.tar.gz: 2a1102d9f90cf10f41a28b8d644d1d51c88a1b90553d3b65c8c8d486180282a9bcb61a3d5f5975333616711da7e3129632f0cb50bc835c43e131102beed62918
|
@@ -43,7 +43,9 @@ module CKEditor5::Rails
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def translations_js_url_imports
|
46
|
-
translations.
|
46
|
+
translations.filter_map do |lang|
|
47
|
+
next if lang == :en
|
48
|
+
|
47
49
|
url = create_cdn_url(import_name, version, "translations/#{lang}.js")
|
48
50
|
|
49
51
|
Assets::JSUrlImportMeta.new(
|
@@ -2,46 +2,53 @@
|
|
2
2
|
|
3
3
|
require 'e2e/spec_helper'
|
4
4
|
|
5
|
+
TRANSLATIONS = {
|
6
|
+
'en' => { 'Edit' => 'Edit', 'Insert' => 'Insert', 'Format' => 'Format' },
|
7
|
+
'pl' => { 'Edit' => 'Zmiana', 'Insert' => 'Wstaw', 'Format' => 'Format' },
|
8
|
+
'es' => { 'Edit' => 'Editar', 'Insert' => 'Insertar', 'Format' => 'Formato' },
|
9
|
+
'ru' => { 'Edit' => 'Редактировать', 'Insert' => 'Вставить', 'Format' => 'Формат' },
|
10
|
+
'de' => { 'Edit' => 'Bearbeiten', 'Insert' => 'Einfügen', 'Format' => 'Format' }
|
11
|
+
}.freeze
|
12
|
+
|
5
13
|
RSpec.describe 'Editor localization', type: :system do
|
6
|
-
|
7
|
-
it
|
8
|
-
visit
|
14
|
+
shared_examples 'localized editor' do |locale|
|
15
|
+
it "displays menubar in #{locale}" do
|
16
|
+
visit path
|
9
17
|
|
10
18
|
expect(page).to have_css('.ck-editor__main')
|
11
19
|
|
12
20
|
within('.ck-menu-bar') do
|
13
|
-
|
14
|
-
|
15
|
-
|
21
|
+
TRANSLATIONS[locale].each_value do |translation|
|
22
|
+
expect(page).to have_content(translation)
|
23
|
+
end
|
16
24
|
end
|
17
25
|
end
|
18
26
|
end
|
19
27
|
|
20
|
-
describe 'setting locale via
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
expect(page).to have_css('.ck-editor__main')
|
28
|
+
describe 'setting locale via assets' do
|
29
|
+
let(:path) { '/locale_via_assets' }
|
30
|
+
it_behaves_like 'localized editor', 'pl'
|
31
|
+
end
|
25
32
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
expect(page).to have_content('Formato')
|
30
|
-
end
|
31
|
-
end
|
33
|
+
describe 'setting locale via editor prop' do
|
34
|
+
let(:path) { '/locale_via_editor' }
|
35
|
+
it_behaves_like 'localized editor', 'es'
|
32
36
|
end
|
33
37
|
|
34
38
|
describe 'setting locale via preset' do
|
35
|
-
|
36
|
-
|
39
|
+
let(:path) { '/locale_via_preset' }
|
40
|
+
it_behaves_like 'localized editor', 'ru'
|
41
|
+
end
|
37
42
|
|
38
|
-
|
43
|
+
describe 'setting locale via Rails I18n' do
|
44
|
+
context 'using default I18n.locale' do
|
45
|
+
let(:path) { '/locale_via_rails_i18n' }
|
46
|
+
it_behaves_like 'localized editor', 'en'
|
47
|
+
end
|
39
48
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
expect(page).to have_content('Формат')
|
44
|
-
end
|
49
|
+
context 'using custom I18n.locale' do
|
50
|
+
let(:path) { '/locale_via_rails_i18n?locale=de' }
|
51
|
+
it_behaves_like 'localized editor', 'de'
|
45
52
|
end
|
46
53
|
end
|
47
54
|
end
|
@@ -58,6 +58,28 @@ RSpec.describe CKEditor5::Rails::Cdn::CKEditorBundle do
|
|
58
58
|
"#{cdn}/npm/#{import_name}@#{version}/build/translations/de.js"
|
59
59
|
)
|
60
60
|
end
|
61
|
+
|
62
|
+
context 'when handling English translation' do
|
63
|
+
before { bundle.translations << :en }
|
64
|
+
|
65
|
+
it 'excludes English translation file' do
|
66
|
+
translation_urls = bundle.scripts.select(&:translation?).map(&:url)
|
67
|
+
expect(translation_urls).not_to include(
|
68
|
+
"#{cdn}/npm/#{import_name}@#{version}/build/translations/en.js"
|
69
|
+
)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'when adding additional translations' do
|
74
|
+
before { bundle.translations << :ru }
|
75
|
+
|
76
|
+
it 'includes new non-English translations' do
|
77
|
+
translation_urls = bundle.scripts.select(&:translation?).map(&:url)
|
78
|
+
expect(translation_urls).to include(
|
79
|
+
"#{cdn}/npm/#{import_name}@#{version}/build/translations/ru.js"
|
80
|
+
)
|
81
|
+
end
|
82
|
+
end
|
61
83
|
end
|
62
84
|
|
63
85
|
describe '#stylesheets' do
|