cmdx-i18n 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. checksums.yaml +7 -0
  2. data/.cursor/prompts/docs.md +12 -0
  3. data/.cursor/prompts/llms.md +20 -0
  4. data/.cursor/prompts/rspec.md +24 -0
  5. data/.cursor/prompts/yardoc.md +14 -0
  6. data/.cursor/rules/cursor-instructions.mdc +60 -0
  7. data/.irbrc +6 -0
  8. data/.rspec +4 -0
  9. data/.rubocop.yml +37 -0
  10. data/.ruby-version +1 -0
  11. data/CHANGELOG.md +12 -0
  12. data/CODE_OF_CONDUCT.md +132 -0
  13. data/LICENSE.txt +21 -0
  14. data/README.md +140 -0
  15. data/Rakefile +12 -0
  16. data/lib/cmdx/i18n/railtie.rb +38 -0
  17. data/lib/cmdx/i18n/version.rb +9 -0
  18. data/lib/cmdx/i18n.rb +26 -0
  19. data/lib/locales/af.yml +49 -0
  20. data/lib/locales/ar.yml +49 -0
  21. data/lib/locales/az.yml +49 -0
  22. data/lib/locales/be.yml +49 -0
  23. data/lib/locales/bg.yml +49 -0
  24. data/lib/locales/bn.yml +49 -0
  25. data/lib/locales/bs.yml +49 -0
  26. data/lib/locales/ca.yml +49 -0
  27. data/lib/locales/cnr.yml +49 -0
  28. data/lib/locales/cs.yml +49 -0
  29. data/lib/locales/cy.yml +49 -0
  30. data/lib/locales/da.yml +49 -0
  31. data/lib/locales/de.yml +49 -0
  32. data/lib/locales/dz.yml +49 -0
  33. data/lib/locales/el.yml +49 -0
  34. data/lib/locales/en.yml +49 -0
  35. data/lib/locales/eo.yml +49 -0
  36. data/lib/locales/es.yml +49 -0
  37. data/lib/locales/et.yml +49 -0
  38. data/lib/locales/eu.yml +49 -0
  39. data/lib/locales/fa.yml +49 -0
  40. data/lib/locales/fi.yml +49 -0
  41. data/lib/locales/fr.yml +49 -0
  42. data/lib/locales/fy.yml +49 -0
  43. data/lib/locales/gd.yml +49 -0
  44. data/lib/locales/gl.yml +49 -0
  45. data/lib/locales/he.yml +49 -0
  46. data/lib/locales/hi.yml +49 -0
  47. data/lib/locales/hr.yml +49 -0
  48. data/lib/locales/hu.yml +49 -0
  49. data/lib/locales/hy.yml +49 -0
  50. data/lib/locales/id.yml +49 -0
  51. data/lib/locales/is.yml +49 -0
  52. data/lib/locales/it.yml +49 -0
  53. data/lib/locales/ja.yml +49 -0
  54. data/lib/locales/ka.yml +49 -0
  55. data/lib/locales/kk.yml +49 -0
  56. data/lib/locales/km.yml +49 -0
  57. data/lib/locales/kn.yml +49 -0
  58. data/lib/locales/ko.yml +49 -0
  59. data/lib/locales/lb.yml +49 -0
  60. data/lib/locales/lo.yml +49 -0
  61. data/lib/locales/lt.yml +49 -0
  62. data/lib/locales/lv.yml +49 -0
  63. data/lib/locales/mg.yml +49 -0
  64. data/lib/locales/mk.yml +49 -0
  65. data/lib/locales/ml.yml +49 -0
  66. data/lib/locales/mn.yml +49 -0
  67. data/lib/locales/mr-IN.yml +49 -0
  68. data/lib/locales/ms.yml +49 -0
  69. data/lib/locales/nb.yml +49 -0
  70. data/lib/locales/ne.yml +49 -0
  71. data/lib/locales/nl.yml +49 -0
  72. data/lib/locales/nn.yml +49 -0
  73. data/lib/locales/oc.yml +49 -0
  74. data/lib/locales/or.yml +49 -0
  75. data/lib/locales/pa.yml +49 -0
  76. data/lib/locales/pl.yml +49 -0
  77. data/lib/locales/pt.yml +49 -0
  78. data/lib/locales/rm.yml +49 -0
  79. data/lib/locales/ro.yml +49 -0
  80. data/lib/locales/ru.yml +49 -0
  81. data/lib/locales/sc.yml +49 -0
  82. data/lib/locales/sk.yml +49 -0
  83. data/lib/locales/sl.yml +49 -0
  84. data/lib/locales/sq.yml +49 -0
  85. data/lib/locales/sr.yml +49 -0
  86. data/lib/locales/st.yml +49 -0
  87. data/lib/locales/sv.yml +49 -0
  88. data/lib/locales/sw.yml +49 -0
  89. data/lib/locales/ta.yml +49 -0
  90. data/lib/locales/te.yml +49 -0
  91. data/lib/locales/th.yml +49 -0
  92. data/lib/locales/tl.yml +49 -0
  93. data/lib/locales/tr.yml +49 -0
  94. data/lib/locales/tt.yml +49 -0
  95. data/lib/locales/ug.yml +49 -0
  96. data/lib/locales/uk.yml +49 -0
  97. data/lib/locales/ur.yml +49 -0
  98. data/lib/locales/uz.yml +49 -0
  99. data/lib/locales/vi.yml +49 -0
  100. data/lib/locales/wo.yml +49 -0
  101. data/lib/locales/zh-CN.yml +49 -0
  102. data/lib/locales/zh-HK.yml +49 -0
  103. data/lib/locales/zh-TW.yml +49 -0
  104. data/lib/locales/zh-YUE.yml +49 -0
  105. data/src/cmdx-i18n-logo.png +0 -0
  106. metadata +290 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9ad9f38d389bf57b7e9e16aca616782e3493e5db6c133784a3ec48a05173293c
