active_cached_resource 0.0.1.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (340) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +22 -0
  4. data/.standard.yml +2 -0
  5. data/CHANGELOG.md +5 -0
  6. data/README.md +45 -0
  7. data/Rakefile +21 -0
  8. data/example/consumer/.dockerignore +41 -0
  9. data/example/consumer/.gitattributes +9 -0
  10. data/example/consumer/.gitignore +36 -0
  11. data/example/consumer/.kamal/hooks/docker-setup.sample +3 -0
  12. data/example/consumer/.kamal/hooks/post-deploy.sample +14 -0
  13. data/example/consumer/.kamal/hooks/post-proxy-reboot.sample +3 -0
  14. data/example/consumer/.kamal/hooks/pre-build.sample +51 -0
  15. data/example/consumer/.kamal/hooks/pre-connect.sample +47 -0
  16. data/example/consumer/.kamal/hooks/pre-deploy.sample +109 -0
  17. data/example/consumer/.kamal/hooks/pre-proxy-reboot.sample +3 -0
  18. data/example/consumer/.kamal/secrets +17 -0
  19. data/example/consumer/Dockerfile +65 -0
  20. data/example/consumer/Gemfile +17 -0
  21. data/example/consumer/Rakefile +6 -0
  22. data/example/consumer/app/controllers/application_controller.rb +2 -0
  23. data/example/consumer/app/controllers/concerns/.keep +0 -0
  24. data/example/consumer/app/jobs/application_job.rb +7 -0
  25. data/example/consumer/app/mailers/application_mailer.rb +4 -0
  26. data/example/consumer/app/models/application_record.rb +3 -0
  27. data/example/consumer/app/models/concerns/.keep +0 -0
  28. data/example/consumer/app/models/person.rb +9 -0
  29. data/example/consumer/app/views/layouts/mailer.html.erb +13 -0
  30. data/example/consumer/app/views/layouts/mailer.text.erb +1 -0
  31. data/example/consumer/bin/brakeman +7 -0
  32. data/example/consumer/bin/bundle +109 -0
  33. data/example/consumer/bin/dev +2 -0
  34. data/example/consumer/bin/docker-entrypoint +14 -0
  35. data/example/consumer/bin/jobs +6 -0
  36. data/example/consumer/bin/kamal +27 -0
  37. data/example/consumer/bin/rails +4 -0
  38. data/example/consumer/bin/rake +4 -0
  39. data/example/consumer/bin/rubocop +8 -0
  40. data/example/consumer/bin/setup +34 -0
  41. data/example/consumer/bin/thrust +5 -0
  42. data/example/consumer/config/application.rb +20 -0
  43. data/example/consumer/config/boot.rb +3 -0
  44. data/example/consumer/config/cache.yml +16 -0
  45. data/example/consumer/config/credentials.yml.enc +1 -0
  46. data/example/consumer/config/database.yml +14 -0
  47. data/example/consumer/config/deploy.yml +116 -0
  48. data/example/consumer/config/environment.rb +5 -0
  49. data/example/consumer/config/environments/development.rb +64 -0
  50. data/example/consumer/config/environments/production.rb +85 -0
  51. data/example/consumer/config/environments/test.rb +50 -0
  52. data/example/consumer/config/initializers/cors.rb +16 -0
  53. data/example/consumer/config/initializers/filter_parameter_logging.rb +8 -0
  54. data/example/consumer/config/initializers/inflections.rb +16 -0
  55. data/example/consumer/config/locales/en.yml +31 -0
  56. data/example/consumer/config/puma.rb +41 -0
  57. data/example/consumer/config/queue.yml +18 -0
  58. data/example/consumer/config/recurring.yml +10 -0
  59. data/example/consumer/config/routes.rb +10 -0
  60. data/example/consumer/config.ru +6 -0
  61. data/example/consumer/db/cache_schema.rb +14 -0
  62. data/example/consumer/db/queue_schema.rb +129 -0
  63. data/example/consumer/db/seeds.rb +0 -0
  64. data/example/consumer/lib/tasks/.keep +0 -0
  65. data/example/consumer/log/.keep +0 -0
  66. data/example/consumer/public/robots.txt +1 -0
  67. data/example/consumer/script/.keep +0 -0
  68. data/example/consumer/storage/.keep +0 -0
  69. data/example/consumer/tmp/.keep +0 -0
  70. data/example/consumer/tmp/cache/.keep +0 -0
  71. data/example/consumer/tmp/pids/.keep +0 -0
  72. data/example/consumer/tmp/storage/.keep +0 -0
  73. data/example/consumer/vendor/.keep +0 -0
  74. data/example/provider/.dockerignore +41 -0
  75. data/example/provider/.gitattributes +9 -0
  76. data/example/provider/.gitignore +32 -0
  77. data/example/provider/.kamal/hooks/docker-setup.sample +3 -0
  78. data/example/provider/.kamal/hooks/post-deploy.sample +14 -0
  79. data/example/provider/.kamal/hooks/post-proxy-reboot.sample +3 -0
  80. data/example/provider/.kamal/hooks/pre-build.sample +51 -0
  81. data/example/provider/.kamal/hooks/pre-connect.sample +47 -0
  82. data/example/provider/.kamal/hooks/pre-deploy.sample +109 -0
  83. data/example/provider/.kamal/hooks/pre-proxy-reboot.sample +3 -0
  84. data/example/provider/.kamal/secrets +17 -0
  85. data/example/provider/Dockerfile +65 -0
  86. data/example/provider/Gemfile +14 -0
  87. data/example/provider/Rakefile +6 -0
  88. data/example/provider/app/controllers/application_controller.rb +2 -0
  89. data/example/provider/app/controllers/concerns/.keep +0 -0
  90. data/example/provider/app/controllers/people_controller.rb +68 -0
  91. data/example/provider/app/jobs/application_job.rb +7 -0
  92. data/example/provider/app/mailers/application_mailer.rb +4 -0
  93. data/example/provider/app/models/address.rb +3 -0
  94. data/example/provider/app/models/application_record.rb +3 -0
  95. data/example/provider/app/models/company.rb +3 -0
  96. data/example/provider/app/models/concerns/.keep +0 -0
  97. data/example/provider/app/models/person.rb +6 -0
  98. data/example/provider/app/views/layouts/mailer.html.erb +13 -0
  99. data/example/provider/app/views/layouts/mailer.text.erb +1 -0
  100. data/example/provider/bin/brakeman +7 -0
  101. data/example/provider/bin/bundle +109 -0
  102. data/example/provider/bin/dev +2 -0
  103. data/example/provider/bin/docker-entrypoint +14 -0
  104. data/example/provider/bin/jobs +6 -0
  105. data/example/provider/bin/kamal +27 -0
  106. data/example/provider/bin/rails +4 -0
  107. data/example/provider/bin/rake +4 -0
  108. data/example/provider/bin/rubocop +8 -0
  109. data/example/provider/bin/setup +34 -0
  110. data/example/provider/bin/thrust +5 -0
  111. data/example/provider/config/application.rb +44 -0
  112. data/example/provider/config/boot.rb +3 -0
  113. data/example/provider/config/cache.yml +16 -0
  114. data/example/provider/config/credentials.yml.enc +1 -0
  115. data/example/provider/config/database.yml +20 -0
  116. data/example/provider/config/deploy.yml +116 -0
  117. data/example/provider/config/environment.rb +5 -0
  118. data/example/provider/config/environments/development.rb +64 -0
  119. data/example/provider/config/environments/production.rb +85 -0
  120. data/example/provider/config/environments/test.rb +50 -0
  121. data/example/provider/config/initializers/cors.rb +16 -0
  122. data/example/provider/config/initializers/filter_parameter_logging.rb +8 -0
  123. data/example/provider/config/initializers/inflections.rb +16 -0
  124. data/example/provider/config/locales/en.yml +31 -0
  125. data/example/provider/config/puma.rb +41 -0
  126. data/example/provider/config/queue.yml +18 -0
  127. data/example/provider/config/recurring.yml +10 -0
  128. data/example/provider/config/routes.rb +4 -0
  129. data/example/provider/config.ru +6 -0
  130. data/example/provider/db/cache_schema.rb +14 -0
  131. data/example/provider/db/migrate/20241202183937_create_people.rb +11 -0
  132. data/example/provider/db/migrate/20241202183955_create_addresses.rb +13 -0
  133. data/example/provider/db/migrate/20241202184017_create_companies.rb +14 -0
  134. data/example/provider/db/queue_schema.rb +129 -0
  135. data/example/provider/db/schema.rb +47 -0
  136. data/example/provider/db/seeds.rb +18 -0
  137. data/example/provider/lib/tasks/.keep +0 -0
  138. data/example/provider/log/.keep +0 -0
  139. data/example/provider/public/robots.txt +1 -0
  140. data/example/provider/script/.keep +0 -0
  141. data/example/provider/storage/.keep +0 -0
  142. data/example/provider/tmp/.keep +0 -0
  143. data/example/provider/tmp/pids/.keep +0 -0
  144. data/example/provider/tmp/storage/.keep +0 -0
  145. data/example/provider/vendor/.keep +0 -0
  146. data/lib/active_cached_resource/caching.rb +176 -0
  147. data/lib/active_cached_resource/caching_strategies/active_support_cache.rb +31 -0
  148. data/lib/active_cached_resource/caching_strategies/base.rb +114 -0
  149. data/lib/active_cached_resource/caching_strategies/sql_cache.rb +32 -0
  150. data/lib/active_cached_resource/configuration.rb +50 -0
  151. data/lib/active_cached_resource/logger.rb +22 -0
  152. data/lib/active_cached_resource/model.rb +33 -0
  153. data/lib/active_cached_resource/version.rb +12 -0
  154. data/lib/active_cached_resource.rb +64 -0
  155. data/lib/activeresource/.gitignore +15 -0
  156. data/lib/activeresource/README.md +283 -0
  157. data/lib/activeresource/examples/performance.rb +72 -0
  158. data/lib/activeresource/lib/active_resource/active_job_serializer.rb +26 -0
  159. data/lib/activeresource/lib/active_resource/associations/builder/association.rb +32 -0
  160. data/lib/activeresource/lib/active_resource/associations/builder/belongs_to.rb +16 -0
  161. data/lib/activeresource/lib/active_resource/associations/builder/has_many.rb +14 -0
  162. data/lib/activeresource/lib/active_resource/associations/builder/has_one.rb +14 -0
  163. data/lib/activeresource/lib/active_resource/associations.rb +175 -0
  164. data/lib/activeresource/lib/active_resource/base.rb +1741 -0
  165. data/lib/activeresource/lib/active_resource/callbacks.rb +22 -0
  166. data/lib/activeresource/lib/active_resource/collection.rb +214 -0
  167. data/lib/activeresource/lib/active_resource/connection.rb +298 -0
  168. data/lib/activeresource/lib/active_resource/custom_methods.rb +129 -0
  169. data/lib/activeresource/lib/active_resource/exceptions.rb +98 -0
  170. data/lib/activeresource/lib/active_resource/formats/json_format.rb +28 -0
  171. data/lib/activeresource/lib/active_resource/formats/xml_format.rb +27 -0
  172. data/lib/activeresource/lib/active_resource/formats.rb +24 -0
  173. data/lib/activeresource/lib/active_resource/http_mock.rb +386 -0
  174. data/lib/activeresource/lib/active_resource/inheriting_hash.rb +34 -0
  175. data/lib/activeresource/lib/active_resource/log_subscriber.rb +26 -0
  176. data/lib/activeresource/lib/active_resource/railtie.rb +31 -0
  177. data/lib/activeresource/lib/active_resource/reflection.rb +78 -0
  178. data/lib/activeresource/lib/active_resource/schema.rb +60 -0
  179. data/lib/activeresource/lib/active_resource/singleton.rb +111 -0
  180. data/lib/activeresource/lib/active_resource/threadsafe_attributes.rb +65 -0
  181. data/lib/activeresource/lib/active_resource/validations.rb +176 -0
  182. data/lib/activeresource/lib/active_resource.rb +49 -0
  183. data/lib/activeresource/lib/activeresource.rb +3 -0
  184. data/lib/activeresource/test/abstract_unit.rb +153 -0
  185. data/lib/activeresource/test/cases/active_job_serializer_test.rb +53 -0
  186. data/lib/activeresource/test/cases/association_test.rb +104 -0
  187. data/lib/activeresource/test/cases/associations/builder/belongs_to_test.rb +42 -0
  188. data/lib/activeresource/test/cases/associations/builder/has_many_test.rb +28 -0
  189. data/lib/activeresource/test/cases/associations/builder/has_one_test.rb +28 -0
  190. data/lib/activeresource/test/cases/authorization_test.rb +276 -0
  191. data/lib/activeresource/test/cases/base/custom_methods_test.rb +155 -0
  192. data/lib/activeresource/test/cases/base/equality_test.rb +53 -0
  193. data/lib/activeresource/test/cases/base/load_test.rb +249 -0
  194. data/lib/activeresource/test/cases/base/schema_test.rb +428 -0
  195. data/lib/activeresource/test/cases/base_errors_test.rb +129 -0
  196. data/lib/activeresource/test/cases/base_test.rb +1622 -0
  197. data/lib/activeresource/test/cases/callbacks_test.rb +155 -0
  198. data/lib/activeresource/test/cases/collection_test.rb +172 -0
  199. data/lib/activeresource/test/cases/connection_test.rb +357 -0
  200. data/lib/activeresource/test/cases/finder_test.rb +217 -0
  201. data/lib/activeresource/test/cases/format_test.rb +137 -0
  202. data/lib/activeresource/test/cases/http_mock_test.rb +213 -0
  203. data/lib/activeresource/test/cases/inheritence_test.rb +19 -0
  204. data/lib/activeresource/test/cases/inheriting_hash_test.rb +25 -0
  205. data/lib/activeresource/test/cases/log_subscriber_test.rb +63 -0
  206. data/lib/activeresource/test/cases/reflection_test.rb +65 -0
  207. data/lib/activeresource/test/cases/validations_test.rb +78 -0
  208. data/lib/activeresource/test/fixtures/address.rb +20 -0
  209. data/lib/activeresource/test/fixtures/beast.rb +16 -0
  210. data/lib/activeresource/test/fixtures/comment.rb +5 -0
  211. data/lib/activeresource/test/fixtures/customer.rb +5 -0
  212. data/lib/activeresource/test/fixtures/inventory.rb +14 -0
  213. data/lib/activeresource/test/fixtures/person.rb +15 -0
  214. data/lib/activeresource/test/fixtures/pet.rb +6 -0
  215. data/lib/activeresource/test/fixtures/post.rb +5 -0
  216. data/lib/activeresource/test/fixtures/product.rb +11 -0
  217. data/lib/activeresource/test/fixtures/project.rb +19 -0
  218. data/lib/activeresource/test/fixtures/proxy.rb +6 -0
  219. data/lib/activeresource/test/fixtures/sound.rb +11 -0
  220. data/lib/activeresource/test/fixtures/street_address.rb +6 -0
  221. data/lib/activeresource/test/fixtures/subscription_plan.rb +7 -0
  222. data/lib/activeresource/test/fixtures/weather.rb +21 -0
  223. data/lib/activeresource/test/setter_trap.rb +28 -0
  224. data/lib/activeresource/test/singleton_test.rb +138 -0
  225. data/lib/activeresource/test/threadsafe_attributes_test.rb +91 -0
  226. data/lib/generators/active_cached_resource/install_generator.rb +31 -0
  227. data/lib/generators/active_cached_resource/templates/migration.erb +16 -0
  228. data/sorbet/config +4 -0
  229. data/sorbet/rbi/annotations/.gitattributes +1 -0
  230. data/sorbet/rbi/annotations/activemodel.rbi +89 -0
  231. data/sorbet/rbi/annotations/activesupport.rbi +457 -0
  232. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  233. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  234. data/sorbet/rbi/dsl/.gitattributes +1 -0
  235. data/sorbet/rbi/dsl/active_support/callbacks.rbi +21 -0
  236. data/sorbet/rbi/gems/.gitattributes +1 -0
  237. data/sorbet/rbi/gems/actioncable@8.0.0.rbi +252 -0
  238. data/sorbet/rbi/gems/actionmailbox@8.0.0.rbi +9 -0
  239. data/sorbet/rbi/gems/actionmailer@8.0.0.rbi +9 -0
  240. data/sorbet/rbi/gems/actionpack@8.0.0.rbi +20909 -0
  241. data/sorbet/rbi/gems/actiontext@8.0.0.rbi +9 -0
  242. data/sorbet/rbi/gems/actionview@8.0.0.rbi +16207 -0
  243. data/sorbet/rbi/gems/activejob@8.0.0.rbi +9 -0
  244. data/sorbet/rbi/gems/activemodel-serializers-xml@1.0.3.rbi +166 -0
  245. data/sorbet/rbi/gems/activemodel@8.0.0.rbi +6857 -0
  246. data/sorbet/rbi/gems/activerecord@8.0.0.rbi +42896 -0
  247. data/sorbet/rbi/gems/activeresource@6.1.4.rbi +3944 -0
  248. data/sorbet/rbi/gems/activestorage@8.0.0.rbi +9 -0
  249. data/sorbet/rbi/gems/activesupport@8.0.0.rbi +21251 -0
  250. data/sorbet/rbi/gems/ast@2.4.2.rbi +585 -0
  251. data/sorbet/rbi/gems/base64@0.2.0.rbi +509 -0
  252. data/sorbet/rbi/gems/benchmark@0.4.0.rbi +618 -0
  253. data/sorbet/rbi/gems/bigdecimal@3.1.8.rbi +78 -0
  254. data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
  255. data/sorbet/rbi/gems/bump@0.10.0.rbi +169 -0
  256. data/sorbet/rbi/gems/byebug@11.1.3.rbi +3607 -0
  257. data/sorbet/rbi/gems/coderay@1.1.3.rbi +3427 -0
  258. data/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi +11645 -0
  259. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +9 -0
  260. data/sorbet/rbi/gems/crass@1.0.6.rbi +623 -0
  261. data/sorbet/rbi/gems/date@3.4.0.rbi +75 -0
  262. data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +1131 -0
  263. data/sorbet/rbi/gems/docile@1.4.1.rbi +377 -0
  264. data/sorbet/rbi/gems/drb@2.2.1.rbi +1347 -0
  265. data/sorbet/rbi/gems/erubi@1.13.0.rbi +150 -0
  266. data/sorbet/rbi/gems/globalid@1.2.1.rbi +9 -0
  267. data/sorbet/rbi/gems/i18n@1.14.6.rbi +2359 -0
  268. data/sorbet/rbi/gems/io-console@0.7.2.rbi +9 -0
  269. data/sorbet/rbi/gems/json@2.8.2.rbi +1901 -0
  270. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14238 -0
  271. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +240 -0
  272. data/sorbet/rbi/gems/logger@1.6.1.rbi +920 -0
  273. data/sorbet/rbi/gems/loofah@2.23.1.rbi +1081 -0
  274. data/sorbet/rbi/gems/mail@2.8.1.rbi +9 -0
  275. data/sorbet/rbi/gems/marcel@1.0.4.rbi +9 -0
  276. data/sorbet/rbi/gems/method_source@1.1.0.rbi +304 -0
  277. data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +9 -0
  278. data/sorbet/rbi/gems/minitest@5.25.2.rbi +1547 -0
  279. data/sorbet/rbi/gems/net-imap@0.5.1.rbi +9 -0
  280. data/sorbet/rbi/gems/net-pop@0.1.2.rbi +9 -0
  281. data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +292 -0
  282. data/sorbet/rbi/gems/net-smtp@0.5.0.rbi +9 -0
  283. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  284. data/sorbet/rbi/gems/nio4r@2.7.4.rbi +9 -0
  285. data/sorbet/rbi/gems/nokogiri@1.16.7.rbi +7311 -0
  286. data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
  287. data/sorbet/rbi/gems/parser@3.3.6.0.rbi +5519 -0
  288. data/sorbet/rbi/gems/prism@1.2.0.rbi +39085 -0
  289. data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +1151 -0
  290. data/sorbet/rbi/gems/pry@0.14.2.rbi +10076 -0
  291. data/sorbet/rbi/gems/psych@5.2.0.rbi +1785 -0
  292. data/sorbet/rbi/gems/racc@1.8.1.rbi +162 -0
  293. data/sorbet/rbi/gems/rack-session@2.0.0.rbi +727 -0
  294. data/sorbet/rbi/gems/rack-test@2.1.0.rbi +747 -0
  295. data/sorbet/rbi/gems/rack@3.1.8.rbi +4905 -0
  296. data/sorbet/rbi/gems/rackup@2.2.1.rbi +230 -0
  297. data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +758 -0
  298. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi +785 -0
  299. data/sorbet/rbi/gems/rails@8.0.0.rbi +9 -0
  300. data/sorbet/rbi/gems/railties@8.0.0.rbi +6287 -0
  301. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  302. data/sorbet/rbi/gems/rake@13.2.1.rbi +3091 -0
  303. data/sorbet/rbi/gems/rbi@0.2.1.rbi +4535 -0
  304. data/sorbet/rbi/gems/rdoc@6.8.1.rbi +12572 -0
  305. data/sorbet/rbi/gems/regexp_parser@2.9.2.rbi +3772 -0
  306. data/sorbet/rbi/gems/reline@0.5.12.rbi +2416 -0
  307. data/sorbet/rbi/gems/rexml@3.3.9.rbi +4858 -0
  308. data/sorbet/rbi/gems/rspec-core@3.13.2.rbi +11287 -0
  309. data/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi +8183 -0
  310. data/sorbet/rbi/gems/rspec-mocks@3.13.2.rbi +5341 -0
  311. data/sorbet/rbi/gems/rspec-support@3.13.1.rbi +1630 -0
  312. data/sorbet/rbi/gems/rspec@3.13.0.rbi +83 -0
  313. data/sorbet/rbi/gems/rubocop-ast@1.36.1.rbi +7303 -0
  314. data/sorbet/rbi/gems/rubocop-performance@1.21.1.rbi +9 -0
  315. data/sorbet/rbi/gems/rubocop@1.65.1.rbi +58170 -0
  316. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  317. data/sorbet/rbi/gems/securerandom@0.3.2.rbi +395 -0
  318. data/sorbet/rbi/gems/simplecov-html@0.13.1.rbi +225 -0
  319. data/sorbet/rbi/gems/simplecov@0.22.0.rbi +2149 -0
  320. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +9 -0
  321. data/sorbet/rbi/gems/spoom@1.5.0.rbi +4932 -0
  322. data/sorbet/rbi/gems/standard-custom@1.0.2.rbi +9 -0
  323. data/sorbet/rbi/gems/standard-performance@1.4.0.rbi +9 -0
  324. data/sorbet/rbi/gems/standard@1.40.0.rbi +929 -0
  325. data/sorbet/rbi/gems/stringio@3.1.2.rbi +9 -0
  326. data/sorbet/rbi/gems/tapioca@0.16.4.rbi +3597 -0
  327. data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
  328. data/sorbet/rbi/gems/timeout@0.4.2.rbi +151 -0
  329. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
  330. data/sorbet/rbi/gems/unicode-display_width@2.6.0.rbi +66 -0
  331. data/sorbet/rbi/gems/uri@1.0.2.rbi +2377 -0
  332. data/sorbet/rbi/gems/useragent@0.16.10.rbi +9 -0
  333. data/sorbet/rbi/gems/websocket-driver@0.7.6.rbi +9 -0
  334. data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +9 -0
  335. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  336. data/sorbet/rbi/gems/yard@0.9.37.rbi +18504 -0
  337. data/sorbet/rbi/gems/zeitwerk@2.7.1.rbi +9 -0
  338. data/sorbet/tapioca/config.yml +13 -0
  339. data/sorbet/tapioca/require.rb +12 -0
  340. metadata +543 -0
