Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skovy/rails-phlex-i18n-vscode
VSCode Extension to Extract Strings in Rails Phlex Views to Translation Files
https://github.com/skovy/rails-phlex-i18n-vscode
i18n phlex-rails vscode-extension
Last synced: 30 days ago
JSON representation
VSCode Extension to Extract Strings in Rails Phlex Views to Translation Files
- Host: GitHub
- URL: https://github.com/skovy/rails-phlex-i18n-vscode
- Owner: skovy
- License: mit
- Created: 2024-06-01T20:10:50.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-10T19:53:58.000Z (3 months ago)
- Last Synced: 2024-10-05T14:08:23.029Z (about 1 month ago)
- Topics: i18n, phlex-rails, vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=skovy.rails-phlex-i18n
- Size: 1.31 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 💎🌐 Rails Phlex I18n
Rails Phlex I18n is a VSCode extension to make working with translations in a Rails app built with Phlex views less painful, and more fun!
It helps extract existing strings from Rails Phlex views into the translations files, displays a preview of the translation on hover, and links directly to the translation key.
Read more in this blog post: [Rails Phlex I18n: A VSCode Extension](https://www.skovy.dev/blog/rails-phlex-i18n-vscode-extension).
## Demo
![demo](/assets/demo.gif)
## Features
- Support for `app/views` and `app/controllers` using relative keys.
- The relevant translation path is inferred based on the files relative path to `app/views` and `app/controllers` and follows conventions.
- The relevant controller action is inferred from the nearest function, which works most of the time.
- Multiple selection/cursor support to replace multiple string at once for bulk translating existing strings in files.
- Hover tooltip to display the value of a given translation key to make it easy to know the exact copy and intent.
- Quicklink to open the relevant translation key in the translation file.
- Auto-formatting based on `i18n-tasks normalize` for consistent formatting.## Requirements
- `i18n-tasks` gem installed for formatting and providing a consistent `en.yml` file.