4
+ data.tar.gz: e4e91914156a83731d8c1a48c36a6d78e52562e414c9ec228f43458fd4de4552
5
+ SHA512:
6
+ metadata.gz: 23ca825e44298e0356b14d572b47530d6e0904e5615d4cebe9ee9ee67a61b31fa68336f0dff570467ce1b09e86b99f84a1fdbd63c738c92d3eedb6438a87f7fb
7
+ data.tar.gz: a4c8c4731aa104a3f8b77e0337a808768f1db217fefb9182fe22b358761bbeeaa279a774ba507805ea2e266334e61bff4ba83538a8d4af252311e975411a1205
@@ -0,0 +1,12 @@
1
+ You are a senior Ruby developer with expert knowledge of CMDx and writing documentation.
2
+
3
+ Update the active tab using the following guidelines:
4
+
5
+ - Follow best practices and implementation
6
+ - Use a consistent professional voice
7
+ - Examples should be concise, non-repetitive, and realistic
8
+ - Update any pre-existing documentation to match stated rules
9
+ - Examples should not cross boundaries or focus
10
+ - Docs must cover both typical use cases, including invalid inputs and error conditions
11
+ - Use GitHub flavored markdown, including alerts to emphasize critical information (https://github.com/orgs/community/discussions/16925)
12
+ - Optimize for LLM's including coding and AI agents
@@ -0,0 +1,20 @@
1
+ Process the following instructions in the order given:
2
+
3
+ 1. Create an `LLM.md` file
4
+ 2. Append all files within `docs/**/*.md` into @LLM.md
5
+ 2a. Use order outlined in the table of contents of @README.md
6
+ 2b. Process one file at a time faster performance and improved accuracy
7
+ 2c. Remove the table of contents from the chunk
8
+ 2c. Remove the navigations below `---` from the chunk
9
+ 2d. Wrap the chunk the files GitHub url the top and a spacer at the bottom like so:
10
+ ```
11
+
12
+ ---
13
+ url: https://github.com/drexed/cmdx/blob/main/docs/callbacks.md
14
+ ---
15
+
16
+ {{ chunk }}
17
+
18
+ ---
19
+
20
+ ```
@@ -0,0 +1,24 @@
1
+ You are a senior Ruby developer with expert knowledge of RSpec.
2
+
3
+ Add tests for the active tab using the following guidelines:
4
+
5
+ - Expectations should be concise, non-repetitive, and realistic (how it would be used in the real world)
6
+ - Follow best practices and implementation
7
+ - Update any pre-existing specs to match stated rules
8
+ - New tests should be consistent with current `spec/cmdx` specs
9
+ - Use custom matchers available within `lib/cmdx/rspec`
10
+ - Use task helpers available within `spec/support/helpers`
11
+ - Use stubs to return predefined values for specific methods. Isolate the unit being tested, but avoid over-mocking; test real behavior when possible (mocks should be used only when necessary)
12
+ - Ensure each test is independent; avoid shared state between tests
13
+ - Use let and let! to define test data, ensuring minimal and necessary setup
14
+ - Context block descriptions should start with the following words: `when`, `with`, `without`
15
+ - Organize tests logically using describe for classes/modules and context for different scenarios
16
+ - Use subject to define the object under test when appropriate to avoid repetition
17
+ - Ensure test file paths mirror the structure of the files being tested, but within the spec directory (e.g., lib/cmdx/task.rb → spec/cmdx/task_spec.rb)
18
+ - Use clear and descriptive names for describe, context, and it blocks
19
+ - Prefer the expect syntax for assertions to improve readability
20
+ - Keep test code concise; avoid unnecessary complexity or duplication
21
+ - Tests must cover both typical cases and edge cases, including invalid inputs and error conditions
22
+ - Consider all possible scenarios for each method or behavior and ensure they are tested
23
+ - Do NOT include integration or real world examples
24
+ - Verify all specs are passing
@@ -0,0 +1,14 @@
1
+ You are a senior Ruby developer with expert knowledge of YARDoc.
2
+
3
+ Add yardoc to the active tab using the following guidelines:
4
+
5
+ - Follow best practices and implementation
6
+ - New documentation should be consistent with current `lib/cmdx` documentation
7
+ - Examples should be concise, non-repetitive, and realistic
8
+ - Avoid unnecessary complexity or duplication
9
+ - Update any pre-existing documentation to match stated rules
10
+ - Do NOT include `CMDx` module level docs
11
+ - Module level docs description should NOT include `@example`
12
+ - Method level docs should include `@example`, `param`, `@options`, `@return`, and any `@raise`
13
+ - Hash `@params` should expand with possible `@option`
14
+ - Module and method level docs should NOT include `@since`
@@ -0,0 +1,60 @@
1
+ ---
2
+ description:
3
+ globs:
4
+ alwaysApply: true
5
+ ---
6
+
7
+ # Ruby Coding Standards
8
+
9
+ Follow the official Ruby gem guides for best practices.
10
+ Reference the guides outlined in https://guides.rubygems.org
11
+
12
+ ## Project Context
13
+ CMDx provides a framework for designing and executing complex
14
+ business logic within service/command objects.
15
+
16
+ ## Technology Stack
17
+ - Ruby 3.4+
18
+ - RSpec 3.1+
19
+
20
+ ## Code Style and Structure
21
+ - Write concise, idiomatic Ruby code with accurate examples
22
+ - Follow Ruby conventions and best practices
23
+ - Use object-oriented and functional programming patterns as appropriate
24
+ - Prefer iteration and modularization over code duplication
25
+ - Use descriptive variable and method names (e.g., user_signed_in?, calculate_total)
26
+ - Write comprehensive code documentation using the Yardoc format
27
+
28
+ ## Naming Conventions
29
+ - Use snake_case for file names, method names, and variables
30
+ - Use CamelCase for class and module names
31
+
32
+ ## Syntax and Formatting
33
+ - Follow the Ruby Style Guide (https://rubystyle.guide/)
34
+ - Follow Ruby style conventions (2-space indentation, snake_case methods)
35
+ - Use Ruby's expressive syntax (e.g., unless, ||=, &.)
36
+ - Prefer double quotes for strings
37
+ - Respect my Rubocop options
38
+
39
+ ## Performance Optimization
40
+ - Use memoization for expensive operations
41
+
42
+ ## Testing
43
+ - Follow the RSpec Style Guide (https://rspec.rubystyle.guide/)
44
+ - Write comprehensive tests using RSpec
45
+ - It's ok to put multiple assertions in the same example
46
+ - Include both BDD and TDD based tests
47
+ - Create test objects to share across tests
48
+ - Do NOT make tests for obvious or reflective expectations
49
+ - Prefer real objects over mocks. Use `instance_double` if necessary; never `double`
50
+ - Don't test declarative configuration
51
+ - Use appropriate matchers
52
+ - Update tests and update Yardocs after you write code
53
+
54
+ ## Documentation
55
+ - Utilize the YARDoc format when documenting Ruby code
56
+ - Follow these best practices:
57
+ - Avoid redundant comments that merely restate the code
58
+ - Keep comments up-to-date with code changes
59
+ - Keep documentation consistent
60
+ - Update CHANGELOG.md with any changes
data/.irbrc ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "pp"
4
+
5
+ # To reload the gem, you must exit and restart the IRB session
6
+ require_relative "lib/cmdx/i18n" unless defined?(CMDx)
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --backtrace
2
+ --color
3
+ --format progress
4
+ --order random
data/.rubocop.yml ADDED
@@ -0,0 +1,37 @@
1
+ plugins:
2
+ - rubocop-performance
3
+ - rubocop-rake
4
+ - rubocop-rspec
5
+ AllCops:
6
+ NewCops: enable
7
+ DisplayCopNames: true
8
+ DisplayStyleGuide: true
9
+ TargetRubyVersion: 3.1
10
+ Gemspec/DevelopmentDependencies:
11
+ EnforcedStyle: gemspec
12
+ Layout/EmptyLinesAroundAttributeAccessor:
13
+ Enabled: true
14
+ Layout/EmptyLinesAroundClassBody:
15
+ EnforcedStyle: empty_lines_except_namespace
16
+ Layout/EmptyLinesAroundModuleBody:
17
+ EnforcedStyle: empty_lines_except_namespace
18
+ Layout/FirstHashElementIndentation:
19
+ EnforcedStyle: consistent
20
+ Layout/LineLength:
21
+ Enabled: false
22
+ RSpec/DescribeClass:
23
+ Exclude:
24
+ - 'spec/integrations/**/*'
25
+ RSpec/SpecFilePathFormat:
26
+ CustomTransform:
27
+ CMDx: cmdx
28
+ Style/Documentation:
29
+ Enabled: false
30
+ Style/FrozenStringLiteralComment:
31
+ Enabled: true
32
+ EnforcedStyle: always_true
33
+ SafeAutoCorrect: true
34
+ Style/ModuleFunction:
35
+ EnforcedStyle: extend_self
36
+ Style/StringLiterals:
37
+ EnforcedStyle: double_quotes
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.5
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [TODO]
8
+
9
+ ## [0.1.0] - 2025-08-21
10
+
11
+ ### Added
12
+ - Initial release
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Juan Gomez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,140 @@
1
+ <p align="center">
2
+ <img src="./src/cmdx-i18n-logo.png" width="200" alt="CMDx::I18n Logo">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <img alt="Version" src="https://img.shields.io/gem/v/cmdx-i18n">
7
+ <img alt="Build" src="https://github.com/drexed/cmdx-i18n/actions/workflows/ci.yml/badge.svg">
8
+ <img alt="License" src="https://img.shields.io/github/license/drexed/cmdx-i18n">
9
+ </p>
10
+
11
+ # CMDx::I18n
12
+
13
+ Centralization of locale data collection for CMDx.
14
+
15
+ ## Installation
16
+
17
+ Add this line to your application's Gemfile:
18
+
19
+ ```ruby
20
+ gem 'cmdx-i18n'
21
+ ```
22
+
23
+ And then execute:
24
+
25
+ $ bundle
26
+
27
+ Or install it yourself as:
28
+
29
+ $ gem install cmdx-i18n
30
+
31
+ ## Configuration
32
+
33
+ By default, `cmdx-i18n` locales are automatically loaded and are managed through the `I18n.available_locales` option.
34
+
35
+ ## Locales
36
+
37
+ - af - Afrikaans
38
+ - ar - Arabic
39
+ - az - Azerbaijani
40
+ - be - Belarusian
41
+ - bg - Bulgarian
42
+ - bn - Bengali
43
+ - bs - Bosnian
44
+ - ca - Catalan
45
+ - cnr - Montenegrin
46
+ - cs - Czech
47
+ - cy - Welsh
48
+ - da - Danish
49
+ - de - German
50
+ - dz - Dzongkha
51
+ - el - Greek
52
+ - en - English
53
+ - eo - Esperanto
54
+ - es - Spanish
55
+ - et - Estonian
56
+ - eu - Basque
57
+ - fa - Persian
58
+ - fi - Finnish
59
+ - fr - French
60
+ - fy - Western Frisian
61
+ - gd - Scottish Gaelic
62
+ - gl - Galician
63
+ - he - Hebrew
64
+ - hi - Hindi
65
+ - hr - Croatian
66
+ - hu - Hungarian
67
+ - hy - Armenian
68
+ - id - Indonesian
69
+ - is - Icelandic
70
+ - it - Italian
71
+ - ja - Japanese
72
+ - ka - Georgian
73
+ - kk - Kazakh
74
+ - km - Khmer
75
+ - kn - Kannada
76
+ - ko - Korean
77
+ - lb - Luxembourgish
78
+ - lo - Lao
79
+ - lt - Lithuanian
80
+ - lv - Latvian
81
+ - mg - Malagasy
82
+ - mk - Macedonian
83
+ - ml - Malayalam
84
+ - mn - Mongolian
85
+ - mr-IN - Marathi (India)
86
+ - ms - Malay
87
+ - nb - Norwegian Bokmål
88
+ - ne - Nepali
89
+ - nl - Dutch
90
+ - nn - Norwegian Nynorsk
91
+ - oc - Occitan
92
+ - or - Odia
93
+ - pa - Punjabi
94
+ - pl - Polish
95
+ - pt - Portuguese
96
+ - rm - Romansh
97
+ - ro - Romanian
98
+ - ru - Russian
99
+ - sc - Sardinian
100
+ - sk - Slovak
101
+ - sl - Slovenian
102
+ - sq - Albanian
103
+ - sr - Serbian
104
+ - st - Southern Sotho
105
+ - sv - Swedish
106
+ - sw - Swahili
107
+ - ta - Tamil
108
+ - te - Telugu
109
+ - th - Thai
110
+ - tl - Tagalog
111
+ - tr - Turkish
112
+ - tt - Tatar
113
+ - ug - Uyghur
114
+ - uk - Ukrainian
115
+ - ur - Urdu
116
+ - uz - Uzbek
117
+ - vi - Vietnamese
118
+ - wo - Wolof
119
+ - zh-CN - Chinese (Simplified)
120
+ - zh-HK - Chinese (Hong Kong)
121
+ - zh-TW - Chinese (Traditional)
122
+ - zh-YUE - Chinese (Yue)
123
+
124
+ ## Development
125
+
126
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
127
+
128
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
129
+
130
+ ## Contributing
131
+
132
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cmdx-i18n. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/cmdx-i18n/blob/master/CODE_OF_CONDUCT.md).
133
+
134
+ ## License
135
+
136
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
137
+
138
+ ## Code of Conduct
139
+
140
+ Everyone interacting in the Cmdx::I18n project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/cmdx-i18n/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CMDx
4
+ module I18n
5
+ # Rails integration class that automatically configures CMDx::I18n when the Rails
6
+ # application initializes. Handles locale configuration and I18n setup.
7
+ class Railtie < Rails::Railtie
8
+
9
+ railtie_name :cmdx_i18n
10
+
11
+ # Configures CMDx::I18n locales during Rails application initialization.
12
+ #
13
+ # Iterates through available locales from the Rails configuration and loads
14
+ # corresponding CMDx::I18n locale files. Reloads the I18n system to ensure
15
+ # all locales are properly registered.
16
+ #
17
+ # @param app [Rails::Application] the Rails application instance
18
+ #
19
+ # @raise [LoadError] if locale files cannot be loaded
20
+ #
21
+ # @example
22
+ # # This initializer runs automatically when Rails starts
23
+ # # It will load locales like en.yml, es.yml, fr.yml if they exist
24
+ # # in the CMDx::I18n gem's locales directory
25
+ initializer("cmdx_i18n.configure_locales") do |app|
26
+ Array(app.config.i18n.available_locales).each do |locale|
27
+ path = CMDx::I18n.gem_path.join("lib/locales/#{locale}.yml")
28
+ next unless File.file?(path)
29
+
30
+ ::I18n.load_path << path
31
+ end
32
+
33
+ ::I18n.reload!
34
+ end
35
+
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CMDx
4
+ module I18n
5
+
6
+ VERSION = "0.1.0"
7
+
8
+ end
9
+ end
data/lib/cmdx/i18n.rb ADDED
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "cmdx"
4
+ require "zeitwerk"
5
+
6
+ module CMDx
7
+ module I18n
8
+
9
+ extend self
10
+
11
+ def gem_path
12
+ @gem_path ||= Pathname.new(__dir__).parent.parent
13
+ end
14
+
15
+ end
16
+ end
17
+
18
+ # Set up Zeitwerk loader for the CMDx gem
19
+ loader = Zeitwerk::Loader.for_gem
20
+ loader.inflector.inflect("cmdx" => "CMDx")
21
+ loader.ignore("#{__dir__}/locales")
22
+ loader.setup
23
+
24
+ # Load the Railtie last after everything else is required so we don't
25
+ # need to load any CMDx::I18n components when we use this Railtie.
26
+ require_relative "cmdx/i18n/railtie" if defined?(Rails::Railtie)
@@ -0,0 +1,49 @@
1
+ af:
2
+ cmdx:
3
+ attributes:
4
+ required: "moet toeganklik wees via die bron"
5
+ undefined: "delegeer na ongedefinieerde metode %{method}"
6
+ coercions:
7
+ into_a: "kon nie na %{type} omskep word nie"
8
+ into_an: "kon nie na %{type} omskep word nie"
9
+ into_any: "kon nie na een van: %{types} omskep word nie"
10
+ unknown: "onbekende %{type} omskep tipe"
11
+ faults:
12
+ unspecified: "geen rede gegee nie"
13
+ types:
14
+ array: "skikking"
15
+ big_decimal: "groot desimale"
16
+ boolean: "booleaanse"
17
+ complex: "kompleks"
18
+ date_time: "datum en tyd"
19
+ date: "datum"
20
+ float: "drywende punt"
21
+ hash: "hash"
22
+ integer: "heelgetal"
23
+ rational: "rasionaal"
24
+ string: "string"
25
+ symbol: "simbool"
26
+ time: "tyd"
27
+ validators:
28
+ exclusion:
29
+ of: "moet nie een van wees nie: %{values}"
30
+ within: "moet nie binne %{min} en %{max} wees nie"
31
+ format: "is 'n ongeldige formaat"
32
+ inclusion:
33
+ of: "moet een van wees: %{values}"
34
+ within: "moet binne %{min} en %{max} wees"
35
+ length:
36
+ is: "lengte moet %{is} wees"
37
+ is_not: "lengte moet nie %{is_not} wees nie"
38
+ min: "lengte moet ten minste %{min} wees"
39
+ max: "lengte kan maksimum %{max} wees"
40
+ not_within: "lengte moet nie binne %{min} en %{max} wees nie"
41
+ within: "lengte moet binne %{min} en %{max} wees"
42
+ numeric:
43
+ is: "moet %{is} wees"
44
+ is_not: "moet nie %{is_not} wees nie"
45
+ min: "moet ten minste %{min} wees"
46
+ max: "kan maksimum %{max} wees"
47
+ not_within: "moet nie binne %{min} en %{max} wees nie"
48
+ within: "moet binne %{min} en %{max} wees"
49
+ presence: "kan nie leeg wees nie"