immosquare-constants 0.1.7 → 0.1.9

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: cf1b489eab5dad935efdde6e47a153c456e6738c76ae7795cc761b86c565aa91
4
- data.tar.gz: 2187d3beb6fe69a6bfdffd71545ac8816e42f86c72a4f4109e8ec893f6137079
3
+ metadata.gz: d669eacfafcfd0307eafea96d504f2f070849c066dbfe781ba3f41f37814d66b
4
+ data.tar.gz: 3cffd5e01d38cc63fe012cccbef7c981729fc2c9b636428dc95c682d5fbcdef2
5
5
  SHA512:
6
- metadata.gz: 42eab3ce08e38fd36c01a2088ebd4d63e7f4f6b22584a991f62a8156b6492adcf75fd087e40574b05ad2220530f4f7b46b2a1adc8cdb30afc582ba5ee534d4b5
7
- data.tar.gz: 19877c8738bd091f10887b0eedda9cf1612b81f4db7a31eecde60f666c1d932858cf9e09698dc811522fd5fa59b6941db9db4b8cb69f040d9de3cb3ebddb7dda
6
+ metadata.gz: d46d1716505c6bc02c68a004748ce0d3b44bd65573a19b4b1f75c7b676c54b8785a1e96d91182ab407eb4e0f1a4620c6e1fb8fe519320597669425805f598679
7
+ data.tar.gz: bbdf4668123d8717065fc45f2694a073e3fe1eff4f6bfcdcf7ec93d84531e4009237216e9f339c722be11035307bec6f50a71cd2f500891ba0e5391d5912de69
@@ -1,99 +1,213 @@
1
1
  module ImmosquareConstants
2
2
  module Locale
