Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svenfuchs/ruby-i18n.tmbundle
https://github.com/svenfuchs/ruby-i18n.tmbundle
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/svenfuchs/ruby-i18n.tmbundle
- Owner: svenfuchs
- Created: 2010-12-26T20:18:29.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2010-12-26T21:07:21.000Z (almost 14 years ago)
- Last Synced: 2024-10-26T22:39:55.849Z (2 months ago)
- Language: Ruby
- Homepage:
- Size: 97.7 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
Awesome Lists containing this project
README
h1. Rails I18n Textmate bundle
h2. Commands
h3. Extract Translation (cmd-shift-e)
* prompts you for a dot-separated key
* adds the translation (mapping the dot-separated key to nested yaml keys)
* replaces the selected string in your source-code with the dot-separated key wrapped into a call to t(your.key), if interpolations are detected within translation, the replacement text will prompt for them.h3. Look up Translation (cmd-shift-i)
* Looks up the currently selected key if text is selected
* If nothing is selected, it will look up all the keys in the currently selected file.h2. Tab triggers
h3. tr
* Inserts I18n.translate("") or translate("") based on your contexth3. The following properties are editable
* default locale
* translation file path
* whether extract inserts the long syntax (I18n.translate) or short syntax (I18n.t)
* where and if translation changes are loggedNote that Textmate, while active, won't reload the translations.yml for you if it's already open. When you give the focus to another application and then go back to Textmate (e.g. with cmd-tab, cmd-tab) it will reload the file. I found it useful to have translations.yml open on a second monitor while extracting translations from my application.
I still have to figure out how to automatically select the next string after this command has run. It works well to just use Textmate's "Find Next" though:
* hit cmd-f and give it
("|').*(\1)
as a search expression, tell it to use this as a "Regular expression"
* hit return and it will select the next string
* use shift-cmd-e to extract that string
* hit cmd-g to select the next string