alchemy_i18n 1.1.0 → 2.0.0

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: 4eb55ef83d5e7214c8f7872cf29a50d94c0f5b5ce2a7c158470ec09203f184e3
4
- data.tar.gz: 1dade4208be77b03187359698c6d063da9bbbf4fe66bdcbb58256017ee9eb582
3
+ metadata.gz: f7570d12517e4318ca4ba96b7c6b228e8d8fd6f1c118cc129565380afb2fa218
4
+ data.tar.gz: 861c794bc16f3c0e8f5528a47cb4629178cdbe3ad23147ef17dcfeffd1d33d97
5
5
  SHA512:
6
- metadata.gz: 8f640b6593fb1f9659b00952e434d71f922ada29983de7fa59e2096f6e55cf9c7f8623a2abafb66268207d65289a0f3dafbb0d22c4b824959fc70cd4b7d75c88
7
- data.tar.gz: c264d9e89505ff3515c7b4db255c49fada4c72889a7f8b8d85fb9e346e55e1deb95809700f3449a1445586b8b58256bd8dddf02f93b93327a049b8a7917f089a
6
+ metadata.gz: c2ebcdcbc6f907004f06d0eebfa612b839cc06f47d4468849a62215ef074ed3f1fe29e1640b1cea71ca35496bbe8860b9a4231505695383d1e6b82cb0ffd34f6
7
+ data.tar.gz: a2a8091d0bf603fdb48439776c1d036316acdbcb056c208daecfd394e30d3fcc1853c695ae54415285e179c8ac87610bf4ae87b4505f7f969fe09dfc632d5eaf
data/README.md CHANGED
@@ -1,54 +1,21 @@
1
- # AlchemyCMS Translation Files
1
+ # AlchemyCMS Translations
2
2
 
3
- Translations files for AlchemyCMS 4.1 and above.
3
+ Translations files for AlchemyCMS 4.4 and above.
4
4
 
5
- ## Usage
5
+ ## Installation
6
6
 