3
3
  LOCALES = {
4
- :af => "Afrikaans",
5
- :am => "አማርኛ",
6
- :ar => "العربية",
7
- :az => "Azərbaycan",
8
- :be => "Беларуская",
9
- :bg => "Български",
10
- :bn => "বাংলা",
11
- :bo => "བོད་སྐད་",
12
- :bs => "Bosanski",
13
- :ca => "Català",
14
- :cs => "Čeština",
15
- :cy => "Cymraeg",
16
- :da => "Dansk",
17
- :de => "Deutsch",
18
- :el => "Ελληνικά",
19
- :en => "English",
20
- :eo => "Esperanto",
21
- :es => "Español",
22
- :et => "Eesti",
23
- :eu => "Euskara",
24
- :fa => "فارسی",
25
- :fi => "Suomi",
26
- :fr => "Français",
27
- :fy => "Frysk",
28
- :ga => "Gaeilge",
29
- :gl => "Galego",
30
- :gu => "ગુજરાતી",
31
- :he => "עברית",
32
- :hi => "हिन्दी",
33
- :hr => "Hrvatski",
34
- :hu => "Magyar",
35
- :hy => "Հայերեն",
36
- :id => "Bahasa Indonesia",
37
- :is => "Íslenska",
38
- :it => "Italiano",
39
- :ja => "日本語",
40
- :jv => "Basa Jawa",
41
- :ka => "ქართული",
42
- :kk => "Қазақ",
43
- :km => "ភាសាខ្មែរ",
44
- :kn => "ಕನ್ನಡ",
45
- :ko => "한국어",
46
- :ky => "Кыргызча",
47
- :lb => "Lëtzebuergesch",
48
- :lo => "ລາວ",
49
- :lt => "Lietuvių",
50
- :lv => "Latviešu",
51
- :mk => "Македонски",
52
- :ml => "മലയാളം",
53
- :mn => "Монгол",
54
- :mr => "मराठी",
55
- :ms => "Bahasa Melayu",
56
- :mt => "Malti",
57
- :my => "မြန်မာ",
58
- :ne => "नेपाली",
59
- :nl => "Nederlands",
60
- :no => "Norsk",
61
- :or => "ଓଡ଼ିଆ",
62
- :pa => "ਪੰਜਾਬੀ",
63
- :pl => "Polski",
64
- :ps => "پښتو",
65
- :pt => "Português",
66
- :ro => "Română",
67
- :ru => "Русский",
68
- :sd => "سنڌي",
69
- :si => "සිංහල",
70
- :sk => "Slovenčina",
71
- :sl => "Slovenščina",
72
- :so => "Soomaali",
73
- :sq => "Shqip",
74
- :sr => "Српски",
75
- :su => "Basa Sunda",
76
- :sv => "Svenska",
77
- :sw => "Kiswahili",
78
- :ta => "தமிழ்",
79
- :te => "తెలుగు",
80
- :tg => "Тоҷикӣ",
81
- :th => "ไทย",
82
- :tl => "Filipino",
83
- :tr => "Türkçe",
84
- :uk => "Українська",
85
- :ur => "اردو",
86
- :uz => "O'zbek",
87
- :vi => "Tiếng Việt",
88
- :xh => "isiXhosa",
89
- :zh => "中文",
90
- :zu => "isiZulu"
4
+ # Afrikaans (South Africa, Namibia)
5
+ :af => "Afrikaans",
6
+ # Amharic (Ethiopia)
7
+ :am => "አማርኛ",
8
+ # Arabic (Middle East, North Africa)
9
+ :ar => "العربية",
10
+ # Azerbaijani (Azerbaijan)
11
+ :az => "Azərbaycan",
12
+ # Belarusian (Belarus)
13
+ :be => "Беларуская",
14
+ # Bulgarian (Bulgaria)
15
+ :bg => "Български",
16
+ # Bengali (Bangladesh, India)
17
+ :bn => "বাংলা",
18
+ # Bosnian (Bosnia and Herzegovina)
19
+ :bs => "Bosanski",
20
+ # Catalan (Spain - Catalonia, Andorra)
21
+ :ca => "Català",
22
+ # Czech (Czech Republic)
23
+ :cs => "Čeština",
24
+ # Welsh (United Kingdom - Wales)
25
+ :cy => "Cymraeg",
26
+ # Danish (Denmark, Greenland, Faroe Islands)
27
+ :da => "Dansk",
28
+ # German (Germany, Austria, Switzerland, Liechtenstein, Luxembourg)
29
+ :de => "Deutsch",
30
+ :"de-AT" => "Deutsch (Österreich)",
31
+ :"de-CH" => "Deutsch (Schweiz)",
32
+ :"de-DE" => "Deutsch (Deutschland)",
33
+ # Greek (Greece, Cyprus)
34
+ :el => "Ελληνικά",
35
+ # English (United Kingdom, United States, Australia, Canada, and many others)
36
+ :en => "English",
37
+ :"en-AU" => "English (Australia)",
38
+ :"en-CA" => "English (Canada)",
39
+ :"en-GB" => "English (United Kingdom)",
40
+ :"en-IE" => "English (Ireland)",
41
+ :"en-IN" => "English (India)",
42
+ :"en-NZ" => "English (New Zealand)",
43
+ :"en-US" => "English (United States)",
44
+ :"en-ZA" => "English (South Africa)",
45
+ # Spanish (Spain, Latin America, United States)
46
+ :es => "Español",
47
+ :"es-AR" => "Español (Argentina)",
48
+ :"es-BO" => "Español (Bolivia)",
49
+ :"es-CL" => "Español (Chile)",
50
+ :"es-CO" => "Español (Colombia)",
51
+ :"es-CR" => "Español (Costa Rica)",
52
+ :"es-DO" => "Español (República Dominicana)",
53
+ :"es-EC" => "Español (Ecuador)",
54
+ :"es-GT" => "Español (Guatemala)",
55
+ :"es-HN" => "Español (Honduras)",
56
+ :"es-MX" => "Español (México)",
57
+ :"es-NI" => "Español (Nicaragua)",
58
+ :"es-PA" => "Español (Panamá)",
59
+ :"es-PE" => "Español (Perú)",
60
+ :"es-PR" => "Español (Puerto Rico)",
61
+ :"es-PY" => "Español (Paraguay)",
62
+ :"es-SV" => "Español (El Salvador)",
63
+ :"es-US" => "Español (Estados Unidos)",
64
+ :"es-UY" => "Español (Uruguay)",
65
+ :"es-VE" => "Español (Venezuela)",
66
+ # Estonian (Estonia)
67
+ :et => "Eesti",
68
+ # Persian (Iran, Afghanistan, Tajikistan)
69
+ :fa => "فارسی",
70
+ # Finnish (Finland)
71
+ :fi => "Suomi",
72
+ # French (France, Canada, Belgium, Switzerland, Luxembourg, and others)
73
+ :fr => "Français",
74
+ :"fr-BE" => "Français (Belgique)",
75
+ :"fr-CA" => "Français (Canada)",
76
+ :"fr-CH" => "Français (Suisse)",
77
+ :"fr-LU" => "Français (Luxembourg)",
78
+ # Gujarati (India)
79
+ :gu => "ગુજરાતી",
80
+ # Hebrew (Israel)
81
+ :he => "עברית",
82
+ # Hindi (India)
83
+ :hi => "हिन्दी",
84
+ # Croatian (Croatia, Bosnia and Herzegovina)
85
+ :hr => "Hrvatski",
86
+ # Hungarian (Hungary)
87
+ :hu => "Magyar",
88
+ # Armenian (Armenia)
89
+ :hy => "Հայերեն",
90
+ # Indonesian (Indonesia)
91
+ :id => "Bahasa Indonesia",
92
+ # Icelandic (Iceland)
93
+ :is => "Íslenska",
94
+ # Italian (Italy, Switzerland)
95
+ :it => "Italiano",
96
+ :"it-CH" => "Italiano (Svizzera)",
97
+ # Japanese (Japan)
98
+ :ja => "日本語",
99
+ # Georgian (Georgia)
100
+ :ka => "ქართული",
101
+ # Kazakh (Kazakhstan)
102
+ :kk => "Қазақ",
103
+ # Khmer (Cambodia)
104
+ :km => "ភាសាខ្មែរ",
105
+ # Kannada (India)
106
+ :kn => "ಕನ್ನಡ",
107
+ # Korean (South Korea, North Korea)
108
+ :ko => "한국어",
109
+ # Kyrgyz (Kyrgyzstan)
110
+ :ky => "Кыргызча",
111
+ # Lao (Laos)
112
+ :lo => "ລາວ",
113
+ # Lithuanian (Lithuania)
114
+ :lt => "Lietuvių",
115
+ # Latvian (Latvia)
116
+ :lv => "Latviešu",
117
+ # Macedonian (North Macedonia)
118
+ :mk => "Македонски",
119
+ # Malayalam (India)
120
+ :ml => "മലയാളം",
121
+ # Mongolian (Mongolia)
122
+ :mn => "Монгол",
123
+ # Marathi (India)
124
+ :mr => "मराठी",
125
+ # Malay (Malaysia, Brunei)
126
+ :ms => "Bahasa Melayu",
127
+ # Maltese (Malta)
128
+ :mt => "Malti",
129
+ # Burmese (Myanmar)
130
+ :my => "မြန်မာ",
131
+ # Nepali (Nepal)
132
+ :ne => "नेपाली",
133
+ # Dutch (Netherlands, Belgium)
134
+ :nl => "Nederlands",
135
+ # Norwegian (Norway)
136
+ :no => "Norsk",
137
+ # Odia (India)
138
+ :or => "ଓଡ଼ିଆ",
139
+ # Punjabi (India, Pakistan)
140
+ :pa => "ਪੰਜਾਬੀ",
141
+ # Polish (Poland)
142
+ :pl => "Polski",
143
+ # Pashto (Afghanistan, Pakistan)
144
+ :ps => "پښتو",
145
+ # Portuguese (Portugal, Brazil, and others)
146
+ :pt => "Português",
147
+ :"pt-BR" => "Português (Brasil)",
148
+ # Romanian (Romania, Moldova)
149
+ :ro => "Română",
150
+ # Russian (Russia, Belarus, and others)
151
+ :ru => "Русский",
152
+ # Sindhi (Pakistan, India)
153
+ :sd => "سنڌي",
154
+ # Sinhala (Sri Lanka)
155
+ :si => "සිංහල",
156
+ # Slovak (Slovakia)
157
+ :sk => "Slovenčina",
158
+ # Slovenian (Slovenia)
159
+ :sl => "Slovenščina",
160
+ # Somali (Somalia, Kenya)
161
+ :so => "Soomaali",
162
+ # Albanian (Albania, Kosovo)
163
+ :sq => "Shqip",
164
+ # Serbian (Serbia, Bosnia and Herzegovina, Montenegro)
165
+ :sr => "Српски",
166
+ # Swedish (Sweden, Finland)
167
+ :sv => "Svenska",
168
+ # Swahili (Kenya, Tanzania, Uganda, and others)
169
+ :sw => "Kiswahili",
170
+ # Tamil (India, Sri Lanka)
171
+ :ta => "தமிழ்",
172
+ # Telugu (India)
173
+ :te => "తెలుగు",
174
+ # Tajik (Tajikistan)
175
+ :tg => "Тоҷикӣ",
176
+ # Thai (Thailand)
177
+ :th => "ไทย",
178
+ # Tagalog (Philippines)
179
+ :tl => "Filipino",
180
+ # Turkish (Turkey, Cyprus)
181
+ :tr => "Türkçe",
182
+ # Ukrainian (Ukraine)
183
+ :uk => "Українська",
184
+ # Urdu (Pakistan, India)
185
+ :ur => "اردو",
186
+ # Uzbek (Uzbekistan)
187
+ :uz => "O'zbek",
188
+ # Vietnamese (Vietnam)
189
+ :vi => "Tiếng Việt",
190
+ # Xhosa (South Africa)
191
+ :xh => "isiXhosa",
192
+ # Chinese (China, Taiwan, Singapore, Hong Kong)
193
+ :zh => "中文",
194
+ :"zh-CN" => "中文 (简体)",
195
+ :"zh-TW" => "中文 (繁體)",
196
+ # Zulu (South Africa)
197
+ :zu => "isiZulu"
91
198
  }.freeze