@@ -0,0 +1,2359 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `i18n` gem.
5
+ # Please instead update this file by running `bin/tapioca gem i18n`.
6
+
7
+
8
+ # source://i18n//lib/i18n/gettext/po_parser.rb#15
9
+ module GetText; end
10
+
11
+ # source://i18n//lib/i18n/gettext/po_parser.rb#17
12
+ class GetText::PoParser < ::Racc::Parser
13
+ # source://i18n//lib/i18n/gettext/po_parser.rb#19
14
+ def _(x); end
15
+
16
+ def _reduce_10(val, _values, result); end
17
+ def _reduce_12(val, _values, result); end
18
+ def _reduce_13(val, _values, result); end
19
+ def _reduce_14(val, _values, result); end
20
+ def _reduce_15(val, _values, result); end
21
+ def _reduce_5(val, _values, result); end
22
+ def _reduce_8(val, _values, result); end
23
+ def _reduce_9(val, _values, result); end
24
+
25
+ # source://i18n//lib/i18n/gettext/po_parser.rb#323
26
+ def _reduce_none(val, _values, result); end
27
+
28
+ def next_token; end
29
+ def on_comment(comment); end
30
+ def on_message(msgid, msgstr); end
31
+ def parse(str, data, ignore_fuzzy = T.unsafe(nil)); end
32
+ def unescape(orig); end
33
+ end
34
+
35
+ # source://i18n//lib/i18n/gettext/po_parser.rb#184
36
+ GetText::PoParser::Racc_arg = T.let(T.unsafe(nil), Array)
37
+
38
+ # source://i18n//lib/i18n/gettext/po_parser.rb#221
39
+ GetText::PoParser::Racc_debug_parser = T.let(T.unsafe(nil), TrueClass)
40
+
41
+ # source://i18n//lib/i18n/gettext/po_parser.rb#200
42
+ GetText::PoParser::Racc_token_to_s_table = T.let(T.unsafe(nil), Array)
43
+
44
+ # Simple Locale tag implementation that computes subtags by simply splitting
45
+ # the locale tag at '-' occurrences.
46
+ #
47
+ # source://i18n//lib/i18n/version.rb#3
48
+ module I18n
49
+ extend ::I18n::Base
50
+
51
+ class << self
52
+ # source://i18n//lib/i18n/backend/cache.rb#64
53
+ def cache_key_digest; end
54
+
55
+ # source://i18n//lib/i18n/backend/cache.rb#68
56
+ def cache_key_digest=(key_digest); end
57
+
58
+ # source://i18n//lib/i18n/backend/cache.rb#56
59
+ def cache_namespace; end
60
+
61
+ # source://i18n//lib/i18n/backend/cache.rb#60
62
+ def cache_namespace=(namespace); end
63
+
64
+ # source://i18n//lib/i18n/backend/cache.rb#48
65
+ def cache_store; end
66
+
67
+ # source://i18n//lib/i18n/backend/cache.rb#52
68
+ def cache_store=(store); end
69
+
70
+ # Returns the current fallbacks implementation. Defaults to +I18n::Locale::Fallbacks+.
71
+ #
72
+ # source://i18n//lib/i18n/backend/fallbacks.rb#17
73
+ def fallbacks; end
74
+
75
+ # Sets the current fallbacks implementation. Use this to set a different fallbacks implementation.
76
+ #
77
+ # source://i18n//lib/i18n/backend/fallbacks.rb#23
78
+ def fallbacks=(fallbacks); end
79
+
80
+ # Return String or raises MissingInterpolationArgument exception.
81
+ # Missing argument's logic is handled by I18n.config.missing_interpolation_argument_handler.
82
+ #
83
+ # @raise [ReservedInterpolationKey]
84
+ #
85
+ # source://i18n//lib/i18n/interpolate/ruby.rb#23
86
+ def interpolate(string, values); end
87
+
88
+ # source://i18n//lib/i18n/interpolate/ruby.rb#29
89
+ def interpolate_hash(string, values); end
90
+
91
+ # source://i18n//lib/i18n.rb#38
92
+ def new_double_nested_cache; end
93
+
94
+ # @return [Boolean]
95
+ #
96
+ # source://i18n//lib/i18n/backend/cache.rb#72
97
+ def perform_caching?; end
98
+
99
+ # Marks a key as reserved. Reserved keys are used internally,
100
+ # and can't also be used for interpolation. If you are using any
101
+ # extra keys as I18n options, you should call I18n.reserve_key
102
+ # before any I18n.translate (etc) calls are made.
103
+ #
104
+ # source://i18n//lib/i18n.rb#46
105
+ def reserve_key(key); end
106
+
107
+ # source://i18n//lib/i18n.rb#51
108
+ def reserved_keys_pattern; end
109
+ end
110
+ end
111
+
112
+ # source://i18n//lib/i18n/exceptions.rb#16
113
+ class I18n::ArgumentError < ::ArgumentError; end
114
+
115
+ # source://i18n//lib/i18n/backend.rb#4
116
+ module I18n::Backend; end
117
+
118
+ # source://i18n//lib/i18n/backend/base.rb#8
119
+ module I18n::Backend::Base
120
+ include ::I18n::Backend::Transliterator
121
+
122
+ # Returns an array of locales for which translations are available
123
+ # ignoring the reserved translation meta data key :i18n.
124
+ #
125
+ # @raise [NotImplementedError]
126
+ #
127
+ # source://i18n//lib/i18n/backend/base.rb#97
128
+ def available_locales; end
129
+
130
+ # source://i18n//lib/i18n/backend/base.rb#105
131
+ def eager_load!; end
132
+
133
+ # @return [Boolean]
134
+ #
135
+ # source://i18n//lib/i18n/backend/base.rb#71
136
+ def exists?(locale, key, options = T.unsafe(nil)); end
137
+
138
+ # Accepts a list of paths to translation files. Loads translations from
139
+ # plain Ruby (*.rb), YAML files (*.yml), or JSON files (*.json). See #load_rb, #load_yml, and #load_json
140
+ # for details.
141
+ #
142
+ # source://i18n//lib/i18n/backend/base.rb#14
143
+ def load_translations(*filenames); end
144
+
145
+ # Acts the same as +strftime+, but uses a localized version of the
146
+ # format string. Takes a key from the date/time formats translations as
147
+ # a format argument (<em>e.g.</em>, <tt>:short</tt> in <tt>:'date.formats'</tt>).
148
+ #
149
+ # @raise [ArgumentError]
150
+ #
151
+ # source://i18n//lib/i18n/backend/base.rb#78
152
+ def localize(locale, object, format = T.unsafe(nil), options = T.unsafe(nil)); end
153
+
154
+ # source://i18n//lib/i18n/backend/base.rb#101
155
+ def reload!; end
156
+
157
+ # This method receives a locale, a data hash and options for storing translations.
158
+ # Should be implemented
159
+ #
160
+ # @raise [NotImplementedError]
161
+ #
162
+ # source://i18n//lib/i18n/backend/base.rb#24
163
+ def store_translations(locale, data, options = T.unsafe(nil)); end
164
+
165
+ # @raise [I18n::ArgumentError]
166
+ #
167
+ # source://i18n//lib/i18n/backend/base.rb#28
168
+ def translate(locale, key, options = T.unsafe(nil)); end
169
+
170
+ protected
171
+
172
+ # Deep interpolation
173
+ #
174
+ # deep_interpolate { people: { ann: "Ann is %{ann}", john: "John is %{john}" } },
175
+ # ann: 'good', john: 'big'
176
+ # #=> { people: { ann: "Ann is good", john: "John is big" } }
177
+ #
178
+ # source://i18n//lib/i18n/backend/base.rb#217
179
+ def deep_interpolate(locale, data, values = T.unsafe(nil)); end
180
+
181
+ # Evaluates defaults.
182
+ # If given subject is an Array, it walks the array and returns the
183
+ # first translation that can be resolved. Otherwise it tries to resolve
184
+ # the translation directly.
185
+ #
186
+ # source://i18n//lib/i18n/backend/base.rb#128
187
+ def default(locale, object, subject, options = T.unsafe(nil)); end
188
+
189
+ # @return [Boolean]
190
+ #
191
+ # source://i18n//lib/i18n/backend/base.rb#111
192
+ def eager_loaded?; end
193
+
194
+ # Interpolates values into a given subject.
195
+ #
196
+ # if the given subject is a string then:
197
+ # method interpolates "file %{file} opened by %%{user}", :file => 'test.txt', :user => 'Mr. X'
198
+ # # => "file test.txt opened by %{user}"
199
+ #
200
+ # if the given subject is an array then:
201
+ # each element of the array is recursively interpolated (until it finds a string)
202
+ # method interpolates ["yes, %{user}", ["maybe no, %{user}", "no, %{user}"]], :user => "bartuz"
203
+ # # => ["yes, bartuz", ["maybe no, bartuz", "no, bartuz"]]
204
+ #
205
+ # source://i18n//lib/i18n/backend/base.rb#201
206
+ def interpolate(locale, subject, values = T.unsafe(nil)); end
207
+
208
+ # Loads a single translations file by delegating to #load_rb or
209
+ # #load_yml depending on the file extension and directly merges the
210
+ # data to the existing translations. Raises I18n::UnknownFileType
211
+ # for all other file extensions.
212
+ #
213
+ # @raise [UnknownFileType]
214
+ #
215
+ # source://i18n//lib/i18n/backend/base.rb#240
216
+ def load_file(filename); end
217
+
218
+ # Loads a JSON translations file. The data must have locales as
219
+ # toplevel keys.
220
+ #
221
+ # source://i18n//lib/i18n/backend/base.rb#276
222
+ def load_json(filename); end
223
+
224
+ # Loads a plain Ruby translations file. eval'ing the file must yield
225
+ # a Hash containing translation data with locales as toplevel keys.
226
+ #
227
+ # source://i18n//lib/i18n/backend/base.rb#254
228
+ def load_rb(filename); end
229
+
230
+ # Loads a YAML translations file. The data must have locales as
231
+ # toplevel keys.
232
+ #
233
+ # source://i18n//lib/i18n/backend/base.rb#261
234
+ def load_yaml(filename); end
235
+
236
+ # Loads a YAML translations file. The data must have locales as
237
+ # toplevel keys.
238
+ #
239
+ # source://i18n//lib/i18n/backend/base.rb#261
240
+ def load_yml(filename); end
241
+
242
+ # The method which actually looks up for the translation in the store.
243
+ #
244
+ # @raise [NotImplementedError]
245
+ #
246
+ # source://i18n//lib/i18n/backend/base.rb#116
247
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
248
+
249
+ # source://i18n//lib/i18n/backend/base.rb#308
250
+ def pluralization_key(entry, count); end
251
+
252
+ # Picks a translation from a pluralized mnemonic subkey according to English
253
+ # pluralization rules :
254
+ # - It will pick the :one subkey if count is equal to 1.
255
+ # - It will pick the :other subkey otherwise.
256
+ # - It will pick the :zero subkey in the special case where count is
257
+ # equal to 0 and there is a :zero subkey present. This behaviour is
258
+ # not standard with regards to the CLDR pluralization rules.
259
+ # Other backends can implement more flexible or complex pluralization rules.
260
+ #
261
+ # @raise [InvalidPluralizationData]
262
+ #
263
+ # source://i18n//lib/i18n/backend/base.rb#182
264
+ def pluralize(locale, entry, count); end
265
+
266
+ # Resolves a translation.
267
+ # If the given subject is a Symbol, it will be translated with the
268
+ # given options. If it is a Proc then it will be evaluated. All other
269
+ # subjects will be returned directly.
270
+ #
271
+ # source://i18n//lib/i18n/backend/base.rb#150
272
+ def resolve(locale, object, subject, options = T.unsafe(nil)); end
273
+
274
+ # Resolves a translation.
275
+ # If the given subject is a Symbol, it will be translated with the
276
+ # given options. If it is a Proc then it will be evaluated. All other
277
+ # subjects will be returned directly.
278
+ #
279
+ # source://i18n//lib/i18n/backend/base.rb#150
280
+ def resolve_entry(locale, object, subject, options = T.unsafe(nil)); end
281
+
282
+ # @return [Boolean]
283
+ #
284
+ # source://i18n//lib/i18n/backend/base.rb#120
285
+ def subtrees?; end
286
+
287
+ # source://i18n//lib/i18n/backend/base.rb#289
288
+ def translate_localization_format(locale, object, format, options); end
289
+ end
290
+
291
+ # TODO Should the cache be cleared if new translations are stored?
292
+ #
293
+ # source://i18n//lib/i18n/backend/cache.rb#79
294
+ module I18n::Backend::Cache
295
+ # source://i18n//lib/i18n/backend/cache.rb#80
296
+ def translate(locale, key, options = T.unsafe(nil)); end
297
+
298
+ protected
299
+
300
+ # source://i18n//lib/i18n/backend/cache.rb#93
301
+ def _fetch(cache_key, &block); end
302
+
303
+ # source://i18n//lib/i18n/backend/cache.rb#101
304
+ def cache_key(locale, key, options); end
305
+
306
+ # source://i18n//lib/i18n/backend/cache.rb#86
307
+ def fetch(cache_key, &block); end
308
+
309
+ private
310
+
311
+ # source://i18n//lib/i18n/backend/cache.rb#108
312
+ def digest_item(key); end
313
+ end
314
+
315
+ # Overwrites the Base load_file method to cache loaded file contents.
316
+ #
317
+ # source://i18n//lib/i18n/backend/cache_file.rb#8
318
+ module I18n::Backend::CacheFile
319
+ # Optionally provide path_roots array to normalize filename paths,
320
+ # to make the cached i18n data portable across environments.
321
+ #
322
+ # source://i18n//lib/i18n/backend/cache_file.rb#11
323
+ def path_roots; end
324
+
325
+ # Optionally provide path_roots array to normalize filename paths,
326
+ # to make the cached i18n data portable across environments.
327
+ #
328
+ # source://i18n//lib/i18n/backend/cache_file.rb#11
329
+ def path_roots=(_arg0); end
330
+
331
+ protected
332
+
333
+ # Track loaded translation files in the `i18n.load_file` scope,
334
+ # and skip loading the file if its contents are still up-to-date.
335
+ #
336
+ # source://i18n//lib/i18n/backend/cache_file.rb#17
337
+ def load_file(filename); end
338
+
339
+ # Translate absolute filename to relative path for i18n key.
340
+ #
341
+ # source://i18n//lib/i18n/backend/cache_file.rb#28
342
+ def normalized_path(file); end
343
+ end
344
+
345
+ # source://i18n//lib/i18n/backend/cascade.rb#35
346
+ module I18n::Backend::Cascade
347
+ # source://i18n//lib/i18n/backend/cascade.rb#36
348
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
349
+ end
350
+
351
+ # Backend that chains multiple other backends and checks each of them when
352
+ # a translation needs to be looked up. This is useful when you want to use
353
+ # standard translations with a Simple backend but store custom application
354
+ # translations in a database or other backends.
355
+ #
356
+ # To use the Chain backend instantiate it and set it to the I18n module.
357
+ # You can add chained backends through the initializer or backends
358
+ # accessor:
359
+ #
360
+ # # preserves the existing Simple backend set to I18n.backend
361
+ # I18n.backend = I18n::Backend::Chain.new(I18n::Backend::ActiveRecord.new, I18n.backend)
362
+ #
363
+ # The implementation assumes that all backends added to the Chain implement
364
+ # a lookup method with the same API as Simple backend does.
365
+ #
366
+ # Fallback translations using the :default option are only used by the last backend of a chain.
367
+ #
368
+ # source://i18n//lib/i18n/backend/chain.rb#21
369
+ class I18n::Backend::Chain
370
+ include ::I18n::Backend::Transliterator
371
+ include ::I18n::Backend::Base
372
+ include ::I18n::Backend::Chain::Implementation
373
+ end
374
+
375
+ # source://i18n//lib/i18n/backend/chain.rb#22
376
+ module I18n::Backend::Chain::Implementation
377
+ include ::I18n::Backend::Transliterator
378
+ include ::I18n::Backend::Base
379
+
380
+ # source://i18n//lib/i18n/backend/chain.rb#27
381
+ def initialize(*backends); end
382
+
383
+ # source://i18n//lib/i18n/backend/chain.rb#52
384
+ def available_locales; end
385
+
386
+ # Returns the value of attribute backends.
387
+ #
388
+ # source://i18n//lib/i18n/backend/chain.rb#25
389
+ def backends; end
390
+
391
+ # Sets the attribute backends
392
+ #
393
+ # @param value the value to set the attribute backends to.
394
+ #
395
+ # source://i18n//lib/i18n/backend/chain.rb#25
396
+ def backends=(_arg0); end
397
+
398
+ # source://i18n//lib/i18n/backend/chain.rb#44
399
+ def eager_load!; end
400
+
401
+ # @return [Boolean]
402
+ #
403
+ # source://i18n//lib/i18n/backend/chain.rb#76
404
+ def exists?(locale, key, options = T.unsafe(nil)); end
405
+
406
+ # @return [Boolean]
407
+ #
408
+ # source://i18n//lib/i18n/backend/chain.rb#31
409
+ def initialized?; end
410
+
411
+ # source://i18n//lib/i18n/backend/chain.rb#82
412
+ def localize(locale, object, format = T.unsafe(nil), options = T.unsafe(nil)); end
413
+
414
+ # source://i18n//lib/i18n/backend/chain.rb#40
415
+ def reload!; end
416
+
417
+ # source://i18n//lib/i18n/backend/chain.rb#48
418
+ def store_translations(locale, data, options = T.unsafe(nil)); end
419
+
420
+ # source://i18n//lib/i18n/backend/chain.rb#56
421
+ def translate(locale, key, default_options = T.unsafe(nil)); end
422
+
423
+ protected
424
+
425
+ # source://i18n//lib/i18n/backend/chain.rb#92
426
+ def init_translations; end
427
+
428
+ # @return [Boolean]
429
+ #
430
+ # source://i18n//lib/i18n/backend/chain.rb#108
431
+ def namespace_lookup?(result, options); end
432
+
433
+ # source://i18n//lib/i18n/backend/chain.rb#98
434
+ def translations; end
435
+
436
+ private
437
+
438
+ # This is approximately what gets used in ActiveSupport.
439
+ # However since we are not guaranteed to run in an ActiveSupport context
440
+ # it is wise to have our own copy. We underscore it
441
+ # to not pollute the namespace of the including class.
442
+ #
443
+ # source://i18n//lib/i18n/backend/chain.rb#117
444
+ def _deep_merge(hash, other_hash); end
445
+ end
446
+
447
+ # source://i18n//lib/i18n/backend/fallbacks.rb#30
448
+ module I18n::Backend::Fallbacks
449
+ # @return [Boolean]
450
+ #
451
+ # source://i18n//lib/i18n/backend/fallbacks.rb#98
452
+ def exists?(locale, key, options = T.unsafe(nil)); end
453
+
454
+ # source://i18n//lib/i18n/backend/fallbacks.rb#89
455
+ def extract_non_symbol_default!(options); end
456
+
457
+ # source://i18n//lib/i18n/backend/fallbacks.rb#67
458
+ def resolve_entry(locale, object, subject, options = T.unsafe(nil)); end
459
+
460
+ # Overwrites the Base backend translate method so that it will try each
461
+ # locale given by I18n.fallbacks for the given locale. E.g. for the
462
+ # locale :"de-DE" it might try the locales :"de-DE", :de and :en
463
+ # (depends on the fallbacks implementation) until it finds a result with
464
+ # the given options. If it does not find any result for any of the
465
+ # locales it will then throw MissingTranslation as usual.
466
+ #
467
+ # The default option takes precedence over fallback locales only when
468
+ # it's a Symbol. When the default contains a String, Proc or Hash
469
+ # it is evaluated last after all the fallback locales have been tried.
470
+ #
471
+ # source://i18n//lib/i18n/backend/fallbacks.rb#41
472
+ def translate(locale, key, options = T.unsafe(nil)); end
473
+
474
+ private
475
+
476
+ # Overwrite on_fallback to add specified logic when the fallback succeeds.
477
+ #
478
+ # source://i18n//lib/i18n/backend/fallbacks.rb#114
479
+ def on_fallback(_original_locale, _fallback_locale, _key, _options); end
480
+ end
481
+
482
+ # This module contains several helpers to assist flattening translations.
483
+ # You may want to flatten translations for:
484
+ #
485
+ # 1) speed up lookups, as in the Memoize backend;
486
+ # 2) In case you want to store translations in a data store, as in ActiveRecord backend;
487
+ #
488
+ # You can check both backends above for some examples.
489
+ # This module also keeps all links in a hash so they can be properly resolved when flattened.
490
+ #
491
+ # source://i18n//lib/i18n/backend/flatten.rb#13
492
+ module I18n::Backend::Flatten
493
+ # Flatten keys for nested Hashes by chaining up keys:
494
+ #
495
+ # >> { "a" => { "b" => { "c" => "d", "e" => "f" }, "g" => "h" }, "i" => "j"}.wind
496
+ # => { "a.b.c" => "d", "a.b.e" => "f", "a.g" => "h", "i" => "j" }
497
+ #
498
+ # source://i18n//lib/i18n/backend/flatten.rb#59
499
+ def flatten_keys(hash, escape, prev_key = T.unsafe(nil), &block); end
500
+
501
+ # Receives a hash of translations (where the key is a locale and
502
+ # the value is another hash) and return a hash with all
503
+ # translations flattened.
504
+ #
505
+ # Nested hashes are included in the flattened hash just if subtree
506
+ # is true and Symbols are automatically stored as links.
507
+ #
508
+ # source://i18n//lib/i18n/backend/flatten.rb#74
509
+ def flatten_translations(locale, data, escape, subtree); end
510
+
511
+ # Store flattened links.
512
+ #
513
+ # source://i18n//lib/i18n/backend/flatten.rb#50
514
+ def links; end
515
+
516
+ # Shortcut to I18n::Backend::Flatten.normalize_flat_keys
517
+ # and then resolve_links.
518
+ #
519
+ # source://i18n//lib/i18n/backend/flatten.rb#44
520
+ def normalize_flat_keys(locale, key, scope, separator); end
521
+
522
+ protected
523
+
524
+ # source://i18n//lib/i18n/backend/flatten.rb#112
525
+ def escape_default_separator(key); end
526
+
527
+ # source://i18n//lib/i18n/backend/flatten.rb#106
528
+ def find_link(locale, key); end
529
+
530
+ # source://i18n//lib/i18n/backend/flatten.rb#93
531
+ def resolve_link(locale, key); end
532
+
533
+ # source://i18n//lib/i18n/backend/flatten.rb#89
534
+ def store_link(locale, key, link); end
535
+
536
+ class << self
537
+ # Receives a string and escape the default separator.
538
+ #
539
+ # source://i18n//lib/i18n/backend/flatten.rb#38
540
+ def escape_default_separator(key); end
541
+
542
+ # normalize_keys the flatten way. This method is significantly faster
543
+ # and creates way less objects than the one at I18n.normalize_keys.
544
+ # It also handles escaping the translation keys.
545
+ #
546
+ # source://i18n//lib/i18n/backend/flatten.rb#20
547
+ def normalize_flat_keys(locale, key, scope, separator); end
548
+ end
549
+ end
550
+
551
+ # source://i18n//lib/i18n/backend/flatten.rb#15
552
+ I18n::Backend::Flatten::FLATTEN_SEPARATOR = T.let(T.unsafe(nil), String)
553
+
554
+ # source://i18n//lib/i18n/backend/flatten.rb#14
555
+ I18n::Backend::Flatten::SEPARATOR_ESCAPE_CHAR = T.let(T.unsafe(nil), String)
556
+
557
+ # Experimental support for using Gettext po files to store translations.
558
+ #
559
+ # To use this you can simply include the module to the Simple backend - or
560
+ # whatever other backend you are using.
561
+ #
562
+ # I18n::Backend::Simple.include(I18n::Backend::Gettext)
563
+ #
564
+ # Now you should be able to include your Gettext translation (*.po) files to
565
+ # the +I18n.load_path+ so they're loaded to the backend and you can use them as
566
+ # usual:
567
+ #
568
+ # I18n.load_path += Dir["path/to/locales/*.po"]
569
+ #
570
+ # Following the Gettext convention this implementation expects that your
571
+ # translation files are named by their locales. E.g. the file en.po would
572
+ # contain the translations for the English locale.
573
+ #
574
+ # To translate text <b>you must use</b> one of the translate methods provided by
575
+ # I18n::Gettext::Helpers.
576
+ #
577
+ # include I18n::Gettext::Helpers
578
+ # puts _("some string")
579
+ #
580
+ # Without it strings containing periods (".") will not be translated.
581
+ #
582
+ # source://i18n//lib/i18n/backend/gettext.rb#33
583
+ module I18n::Backend::Gettext
584
+ protected
585
+
586
+ # source://i18n//lib/i18n/backend/gettext.rb#41
587
+ def load_po(filename); end
588
+
589
+ # source://i18n//lib/i18n/backend/gettext.rb#51
590
+ def normalize(locale, data); end
591
+
592
+ # source://i18n//lib/i18n/backend/gettext.rb#68
593
+ def normalize_pluralization(locale, key, value); end
594
+
595
+ # source://i18n//lib/i18n/backend/gettext.rb#47
596
+ def parse(filename); end
597
+ end
598
+
599
+ # source://i18n//lib/i18n/backend/gettext.rb#34
600
+ class I18n::Backend::Gettext::PoData < ::Hash
601
+ # source://i18n//lib/i18n/backend/gettext.rb#35
602
+ def set_comment(msgid_or_sym, comment); end
603
+ end
604
+
605
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#20
606
+ module I18n::Backend::InterpolationCompiler
607
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#97
608
+ def interpolate(locale, string, values); end
609
+
610
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#107
611
+ def store_translations(locale, data, options = T.unsafe(nil)); end
612
+
613
+ protected
614
+
615
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#113
616
+ def compile_all_strings_in(data); end
617
+ end
618
+
619
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#21
620
+ module I18n::Backend::InterpolationCompiler::Compiler
621
+ extend ::I18n::Backend::InterpolationCompiler::Compiler
622
+
623
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#26
624
+ def compile_if_an_interpolation(string); end
625
+
626
+ # @return [Boolean]
627
+ #
628
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#38
629
+ def interpolated_str?(str); end
630
+
631
+ protected
632
+
633
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#58
634
+ def compile_interpolation_token(key); end
635
+
636
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#48
637
+ def compiled_interpolation_body(str); end
638
+
639
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#71
640
+ def direct_key(key); end
641
+
642
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#91
643
+ def escape_key_sym(key); end
644
+
645
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#87
646
+ def escape_plain_str(str); end
647
+
648
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#54
649
+ def handle_interpolation_token(token); end
650
+
651
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#67
652
+ def interpolate_key(key); end
653
+
654
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#62
655
+ def interpolate_or_raise_missing(key); end
656
+
657
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#79
658
+ def missing_key(key); end
659
+
660
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#75
661
+ def nil_key(key); end
662
+
663
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#83
664
+ def reserved_key(key); end
665
+
666
+ # tokenize("foo %{bar} baz %%{buz}") # => ["foo ", "%{bar}", " baz ", "%%{buz}"]
667
+ #
668
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#44
669
+ def tokenize(str); end
670
+ end
671
+
672
+ # source://i18n//lib/i18n/backend/interpolation_compiler.rb#24
673
+ I18n::Backend::InterpolationCompiler::Compiler::TOKENIZER = T.let(T.unsafe(nil), Regexp)
674
+
675
+ # This is a basic backend for key value stores. It receives on
676
+ # initialization the store, which should respond to three methods:
677
+ #
678
+ # * store#[](key) - Used to get a value
679
+ # * store#[]=(key, value) - Used to set a value
680
+ # * store#keys - Used to get all keys
681
+ #
682
+ # Since these stores only supports string, all values are converted
683
+ # to JSON before being stored, allowing it to also store booleans,
684
+ # hashes and arrays. However, this store does not support Procs.
685
+ #
686
+ # As the ActiveRecord backend, Symbols are just supported when loading
687
+ # translations from the filesystem or through explicit store translations.
688
+ #
689
+ # Also, avoid calling I18n.available_locales since it's a somehow
690
+ # expensive operation in most stores.
691
+ #
692
+ # == Example
693
+ #
694
+ # To setup I18n to use TokyoCabinet in memory is quite straightforward:
695
+ #
696
+ # require 'rufus/tokyo/cabinet' # gem install rufus-tokyo
697
+ # I18n.backend = I18n::Backend::KeyValue.new(Rufus::Tokyo::Cabinet.new('*'))
698
+ #
699
+ # == Performance
700
+ #
701
+ # You may make this backend even faster by including the Memoize module.
702
+ # However, notice that you should properly clear the cache if you change
703
+ # values directly in the key-store.
704
+ #
705
+ # == Subtrees
706
+ #
707
+ # In most backends, you are allowed to retrieve part of a translation tree:
708
+ #
709
+ # I18n.backend.store_translations :en, :foo => { :bar => :baz }
710
+ # I18n.t "foo" #=> { :bar => :baz }
711
+ #
712
+ # This backend supports this feature by default, but it slows down the storage
713
+ # of new data considerably and makes hard to delete entries. That said, you are
714
+ # allowed to disable the storage of subtrees on initialization:
715
+ #
716
+ # I18n::Backend::KeyValue.new(@store, false)
717
+ #
718
+ # This is useful if you are using a KeyValue backend chained to a Simple backend.
719
+ #
720
+ # source://i18n//lib/i18n/backend/key_value.rb#69
721
+ class I18n::Backend::KeyValue
722
+ include ::I18n::Backend::Flatten
723
+ include ::I18n::Backend::Transliterator
724
+ include ::I18n::Backend::Base
725
+ include ::I18n::Backend::KeyValue::Implementation
726
+ end
727
+
728
+ # source://i18n//lib/i18n/backend/key_value.rb#70
729
+ module I18n::Backend::KeyValue::Implementation
730
+ include ::I18n::Backend::Flatten
731
+ include ::I18n::Backend::Transliterator
732
+ include ::I18n::Backend::Base
733
+
734
+ # source://i18n//lib/i18n/backend/key_value.rb#75
735
+ def initialize(store, subtrees = T.unsafe(nil)); end
736
+
737
+ # source://i18n//lib/i18n/backend/key_value.rb#102
738
+ def available_locales; end
739
+
740
+ # @return [Boolean]
741
+ #
742
+ # source://i18n//lib/i18n/backend/key_value.rb#79
743
+ def initialized?; end
744
+
745
+ # Returns the value of attribute store.
746
+ #
747
+ # source://i18n//lib/i18n/backend/key_value.rb#71
748
+ def store; end
749
+
750
+ # Sets the attribute store
751
+ #
752
+ # @param value the value to set the attribute store to.
753
+ #
754
+ # source://i18n//lib/i18n/backend/key_value.rb#71
755
+ def store=(_arg0); end
756
+
757
+ # source://i18n//lib/i18n/backend/key_value.rb#83
758
+ def store_translations(locale, data, options = T.unsafe(nil)); end
759
+
760
+ protected
761
+
762
+ # source://i18n//lib/i18n/backend/key_value.rb#124
763
+ def init_translations; end
764
+
765
+ # source://i18n//lib/i18n/backend/key_value.rb#136
766
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
767
+
768
+ # source://i18n//lib/i18n/backend/key_value.rb#150
769
+ def pluralize(locale, entry, count); end
770
+
771
+ # @return [Boolean]
772
+ #
773
+ # source://i18n//lib/i18n/backend/key_value.rb#132
774
+ def subtrees?; end
775
+
776
+ # Queries the translations from the key-value store and converts
777
+ # them into a hash such as the one returned from loading the
778
+ # haml files
779
+ #
780
+ # source://i18n//lib/i18n/backend/key_value.rb#115
781
+ def translations; end
782
+ end
783
+
784
+ # source://i18n//lib/i18n/backend/key_value.rb#161
785
+ class I18n::Backend::KeyValue::SubtreeProxy
786
+ # @return [SubtreeProxy] a new instance of SubtreeProxy
787
+ #
788
+ # source://i18n//lib/i18n/backend/key_value.rb#162
789
+ def initialize(master_key, store); end
790
+
791
+ # source://i18n//lib/i18n/backend/key_value.rb#172
792
+ def [](key); end
793
+
794
+ # @return [Boolean]
795
+ #
796
+ # source://i18n//lib/i18n/backend/key_value.rb#168
797
+ def has_key?(key); end
798
+
799
+ # source://i18n//lib/i18n/backend/key_value.rb#196
800
+ def inspect; end
801
+
802
+ # @return [Boolean]
803
+ #
804
+ # source://i18n//lib/i18n/backend/key_value.rb#188
805
+ def instance_of?(klass); end
806
+
807
+ # @return [Boolean]
808
+ #
809
+ # source://i18n//lib/i18n/backend/key_value.rb#183
810
+ def is_a?(klass); end
811
+
812
+ # @return [Boolean]
813
+ #
814
+ # source://i18n//lib/i18n/backend/key_value.rb#183
815
+ def kind_of?(klass); end
816
+
817
+ # @return [Boolean]
818
+ #
819
+ # source://i18n//lib/i18n/backend/key_value.rb#192
820
+ def nil?; end
821
+ end
822
+
823
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#65
824
+ class I18n::Backend::LazyLoadable < ::I18n::Backend::Simple
825
+ # @return [LazyLoadable] a new instance of LazyLoadable
826
+ #
827
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#66
828
+ def initialize(lazy_load: T.unsafe(nil)); end
829
+
830
+ # Parse the load path and extract all locales.
831
+ #
832
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#99
833
+ def available_locales; end
834
+
835
+ # Eager loading is not supported in the lazy context.
836
+ #
837
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#90
838
+ def eager_load!; end
839
+
840
+ # Returns whether the current locale is initialized.
841
+ #
842
+ # @return [Boolean]
843
+ #
844
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#71
845
+ def initialized?; end
846
+
847
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#107
848
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
849
+
850
+ # Clean up translations and uninitialize all locales.
851
+ #
852
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#80
853
+ def reload!; end
854
+
855
+ protected
856
+
857
+ # Load translations from files that belong to the current locale.
858
+ #
859
+ # @raise [InvalidFilenames]
860
+ #
861
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#121
862
+ def init_translations; end
863
+
864
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#133
865
+ def initialized_locales; end
866
+
867
+ private
868
+
869
+ # Checks if a filename is named in correspondence to the translations it loaded.
870
+ # The locale extracted from the path must be the single locale loaded in the translations.
871
+ #
872
+ # @raise [FilenameIncorrect]
873
+ #
874
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#175
875
+ def assert_file_named_correctly!(file, translations); end
876
+
877
+ # Select all files from I18n load path that belong to current locale.
878
+ # These files must start with the locale identifier (ie. "en", "pt-BR"),
879
+ # followed by an "_" demarcation to separate proceeding text.
880
+ #
881
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#167
882
+ def filenames_for_current_locale; end
883
+
884
+ # @return [Boolean]
885
+ #
886
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#139
887
+ def lazy_load?; end
888
+
889
+ # Loads each file supplied and asserts that the file only loads
890
+ # translations as expected by the name. The method returns a list of
891
+ # errors corresponding to offending files.
892
+ #
893
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#152
894
+ def load_translations_and_collect_file_errors(files); end
895
+ end
896
+
897
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#143
898
+ class I18n::Backend::LazyLoadable::FilenameIncorrect < ::StandardError
899
+ # @return [FilenameIncorrect] a new instance of FilenameIncorrect
900
+ #
901
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#144
902
+ def initialize(file, expected_locale, unexpected_locales); end
903
+ end
904
+
905
+ # Backend that lazy loads translations based on the current locale. This
906
+ # implementation avoids loading all translations up front. Instead, it only
907
+ # loads the translations that belong to the current locale. This offers a
908
+ # performance incentive in local development and test environments for
909
+ # applications with many translations for many different locales. It's
910
+ # particularly useful when the application only refers to a single locales'
911
+ # translations at a time (ex. A Rails workload). The implementation
912
+ # identifies which translation files from the load path belong to the
913
+ # current locale by pattern matching against their path name.
914
+ #
915
+ # Specifically, a translation file is considered to belong to a locale if:
916
+ # a) the filename is in the I18n load path
917
+ # b) the filename ends in a supported extension (ie. .yml, .json, .po, .rb)
918
+ # c) the filename starts with the locale identifier
919
+ # d) the locale identifier and optional proceeding text is separated by an underscore, ie. "_".
920
+ #
921
+ # Examples:
922
+ # Valid files that will be selected by this backend:
923
+ #
924
+ # "files/locales/en_translation.yml" (Selected for locale "en")
925
+ # "files/locales/fr.po" (Selected for locale "fr")
926
+ #
927
+ # Invalid files that won't be selected by this backend:
928
+ #
929
+ # "files/locales/translation-file"
930
+ # "files/locales/en-translation.unsupported"
931
+ # "files/locales/french/translation.yml"
932
+ # "files/locales/fr/translation.yml"
933
+ #
934
+ # The implementation uses this assumption to defer the loading of
935
+ # translation files until the current locale actually requires them.
936
+ #
937
+ # The backend has two working modes: lazy_load and eager_load.
938
+ #
939
+ # Note: This backend should only be enabled in test environments!
940
+ # When the mode is set to false, the backend behaves exactly like the
941
+ # Simple backend, with an additional check that the paths being loaded
942
+ # abide by the format. If paths can't be matched to the format, an error is raised.
943
+ #
944
+ # You can configure lazy loaded backends through the initializer or backends
945
+ # accessor:
946
+ #
947
+ # # In test environments
948
+ #
949
+ # I18n.backend = I18n::Backend::LazyLoadable.new(lazy_load: true)
950
+ #
951
+ # # In other environments, such as production and CI
952
+ #
953
+ # I18n.backend = I18n::Backend::LazyLoadable.new(lazy_load: false) # default
954
+ #
955
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#55
956
+ class I18n::Backend::LocaleExtractor
957
+ class << self
958
+ # source://i18n//lib/i18n/backend/lazy_loadable.rb#57
959
+ def locale_from_path(path); end
960
+ end
961
+ end
962
+
963
+ # source://i18n//lib/i18n/backend/memoize.rb#14
964
+ module I18n::Backend::Memoize
965
+ # source://i18n//lib/i18n/backend/memoize.rb#15
966
+ def available_locales; end
967
+
968
+ # source://i18n//lib/i18n/backend/memoize.rb#29
969
+ def eager_load!; end
970
+
971
+ # source://i18n//lib/i18n/backend/memoize.rb#24
972
+ def reload!; end
973
+
974
+ # source://i18n//lib/i18n/backend/memoize.rb#19
975
+ def store_translations(locale, data, options = T.unsafe(nil)); end
976
+
977
+ protected
978
+
979
+ # source://i18n//lib/i18n/backend/memoize.rb#37
980
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
981
+
982
+ # source://i18n//lib/i18n/backend/memoize.rb#44
983
+ def memoized_lookup; end
984
+
985
+ # source://i18n//lib/i18n/backend/memoize.rb#48
986
+ def reset_memoizations!(locale = T.unsafe(nil)); end
987
+ end
988
+
989
+ # source://i18n//lib/i18n/backend/metadata.rb#21
990
+ module I18n::Backend::Metadata
991
+ # source://i18n//lib/i18n/backend/metadata.rb#52
992
+ def interpolate(locale, entry, values = T.unsafe(nil)); end
993
+
994
+ # source://i18n//lib/i18n/backend/metadata.rb#57
995
+ def pluralize(locale, entry, count); end
996
+
997
+ # source://i18n//lib/i18n/backend/metadata.rb#40
998
+ def translate(locale, key, options = T.unsafe(nil)); end
999
+
1000
+ protected
1001
+
1002
+ # source://i18n//lib/i18n/backend/metadata.rb#63
1003
+ def with_metadata(metadata, &block); end
1004
+
1005
+ class << self
1006
+ # @private
1007
+ #
1008
+ # source://i18n//lib/i18n/backend/metadata.rb#23
1009
+ def included(base); end
1010
+ end
1011
+ end
1012
+
1013
+ # source://i18n//lib/i18n/backend/pluralization.rb#16
1014
+ module I18n::Backend::Pluralization
1015
+ # Overwrites the Base backend translate method so that it will check the
1016
+ # translation meta data space (:i18n) for a locale specific pluralization
1017
+ # rule and use it to pluralize the given entry. I.e., the library expects
1018
+ # pluralization rules to be stored at I18n.t(:'i18n.plural.rule')
1019
+ #
1020
+ # Pluralization rules are expected to respond to #call(count) and
1021
+ # return a pluralization key. Valid keys depend on the pluralization
1022
+ # rules for the locale, as defined in the CLDR.
1023
+ # As of v41, 6 locale-specific plural categories are defined:
1024
+ # :few, :many, :one, :other, :two, :zero
1025
+ #
1026
+ # n.b., The :one plural category does not imply the number 1.
1027
+ # Instead, :one is a category for any number that behaves like 1 in
1028
+ # that locale. For example, in some locales, :one is used for numbers
1029
+ # that end in "1" (like 1, 21, 151) but that don't end in
1030
+ # 11 (like 11, 111, 10311).
1031
+ # Similar notes apply to the :two, and :zero plural categories.
1032
+ #
1033
+ # If you want to have different strings for the categories of count == 0
1034
+ # (e.g. "I don't have any cars") or count == 1 (e.g. "I have a single car")
1035
+ # use the explicit `"0"` and `"1"` keys.
1036
+ # https://unicode-org.github.io/cldr/ldml/tr35-numbers.html#Explicit_0_1_rules
1037
+ #
1038
+ # source://i18n//lib/i18n/backend/pluralization.rb#39
1039
+ def pluralize(locale, entry, count); end
1040
+
1041
+ protected
1042
+
1043
+ # source://i18n//lib/i18n/backend/pluralization.rb#81
1044
+ def pluralizer(locale); end
1045
+
1046
+ # source://i18n//lib/i18n/backend/pluralization.rb#77
1047
+ def pluralizers; end
1048
+
1049
+ private
1050
+
1051
+ # Normalizes categories of 0.0 and 1.0
1052
+ # and returns the symbolic version
1053
+ #
1054
+ # source://i18n//lib/i18n/backend/pluralization.rb#89
1055
+ def symbolic_count(count); end
1056
+ end
1057
+
1058
+ # A simple backend that reads translations from YAML files and stores them in
1059
+ # an in-memory hash. Relies on the Base backend.
1060
+ #
1061
+ # The implementation is provided by a Implementation module allowing to easily
1062
+ # extend Simple backend's behavior by including modules. E.g.:
1063
+ #
1064
+ # module I18n::Backend::Pluralization
1065
+ # def pluralize(*args)
1066
+ # # extended pluralization logic
1067
+ # super
1068
+ # end
1069
+ # end
1070
+ #
1071
+ # I18n::Backend::Simple.include(I18n::Backend::Pluralization)
1072
+ #
1073
+ # source://i18n//lib/i18n/backend/simple.rb#21
1074
+ class I18n::Backend::Simple
1075
+ include ::I18n::Backend::Transliterator
1076
+ include ::I18n::Backend::Base
1077
+ include ::I18n::Backend::Simple::Implementation
1078
+ end
1079
+
1080
+ # source://i18n//lib/i18n/backend/simple.rb#22
1081
+ module I18n::Backend::Simple::Implementation
1082
+ include ::I18n::Backend::Transliterator
1083
+ include ::I18n::Backend::Base
1084
+
1085
+ # Get available locales from the translations hash
1086
+ #
1087
+ # source://i18n//lib/i18n/backend/simple.rb#49
1088
+ def available_locales; end
1089
+
1090
+ # source://i18n//lib/i18n/backend/simple.rb#64
1091
+ def eager_load!; end
1092
+
1093
+ # @return [Boolean]
1094
+ #
1095
+ # source://i18n//lib/i18n/backend/simple.rb#28
1096
+ def initialized?; end
1097
+
1098
+ # Clean up translations hash and set initialized to false on reload!
1099
+ #
1100
+ # source://i18n//lib/i18n/backend/simple.rb#58
1101
+ def reload!; end
1102
+
1103
+ # Stores translations for the given locale in memory.
1104
+ # This uses a deep merge for the translations hash, so existing
1105
+ # translations will be overwritten by new ones only at the deepest
1106
+ # level of the hash.
1107
+ #
1108
+ # source://i18n//lib/i18n/backend/simple.rb#36
1109
+ def store_translations(locale, data, options = T.unsafe(nil)); end
1110
+
1111
+ # source://i18n//lib/i18n/backend/simple.rb#69
1112
+ def translations(do_init: T.unsafe(nil)); end
1113
+
1114
+ protected
1115
+
1116
+ # source://i18n//lib/i18n/backend/simple.rb#83
1117
+ def init_translations; end
1118
+
1119
+ # Looks up a translation from the translations hash. Returns nil if
1120
+ # either key is nil, or locale, scope or key do not exist as a key in the
1121
+ # nested translations hash. Splits keys or scopes containing dots
1122
+ # into multiple keys, i.e. <tt>currency.format</tt> is regarded the same as
1123
+ # <tt>%w(currency format)</tt>.
1124
+ #
1125
+ # source://i18n//lib/i18n/backend/simple.rb#93
1126
+ def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end
1127
+ end
1128
+
1129
+ # Mutex to ensure that concurrent translations loading will be thread-safe
1130
+ #
1131
+ # source://i18n//lib/i18n/backend/simple.rb#26
1132
+ I18n::Backend::Simple::Implementation::MUTEX = T.let(T.unsafe(nil), Thread::Mutex)
1133
+
1134
+ # source://i18n//lib/i18n/backend/transliterator.rb#6
1135
+ module I18n::Backend::Transliterator
1136
+ # Given a locale and a UTF-8 string, return the locale's ASCII
1137
+ # approximation for the string.
1138
+ #
1139
+ # source://i18n//lib/i18n/backend/transliterator.rb#11
1140
+ def transliterate(locale, string, replacement = T.unsafe(nil)); end
1141
+
1142
+ class << self
1143
+ # Get a transliterator instance.
1144
+ #
1145
+ # source://i18n//lib/i18n/backend/transliterator.rb#19
1146
+ def get(rule = T.unsafe(nil)); end
1147
+ end
1148
+ end
1149
+
1150
+ # source://i18n//lib/i18n/backend/transliterator.rb#7
1151
+ I18n::Backend::Transliterator::DEFAULT_REPLACEMENT_CHAR = T.let(T.unsafe(nil), String)
1152
+
1153
+ # A transliterator which accepts a Hash of characters as its translation
1154
+ # rule.
1155
+ #
1156
+ # source://i18n//lib/i18n/backend/transliterator.rb#42
1157
+ class I18n::Backend::Transliterator::HashTransliterator
1158
+ # @return [HashTransliterator] a new instance of HashTransliterator
1159
+ #
1160
+ # source://i18n//lib/i18n/backend/transliterator.rb#74
1161
+ def initialize(rule = T.unsafe(nil)); end
1162
+
1163
+ # source://i18n//lib/i18n/backend/transliterator.rb#80
1164
+ def transliterate(string, replacement = T.unsafe(nil)); end
1165
+
1166
+ private
1167
+
1168
+ # Add transliteration rules to the approximations hash.
1169
+ #
1170
+ # source://i18n//lib/i18n/backend/transliterator.rb#100
1171
+ def add(hash); end
1172
+
1173
+ # source://i18n//lib/i18n/backend/transliterator.rb#93
1174
+ def add_default_approximations; end
1175
+
1176
+ # source://i18n//lib/i18n/backend/transliterator.rb#89
1177
+ def approximations; end
1178
+ end
1179
+
1180
+ # source://i18n//lib/i18n/backend/transliterator.rb#43
1181
+ I18n::Backend::Transliterator::HashTransliterator::DEFAULT_APPROXIMATIONS = T.let(T.unsafe(nil), Hash)
1182
+
1183
+ # A transliterator which accepts a Proc as its transliteration rule.
1184
+ #
1185
+ # source://i18n//lib/i18n/backend/transliterator.rb#30
1186
+ class I18n::Backend::Transliterator::ProcTransliterator
1187
+ # @return [ProcTransliterator] a new instance of ProcTransliterator
1188
+ #
1189
+ # source://i18n//lib/i18n/backend/transliterator.rb#31
1190
+ def initialize(rule); end
1191
+
1192
+ # source://i18n//lib/i18n/backend/transliterator.rb#35
1193
+ def transliterate(string, replacement = T.unsafe(nil)); end
1194
+ end
1195
+
1196
+ # source://i18n//lib/i18n.rb#55
1197
+ module I18n::Base
1198
+ # source://i18n//lib/i18n.rb#70
1199
+ def available_locales; end
1200
+
1201
+ # source://i18n//lib/i18n.rb#74
1202
+ def available_locales=(value); end
1203
+
1204
+ # @return [Boolean]
1205
+ #
1206
+ # source://i18n//lib/i18n.rb#386
1207
+ def available_locales_initialized?; end
1208
+
1209
+ # source://i18n//lib/i18n.rb#70
1210
+ def backend; end
1211
+
1212
+ # source://i18n//lib/i18n.rb#74
1213
+ def backend=(value); end
1214
+
1215
+ # Gets I18n configuration object.
1216
+ #
1217
+ # source://i18n//lib/i18n.rb#57
1218
+ def config; end
1219
+
1220
+ # Sets I18n configuration object.
1221
+ #
1222
+ # source://i18n//lib/i18n.rb#62
1223
+ def config=(value); end
1224
+
1225
+ # source://i18n//lib/i18n.rb#70
1226
+ def default_locale; end
1227
+
1228
+ # source://i18n//lib/i18n.rb#74
1229
+ def default_locale=(value); end
1230
+
1231
+ # source://i18n//lib/i18n.rb#70
1232
+ def default_separator; end
1233
+
1234
+ # source://i18n//lib/i18n.rb#74
1235
+ def default_separator=(value); end
1236
+
1237
+ # Tells the backend to load translations now. Used in situations like the
1238
+ # Rails production environment. Backends can implement whatever strategy
1239
+ # is useful.
1240
+ #
1241
+ # source://i18n//lib/i18n.rb#91
1242
+ def eager_load!; end
1243
+
1244
+ # source://i18n//lib/i18n.rb#70
1245
+ def enforce_available_locales; end
1246
+
1247
+ # Raises an InvalidLocale exception when the passed locale is not available.
1248
+ #
1249
+ # source://i18n//lib/i18n.rb#380
1250
+ def enforce_available_locales!(locale); end
1251
+
1252
+ # source://i18n//lib/i18n.rb#74
1253
+ def enforce_available_locales=(value); end
1254
+
1255
+ # source://i18n//lib/i18n.rb#70
1256
+ def exception_handler; end
1257
+
1258
+ # source://i18n//lib/i18n.rb#74
1259
+ def exception_handler=(value); end
1260
+
1261
+ # Returns true if a translation exists for a given key, otherwise returns false.
1262
+ #
1263
+ # @raise [Disabled]
1264
+ # @return [Boolean]
1265
+ #
1266
+ # source://i18n//lib/i18n.rb#265
1267
+ def exists?(key, _locale = T.unsafe(nil), locale: T.unsafe(nil), **options); end
1268
+
1269
+ # Returns an array of interpolation keys for the given translation key
1270
+ #
1271
+ # *Examples*
1272
+ #
1273
+ # Suppose we have the following:
1274
+ # I18n.t 'example.zero' == 'Zero interpolations'
1275
+ # I18n.t 'example.one' == 'One interpolation %{foo}'
1276
+ # I18n.t 'example.two' == 'Two interpolations %{foo} %{bar}'
1277
+ # I18n.t 'example.three' == ['One %{foo}', 'Two %{bar}', 'Three %{baz}']
1278
+ # I18n.t 'example.one', locale: :other == 'One interpolation %{baz}'
1279
+ #
1280
+ # Then we can expect the following results:
1281
+ # I18n.interpolation_keys('example.zero') #=> []
1282
+ # I18n.interpolation_keys('example.one') #=> ['foo']
1283
+ # I18n.interpolation_keys('example.two') #=> ['foo', 'bar']
1284
+ # I18n.interpolation_keys('example.three') #=> ['foo', 'bar', 'baz']
1285
+ # I18n.interpolation_keys('one', scope: 'example', locale: :other) #=> ['baz']
1286
+ # I18n.interpolation_keys('does-not-exist') #=> []
1287
+ # I18n.interpolation_keys('example') #=> []
1288
+ #
1289
+ # @raise [I18n::ArgumentError]
1290
+ #
1291
+ # source://i18n//lib/i18n.rb#254
1292
+ def interpolation_keys(key, **options); end
1293
+
1294
+ # Localizes certain objects, such as dates and numbers to local formatting.
1295
+ #
1296
+ # @raise [Disabled]
1297
+ #
1298
+ # source://i18n//lib/i18n.rb#335
1299
+ def l(object, locale: T.unsafe(nil), format: T.unsafe(nil), **options); end
1300
+
1301
+ # source://i18n//lib/i18n.rb#70
1302
+ def load_path; end
1303
+
1304
+ # source://i18n//lib/i18n.rb#74
1305
+ def load_path=(value); end
1306
+
1307
+ # source://i18n//lib/i18n.rb#70
1308
+ def locale; end
1309
+
1310
+ # source://i18n//lib/i18n.rb#74
1311
+ def locale=(value); end
1312
+
1313
+ # Returns true when the passed locale, which can be either a String or a
1314
+ # Symbol, is in the list of available locales. Returns false otherwise.
1315
+ #
1316
+ # @return [Boolean]
1317
+ #
1318
+ # source://i18n//lib/i18n.rb#375
1319
+ def locale_available?(locale); end
1320
+
1321
+ # Localizes certain objects, such as dates and numbers to local formatting.
1322
+ #
1323
+ # @raise [Disabled]
1324
+ #
1325
+ # source://i18n//lib/i18n.rb#335
1326
+ def localize(object, locale: T.unsafe(nil), format: T.unsafe(nil), **options); end
1327
+
1328
+ # Merges the given locale, key and scope into a single array of keys.
1329
+ # Splits keys that contain dots into multiple keys. Makes sure all
1330
+ # keys are Symbols.
1331
+ #
1332
+ # source://i18n//lib/i18n.rb#363
1333
+ def normalize_keys(locale, key, scope, separator = T.unsafe(nil)); end
1334
+
1335
+ # Tells the backend to reload translations. Used in situations like the
1336
+ # Rails development environment. Backends can implement whatever strategy
1337
+ # is useful.
1338
+ #
1339
+ # source://i18n//lib/i18n.rb#83
1340
+ def reload!; end
1341
+
1342
+ # Translates, pluralizes and interpolates a given key using a given locale,
1343
+ # scope, and default, as well as interpolation values.
1344
+ #
1345
+ # *LOOKUP*
1346
+ #
1347
+ # Translation data is organized as a nested hash using the upper-level keys
1348
+ # as namespaces. <em>E.g.</em>, ActionView ships with the translation:
1349
+ # <tt>:date => {:formats => {:short => "%b %d"}}</tt>.
1350
+ #
1351
+ # Translations can be looked up at any level of this hash using the key argument
1352
+ # and the scope option. <em>E.g.</em>, in this example <tt>I18n.t :date</tt>
1353
+ # returns the whole translations hash <tt>{:formats => {:short => "%b %d"}}</tt>.
1354
+ #
1355
+ # Key can be either a single key or a dot-separated key (both Strings and Symbols
1356
+ # work). <em>E.g.</em>, the short format can be looked up using both:
1357
+ # I18n.t 'date.formats.short'
1358
+ # I18n.t :'date.formats.short'
1359
+ #
1360
+ # Scope can be either a single key, a dot-separated key or an array of keys
1361
+ # or dot-separated keys. Keys and scopes can be combined freely. So these
1362
+ # examples will all look up the same short date format:
1363
+ # I18n.t 'date.formats.short'
1364
+ # I18n.t 'formats.short', :scope => 'date'
1365
+ # I18n.t 'short', :scope => 'date.formats'
1366
+ # I18n.t 'short', :scope => %w(date formats)
1367
+ #
1368
+ # *INTERPOLATION*
1369
+ #
1370
+ # Translations can contain interpolation variables which will be replaced by
1371
+ # values passed to #translate as part of the options hash, with the keys matching
1372
+ # the interpolation variable names.
1373
+ #
1374
+ # <em>E.g.</em>, with a translation <tt>:foo => "foo %{bar}"</tt> the option
1375
+ # value for the key +bar+ will be interpolated into the translation:
1376
+ # I18n.t :foo, :bar => 'baz' # => 'foo baz'
1377
+ #
1378
+ # *PLURALIZATION*
1379
+ #
1380
+ # Translation data can contain pluralized translations. Pluralized translations
1381
+ # are arrays of singular/plural versions of translations like <tt>['Foo', 'Foos']</tt>.
1382
+ #
1383
+ # Note that <tt>I18n::Backend::Simple</tt> only supports an algorithm for English
1384
+ # pluralization rules. Other algorithms can be supported by custom backends.
1385
+ #
1386
+ # This returns the singular version of a pluralized translation:
1387
+ # I18n.t :foo, :count => 1 # => 'Foo'
1388
+ #
1389
+ # These both return the plural version of a pluralized translation:
1390
+ # I18n.t :foo, :count => 0 # => 'Foos'
1391
+ # I18n.t :foo, :count => 2 # => 'Foos'
1392
+ #
1393
+ # The <tt>:count</tt> option can be used both for pluralization and interpolation.
1394
+ # <em>E.g.</em>, with the translation
1395
+ # <tt>:foo => ['%{count} foo', '%{count} foos']</tt>, count will
1396
+ # be interpolated to the pluralized translation:
1397
+ # I18n.t :foo, :count => 1 # => '1 foo'
1398
+ #
1399
+ # *DEFAULTS*
1400
+ #
1401
+ # This returns the translation for <tt>:foo</tt> or <tt>default</tt> if no translation was found:
1402
+ # I18n.t :foo, :default => 'default'
1403
+ #
1404
+ # This returns the translation for <tt>:foo</tt> or the translation for <tt>:bar</tt> if no
1405
+ # translation for <tt>:foo</tt> was found:
1406
+ # I18n.t :foo, :default => :bar
1407
+ #
1408
+ # Returns the translation for <tt>:foo</tt> or the translation for <tt>:bar</tt>
1409
+ # or <tt>default</tt> if no translations for <tt>:foo</tt> and <tt>:bar</tt> were found.
1410
+ # I18n.t :foo, :default => [:bar, 'default']
1411
+ #
1412
+ # <b>BULK LOOKUP</b>
1413
+ #
1414
+ # This returns an array with the translations for <tt>:foo</tt> and <tt>:bar</tt>.
1415
+ # I18n.t [:foo, :bar]
1416
+ #
1417
+ # Can be used with dot-separated nested keys:
1418
+ # I18n.t [:'baz.foo', :'baz.bar']
1419
+ #
1420
+ # Which is the same as using a scope option:
1421
+ # I18n.t [:foo, :bar], :scope => :baz
1422
+ #
1423
+ # *LAMBDAS*
1424
+ #
1425
+ # Both translations and defaults can be given as Ruby lambdas. Lambdas will be
1426
+ # called and passed the key and options.
1427
+ #
1428
+ # E.g. assuming the key <tt>:salutation</tt> resolves to:
1429
+ # lambda { |key, options| options[:gender] == 'm' ? "Mr. #{options[:name]}" : "Mrs. #{options[:name]}" }
1430
+ #
1431
+ # Then <tt>I18n.t(:salutation, :gender => 'w', :name => 'Smith')</tt> will result in "Mrs. Smith".
1432
+ #
1433
+ # Note that the string returned by lambda will go through string interpolation too,
1434
+ # so the following lambda would give the same result:
1435
+ # lambda { |key, options| options[:gender] == 'm' ? "Mr. %{name}" : "Mrs. %{name}" }
1436
+ #
1437
+ # It is recommended to use/implement lambdas in an "idempotent" way. E.g. when
1438
+ # a cache layer is put in front of I18n.translate it will generate a cache key
1439
+ # from the argument values passed to #translate. Therefore your lambdas should
1440
+ # always return the same translations/values per unique combination of argument
1441
+ # values.
1442
+ #
1443
+ # <b>Ruby 2.7+ keyword arguments warning</b>
1444
+ #
1445
+ # This method uses keyword arguments.
1446
+ # There is a breaking change in ruby that produces warning with ruby 2.7 and won't work as expected with ruby 3.0
1447
+ # The "hash" parameter must be passed as keyword argument.
1448
+ #
1449
+ # Good:
1450
+ # I18n.t(:salutation, :gender => 'w', :name => 'Smith')
1451
+ # I18n.t(:salutation, **{ :gender => 'w', :name => 'Smith' })
1452
+ # I18n.t(:salutation, **any_hash)
1453
+ #
1454
+ # Bad:
1455
+ # I18n.t(:salutation, { :gender => 'w', :name => 'Smith' })
1456
+ # I18n.t(:salutation, any_hash)
1457
+ #
1458
+ # @raise [Disabled]
1459
+ #
1460
+ # source://i18n//lib/i18n.rb#211
1461
+ def t(key = T.unsafe(nil), throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), **options); end
1462
+
1463
+ # Wrapper for <tt>translate</tt> that adds <tt>:raise => true</tt>. With
1464
+ # this option, if no translation is found, it will raise <tt>I18n::MissingTranslationData</tt>
1465
+ #
1466
+ # source://i18n//lib/i18n.rb#230
1467
+ def t!(key, **options); end
1468
+
1469
+ # Translates, pluralizes and interpolates a given key using a given locale,
1470
+ # scope, and default, as well as interpolation values.
1471
+ #
1472
+ # *LOOKUP*
1473
+ #
1474
+ # Translation data is organized as a nested hash using the upper-level keys
1475
+ # as namespaces. <em>E.g.</em>, ActionView ships with the translation:
1476
+ # <tt>:date => {:formats => {:short => "%b %d"}}</tt>.
1477
+ #
1478
+ # Translations can be looked up at any level of this hash using the key argument
1479
+ # and the scope option. <em>E.g.</em>, in this example <tt>I18n.t :date</tt>
1480
+ # returns the whole translations hash <tt>{:formats => {:short => "%b %d"}}</tt>.
1481
+ #
1482
+ # Key can be either a single key or a dot-separated key (both Strings and Symbols
1483
+ # work). <em>E.g.</em>, the short format can be looked up using both:
1484
+ # I18n.t 'date.formats.short'
1485
+ # I18n.t :'date.formats.short'
1486
+ #
1487
+ # Scope can be either a single key, a dot-separated key or an array of keys
1488
+ # or dot-separated keys. Keys and scopes can be combined freely. So these
1489
+ # examples will all look up the same short date format:
1490
+ # I18n.t 'date.formats.short'
1491
+ # I18n.t 'formats.short', :scope => 'date'
1492
+ # I18n.t 'short', :scope => 'date.formats'
1493
+ # I18n.t 'short', :scope => %w(date formats)
1494
+ #
1495
+ # *INTERPOLATION*
1496
+ #
1497
+ # Translations can contain interpolation variables which will be replaced by
1498
+ # values passed to #translate as part of the options hash, with the keys matching
1499
+ # the interpolation variable names.
1500
+ #
1501
+ # <em>E.g.</em>, with a translation <tt>:foo => "foo %{bar}"</tt> the option
1502
+ # value for the key +bar+ will be interpolated into the translation:
1503
+ # I18n.t :foo, :bar => 'baz' # => 'foo baz'
1504
+ #
1505
+ # *PLURALIZATION*
1506
+ #
1507
+ # Translation data can contain pluralized translations. Pluralized translations
1508
+ # are arrays of singular/plural versions of translations like <tt>['Foo', 'Foos']</tt>.
1509
+ #
1510
+ # Note that <tt>I18n::Backend::Simple</tt> only supports an algorithm for English
1511
+ # pluralization rules. Other algorithms can be supported by custom backends.
1512
+ #
1513
+ # This returns the singular version of a pluralized translation:
1514
+ # I18n.t :foo, :count => 1 # => 'Foo'
1515
+ #
1516
+ # These both return the plural version of a pluralized translation:
1517
+ # I18n.t :foo, :count => 0 # => 'Foos'
1518
+ # I18n.t :foo, :count => 2 # => 'Foos'
1519
+ #
1520
+ # The <tt>:count</tt> option can be used both for pluralization and interpolation.
1521
+ # <em>E.g.</em>, with the translation
1522
+ # <tt>:foo => ['%{count} foo', '%{count} foos']</tt>, count will
1523
+ # be interpolated to the pluralized translation:
1524
+ # I18n.t :foo, :count => 1 # => '1 foo'
1525
+ #
1526
+ # *DEFAULTS*
1527
+ #
1528
+ # This returns the translation for <tt>:foo</tt> or <tt>default</tt> if no translation was found:
1529
+ # I18n.t :foo, :default => 'default'
1530
+ #
1531
+ # This returns the translation for <tt>:foo</tt> or the translation for <tt>:bar</tt> if no
1532
+ # translation for <tt>:foo</tt> was found:
1533
+ # I18n.t :foo, :default => :bar
1534
+ #
1535
+ # Returns the translation for <tt>:foo</tt> or the translation for <tt>:bar</tt>
1536
+ # or <tt>default</tt> if no translations for <tt>:foo</tt> and <tt>:bar</tt> were found.
1537
+ # I18n.t :foo, :default => [:bar, 'default']
1538
+ #
1539
+ # <b>BULK LOOKUP</b>
1540
+ #
1541
+ # This returns an array with the translations for <tt>:foo</tt> and <tt>:bar</tt>.
1542
+ # I18n.t [:foo, :bar]
1543
+ #
1544
+ # Can be used with dot-separated nested keys:
1545
+ # I18n.t [:'baz.foo', :'baz.bar']
1546
+ #
1547
+ # Which is the same as using a scope option:
1548
+ # I18n.t [:foo, :bar], :scope => :baz
1549
+ #
1550
+ # *LAMBDAS*
1551
+ #
1552
+ # Both translations and defaults can be given as Ruby lambdas. Lambdas will be
1553
+ # called and passed the key and options.
1554
+ #
1555
+ # E.g. assuming the key <tt>:salutation</tt> resolves to:
1556
+ # lambda { |key, options| options[:gender] == 'm' ? "Mr. #{options[:name]}" : "Mrs. #{options[:name]}" }
1557
+ #
1558
+ # Then <tt>I18n.t(:salutation, :gender => 'w', :name => 'Smith')</tt> will result in "Mrs. Smith".
1559
+ #
1560
+ # Note that the string returned by lambda will go through string interpolation too,
1561
+ # so the following lambda would give the same result:
1562
+ # lambda { |key, options| options[:gender] == 'm' ? "Mr. %{name}" : "Mrs. %{name}" }
1563
+ #
1564
+ # It is recommended to use/implement lambdas in an "idempotent" way. E.g. when
1565
+ # a cache layer is put in front of I18n.translate it will generate a cache key
1566
+ # from the argument values passed to #translate. Therefore your lambdas should
1567
+ # always return the same translations/values per unique combination of argument
1568
+ # values.
1569
+ #
1570
+ # <b>Ruby 2.7+ keyword arguments warning</b>
1571
+ #
1572
+ # This method uses keyword arguments.
1573
+ # There is a breaking change in ruby that produces warning with ruby 2.7 and won't work as expected with ruby 3.0
1574
+ # The "hash" parameter must be passed as keyword argument.
1575
+ #
1576
+ # Good:
1577
+ # I18n.t(:salutation, :gender => 'w', :name => 'Smith')
1578
+ # I18n.t(:salutation, **{ :gender => 'w', :name => 'Smith' })
1579
+ # I18n.t(:salutation, **any_hash)
1580
+ #
1581
+ # Bad:
1582
+ # I18n.t(:salutation, { :gender => 'w', :name => 'Smith' })
1583
+ # I18n.t(:salutation, any_hash)
1584
+ #
1585
+ # @raise [Disabled]
1586
+ #
1587
+ # source://i18n//lib/i18n.rb#211
1588
+ def translate(key = T.unsafe(nil), throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), **options); end
1589
+
1590
+ # Wrapper for <tt>translate</tt> that adds <tt>:raise => true</tt>. With
1591
+ # this option, if no translation is found, it will raise <tt>I18n::MissingTranslationData</tt>
1592
+ #
1593
+ # source://i18n//lib/i18n.rb#230
1594
+ def translate!(key, **options); end
1595
+
1596
+ # Transliterates UTF-8 characters to ASCII. By default this method will
1597
+ # transliterate only Latin strings to an ASCII approximation:
1598
+ #
1599
+ # I18n.transliterate("Ærøskøbing")
1600
+ # # => "AEroskobing"
1601
+ #
1602
+ # I18n.transliterate("日本語")
1603
+ # # => "???"
1604
+ #
1605
+ # It's also possible to add support for per-locale transliterations. I18n
1606
+ # expects transliteration rules to be stored at
1607
+ # <tt>i18n.transliterate.rule</tt>.
1608
+ #
1609
+ # Transliteration rules can either be a Hash or a Proc. Procs must accept a
1610
+ # single string argument. Hash rules inherit the default transliteration
1611
+ # rules, while Procs do not.
1612
+ #
1613
+ # *Examples*
1614
+ #
1615
+ # Setting a Hash in <locale>.yml:
1616
+ #
1617
+ # i18n:
1618
+ # transliterate:
1619
+ # rule:
1620
+ # ü: "ue"
1621
+ # ö: "oe"
1622
+ #
1623
+ # Setting a Hash using Ruby:
1624
+ #
1625
+ # store_translations(:de, i18n: {
1626
+ # transliterate: {
1627
+ # rule: {
1628
+ # 'ü' => 'ue',
1629
+ # 'ö' => 'oe'
1630
+ # }
1631
+ # }
1632
+ # })
1633
+ #
1634
+ # Setting a Proc:
1635
+ #
1636
+ # translit = lambda {|string| MyTransliterator.transliterate(string) }
1637
+ # store_translations(:xx, :i18n => {:transliterate => {:rule => translit})
1638
+ #
1639
+ # Transliterating strings:
1640
+ #
1641
+ # I18n.locale = :en
1642
+ # I18n.transliterate("Jürgen") # => "Jurgen"
1643
+ # I18n.locale = :de
1644
+ # I18n.transliterate("Jürgen") # => "Juergen"
1645
+ # I18n.transliterate("Jürgen", :locale => :en) # => "Jurgen"
1646
+ # I18n.transliterate("Jürgen", :locale => :de) # => "Juergen"
1647
+ #
1648
+ # source://i18n//lib/i18n.rb#324
1649
+ def transliterate(key, throw: T.unsafe(nil), raise: T.unsafe(nil), locale: T.unsafe(nil), replacement: T.unsafe(nil), **options); end
1650
+
1651
+ # Executes block with given I18n.locale set.
1652
+ #
1653
+ # source://i18n//lib/i18n.rb#346
1654
+ def with_locale(tmp_locale = T.unsafe(nil)); end
1655
+
1656
+ private
1657
+
1658
+ # Any exceptions thrown in translate will be sent to the @@exception_handler
1659
+ # which can be a Symbol, a Proc or any other Object unless they're forced to
1660
+ # be raised or thrown (MissingTranslation).
1661
+ #
1662
+ # If exception_handler is a Symbol then it will simply be sent to I18n as
1663
+ # a method call. A Proc will simply be called. In any other case the
1664
+ # method #call will be called on the exception_handler object.
1665
+ #
1666
+ # Examples:
1667
+ #
1668
+ # I18n.exception_handler = :custom_exception_handler # this is the default
1669
+ # I18n.custom_exception_handler(exception, locale, key, options) # will be called like this
1670
+ #
1671
+ # I18n.exception_handler = lambda { |*args| ... } # a lambda
1672
+ # I18n.exception_handler.call(exception, locale, key, options) # will be called like this
1673
+ #
1674
+ # I18n.exception_handler = I18nExceptionHandler.new # an object
1675
+ # I18n.exception_handler.call(exception, locale, key, options) # will be called like this
1676
+ #
1677
+ # source://i18n//lib/i18n.rb#422
1678
+ def handle_exception(handling, exception, locale, key, options); end
1679
+
1680
+ # source://i18n//lib/i18n.rb#464
1681
+ def interpolation_keys_from_translation(translation); end
1682
+
1683
+ # source://i18n//lib/i18n.rb#440
1684
+ def normalize_key(key, separator); end
1685
+
1686
+ # source://i18n//lib/i18n.rb#392
1687
+ def translate_key(key, throw, raise, locale, backend, options); end
1688
+ end
1689
+
1690
+ # source://i18n//lib/i18n/config.rb#6
1691
+ class I18n::Config
1692
+ # Returns an array of locales for which translations are available.
1693
+ # Unless you explicitly set these through I18n.available_locales=
1694
+ # the call will be delegated to the backend.
1695
+ #
1696
+ # source://i18n//lib/i18n/config.rb#43
1697
+ def available_locales; end
1698
+
1699
+ # Sets the available locales.
1700
+ #
1701
+ # source://i18n//lib/i18n/config.rb#57
1702
+ def available_locales=(locales); end
1703
+
1704
+ # Returns true if the available_locales have been initialized
1705
+ #
1706
+ # @return [Boolean]
1707
+ #
1708
+ # source://i18n//lib/i18n/config.rb#64
1709
+ def available_locales_initialized?; end
1710
+
1711
+ # Caches the available locales list as both strings and symbols in a Set, so
1712
+ # that we can have faster lookups to do the available locales enforce check.
1713
+ #
1714
+ # source://i18n//lib/i18n/config.rb#50
1715
+ def available_locales_set; end
1716
+
1717
+ # Returns the current backend. Defaults to +Backend::Simple+.
1718
+ #
1719
+ # source://i18n//lib/i18n/config.rb#20
1720
+ def backend; end
1721
+
1722
+ # Sets the current backend. Used to set a custom backend.
1723
+ #
1724
+ # source://i18n//lib/i18n/config.rb#25
1725
+ def backend=(backend); end
1726
+
1727
+ # Clears the available locales set so it can be recomputed again after I18n
1728
+ # gets reloaded.
1729
+ #
1730
+ # source://i18n//lib/i18n/config.rb#70
1731
+ def clear_available_locales_set; end
1732
+
1733
+ # Returns the current default locale. Defaults to :'en'
1734
+ #
1735
+ # source://i18n//lib/i18n/config.rb#30
1736
+ def default_locale; end
1737
+
1738
+ # Sets the current default locale. Used to set a custom default locale.
1739
+ #
1740
+ # source://i18n//lib/i18n/config.rb#35
1741
+ def default_locale=(locale); end
1742
+
1743
+ # Returns the current default scope separator. Defaults to '.'
1744
+ #
1745
+ # source://i18n//lib/i18n/config.rb#75
1746
+ def default_separator; end
1747
+
1748
+ # Sets the current default scope separator.
1749
+ #
1750
+ # source://i18n//lib/i18n/config.rb#80
1751
+ def default_separator=(separator); end
1752
+
1753
+ # source://i18n//lib/i18n/config.rb#141
1754
+ def enforce_available_locales; end
1755
+
1756
+ # source://i18n//lib/i18n/config.rb#145
1757
+ def enforce_available_locales=(enforce_available_locales); end
1758
+
1759
+ # Returns the current exception handler. Defaults to an instance of
1760
+ # I18n::ExceptionHandler.
1761
+ #
1762
+ # source://i18n//lib/i18n/config.rb#86
1763
+ def exception_handler; end
1764
+
1765
+ # Sets the exception handler.
1766
+ #
1767
+ # source://i18n//lib/i18n/config.rb#91
1768
+ def exception_handler=(exception_handler); end
1769
+
1770
+ # Returns the current interpolation patterns. Defaults to
1771
+ # I18n::DEFAULT_INTERPOLATION_PATTERNS.
1772
+ #
1773
+ # source://i18n//lib/i18n/config.rb#151
1774
+ def interpolation_patterns; end
1775
+
1776
+ # Sets the current interpolation patterns. Used to set a interpolation
1777
+ # patterns.
1778
+ #
1779
+ # E.g. using {{}} as a placeholder like "{{hello}}, world!":
1780
+ #
1781
+ # I18n.config.interpolation_patterns << /\{\{(\w+)\}\}/
1782
+ #
1783
+ # source://i18n//lib/i18n/config.rb#161
1784
+ def interpolation_patterns=(interpolation_patterns); end
1785
+
1786
+ # Allow clients to register paths providing translation data sources. The
1787
+ # backend defines acceptable sources.
1788
+ #
1789
+ # E.g. the provided SimpleBackend accepts a list of paths to translation
1790
+ # files which are either named *.rb and contain plain Ruby Hashes or are
1791
+ # named *.yml and contain YAML data. So for the SimpleBackend clients may
1792
+ # register translation files like this:
1793
+ # I18n.load_path << 'path/to/locale/en.yml'
1794
+ #
1795
+ # source://i18n//lib/i18n/config.rb#126
1796
+ def load_path; end
1797
+
1798
+ # Sets the load path instance. Custom implementations are expected to
1799
+ # behave like a Ruby Array.
1800
+ #
1801
+ # source://i18n//lib/i18n/config.rb#132
1802
+ def load_path=(load_path); end
1803
+
1804
+ # The only configuration value that is not global and scoped to thread is :locale.
1805
+ # It defaults to the default_locale.
1806
+ #
1807
+ # source://i18n//lib/i18n/config.rb#9
1808
+ def locale; end
1809
+
1810
+ # Sets the current locale pseudo-globally, i.e. in the Thread.current hash.
1811
+ #
1812
+ # source://i18n//lib/i18n/config.rb#14
1813
+ def locale=(locale); end
1814
+
1815
+ # Returns the current handler for situations when interpolation argument
1816
+ # is missing. MissingInterpolationArgument will be raised by default.
1817
+ #
1818
+ # source://i18n//lib/i18n/config.rb#97
1819
+ def missing_interpolation_argument_handler; end
1820
+
1821
+ # Sets the missing interpolation argument handler. It can be any
1822
+ # object that responds to #call. The arguments that will be passed to #call
1823
+ # are the same as for MissingInterpolationArgument initializer. Use +Proc.new+
1824
+ # if you don't care about arity.
1825
+ #
1826
+ # == Example:
1827
+ # You can suppress raising an exception and return string instead:
1828
+ #
1829
+ # I18n.config.missing_interpolation_argument_handler = Proc.new do |key|
1830
+ # "#{key} is missing"
1831
+ # end
1832
+ #
1833
+ # source://i18n//lib/i18n/config.rb#114
1834
+ def missing_interpolation_argument_handler=(exception_handler); end
1835
+ end
1836
+
1837
+ # source://i18n//lib/i18n/interpolate/ruby.rb#7
1838
+ I18n::DEFAULT_INTERPOLATION_PATTERNS = T.let(T.unsafe(nil), Array)
1839
+
1840
+ # source://i18n//lib/i18n/exceptions.rb#18
1841
+ class I18n::Disabled < ::I18n::ArgumentError
1842
+ # @return [Disabled] a new instance of Disabled
1843
+ #
1844
+ # source://i18n//lib/i18n/exceptions.rb#19
1845
+ def initialize(method); end
1846
+ end
1847
+
1848
+ # source://i18n//lib/i18n.rb#36
1849
+ I18n::EMPTY_HASH = T.let(T.unsafe(nil), Hash)
1850
+
1851
+ # source://i18n//lib/i18n/exceptions.rb#6
1852
+ class I18n::ExceptionHandler
1853
+ # source://i18n//lib/i18n/exceptions.rb#7
1854
+ def call(exception, _locale, _key, _options); end
1855
+ end
1856
+
1857
+ # source://i18n//lib/i18n/gettext.rb#4
1858
+ module I18n::Gettext
1859
+ class << self
1860
+ # source://i18n//lib/i18n/gettext.rb#21
1861
+ def extract_scope(msgid, separator); end
1862
+
1863
+ # returns an array of plural keys for the given locale or the whole hash
1864
+ # of locale mappings to plural keys so that we can convert from gettext's
1865
+ # integer-index based style
1866
+ # TODO move this information to the pluralization module
1867
+ #
1868
+ # source://i18n//lib/i18n/gettext.rb#17
1869
+ def plural_keys(*args); end
1870
+ end
1871
+ end
1872
+
1873
+ # source://i18n//lib/i18n/gettext.rb#6
1874
+ I18n::Gettext::CONTEXT_SEPARATOR = T.let(T.unsafe(nil), String)
1875
+
1876
+ # Implements classical Gettext style accessors. To use this include the
1877
+ # module to the global namespace or wherever you want to use it.
1878
+ #
1879
+ # include I18n::Gettext::Helpers
1880
+ #
1881
+ # source://i18n//lib/i18n/gettext/helpers.rb#11
1882
+ module I18n::Gettext::Helpers
1883
+ # Makes dynamic translation messages readable for the gettext parser.
1884
+ # <tt>_(fruit)</tt> cannot be understood by the gettext parser. To help the parser find all your translations,
1885
+ # you can add <tt>fruit = N_("Apple")</tt> which does not translate, but tells the parser: "Apple" needs translation.
1886
+ # * msgid: the message id.
1887
+ # * Returns: msgid.
1888
+ #
1889
+ # source://i18n//lib/i18n/gettext/helpers.rb#17
1890
+ def N_(msgsid); end
1891
+
1892
+ # source://i18n//lib/i18n/gettext/helpers.rb#21
1893
+ def _(msgid, options = T.unsafe(nil)); end
1894
+
1895
+ # source://i18n//lib/i18n/gettext/helpers.rb#21
1896
+ def gettext(msgid, options = T.unsafe(nil)); end
1897
+
1898
+ # source://i18n//lib/i18n/gettext/helpers.rb#38
1899
+ def n_(msgid, msgid_plural, n = T.unsafe(nil)); end
1900
+
1901
+ # source://i18n//lib/i18n/gettext/helpers.rb#38
1902
+ def ngettext(msgid, msgid_plural, n = T.unsafe(nil)); end
1903
+
1904
+ # Method signatures:
1905
+ # npgettext('Fruits', 'apple', 'apples', 2)
1906
+ # npgettext('Fruits', ['apple', 'apples'], 2)
1907
+ #
1908
+ # source://i18n//lib/i18n/gettext/helpers.rb#61
1909
+ def np_(msgctxt, msgid, msgid_plural, n = T.unsafe(nil)); end
1910
+
1911
+ # Method signatures:
1912
+ # npgettext('Fruits', 'apple', 'apples', 2)
1913
+ # npgettext('Fruits', ['apple', 'apples'], 2)
1914
+ #
1915
+ # source://i18n//lib/i18n/gettext/helpers.rb#61
1916
+ def npgettext(msgctxt, msgid, msgid_plural, n = T.unsafe(nil)); end
1917
+
1918
+ # Method signatures:
1919
+ # nsgettext('Fruits|apple', 'apples', 2)
1920
+ # nsgettext(['Fruits|apple', 'apples'], 2)
1921
+ #
1922
+ # source://i18n//lib/i18n/gettext/helpers.rb#46
1923
+ def ns_(msgid, msgid_plural, n = T.unsafe(nil), separator = T.unsafe(nil)); end
1924
+
1925
+ # Method signatures:
1926
+ # nsgettext('Fruits|apple', 'apples', 2)
1927
+ # nsgettext(['Fruits|apple', 'apples'], 2)
1928
+ #
1929
+ # source://i18n//lib/i18n/gettext/helpers.rb#46
1930
+ def nsgettext(msgid, msgid_plural, n = T.unsafe(nil), separator = T.unsafe(nil)); end
1931
+
1932
+ # source://i18n//lib/i18n/gettext/helpers.rb#32
1933
+ def p_(msgctxt, msgid); end
1934
+
1935
+ # source://i18n//lib/i18n/gettext/helpers.rb#32
1936
+ def pgettext(msgctxt, msgid); end
1937
+
1938
+ # source://i18n//lib/i18n/gettext/helpers.rb#26
1939
+ def s_(msgid, separator = T.unsafe(nil)); end
1940
+
1941
+ # source://i18n//lib/i18n/gettext/helpers.rb#26
1942
+ def sgettext(msgid, separator = T.unsafe(nil)); end
1943
+ end
1944
+
1945
+ # source://i18n//lib/i18n/gettext.rb#5
1946
+ I18n::Gettext::PLURAL_SEPARATOR = T.let(T.unsafe(nil), String)
1947
+
1948
+ # source://i18n//lib/i18n/interpolate/ruby.rb#12
1949
+ I18n::INTERPOLATION_PATTERN = T.let(T.unsafe(nil), Regexp)
1950
+
1951
+ # source://i18n//lib/i18n/interpolate/ruby.rb#15
1952
+ I18n::INTERPOLATION_PATTERNS_CACHE = T.let(T.unsafe(nil), Hash)
1953
+
1954
+ # source://i18n//lib/i18n/exceptions.rb#134
1955
+ class I18n::InvalidFilenames < ::I18n::ArgumentError
1956
+ # @return [InvalidFilenames] a new instance of InvalidFilenames
1957
+ #
1958
+ # source://i18n//lib/i18n/exceptions.rb#136
1959
+ def initialize(file_errors); end
1960
+ end
1961
+
1962
+ # source://i18n//lib/i18n/exceptions.rb#135
1963
+ I18n::InvalidFilenames::NUMBER_OF_ERRORS_SHOWN = T.let(T.unsafe(nil), Integer)
1964
+
1965
+ # source://i18n//lib/i18n/exceptions.rb#32
1966
+ class I18n::InvalidLocale < ::I18n::ArgumentError
1967
+ # @return [InvalidLocale] a new instance of InvalidLocale
1968
+ #
1969
+ # source://i18n//lib/i18n/exceptions.rb#34
1970
+ def initialize(locale); end
1971
+
1972
+ # Returns the value of attribute locale.
1973
+ #
1974
+ # source://i18n//lib/i18n/exceptions.rb#33
1975
+ def locale; end
1976
+ end
1977
+
1978
+ # source://i18n//lib/i18n/exceptions.rb#40
1979
+ class I18n::InvalidLocaleData < ::I18n::ArgumentError
1980
+ # @return [InvalidLocaleData] a new instance of InvalidLocaleData
1981
+ #
1982
+ # source://i18n//lib/i18n/exceptions.rb#42
1983
+ def initialize(filename, exception_message); end
1984
+
1985
+ # Returns the value of attribute filename.
1986
+ #
1987
+ # source://i18n//lib/i18n/exceptions.rb#41
1988
+ def filename; end
1989
+ end
1990
+
1991
+ # source://i18n//lib/i18n/exceptions.rb#92
1992
+ class I18n::InvalidPluralizationData < ::I18n::ArgumentError
1993
+ # @return [InvalidPluralizationData] a new instance of InvalidPluralizationData
1994
+ #
1995
+ # source://i18n//lib/i18n/exceptions.rb#94
1996
+ def initialize(entry, count, key); end
1997
+
1998
+ # Returns the value of attribute count.
1999
+ #
2000
+ # source://i18n//lib/i18n/exceptions.rb#93
2001
+ def count; end
2002
+
2003
+ # Returns the value of attribute entry.
2004
+ #
2005
+ # source://i18n//lib/i18n/exceptions.rb#93
2006
+ def entry; end
2007
+
2008
+ # Returns the value of attribute key.
2009
+ #
2010
+ # source://i18n//lib/i18n/exceptions.rb#93
2011
+ def key; end
2012
+ end
2013
+
2014
+ # source://i18n//lib/i18n/backend/key_value.rb#21
2015
+ I18n::JSON = ActiveSupport::JSON
2016
+
2017
+ # source://i18n//lib/i18n/locale.rb#4
2018
+ module I18n::Locale; end
2019
+
2020
+ # source://i18n//lib/i18n/locale/fallbacks.rb#48
2021
+ class I18n::Locale::Fallbacks < ::Hash
2022
+ # @return [Fallbacks] a new instance of Fallbacks
2023
+ #
2024
+ # source://i18n//lib/i18n/locale/fallbacks.rb#49
2025
+ def initialize(*mappings); end
2026
+
2027
+ # @raise [InvalidLocale]
2028
+ #
2029
+ # source://i18n//lib/i18n/locale/fallbacks.rb#60
2030
+ def [](locale); end
2031
+
2032
+ # Returns the value of attribute defaults.
2033
+ #
2034
+ # source://i18n//lib/i18n/locale/fallbacks.rb#58
2035
+ def defaults; end
2036
+
2037
+ # source://i18n//lib/i18n/locale/fallbacks.rb#55
2038
+ def defaults=(defaults); end
2039
+
2040
+ # @return [Boolean]
2041
+ #
2042
+ # source://i18n//lib/i18n/locale/fallbacks.rb#82
2043
+ def empty?; end
2044
+
2045
+ # source://i18n//lib/i18n/locale/fallbacks.rb#86
2046
+ def inspect; end
2047
+
2048
+ # source://i18n//lib/i18n/locale/fallbacks.rb#67
2049
+ def map(*args, &block); end
2050
+
2051
+ protected
2052
+
2053
+ # source://i18n//lib/i18n/locale/fallbacks.rb#92
2054
+ def compute(tags, include_defaults = T.unsafe(nil), exclude = T.unsafe(nil)); end
2055
+ end
2056
+
2057
+ # source://i18n//lib/i18n/locale/tag.rb#5
2058
+ module I18n::Locale::Tag
2059
+ class << self
2060
+ # Returns the current locale tag implementation. Defaults to +I18n::Locale::Tag::Simple+.
2061
+ #
2062
+ # source://i18n//lib/i18n/locale/tag.rb#12
2063
+ def implementation; end
2064
+
2065
+ # Sets the current locale tag implementation. Use this to set a different locale tag implementation.
2066
+ #
2067
+ # source://i18n//lib/i18n/locale/tag.rb#17
2068
+ def implementation=(implementation); end
2069
+
2070
+ # Factory method for locale tags. Delegates to the current locale tag implementation.
2071
+ #
2072
+ # source://i18n//lib/i18n/locale/tag.rb#22
2073
+ def tag(tag); end
2074
+ end
2075
+ end
2076
+
2077
+ # source://i18n//lib/i18n/locale/tag/parents.rb#4
2078
+ module I18n::Locale::Tag::Parents
2079
+ # source://i18n//lib/i18n/locale/tag/parents.rb#5
2080
+ def parent; end
2081
+
2082
+ # source://i18n//lib/i18n/locale/tag/parents.rb#18
2083
+ def parents; end
2084
+
2085
+ # source://i18n//lib/i18n/locale/tag/parents.rb#14
2086
+ def self_and_parents; end
2087
+ end
2088
+
2089
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#12
2090
+ I18n::Locale::Tag::RFC4646_FORMATS = T.let(T.unsafe(nil), Hash)
2091
+
2092
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#11
2093
+ I18n::Locale::Tag::RFC4646_SUBTAGS = T.let(T.unsafe(nil), Array)
2094
+
2095
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#14
2096
+ class I18n::Locale::Tag::Rfc4646 < ::Struct
2097
+ include ::I18n::Locale::Tag::Parents
2098
+
2099
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#35
2100
+ def language; end
2101
+
2102
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#35
2103
+ def region; end
2104
+
2105
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#35
2106
+ def script; end
2107
+
2108
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#46
2109
+ def to_a; end
2110
+
2111
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#42
2112
+ def to_s; end
2113
+
2114
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#38
2115
+ def to_sym; end
2116
+
2117
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#35
2118
+ def variant; end
2119
+
2120
+ class << self
2121
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#23
2122
+ def parser; end
2123
+
2124
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#27
2125
+ def parser=(parser); end
2126
+
2127
+ # Parses the given tag and returns a Tag instance if it is valid.
2128
+ # Returns false if the given tag is not valid according to RFC 4646.
2129
+ #
2130
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#18
2131
+ def tag(tag); end
2132
+ end
2133
+ end
2134
+
2135
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#50
2136
+ module I18n::Locale::Tag::Rfc4646::Parser
2137
+ class << self
2138
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#63
2139
+ def match(tag); end
2140
+ end
2141
+ end
2142
+
2143
+ # source://i18n//lib/i18n/locale/tag/rfc4646.rb#51
2144
+ I18n::Locale::Tag::Rfc4646::Parser::PATTERN = T.let(T.unsafe(nil), Regexp)
2145
+
2146
+ # source://i18n//lib/i18n/locale/tag/simple.rb#6
2147
+ class I18n::Locale::Tag::Simple
2148
+ include ::I18n::Locale::Tag::Parents
2149
+
2150
+ # @return [Simple] a new instance of Simple
2151
+ #
2152
+ # source://i18n//lib/i18n/locale/tag/simple.rb#17
2153
+ def initialize(*tag); end
2154
+
2155
+ # source://i18n//lib/i18n/locale/tag/simple.rb#21
2156
+ def subtags; end
2157
+
2158
+ # Returns the value of attribute tag.
2159
+ #
2160
+ # source://i18n//lib/i18n/locale/tag/simple.rb#15
2161
+ def tag; end
2162
+
2163
+ # source://i18n//lib/i18n/locale/tag/simple.rb#33
2164
+ def to_a; end
2165
+
2166
+ # source://i18n//lib/i18n/locale/tag/simple.rb#29
2167
+ def to_s; end
2168
+
2169
+ # source://i18n//lib/i18n/locale/tag/simple.rb#25
2170
+ def to_sym; end
2171
+
2172
+ class << self
2173
+ # source://i18n//lib/i18n/locale/tag/simple.rb#8
2174
+ def tag(tag); end
2175
+ end
2176
+ end
2177
+
2178
+ # source://i18n//lib/i18n/middleware.rb#4
2179
+ class I18n::Middleware
2180
+ # @return [Middleware] a new instance of Middleware
2181
+ #
2182
+ # source://i18n//lib/i18n/middleware.rb#6
2183
+ def initialize(app); end
2184
+
2185
+ # source://i18n//lib/i18n/middleware.rb#10
2186
+ def call(env); end
2187
+ end
2188
+
2189
+ # source://i18n//lib/i18n/exceptions.rb#100
2190
+ class I18n::MissingInterpolationArgument < ::I18n::ArgumentError
2191
+ # @return [MissingInterpolationArgument] a new instance of MissingInterpolationArgument
2192
+ #
2193
+ # source://i18n//lib/i18n/exceptions.rb#102
2194
+ def initialize(key, values, string); end
2195
+
2196
+ # Returns the value of attribute key.
2197
+ #
2198
+ # source://i18n//lib/i18n/exceptions.rb#101
2199
+ def key; end
2200
+
2201
+ # Returns the value of attribute string.
2202
+ #
2203
+ # source://i18n//lib/i18n/exceptions.rb#101
2204
+ def string; end
2205
+
2206
+ # Returns the value of attribute values.
2207
+ #
2208
+ # source://i18n//lib/i18n/exceptions.rb#101
2209
+ def values; end
2210
+ end
2211
+
2212
+ # source://i18n//lib/i18n/exceptions.rb#48
2213
+ class I18n::MissingTranslation < ::I18n::ArgumentError
2214
+ include ::I18n::MissingTranslation::Base
2215
+ end
2216
+
2217
+ # source://i18n//lib/i18n/exceptions.rb#49
2218
+ module I18n::MissingTranslation::Base
2219
+ # source://i18n//lib/i18n/exceptions.rb#54
2220
+ def initialize(locale, key, options = T.unsafe(nil)); end
2221
+
2222
+ # Returns the value of attribute key.
2223
+ #
2224
+ # source://i18n//lib/i18n/exceptions.rb#52
2225
+ def key; end
2226
+
2227
+ # source://i18n//lib/i18n/exceptions.rb#59
2228
+ def keys; end
2229
+
2230
+ # Returns the value of attribute locale.
2231
+ #
2232
+ # source://i18n//lib/i18n/exceptions.rb#52
2233
+ def locale; end
2234
+
2235
+ # source://i18n//lib/i18n/exceptions.rb#65
2236
+ def message; end
2237
+
2238
+ # source://i18n//lib/i18n/exceptions.rb#74
2239
+ def normalized_option(key); end
2240
+
2241
+ # Returns the value of attribute options.
2242
+ #
2243
+ # source://i18n//lib/i18n/exceptions.rb#52
2244
+ def options; end
2245
+
2246
+ # source://i18n//lib/i18n/exceptions.rb#80
2247
+ def to_exception; end
2248
+
2249
+ # source://i18n//lib/i18n/exceptions.rb#65
2250
+ def to_s; end
2251
+ end
2252
+
2253
+ # source://i18n//lib/i18n/exceptions.rb#50
2254
+ I18n::MissingTranslation::Base::PERMITTED_KEYS = T.let(T.unsafe(nil), Array)
2255
+
2256
+ # source://i18n//lib/i18n/exceptions.rb#88
2257
+ class I18n::MissingTranslationData < ::I18n::ArgumentError
2258
+ include ::I18n::MissingTranslation::Base
2259
+ end
2260
+
2261
+ # source://i18n//lib/i18n.rb#19
2262
+ I18n::RESERVED_KEYS = T.let(T.unsafe(nil), Array)
2263
+
2264
+ # source://i18n//lib/i18n/exceptions.rb#108
2265
+ class I18n::ReservedInterpolationKey < ::I18n::ArgumentError
2266
+ # @return [ReservedInterpolationKey] a new instance of ReservedInterpolationKey
2267
+ #
2268
+ # source://i18n//lib/i18n/exceptions.rb#110
2269
+ def initialize(key, string); end
2270
+
2271
+ # Returns the value of attribute key.
2272
+ #
2273
+ # source://i18n//lib/i18n/exceptions.rb#109
2274
+ def key; end
2275
+
2276
+ # Returns the value of attribute string.
2277
+ #
2278
+ # source://i18n//lib/i18n/exceptions.rb#109
2279
+ def string; end
2280
+ end
2281
+
2282
+ # source://i18n//lib/i18n/tests.rb#4
2283
+ module I18n::Tests; end
2284
+
2285
+ # source://i18n//lib/i18n/tests/localization.rb#3
2286
+ module I18n::Tests::Localization
2287
+ class << self
2288
+ # @private
2289
+ #
2290
+ # source://i18n//lib/i18n/tests/localization.rb#9
2291
+ def included(base); end
2292
+ end
2293
+ end
2294
+
2295
+ # source://i18n//lib/i18n/exceptions.rb#116
2296
+ class I18n::UnknownFileType < ::I18n::ArgumentError
2297
+ # @return [UnknownFileType] a new instance of UnknownFileType
2298
+ #
2299
+ # source://i18n//lib/i18n/exceptions.rb#118
2300
+ def initialize(type, filename); end
2301
+
2302
+ # Returns the value of attribute filename.
2303
+ #
2304
+ # source://i18n//lib/i18n/exceptions.rb#117
2305
+ def filename; end
2306
+
2307
+ # Returns the value of attribute type.
2308
+ #
2309
+ # source://i18n//lib/i18n/exceptions.rb#117
2310
+ def type; end
2311
+ end
2312
+
2313
+ # source://i18n//lib/i18n/exceptions.rb#124
2314
+ class I18n::UnsupportedMethod < ::I18n::ArgumentError
2315
+ # @return [UnsupportedMethod] a new instance of UnsupportedMethod
2316
+ #
2317
+ # source://i18n//lib/i18n/exceptions.rb#126
2318
+ def initialize(method, backend_klass, msg); end
2319
+
2320
+ # Returns the value of attribute backend_klass.
2321
+ #
2322
+ # source://i18n//lib/i18n/exceptions.rb#125
2323
+ def backend_klass; end
2324
+
2325
+ # Returns the value of attribute method.
2326
+ #
2327
+ # source://i18n//lib/i18n/exceptions.rb#125
2328
+ def method; end
2329
+
2330
+ # Returns the value of attribute msg.
2331
+ #
2332
+ # source://i18n//lib/i18n/exceptions.rb#125
2333
+ def msg; end
2334
+ end
2335
+
2336
+ # source://i18n//lib/i18n/utils.rb#4
2337
+ module I18n::Utils
2338
+ class << self
2339
+ # source://i18n//lib/i18n/utils.rb#18
2340
+ def deep_merge(hash, other_hash, &block); end
2341
+
2342
+ # source://i18n//lib/i18n/utils.rb#22
2343
+ def deep_merge!(hash, other_hash, &block); end
2344
+
2345
+ # source://i18n//lib/i18n/utils.rb#34
2346
+ def deep_symbolize_keys(hash); end
2347
+
2348
+ # source://i18n//lib/i18n/utils.rb#7
2349
+ def except(hash, *keys); end
2350
+
2351
+ private
2352
+
2353
+ # source://i18n//lib/i18n/utils.rb#43
2354
+ def deep_symbolize_keys_in_object(value); end
2355
+ end
2356
+ end
2357
+
2358
+ # source://i18n//lib/i18n/version.rb#4
2359
+ I18n::VERSION = T.let(T.unsafe(nil), String)