7
- The recommended way of adding Alchemy translations is to [download the translation files](https://github.com/AlchemyCMS/alchemy_i18n/tree/master/config/locales) you need
8
- and save them into your apps `config/locales` folder.
7
+ Add this Gem to your `Gemfile` and run the install generator
9
8
 
10
- Alternatively you could add this gem into your apps `Gemfile`, but then you will add all supported translations into the `I18n.load_path`
11
- which will raise the consumed runtime memory and increase the app start up time.
12
-
13
- ### Backend javascript translations
14
-
15
- [Download the Javascript translation files](https://github.com/AlchemyCMS/alchemy_i18n/tree/master/app/assets/javascripts/alchemy_i18n) you need
16
- and save them into your apps `vendor/assets/javascripts/alchemy_i18n` folder.
17
-
18
- Require each js locale you need to your `vendor/assets/javascripts/alchemy/admin/all.js` file
19
-
20
- ```js
21
- //= require alchemy_i18n/de
22
- //= require alchemy_i18n/fr
23
- //= require select2_locale_de
24
- //= require select2_locale_fr
25
- //= require flatpickr/de
26
- //= require flatpickr/fr
27
9
  ```
28
-
29
- Or require all js translations at once by adding (**not recommended**)
30
-
31
- ```js
32
- //= require alchemy_i18n
10
+ bin/rails g alchemy_i18n:install
33
11
  ```
34
12
 
35
- ### Rails translations
13
+ Pass the locales you want to generate files for with the `--locales` option.
14
+ Seperate multiple locales by space.
36
15
 
37
- This gem only provides translations for Alchemy itself. If you also need translations for ActiveSupport features (like `to_sentence` or `number_with_currency`, etc.)
38
- you should [download the Rails translation files](https://github.com/svenfuchs/rails-i18n/tree/master/rails/locale) and save them into your apps `config/locales` folder.
39
-
40
- Alternatively you could add the `rails-i18n` gem into your apps `Gemfile`, but then you will add all supported translations into the `I18n.load_path`
41
- which will raise the consumed runtime memory and increase the app start up time.
42
-
43
- ### Russian translations
44
-
45
- If you want to use Russian translation and have better i18n support, you should put:
46
-
47
- ```ruby
48
- gem 'russian', '~> 0.6.0'
49
16
  ```
50
-
51
- or a gem with similar functionality into your apps `Gemfile`.
17
+ bin/rails g alchemy_i18n:install --locales=de it es
18
+ ```
52
19
 
53
20
  ---
54
21
 
@@ -1,3 +1,3 @@
1
1
  module AlchemyI18n
2
- VERSION = '1.1.0'
2
+ VERSION = '2.0.0'
3
3
  end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails'
4
+ require 'alchemy/i18n'
5
+
6
+ module AlchemyI18n
7
+ module Generators
8
+ class InstallGenerator < ::Rails::Generators::Base
9
+ desc "Installs Alchemy locales into your App."
10
+
11
+ def self.description
12
+ locales = Alchemy::I18n.available_locales.reject { |l| l == :en }.to_sentence
13
+ "Available locales are #{locales}"
14
+ end
15
+
16
+ class_option :locales,
17
+ type: :array,
18
+ default: [],
19
+ desc: "Locales to generate files for. #{description}"
20
+
21
+ source_root AlchemyI18n::Engine.root.join('locales')
22
+
23
+ def copy_locales
24
+ locales.each do |locale|
25
+ filename = "alchemy.#{locale}.yml"
26
+ copy_file filename, Rails.root.join('config', 'locales', filename)
27
+ end
28
+ end
29
+
30
+ def append_assets
31
+ locales.each do |locale|
32
+ append_file 'vendor/assets/javascripts/alchemy/admin/all.js', <<~ASSETS
33
+ //= require alchemy_i18n/#{locale}
34
+ //= require select2_locale_#{locale}
35
+ //= require flatpickr/#{locale}
36
+ ASSETS
37
+ end
38
+ end
39
+
40
+ def copy_tinymce_locales
41
+ locales.each do |locale|
42
+ copy_file "tinymce/#{locale}.js",
43
+ Rails.root.join('vendor', 'assets', 'javascripts', 'tinymce', 'langs', "#{locale}.js")
44
+ end
45
+ end
46
+
47
+ def append_manifest
48
+ locales.each do |locale|
49
+ append_file 'app/assets/config/manifest.js', <<~MANIFEST
50
+ //= link vendor/assets/javascripts/tinymce/langs/#{locale}.js
51
+ MANIFEST
52
+ end
53
+ end
54
+
55
+ def add_rails_i18n
56
+ environment do
57
+ "config.i18n.available_locales = #{locales.map(&:to_sym).inspect}"
58
+ end
59
+ end
60
+
61
+ def add_russian_gem
62
+ if locales.include?('ru')
63
+ gem 'russian', '~> 0.6'
64
+ end
65
+ end
66
+
67
+ private
68
+
69
+ def locales
70
+ @_locales ||= begin
71
+ options[:locales].presence || ask_locales.split(' ')
72
+ end
73
+ end
74
+
75
+ def ask_locales
76
+ ask <<~LOCALES
77
+ Which locales should we generate files for?
78
+ #{self.class.description}
79
+ (seperate multiple locales with space):
80
+ LOCALES
81
+ end
82
+ end
83
+ end
84
+ end
@@ -18,6 +18,7 @@ de:
18
18
  # search: Suche
19
19
  #
20
20
  page_layout_names:
21
+ index: Startseite
21
22
 
22
23
  # == Translations for element names
23
24
  # Just use the elements name like defined inside the config/alchemy/elements.yml file and translate it.
@@ -31,6 +32,7 @@ de:
31
32
  # contactform: Kontaktformular
32
33
  #
33
34
  element_names:
35
+ article: Artikel
34
36
 
35
37
  # == Translated names for contents in elements.
36
38
  # Used for the content editor label inside the element editor view (The elements window)
@@ -50,6 +52,9 @@ de:
50
52
  # show_caption: Zeige Bildunterschrift
51
53
  #
52
54
  content_names:
55
+ headline: Überschrift
56
+ text: Text
57
+ picture: Bild
53
58
 
54
59
  # === Translations for content validations
55
60
  # Used when a user did not enter (correct) values to the content field.
@@ -73,10 +78,23 @@ de:
73
78
  invalid: '%{field} hat das falsche Format'
74
79
  taken: '%{field} wurde schon benutzt'
75
80
 
81
+ # Hint texts for contents
82
+ content_hints:
83
+ headline: "Dies ist ein einzeiliger unformatierter Text"
84
+ picture: "Bilder werden in der Bibliothek gespeichert. Ein Bild kann mehrfach einem Element zugewiesen werden. Auch ein Bildauswahlwerkzeug ist in Alchemy integriert."
85
+ text: "Dies ist ein formatierbarer Textblock. Die Einstellungen des Editors können angepasst werden. Siehe http://guides.alchemy-cms.com/stable/customize_tinymce.html"
86
+
87
+ # Default texts for new contents created
76
88
  default_content_texts:
89
+ article_headline: "Willkommen auf Ihrer Alchemy Seite"
90
+ article_text: '<p>Als erstes sollte man sich mit der Struktur von Alchemy vertraut machen. <a class="external" href="http://guides.alchemy-cms.com/stable/alchemy_approach.html" target="_blank" data-link-target="blank">Mehr dazu in den Guidelines</a>.</p><p>Die wichtigsten beiden Dinge die man über Alchemy wissen muss sind Elemente und Seitentypen.</p><p><span style="text-decoration: underline;"><strong>Elemente:</strong></span></p><p>Mit Alchemy kann man eine Seite in Inhaltsbereiche aufteilen, Elemente. Diese Elemente werden aus verschiedenen Grundtypen (Essenzen) zusammengesetzt. Die Essenzen sind:</p><ul><li>EssenceText - <em>Eine Zeile Text</em></li><li>EssenceRichtext - <em>Ein TinyMCE basierter formatierter Textblock</em></li><li>EssencePicture - <em>Ein Verweis auf ein Bild</em></li><li>EssenceHtml - <em>HTML Code</em></li><li>EssenceSelect - <em>Eine Auswahl an Werten</em></li><li>EssenceBoolean - <em>Eine Checkbox</em></li></ul><p>Elemente werden in einer YAML Datei definiert: <strong>config/alchemy/elements.yml</strong></p><p><a class="external" href="http://guides.alchemy-cms.com/stable/elements.html" target="_blank" data-link-target="blank">Mehr über Elemente und wie sie definiert werden, kann in den Guidelines nachgelesen werden.</a></p><p><span style="text-decoration: underline;"><strong>Seitentypen:</strong></span></p><p>Es können verschiedene Seitentypen definiert werden. Diesen können Elemente zugewiesen und ihr Verhalten definiert werden.</p><p>Seitentypen werden ein einer YAML Datei definiert: <strong>config/alchemy/page_layouts.yml</strong></p><p><a class="external" href="http://guides.alchemy-cms.com/stable/page_layouts.html" target="_blank" data-link-target="blank">Mehr über das Erstellen von Seitentypen kann in den Guidelines nachgelesen werden.</a></p>'
77
91
  lorem: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
78
92
  corporate_lorem: "Appropriately enable sustainable growth strategies vis-a-vis holistic materials. Energistically orchestrate open-source e-tailers vis-a-vis plug-and-play best practices. Uniquely plagiarize client-centric opportunities whereas plug-and-play ideas. Distinctively reconceptualize backward-compatible partnerships vis-a-vis reliable total linkage. Interactively fabricate highly efficient networks for clicks-and-mortar content. Collaboratively reconceptualize holistic markets via 2.0 architectures."
79
93
 
94
+ # Hint texts for elements
95
+ element_hints:
96
+ article: "Dies ist ein Hinweistext für das Artikel Element. Dieser Text kann in der `config/locales/alchemy.de.yml` Datei angepasst werden."
97
+
80
98
  essence_pictures:
81
99
  css_classes:
82
100
  left: 'Links vom Text'
@@ -18,6 +18,7 @@ es:
18
18
  # search: Buscar
19
19
  #
20
20
  page_layout_names:
21
+ index: Inicio
21
22
 
22
23
  # == Translations for element names
23
24
  # Just use the elements name like defined inside the config/alchemy/elements.yml file and translate it.
@@ -31,6 +32,7 @@ es:
31
32
  # contactform: Contact form
32
33
  #
33
34
  element_names:
35
+ article: Artículo
34
36
 
35
37
  # == Translated names for contents in elements.
36
38
  # Used for the content editor label inside the element editor view (The elements window)
@@ -50,6 +52,9 @@ es:
50
52
  # show_caption: Subtítulo de programa
51
53
  #
52
54
  content_names:
55
+ headline: Titular
56
+ text: Texto
57
+ picture: Imagen
53
58
 
54
59
  # === Translations for content validations
55
60
  # Used when a user did not enter (correct) values to the content field.
@@ -73,10 +78,23 @@ es:
73
78
  invalid: '%{field} tiene un formato incorrecto '
74
79
  taken: '%{field} ya está en uso'
75
80
 
81
+ # Hint texts for contents
82
+ content_hints:
83
+ headline: "Esta es una sencilla linea de texto sin formato"
84
+ picture: "Las imágenes se almacenan en la librería. Puedes asignar una imagen varias veces en tu sitio. Alchemy tiene una herramienta de recorte de imagen integrada."
85
+ text: "Este es un bloque de texto enriquecido mediante el editor TinyMCE. Puedes cambiar la configuración del editor. Ver http://guides.alchemy-cms.com/stable/customize_tinymce.html"
86
+
87
+ # Default texts for new contents created
76
88
  default_content_texts:
89
+ article_headline: "Bienvenido a tu primera página de Alchemy CMS"
90
+ article_text: '<p><strong>Como empezar.</strong></p><p>Lo primero de todo deberías leer sobre Alchemy y su arquitectura en las <a class="external" href="http://guides.alchemy-cms.com/stable/alchemy_approach.html" target="_blank" data-link-target="blank">guías</a>.</p><p>Las cosas más importantes que debes saber sobre Alchemy son elementos (<i>elements</i>) y disposiciones de página (<i>page layouts</i>).</p><p><span style="text-decoration: underline;"><strong>Elementos:</strong></span></p><p>Con Alchemy puedes dividir las páginas en partes de contenido, elementos. Estos elementos se pueden definir mediante varios tipos de contenido básicos: esencias (<i>essences</i>). Las esencias básicas son:</p><ul><li>EssenceText - <em>Un única línea de texto</em></li><li>EssenceRichtext - <em>Un bloque de texto formateado mediante TinyMCE</em></li><li>EssencePicture - <em>Una referencia a una imagen</em></li><li>EssenceHtml - <em>Código HTML empotrado</em></li><li>EssenceSelect - <em>Una selección de valores</em></li><li>EssenceBoolean - <em>Una casilla de verificación</em></li></ul><p>Los elementos se definen en el fichero YAML <strong>config/alchemy/elements.yml</strong></p><p><a class="external" href="http://guides.alchemy-cms.com/stable/elements.html" target="_blank" data-link-target="blank">Lee más sobre elementos y cómo definirlos en las guías.</a></p><p><span style="text-decoration: underline;"><strong>Tipos de página:</strong></span></p><p>Puedes definir varios tipos de páginas, llamados disposiciones de páginas (<i>page layouts</i>). Puedes asignar elementos a las disposiciones de páginas y controlar cómo se comportan los elementos y una página con una disposición concreta.</p><p>Las disposiciones de páginas se definen en el fichero YAML <strong>config/alchemy/page_layouts.yml</strong></p><p><a class="external" href="http://guides.alchemy-cms.com/stable/page_layouts.html" target="_blank" data-link-target="blank">Lee más sobre definir disposiciones de páginas en las guías.</a></p>'
77
91
  lorem: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
78
92
  corporate_lorem: "Appropriately enable sustainable growth strategies vis-a-vis holistic materials. Energistically orchestrate open-source e-tailers vis-a-vis plug-and-play best practices. Uniquely plagiarize client-centric opportunities whereas plug-and-play ideas. Distinctively reconceptualize backward-compatible partnerships vis-a-vis reliable total linkage. Interactively fabricate highly efficient networks for clicks-and-mortar content. Collaboratively reconceptualize holistic markets via 2.0 architectures."
79
93
 
94
+ # Hint texts for elements
95
+ element_hints:
96
+ article: "Este es el texto de ayuda del elemento artículo. Puedes cambiar este texto en `config/locales/alchemy.en.yml`. Siéntete libre de cambiarlo a tu gusto, es tuyo."
97
+
80
98
  essence_pictures:
81
99
  css_classes:
82
100
  left: 'A la izquierda'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.0.beta
19
+ version: 4.4.0.a
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '5.0'
@@ -26,10 +26,24 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 4.1.0.beta
29
+ version: 4.4.0.a
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: rails-i18n
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
33
47
  description: Translation files for AlchemyCMS
34
48
  email:
35
49
  - thomas@vondeyen.com
@@ -47,17 +61,25 @@ files:
47
61
  - app/assets/javascripts/alchemy_i18n/nl.js
48
62
  - app/assets/javascripts/alchemy_i18n/ru.js
49
63
  - app/assets/javascripts/alchemy_i18n/zh-CN.js
50
- - config/locales/alchemy.de.yml
51
- - config/locales/alchemy.es.yml
52
- - config/locales/alchemy.fr.yml
53
- - config/locales/alchemy.it.yml
54
- - config/locales/alchemy.nl.yml
55
- - config/locales/alchemy.pl.yml
56
- - config/locales/alchemy.ru.yml
57
- - config/locales/alchemy.zh-CN.yml
58
64
  - lib/alchemy_i18n.rb
59
65
  - lib/alchemy_i18n/engine.rb
60
66
  - lib/alchemy_i18n/version.rb
67
+ - lib/generators/alchemy_i18n/install/install_generator.rb
68
+ - locales/alchemy.de.yml
69
+ - locales/alchemy.es.yml
70
+ - locales/alchemy.fr.yml
71
+ - locales/alchemy.it.yml
72
+ - locales/alchemy.nl.yml
73
+ - locales/alchemy.pl.yml
74
+ - locales/alchemy.ru.yml
75
+ - locales/alchemy.zh-CN.yml
76
+ - locales/tinymce/de.js
77
+ - locales/tinymce/es.js
78
+ - locales/tinymce/fr.js
79
+ - locales/tinymce/it.js
80
+ - locales/tinymce/nl.js
81
+ - locales/tinymce/ru.js
82
+ - locales/tinymce/zh-CN.js
61
83
  - vendor/assets/javascripts/flatpickr/de.js
62
84
  - vendor/assets/javascripts/flatpickr/es.js
63
85
  - vendor/assets/javascripts/flatpickr/fr.js
@@ -66,13 +88,6 @@ files:
66
88
  - vendor/assets/javascripts/flatpickr/pl.js
67
89
  - vendor/assets/javascripts/flatpickr/ru.js
68
90
  - vendor/assets/javascripts/flatpickr/zh.js
69
- - vendor/assets/javascripts/tinymce/langs/de.js
70
- - vendor/assets/javascripts/tinymce/langs/es.js
71
- - vendor/assets/javascripts/tinymce/langs/fr.js
72
- - vendor/assets/javascripts/tinymce/langs/it.js
73
- - vendor/assets/javascripts/tinymce/langs/nl.js
74
- - vendor/assets/javascripts/tinymce/langs/ru.js
75
- - vendor/assets/javascripts/tinymce/langs/zh-CN.js
76
91
  homepage: https://alchemy-cms.com
77
92
  licenses:
78
93
  - MIT