92
199
 
93
200
  class << self
94
201
 
95
202
  def native_name_for_locale(locale)
96
- LOCALES[locale.to_sym]
203
+ begin
204
+ key = locale.to_s.split("-").map.with_index do |part, index|
205
+ index == 0 ? part.downcase : part.upcase
206
+ end.join("-").to_sym
207
+ LOCALES[key]
208
+ rescue StandardError
209
+ nil
210
+ end
97
211
  end
98
212
 
99
213
  end
@@ -3,18 +3,23 @@ module ImmosquareConstants
3
3
  class << self
4
4
 
5
5
  ##============================================================##
6
- ## Explication de la nouvelle expression régulière :
7
- ## /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/i
8
- ## \A : Début de la chaîne.
9
- ## [A-Z0-9._%+-]+ : Correspond à un ou plusieurs caractères autorisés dans la partie locale de l'adresse email (avant le @), y compris les lettres, les chiffres et les caractères spéciaux courants.
10
- ## @ : Le symbole arobase séparant la partie locale du domaine.
11
- ## [A-Z0-9.-]+ : Correspond à un ou plusieurs caractères autorisés dans le nom de domaine, y compris les lettres, les chiffres, les points et les tirets.
12
- ## \. : Correspond à un point littéral . séparant le domaine de l'extension.
13
- ## [A-Z]{2,} : Correspond à une extension de domaine composée d'au moins deux lettres (par exemple, com, org, net, fr).
14
- ## \z : Fin de la chaîne.
15
- ## /i : Modificateur rendant la correspondance insensible à la casse (majuscule/minuscule).
6
+ ## [A-Z0-9._%+-]+ : Correspond à un ou plusieurs caractères autorisés dans la partie locale de l'adresse email (avant le @), y compris les lettres, les chiffres et les caractères spéciaux courants.
7
+ ## @ : Le symbole arobase séparant la partie locale du domaine.
8
+ ## [A-Z0-9.-]+ : Correspond à un ou plusieurs caractères autorisés dans le nom de domaine, y compris les lettres, les chiffres, les points et les tirets.
9
+ ## \. : Correspond à un point littéral . séparant le domaine de l'extension.
10
+ ## [A-Z]{2,} : Correspond à une extension de domaine composée d'au moins deux lettres (par exemple, com, org, net, fr).
11
+ ##============================================================##
12
+ def email_raw
13
+ /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/i
14
+ end
15
+
16
+ ##============================================================##
17
+ ## \A : Début de la chaîne.
18
+ ## \z : Fin de la chaîne.
19
+ ## /i : Modificateur rendant la correspondance insensible à la casse (majuscule/minuscule).
20
+ ##============================================================##
16
21
  def email
17
- /\A[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\z/i
22
+ /\A#{email_raw.source}\z/i
18
23
  end
19
24
 
20
25
  ##============================================================##
@@ -22,7 +27,7 @@ module ImmosquareConstants
22
27
  ## délimiteurs de mots \b à la place des délimiteurs de chaîne
23
28
  ##============================================================##
24
29
  def email_in_string
25
- /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/i
30
+ /\b#{email_raw.source}\b/i
26
31
  end
27
32
 
28
33
  end
@@ -1,3 +1,3 @@
1
1
  module ImmosquareConstants
2
- VERSION = "0.1.7".freeze
2
+ VERSION = "0.1.9".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immosquare-constants
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - immosquare
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-11 00:00:00.000000000 Z
11
+ date: 2024-11-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ImmosquareConstants gem provides a robust set of constants to facilitate
14
14
  application development across various domains
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  requirements: []
46
- rubygems_version: 3.5.11
46
+ rubygems_version: 3.5.21
47
47
  signing_key:
48
48
  specification_version: 4
49
49
  summary: ImmosquareConstants is a comprehensive collection of constants useful for