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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cf94a139c881e315445fb0df7f24699166c1833b2b5f0746b86c91f5025ba5c
|
4
|
+
data.tar.gz: b518012e6deafacb308f178c1c21ab0191c2e491d47f0bda97e976605155a37f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f96fdafd54a457e86ee7d8b0475807e4f8308ff5e8080a08ca6df369a1c4d515dc45ec90a240d4a4143a531bdaaaf51881532313252054e133b5fd0d33281ae
|
7
|
+
data.tar.gz: 715d03787f074bff87e69039ddeb466f9cbe449e1e57021ea9a3587fc272cc71d8f431e6f74aa75c33cb9accab2976e559d4ad885989b6d6c2ceab21637208e3
|
data/lib/immosquare-translate.rb
CHANGED
@@ -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 :
|
1
|
+
namespace :immosquare_translate do
|
2
2
|
##============================================================##
|
3
3
|
## Function to translate translation files in rails app
|
4
|
-
## rake
|
4
|
+
## rake immosquare_translate:translate SOURCE_LOCALE=fr
|
5
5
|
##============================================================##
|
6
6
|
desc "Translate translation files in rails app"
|
7
|
-
task :
|
7
|
+
task :translate_rails_locales => :environment do
|
8
8
|
begin
|
9
|
-
source_locale = ENV.fetch("SOURCE_LOCALE", nil)
|
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
|
-
|
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.
|
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-
|
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-
|
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.
|
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
|