ckeditor5 1.17.2 → 1.17.4
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: 882d02a7893248e643ac6549d344940b08c946ef9e64193ca227551f4a9ed174
|
4
|
+
data.tar.gz: d6e17a5e168c474c76f53b1be819c5a3248b46cb41e6144097088123aefeba6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48ded629378991aa8fac441598dac72a8006dd7cf11c094ac910eb0fe295bc099594dc36921563a37796132b483b05d74dba5f760980d1ce7d833ba0f33fb182
|
7
|
+
data.tar.gz: 6ebf7b52994e7da6b52922f7cb970260deee6cc65c0a0e87f136f768e9d0abc5180431f2350a3608d22962ae888e58bf7bf410e2c310ff25fdde88dcdcc1c49e
|
@@ -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
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ckeditor5
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.17.
|
4
|
+
version: 1.17.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mateusz Bagiński
|
@@ -116,7 +116,11 @@ files:
|
|
116
116
|
homepage: https://github.com/Mati365/ckeditor5-rails
|
117
117
|
licenses:
|
118
118
|
- GPL-2.0
|
119
|
-
metadata:
|
119
|
+
metadata:
|
120
|
+
homepage_uri: https://github.com/Mati365/ckeditor5-rails
|
121
|
+
documentation_uri: https://github.com/Mati365/ckeditor5-rails
|
122
|
+
source_code_uri: https://github.com/Mati365/ckeditor5-rails
|
123
|
+
bug_tracker_uri: https://github.com/Mati365/ckeditor5-rails/issues
|
120
124
|
post_install_message:
|
121
125
|
rdoc_options: []
|
122
126
|
require_paths:
|