immosquare-translate 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71add0a533248479a8a83a8f97c25beaeb8172c1dc7469e49b63b18baa34bf82
4
- data.tar.gz: e266dd37a4c21b6d5ee4b9dbe344e24d2dbb3d671a82916412846842957f7051
3
+ metadata.gz: 2cf94a139c881e315445fb0df7f24699166c1833b2b5f0746b86c91f5025ba5c
4
+ data.tar.gz: b518012e6deafacb308f178c1c21ab0191c2e491d47f0bda97e976605155a37f
5
5
  SHA512:
6
- metadata.gz: 4b16fb9414e574cbee14da6a5e54f3cf6df8d0bf6430e4d9ab6dcd8b185f21d4987074646ddaa78375c86124e1b73bad89807e1daf51f57dfb9369a5f84c2ca3
7
- data.tar.gz: 9931a5bfca8430befcd24e25b1087decd4099e4958039af615fe080da9e962a5b0ea5fc8dbcc054d64df130391f6442f781adb3677784363c6e0cea41c3c3ff4
6
+ metadata.gz: 1f96fdafd54a457e86ee7d8b0475807e4f8308ff5e8080a08ca6df369a1c4d515dc45ec90a240d4a4143a531bdaaaf51881532313252054e133b5fd0d33281ae
7
+ data.tar.gz: 715d03787f074bff87e69039ddeb466f9cbe449e1e57021ea9a3587fc272cc71d8f431e6f74aa75c33cb9accab2976e559d4ad885989b6d6c2ceab21637208e3
@@ -0,0 +1,9 @@
1
+ module ImmosquareTranslate
2
+ class Railtie < Rails::Railtie
3
+
4
+ rake_tasks do
5
+ load "tasks/immosquare-translate.rake"
6
+ end
7
+
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module ImmosquareTranslate
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.1.3".freeze
3
3
  end
@@ -2,7 +2,7 @@ require_relative "immosquare-translate/configuration"
2
2
  require_relative "immosquare-translate/shared_methods"
3
3
  require_relative "immosquare-translate/yml_translator"
4
4
  require_relative "immosquare-translate/translator"
5
-
5
+ require_relative "immosquare-translate/railtie" if defined?(Rails)
6
6
 
7
7
 
8
8
  ##===========================================================================##
@@ -1,12 +1,12 @@
1
- namespace :immosquare_yaml do
1
+ namespace :immosquare_translate do
2
2
  ##============================================================##
3
3
  ## Function to translate translation files in rails app
4
- ## rake immosquare_yaml:translate SOURCE_LOCALE=fr
4
+ ## rake immosquare_translate:translate SOURCE_LOCALE=fr
5
5
  ##============================================================##
6
6
  desc "Translate translation files in rails app"
7
- task :translate => :environment do
7
+ task :translate_rails_locales => :environment do
8
8
  begin
9
- source_locale = ENV.fetch("SOURCE_LOCALE", nil) || "fr"
9
+ source_locale = ENV.fetch("SOURCE_LOCALE", nil) || "fr"
10
10
  reset_translations = ENV.fetch("RESET_TRANSLATIONS", nil) || false
11
11
  reset_translations = reset_translations == "true"
12
12
 
@@ -17,21 +17,11 @@ namespace :immosquare_yaml do
17
17
  puts("Translating from #{source_locale} to #{locales.join(", ")} with reset_translations=#{reset_translations}")
18
18
  Dir.glob("#{Rails.root}/config/locales/**/*#{source_locale}.yml").each do |file|
19
19
  locales.each do |locale|
20
- ImmosquareYaml::Translate.translate(file, locale, :reset_translations => reset_translations)
20
+ ImmosquareTranslate::YmlTranslator.translate(file, locale, :reset_translations => reset_translations)
21
21
  end
22
22
  end
23
23
  rescue StandardError => e
24
24
  puts(e.message)
25
25
  end
26
26
  end
27
-
28
- ##============================================================##
29
- ## Function to clean translation files in rails app
30
- ##============================================================##
31
- desc "Clean translation files in rails app"
32
- task :clean => :environment do
33
- Dir.glob("#{Rails.root}/config/locales/**/*.yml").each do |file|
34
- ImmosquareYaml.clean(file)
35
- end
36
- end
37
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immosquare-translate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - IMMO SQUARE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-19 00:00:00.000000000 Z
11
+ date: 2024-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -71,11 +71,12 @@ extra_rdoc_files: []
71
71
  files:
72
72
  - lib/immosquare-translate.rb
73
73
  - lib/immosquare-translate/configuration.rb
74
+ - lib/immosquare-translate/railtie.rb
74
75
  - lib/immosquare-translate/shared_methods.rb
75
76
  - lib/immosquare-translate/translator.rb
76
77
  - lib/immosquare-translate/version.rb
77
78
  - lib/immosquare-translate/yml_translator.rb
78
- - lib/tasks/immosquare-yaml.rake
79
+ - lib/tasks/immosquare-translate.rake
79
80
  homepage: https://github.com/IMMOSQUARE/immosquare-translate
80
81
  licenses:
81
82
  - MIT
@@ -95,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
96
  - !ruby/object:Gem::Version
96
97
  version: '0'
97
98
  requirements: []
98
- rubygems_version: 3.4.13
99
+ rubygems_version: 3.5.7
99
100
  signing_key:
100
101
  specification_version: 4
101
102
  summary: AI-powered translations for Ruby applications, supporting a wide range of