Rails I18n Extractor is a RubyMine plugin designed to assist in the internationalization of Ruby on Rails projects. It enables developers to manually select hardcoded strings within their project and replace them with I18n translation keys, streamlining the process of preparing an application for localization. Additionally, the plugin facilitates the generation of corresponding entries in locale YAML files.
- Manual Text Selection: Users can manually select the text that needs to be internationalized.
- YAML Generation: Automatically creates or updates locale YAML files with selected strings as I18n translation keys.
- Custom Key Support: Offers the ability to specify custom translation keys for the selected strings.
- packwerk: This plugin provides support for the Packwerk folder structure.
To install the Rails I18n Extractor plugin in RubyMine:
- Download the plugin
.jar
file. - Open RubyMine and navigate to
Preferences
>Plugins
. - Click on the gear icon and select
Install Plugin from Disk...
. - Choose the downloaded file and restart RubyMine.
- Open any Ruby or ERB file in RubyMine.
- Select the hardcoded string you wish to internationalize.
- Right-click to open the context menu and select the
Extract
option. - Follow the prompts to specify a custom translation key if desired. The plugin will replace the selected text with the appropriate I18n method call and generate or update the corresponding entry in your locale YAML file.
Contributions to Rails I18n Extractor are warmly welcomed. If you'd like to contribute, please fork the repository and use a feature branch for your development. Pull requests are highly appreciated.
Rails I18n Extractor is made available under the MIT License.