Add global shortcuts T() and L() convenience methods#10
Conversation
Co-authored-by: markets <[email protected]>
T or t shortcut
markets
left a comment
There was a problem hiding this comment.
Cool! Some changes:
- Lets keep only the upcase versions
- Update the README explaining these new methods
- Rename the file to "kernel_extensions.rb"
…ions, rename file, update README Co-authored-by: markets <[email protected]>
Done! I've implemented all the requested changes:
The changes are in commit b15a738. The global shortcuts now only include T() and L() methods, which work exactly like their MiniI18n.t() and MiniI18n.l() counterparts. |
markets
left a comment
There was a problem hiding this comment.
In the docs, dont add a title, add just a sentence as we do for current aliases. Please and mention each method under their specific section.
Co-authored-by: markets <[email protected]>
Updated the README documentation to integrate the global shortcuts into their respective sections instead of having a separate section. The T() shortcut is now documented under the translation section and L() under the localization section, following the same pattern as existing aliases. Changes in commit 52d5e41. |
T() and L() convenience methods
This PR introduces global shortcut methods for MiniI18n's main functionality by injecting them into the
Kernelmodule:T()andt()- shortcuts forMiniI18n.t()L()andl()- shortcuts forMiniI18n.l()Usage
The shortcuts work exactly like their full counterparts:
Implementation
lib/mini_i18n/kernel.rbwith the four global methodsThe methods are simple delegation methods that pass all arguments through to the original MiniI18n methods, ensuring full compatibility with all existing options and features.
Fixes #8.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.