habluhablu 0.4.1 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/config/locales/es.yml +46 -1
- data/config/locales/iw.yml +2 -1
- data/exe/habluhablu +14 -8
- data/lib/habluhablu/version.rb +1 -1
- data/lib/languages/languages.rb +80 -10
- data/lib/languages/render_json.rb +18 -0
- data/lib/translation.rb +0 -3
- metadata +3 -4
- data/config/api_key.txt +0 -0
- data/config/locales/api_key.txt +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fddbbb7f1a2deea712eded20510ac062236e97dd5269a021754f900e8ed59d6
|
4
|
+
data.tar.gz: f6ec7aa9a73cf608e95a9c3784cea0a6f3af17c9370c09c8a5b51798fa33485c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 077addd1e52120efbad96d5febf0b4d4914c8404a8a577cc6701393201209822aa118672eade367682fadef2a5fda22a494e033fde8d9f2990ebc167dde84d72
|
7
|
+
data.tar.gz: bcdf989cd560389661c26aa98080438871e1191e3a9fdb06d54f1689e5b30082e15ffe91db2df6fe5dfbc9151d967b4caa10659cc774ec1dd0c4e983a51d68f5
|
data/Gemfile.lock
CHANGED
data/config/locales/es.yml
CHANGED
@@ -1,2 +1,47 @@
|
|
1
1
|
---
|
2
|
-
|
2
|
+
es:
|
3
|
+
date:
|
4
|
+
months_names:
|
5
|
+
- Enero
|
6
|
+
- Febrero
|
7
|
+
- Marzo
|
8
|
+
- Abril
|
9
|
+
- Mayo
|
10
|
+
- Junio
|
11
|
+
- Julio
|
12
|
+
- Agosto
|
13
|
+
- Septiembre
|
14
|
+
- Octubre
|
15
|
+
- Noviembre
|
16
|
+
- Dieciembre
|
17
|
+
abbr_month_names:
|
18
|
+
- Ene
|
19
|
+
- Feb
|
20
|
+
- Mar
|
21
|
+
- Abr
|
22
|
+
- May
|
23
|
+
- Jun
|
24
|
+
- Jul
|
25
|
+
- Ago
|
26
|
+
- Set
|
27
|
+
- Oct
|
28
|
+
- Nov
|
29
|
+
- Dic
|
30
|
+
language: Español
|
31
|
+
welcome: Bienvenido
|
32
|
+
registration: Regístrate
|
33
|
+
log_in: Iniciar sesión
|
34
|
+
log_in_with: Iniciar sesión con %{replace}
|
35
|
+
log_out: Cerrar la sesión
|
36
|
+
email_address: Dirección de correo electrónico
|
37
|
+
username: Nombre de usuario
|
38
|
+
password: Contraseña
|
39
|
+
remember_me: Recordarme
|
40
|
+
forgot_password: "¿Has olvidado tu contraseña?"
|
41
|
+
do_not_have_account: "¿No tienes una cuenta en %{register}?"
|
42
|
+
lorem: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
|
43
|
+
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
|
44
|
+
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
|
45
|
+
irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
46
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
|
47
|
+
deserunt mollit anim id est laborum.
|
data/config/locales/iw.yml
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
---
|
2
2
|
iw:
|
3
|
+
language: עִברִית
|
3
4
|
welcome: שלום
|
4
5
|
registration: הירשם
|
5
6
|
log_in: להתחבר
|
@@ -10,7 +11,7 @@ iw:
|
|
10
11
|
password: סיסמה
|
11
12
|
remember_me: זכור אותי
|
12
13
|
forgot_password: שכחת את הסיסמא?
|
13
|
-
do_not_have_account: אין לך חשבון?
|
14
|
+
do_not_have_account: "%{register} אין לך חשבון?"
|
14
15
|
lorem: כדי יסוד מונחים מועמדים של, דת דפים מאמרשיחהצפה זאת. אתה דת שונה כלשהו, גם
|
15
16
|
אחר ליום בשפות, או ניווט פולנית לחיבור ארץ. ויש בקלות ואמנות אירועים או, אל אינו
|
16
17
|
כלכלה שתי.
|
data/exe/habluhablu
CHANGED
@@ -16,10 +16,11 @@ OptionParser.new do |opts|
|
|
16
16
|
opts.on("-t", "--translate TEXT", "Translation text example: Hello_world_test!")
|
17
17
|
opts.on("-f", "--from SYMBOL", "From example: en")
|
18
18
|
opts.on("-o", "--target SYMBOL", "Target language example: es")
|
19
|
+
opts.on("-j", "--json SYMBOL", "Render languages' json files.")
|
19
20
|
end.parse!(into: args)
|
20
21
|
|
21
|
-
information = lambda do |param|
|
22
|
-
if File.exist?("config/locales/#{param}
|
22
|
+
information = lambda do |param, exe|
|
23
|
+
if File.exist?("config/locales/#{param}.#{exe}")
|
23
24
|
puts "..."
|
24
25
|
sleep 0.5
|
25
26
|
puts "Everything was generated successfully!"
|
@@ -28,19 +29,24 @@ information = lambda do |param|
|
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
32
|
+
if args[:json].nil? == false
|
33
|
+
Languages.new("en").render_json(args[:json])
|
34
|
+
information.call(args[:json].split("_").first, "json")
|
35
|
+
end
|
36
|
+
|
31
37
|
if args[:translate].nil? == false
|
32
|
-
if args[:from].nil? == false
|
38
|
+
if args[:from].nil? == false
|
33
39
|
translator = Translation.new(args[:translate], args[:target])
|
34
40
|
else
|
35
41
|
translator = Translation.new(args[:translate], args[:target], args[:from])
|
36
42
|
end
|
43
|
+
translator.response
|
44
|
+
information.call(args[:target], "yml")
|
37
45
|
end
|
38
|
-
translator.response
|
39
|
-
information.call(args[:target])
|
40
46
|
|
41
47
|
if args[:language].nil? == false
|
42
48
|
Habluhablu.hablu(args[:language])
|
43
|
-
information.call(args[:language])
|
49
|
+
information.call(args[:language], "yml")
|
44
50
|
end
|
45
51
|
|
46
52
|
if args[:keyword].nil? == false
|
@@ -55,10 +61,10 @@ if args[:multi].nil? == false
|
|
55
61
|
languages_array.each do |language|
|
56
62
|
Habluhablu.hablu(language)
|
57
63
|
end
|
58
|
-
information.call(languages_array.last)
|
64
|
+
information.call(languages_array.last, "yml")
|
59
65
|
end
|
60
66
|
|
61
67
|
if args[:sample].nil? == false
|
62
68
|
Habluhablu.render_sample(args[:sample])
|
63
|
-
information.call("sample")
|
69
|
+
information.call("sample", "yml")
|
64
70
|
end
|
data/lib/habluhablu/version.rb
CHANGED
data/lib/languages/languages.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "yaml"
|
4
|
+
require_relative "render_json"
|
4
5
|
|
5
6
|
# Class comment
|
6
7
|
class Languages
|
8
|
+
include RenderJson
|
7
9
|
attr_writer :languages
|
8
10
|
|
9
11
|
def initialize(language)
|
@@ -11,6 +13,7 @@ class Languages
|
|
11
13
|
@languages = {
|
12
14
|
ar: {
|
13
15
|
"ar" => {
|
16
|
+
"language" => "العربية",
|
14
17
|
"welcome" => "مرحبا",
|
15
18
|
"registration" => "عنوان البريد الإلكتروني",
|
16
19
|
"log_in" => "تسجيل الدخول",
|
@@ -21,12 +24,13 @@ class Languages
|
|
21
24
|
"password" => "كلمه المرور",
|
22
25
|
"remember_me" => "تذكرنى",
|
23
26
|
"forgot_password" => "نسيت كلمة مرورك",
|
24
|
-
"do_not_have_account" => "ليس لديك
|
27
|
+
"do_not_have_account" => "ليس لديك حساب على {register}%؟",
|
25
28
|
"lorem" => "غينيا واستمر العصبة ضرب قد. وباءت الأمريكي الأوربيين هو به،, هو العالم، الثقيلة بال. مع وايرلندا الأوروبيّون كان, قد بحق أسابيع العظمى واعتلاء. انه كل وإقامة المواد. "
|
26
29
|
}
|
27
30
|
},
|
28
31
|
en: {
|
29
32
|
"en" => {
|
33
|
+
"language" => "English",
|
30
34
|
"welcome" => "Welcome",
|
31
35
|
"registration" => "Registartion",
|
32
36
|
"log_in" => "Log in",
|
@@ -37,7 +41,7 @@ class Languages
|
|
37
41
|
"password" => "Password",
|
38
42
|
"remember_me" => "Remember me",
|
39
43
|
"forgot_password" => "Forgot password?",
|
40
|
-
"do_not_have_account" => "Don't You have an account?",
|
44
|
+
"do_not_have_account" => "Don't You have an %{register} account?",
|
41
45
|
"lorem" => "Lorem ipsum dolor sit amet, consectetur adipiscing 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."
|
42
46
|
}
|
43
47
|
},
|
@@ -51,6 +55,7 @@ class Languages
|
|
51
55
|
Ene Feb Mar Abr May Jun Jul Ago Set Oct Nov Dic
|
52
56
|
]
|
53
57
|
},
|
58
|
+
"language" => "Español",
|
54
59
|
"welcome" => "Bienvenido",
|
55
60
|
"registration" => "Regístrate",
|
56
61
|
"log_in" => "Iniciar sesión",
|
@@ -61,7 +66,7 @@ class Languages
|
|
61
66
|
"password" => "Contraseña",
|
62
67
|
"remember_me" => "Recordarme",
|
63
68
|
"forgot_password" => "¿Has olvidado tu contraseña?",
|
64
|
-
"do_not_have_account" => "¿No tienes una cuenta?",
|
69
|
+
"do_not_have_account" => "¿No tienes una cuenta en %{register}?",
|
65
70
|
"lorem" => "Lorem ipsum dolor sit amet, consectetur adipiscing 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."
|
66
71
|
}
|
67
72
|
},
|
@@ -75,6 +80,7 @@ class Languages
|
|
75
80
|
Sty Lut Mar Kwi Maj Cze Lip Sie Wrz Paź Lis Gru
|
76
81
|
]
|
77
82
|
},
|
83
|
+
"language" => "Polski",
|
78
84
|
"welcome" => "Witaj",
|
79
85
|
"registration" => "Zarejestruj się",
|
80
86
|
"log_in" => "Zaloguj się",
|
@@ -85,13 +91,14 @@ class Languages
|
|
85
91
|
"password" => "Hasło",
|
86
92
|
"remember_me" => "Zapamiętaj mnie!",
|
87
93
|
"forgot_password" => "Zapomniałeś hasła?",
|
88
|
-
"do_not_have_account" => "Nie masz jeszcze konta?",
|
94
|
+
"do_not_have_account" => "Nie masz jeszcze konta w ${register}?",
|
89
95
|
"lorem" => "Lorem ipsum dolor sit amet, consectetur adipiscing 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."
|
90
96
|
}
|
91
97
|
},
|
92
98
|
iw: {
|
93
99
|
"iw" => {
|
94
100
|
# I'm not sure about this translation, it has to be checked!!
|
101
|
+
"language" => "עִברִית",
|
95
102
|
"welcome" => "שלום",
|
96
103
|
"registration" => "הירשם",
|
97
104
|
"log_in" => "להתחבר",
|
@@ -102,12 +109,13 @@ class Languages
|
|
102
109
|
"password" => "סיסמה",
|
103
110
|
"remember_me" => "זכור אותי",
|
104
111
|
"forgot_password" => "שכחת את הסיסמא?",
|
105
|
-
"do_not_have_account" => "אין לך חשבון?",
|
112
|
+
"do_not_have_account" => "%{register} אין לך חשבון?",
|
106
113
|
"lorem" => "כדי יסוד מונחים מועמדים של, דת דפים מאמרשיחהצפה זאת. אתה דת שונה כלשהו, גם אחר ליום בשפות, או ניווט פולנית לחיבור ארץ. ויש בקלות ואמנות אירועים או, אל אינו כלכלה שתי."
|
107
114
|
}
|
108
115
|
},
|
109
116
|
fr: {
|
110
117
|
"fr" => {
|
118
|
+
"language" => "Français",
|
111
119
|
"welcome" => "Bienvenu", # bienvenue female
|
112
120
|
"registration" => "Créer un compte",
|
113
121
|
"log_in" => "Connexion",
|
@@ -118,12 +126,13 @@ class Languages
|
|
118
126
|
"password" => "Mot de passe",
|
119
127
|
"remember_me" => "Mémoriser",
|
120
128
|
"forgot_password" => "Mot de passe oublié",
|
121
|
-
"do_not_have_account" => "Vous n'avez pas de compte?",
|
129
|
+
"do_not_have_account" => "Vous n'avez pas de compte %{register}?",
|
122
130
|
"lorem" => "Lorem ipsum dolor sit amet, consectetur adipiscing 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."
|
123
131
|
}
|
124
132
|
},
|
125
133
|
it: {
|
126
134
|
"it" => {
|
135
|
+
"language" => "Italiano",
|
127
136
|
"welcome" => "Benvenuto", # benvenuta female
|
128
137
|
"registration" => "Iscriviti",
|
129
138
|
"log_in" => "Accedi",
|
@@ -134,12 +143,13 @@ class Languages
|
|
134
143
|
"password" => "Password",
|
135
144
|
"remember_me" => "Ricordami",
|
136
145
|
"forgot_password" => "Ho dimenticato la password",
|
137
|
-
"do_not_have_account" => "Non possiedi un account?",
|
146
|
+
"do_not_have_account" => "Non possiedi un account %{register}?",
|
138
147
|
"lorem" => "Lorem ipsum dolor sit amet, consectetur adipiscing 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."
|
139
148
|
}
|
140
149
|
},
|
141
150
|
de: {
|
142
151
|
"de" => {
|
152
|
+
"language" => "Deutsch",
|
143
153
|
"welcome" => "Willkommen",
|
144
154
|
"registration" => "Registrieren",
|
145
155
|
"log_in" => "Anmelden",
|
@@ -150,10 +160,44 @@ class Languages
|
|
150
160
|
"password" => "Passwort",
|
151
161
|
"remember_me" => "Merken",
|
152
162
|
"forgot_password" => "Passwort vergessen?",
|
153
|
-
"do_not_have_account" => "Hast du noch kein
|
163
|
+
"do_not_have_account" => "Hast du noch kein %{replace}-Konto?", # Change!
|
154
164
|
"lorem" => "Lorem ipsum dolor sit amet, consectetur adipiscing 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."
|
155
165
|
}
|
156
166
|
},
|
167
|
+
ru: {
|
168
|
+
"ru" => {
|
169
|
+
"language" => "Русский",
|
170
|
+
"welcome" => "Добро пожаловать",
|
171
|
+
"registration" => "Зарегистрироваться",
|
172
|
+
"log_in" => "Вход",
|
173
|
+
"log_in_with" => "Войти с помощью %{replace}", # Example: 'with Facebook'
|
174
|
+
"log_out" => "Выйти",
|
175
|
+
"email_address" => "Адрес электронной почты",
|
176
|
+
"username" => "имя пользователя",
|
177
|
+
"password" => "Пароль",
|
178
|
+
"remember_me" => "Запомнить меня",
|
179
|
+
"forgot_password" => "Забыли пароль",
|
180
|
+
"do_not_have_account" => "У вас нет учётной записи %{register}?", # Change facebook!
|
181
|
+
"lorem" => "Лорем ипсум долор сит амет, пер цлита поссит ех, ат мунере фабулас петентиум сит. Иус цу цибо саперет сцрипсерит, нец виси муциус лабитур ид. Ет хис нонумес нолуиссе дигниссим."
|
182
|
+
}
|
183
|
+
},
|
184
|
+
ja: {
|
185
|
+
"ja" => {
|
186
|
+
"language" => "日本語",
|
187
|
+
"welcome" => "ようこそ",
|
188
|
+
"registration" => "サインアップ",
|
189
|
+
"log_in" => "サインイン",
|
190
|
+
"log_in_with" => "%{replace}でサインインする", # Example: 'with Facebook'
|
191
|
+
"log_out" => "サインアウト",
|
192
|
+
"email_address" => "メールアドレス",
|
193
|
+
"username" => "ユーザー名",
|
194
|
+
"password" => "パスワード",
|
195
|
+
"remember_me" => "パスワードを記憶する",
|
196
|
+
"forgot_password" => "パスワードを忘れた場合",
|
197
|
+
"do_not_have_account" => "%{register}アカウントをお持ちではありませんか??", # Change facebook!
|
198
|
+
"lorem" => "旅ロ京青利セムレ弱改フヨス波府かばぼ意送でぼ調掲察たス日西重ケアナ住橋ユムミク順待ふかんぼ人奨貯鏡すびそ。"
|
199
|
+
}
|
200
|
+
},
|
157
201
|
pt: {
|
158
202
|
"pt" => {
|
159
203
|
"date" => {
|
@@ -162,6 +206,7 @@ class Languages
|
|
162
206
|
"abbr_month_names" => %w[
|
163
207
|
]
|
164
208
|
},
|
209
|
+
"language" => "Português",
|
165
210
|
"welcome" => "Bem-vindo",
|
166
211
|
"registration" => "Cadastrar",
|
167
212
|
"log_in" => "Entrar",
|
@@ -172,7 +217,7 @@ class Languages
|
|
172
217
|
"password" => "Senha",
|
173
218
|
"remember_me" => "Lembrar de mim",
|
174
219
|
"forgot_password" => "Esqueceu Sua Senha",
|
175
|
-
"do_not_have_account" => "Não tem uma conta da?", # Example: da Facebook
|
220
|
+
"do_not_have_account" => "Não tem uma conta da %{register}?", # Example: da Facebook
|
176
221
|
"lorem" => "Lorem ipsum dolor sit amet, consectetur adipiscing 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."
|
177
222
|
}
|
178
223
|
},
|
@@ -184,6 +229,7 @@ class Languages
|
|
184
229
|
"abbr_month_names" => %w[
|
185
230
|
]
|
186
231
|
},
|
232
|
+
"language" => "Türkçe",
|
187
233
|
"welcome" => "Hoşgeldiniz",
|
188
234
|
"registration" => "Kayıt Ol",
|
189
235
|
"log_in" => "Giriş Yap",
|
@@ -194,10 +240,33 @@ class Languages
|
|
194
240
|
"password" => "Şifre",
|
195
241
|
"remember_me" => "Beni hatırla",
|
196
242
|
"forgot_password" => "Şifreni Mi Unuttun?",
|
197
|
-
"do_not_have_account" => "Bir %{
|
243
|
+
"do_not_have_account" => "Bir %{register} hesabın yok mu?", # Example: Facebook
|
198
244
|
"lorem" => "Lorem ipsum dolor sit amet, consectetur adipiscing 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."
|
199
245
|
}
|
200
246
|
},
|
247
|
+
ko: {
|
248
|
+
"ko" => {
|
249
|
+
"date" => {
|
250
|
+
"months_names" => %w[
|
251
|
+
],
|
252
|
+
"abbr_month_names" => %w[
|
253
|
+
]
|
254
|
+
},
|
255
|
+
"language" => "한국어",
|
256
|
+
"welcome" => "안녕하세요",
|
257
|
+
"registration" => "가입",
|
258
|
+
"log_in" => "로그인",
|
259
|
+
"log_in_with" => "%{replace}으로 로그인", # Example: 'with Facebook' carefully!
|
260
|
+
"log_out" => "로그아웃",
|
261
|
+
"email_address" => "이메일 주소",
|
262
|
+
"username" => "사용자 이름",
|
263
|
+
"password" => "비밀번호",
|
264
|
+
"remember_me" => "사용자 이름 저장",
|
265
|
+
"forgot_password" => "비밀번호를 잊으셨나요?",
|
266
|
+
"do_not_have_account" => "%{register}계정이 없으신가요?",
|
267
|
+
"lorem" => "국민경제의 발전을 위한 중요정책의 수립에 관하여 대통령의 자문에 응하기 위하여 국민경제자문회의를 둘 수 있다."
|
268
|
+
}
|
269
|
+
},
|
201
270
|
example: {
|
202
271
|
"example" => {
|
203
272
|
"date" => {
|
@@ -206,6 +275,7 @@ class Languages
|
|
206
275
|
"abbr_month_names" => %w[
|
207
276
|
]
|
208
277
|
},
|
278
|
+
"language" => "",
|
209
279
|
"welcome" => "",
|
210
280
|
"registration" => "",
|
211
281
|
"log_in" => "",
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
|
5
|
+
# Class comment
|
6
|
+
module RenderJson
|
7
|
+
def render_json(languages_input)
|
8
|
+
# "ar" || "ar_iw_pl"
|
9
|
+
languages_input = languages_input.split("_")
|
10
|
+
languages_input.each do |language|
|
11
|
+
next unless @languages.key?(language.to_sym)
|
12
|
+
|
13
|
+
File.open("config/locales/#{language}.json", "a+") do |f|
|
14
|
+
f.write(@languages[language.to_sym].to_json)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/translation.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: habluhablu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Gramatowski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Generate language file (for I18n) with translations of the most useful
|
14
14
|
phrases.
|
@@ -31,8 +31,6 @@ files:
|
|
31
31
|
- Rakefile
|
32
32
|
- bin/console
|
33
33
|
- bin/setup
|
34
|
-
- config/api_key.txt
|
35
|
-
- config/locales/api_key.txt
|
36
34
|
- config/locales/es.yml
|
37
35
|
- config/locales/iw.yml
|
38
36
|
- exe/habluhablu
|
@@ -41,6 +39,7 @@ files:
|
|
41
39
|
- lib/habluhablu/version.rb
|
42
40
|
- lib/languages/Countries_Flags.md
|
43
41
|
- lib/languages/languages.rb
|
42
|
+
- lib/languages/render_json.rb
|
44
43
|
- lib/translation.rb
|
45
44
|
homepage: https://github.com/patrickgramatowski/habluhablu_gem
|
46
45
|
licenses:
|
data/config/api_key.txt
DELETED
File without changes
|
data/config/locales/api_key.txt
DELETED
File without changes
|