Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: aptana/text.ruble
base: a25b03cc17
...
head fork: aptana/text.ruble
compare: 86c9e92a2c
  • 9 commits
  • 28 files changed
  • 0 commit comments
  • 2 contributors
Showing with 93 additions and 661 deletions.
  1. +1 −0  .gitignore
  2. +32 −38 bundle.rb
  3. +0 −595 cache.yml
  4. +1 −1  commands/convert_to_ascii.rb
  5. +1 −1  commands/convert_to_hex.rb
  6. +1 −1  commands/copy_matching_lines_into_new_document.rb
  7. +1 −1  commands/copy_non-matching_lines_into_new_document.rb
  8. +1 −1  commands/decrypt_selection.rb
  9. +1 −1  commands/delete_to_beginning_of_line.rb
  10. +1 −1  commands/distill_document_selection.rb
  11. +1 −1  commands/duplicate_line.rb
  12. +1 −1  commands/encrypt_selection.rb
  13. +1 −1  commands/enumerate_lines.rb
  14. +1 −1  commands/execute_and_insert.rb
  15. +1 −1  commands/font_decrease.rb
  16. +1 −1  commands/font_increase.rb
  17. +1 −2  commands/join_lines.rb
  18. +1 −1  commands/move_to_eol_and_insert_period.rb
  19. +1 −1  commands/move_to_eol_and_insert_period_and_lf.rb
  20. +1 −1  commands/randomize_lines_in_document_selection.rb
  21. +1 −1  commands/sort.rb
  22. +1 −1  commands/sort_uniq.rb
  23. +1 −1  commands/speak_document_selection.rb
  24. +2 −2 commands/strip_non-printables.rb
  25. +1 −1  commands/strip_trailing_spaces.rb
  26. +1 −1  commands/word_count.rb
  27. +33 −0 config/locales/en.yml
  28. +3 −3 snippets/snippets.rb
View
1  .gitignore
@@ -1 +1,2 @@
.DS_Store
+cache*.yml
View
70 bundle.rb
@@ -1,58 +1,52 @@
-require 'java'
require 'ruble'
-require 'ruble/platform'
bundle do |bundle|
bundle.author = 'Christopher Williams'
bundle.copyright = "Copyright 2010 Aptana Inc. Distributed under the MIT license."
- bundle.display_name = 'Text'
- bundle.description = <<END
-A port of the TextMate bundle.
-
-The text bundle has a lot of support for plain text and is a requisite for working with text.
-END
+ bundle.display_name = t(:bundle_name)
+ bundle.description = 'A port of the TextMate bundle. The text bundle has a lot of support for plain text and is a requisite for working with text.'
bundle.repository = "git://github.com/aptana/text.ruble.git"
- bundle.menu 'Text' do |main_menu|
- main_menu.menu 'Font' do |font_menu|
- font_menu.command 'Bigger'
- font_menu.command 'Smaller'
+ bundle.menu t(:bundle_name) do |main_menu|
+ main_menu.menu t(:font) do |font_menu|
+ font_menu.command t(:bigger)
+ font_menu.command t(:smaller)
end
- main_menu.menu 'Converting / Stripping' do |submenu|
- submenu.command 'Convert Character / Selection to Hex'
- submenu.command 'Remove Trailing Spaces in Document / Selection'
- submenu.command 'Remove Unprintable Characters in Document / Selection'
- submenu.command 'Transliterate Word / Selection to ASCII'
+ main_menu.menu t(:convert_strip) do |submenu|
+ submenu.command t(:convert_to_hex)
+ submenu.command t(:remove_trailing_spaces)
+ submenu.command t(:remove_unprintable)
+ submenu.command t(:transliterate_to_ascii)
end
- main_menu.menu 'Encryption' do |submenu|
- submenu.command 'AES Encrypt Document / Selection With Password...'
- submenu.command 'AES Decrypt Document / Selection With Password...'
+ main_menu.menu t(:encryption) do |submenu|
+ submenu.command t(:aes_encrypt)
+ submenu.command t(:aes_decrypt)
end
- main_menu.menu 'Filtering' do |submenu|
- submenu.command 'Distill Document / Selection'
- submenu.command 'Copy Matching Lines into New Document'
- submenu.command 'Copy Non-Matching Lines into New Document'
+ main_menu.menu t(:filtering) do |submenu|
+ submenu.command t(:distill)
+ submenu.command t(:copy_matching_lines)
+ submenu.command t(:copy_non_matching_lines)
end
- main_menu.menu 'Sorting' do |submenu|
- submenu.command 'Sort Lines in Document / Selection'
- submenu.command 'Sort Lines & Remove Duplicates'
+ main_menu.menu t(:sorting) do |submenu|
+ submenu.command t(:sort_lines)
+ submenu.command t(:sort_and_remove_duplicates)
submenu.separator
- submenu.command 'Randomize Lines in Document / Selection'
+ submenu.command t(:randomize_lines)
end
main_menu.separator
- main_menu.command 'Delete to Beginning of Line'
- main_menu.command 'Duplicate Line / Selection'
- main_menu.command 'Join Lines'
+ main_menu.command t(:delete_to_beginning_of_line)
+ main_menu.command t(:duplicate_line)
+ main_menu.command t(:join_lines)
main_menu.separator
- main_menu.command "Execute Selection/Line Inserting Results"
+ main_menu.command t(:execute_and_insert)
main_menu.separator
- main_menu.command 'Add Line Numbers to Document / Selection'
- main_menu.command 'Statistics for Document / Selection (Word Count)'
+ main_menu.command t(:add_line_numbers)
+ main_menu.command t(:word_count)
main_menu.separator
- main_menu.command 'Copyright Notice'
- main_menu.command 'Current Date - YYYY-MM-DD'
- main_menu.command 'Lorem ipsum'
- main_menu.command 'Speak Document / Selection' unless Ruble.is_windows?
+ main_menu.command t(:copyright)
+ main_menu.command t(:current_date)
+ main_menu.command t(:lorem_ipsum)
+ main_menu.command t(:speak) if Ruble.is_mac?
end
end
View
595 cache.yml
@@ -1,595 +0,0 @@
-!!com.aptana.scripting.model.BundleElement
-author: Christopher Williams
-children:
-- !!com.aptana.scripting.model.MenuElement
- children:
- - children:
- - children: &id001 []
- commandName: Bigger
- customProperties: null
- displayName: Bigger
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Smaller
- customProperties: null
- displayName: Smaller
- path: bundle.rb
- scope: null
- commandName: Font
- customProperties: null
- displayName: Font
- path: bundle.rb
- scope: null
- - children:
- - children: *id001
- commandName: Convert Character / Selection to Hex
- customProperties: null
- displayName: Convert Character / Selection to Hex
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Remove Trailing Spaces in Document / Selection
- customProperties: null
- displayName: Remove Trailing Spaces in Document / Selection
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Remove Unprintable Characters in Document / Selection
- customProperties: null
- displayName: Remove Unprintable Characters in Document / Selection
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Transliterate Word / Selection to ASCII
- customProperties: null
- displayName: Transliterate Word / Selection to ASCII
- path: bundle.rb
- scope: null
- commandName: Converting / Stripping
- customProperties: null
- displayName: Converting / Stripping
- path: bundle.rb
- scope: null
- - children:
- - children: *id001
- commandName: AES Encrypt Document / Selection With Password...
- customProperties: null
- displayName: AES Encrypt Document / Selection With Password...
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: AES Decrypt Document / Selection With Password...
- customProperties: null
- displayName: AES Decrypt Document / Selection With Password...
- path: bundle.rb
- scope: null
- commandName: Encryption
- customProperties: null
- displayName: Encryption
- path: bundle.rb
- scope: null
- - children:
- - children: *id001
- commandName: Distill Document / Selection
- customProperties: null
- displayName: Distill Document / Selection
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Copy Matching Lines into New Document
- customProperties: null
- displayName: Copy Matching Lines into New Document
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Copy Non-Matching Lines into New Document
- customProperties: null
- displayName: Copy Non-Matching Lines into New Document
- path: bundle.rb
- scope: null
- commandName: Filtering
- customProperties: null
- displayName: Filtering
- path: bundle.rb
- scope: null
- - children:
- - children: *id001
- commandName: Sort Lines in Document / Selection
- customProperties: null
- displayName: Sort Lines in Document / Selection
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Sort Lines & Remove Duplicates
- customProperties: null
- displayName: Sort Lines & Remove Duplicates
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: '-'
- customProperties: null
- displayName: '-'
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Randomize Lines in Document / Selection
- customProperties: null
- displayName: Randomize Lines in Document / Selection
- path: bundle.rb
- scope: null
- commandName: Sorting
- customProperties: null
- displayName: Sorting
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: '-'
- customProperties: null
- displayName: '-'
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Delete to Beginning of Line
- customProperties: null
- displayName: Delete to Beginning of Line
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Duplicate Line / Selection
- customProperties: null
- displayName: Duplicate Line / Selection
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Join Lines
- customProperties: null
- displayName: Join Lines
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: '-'
- customProperties: null
- displayName: '-'
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Execute Selection/Line Inserting Results
- customProperties: null
- displayName: Execute Selection/Line Inserting Results
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: '-'
- customProperties: null
- displayName: '-'
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Add Line Numbers to Document / Selection
- customProperties: null
- displayName: Add Line Numbers to Document / Selection
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Statistics for Document / Selection (Word Count)
- customProperties: null
- displayName: Statistics for Document / Selection (Word Count)
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: '-'
- customProperties: null
- displayName: '-'
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Copyright Notice
- customProperties: null
- displayName: Copyright Notice
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Current Date - YYYY-MM-DD
- customProperties: null
- displayName: Current Date - YYYY-MM-DD
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Lorem ipsum
- customProperties: null
- displayName: Lorem ipsum
- path: bundle.rb
- scope: null
- - children: *id001
- commandName: Speak Document / Selection
- customProperties: null
- displayName: Speak Document / Selection
- path: bundle.rb
- scope: null
- commandName: Text
- customProperties: null
- displayName: Text
- path: bundle.rb
- scope: null
-- !!com.aptana.scripting.model.SmartTypingPairsElement
- customProperties: null
- displayName: smart_typing_pairs-b3c2f215-945a-48e0-bee0-b63109ece088
- pairs: ['"', '"', (, ), '{', '}', '[', ']']
- path: bundle.rb
- scope: ''
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Transliterate Word / Selection to ASCII
- input: [selection, word]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: replace_selection
- path: commands/convert_to_ascii.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Convert Character / Selection to Hex
- input: [selection, right_character]
- inputPath: null
- keyBindingMap:
- !!com.aptana.scripting.model.Platform 'ALL': [CONTROL+M2+X]
- outputPath: null
- outputType: replace_selection
- path: commands/convert_to_hex.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Copy Matching Lines into New Document
- input: [document]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: create_new_document
- path: commands/copy_matching_lines_into_new_document.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Copy Non-Matching Lines into New Document
- input: [document]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: create_new_document
- path: commands/copy_non-matching_lines_into_new_document.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: AES Decrypt Document / Selection With Password...
- input: [selection, document]
- inputPath: null
- keyBindingMap:
- !!com.aptana.scripting.model.Platform 'ALL': [CONTROL+SHIFT+COMMAND+E]
- outputPath: null
- outputType: replace_selection
- path: commands/decrypt_selection.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Delete to Beginning of Line
- input: [none]
- inputPath: null
- keyBindingMap:
- !!com.aptana.scripting.model.Platform 'ALL': [COMMAND+BACKSPACE]
- outputPath: null
- outputType: discard
- path: commands/delete_to_beginning_of_line.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Distill Document / Selection
- input: [document]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: replace_selection
- path: commands/distill_document_selection.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Duplicate Line / Selection
- input: [selection, none]
- inputPath: null
- keyBindingMap:
- !!com.aptana.scripting.model.Platform 'ALL': [CONTROL+M2+D]
- outputPath: null
- outputType: insert_as_text
- path: commands/duplicate_line.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: AES Encrypt Document / Selection With Password...
- input: [selection, document]
- inputPath: null
- keyBindingMap:
- !!com.aptana.scripting.model.Platform 'ALL': [CONTROL+SHIFT+COMMAND+E]
- outputPath: null
- outputType: replace_selection
- path: commands/encrypt_selection.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Add Line Numbers to Document / Selection
- input: [selection, document]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: replace_selection
- path: commands/enumerate_lines.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Execute Selection/Line Inserting Results
- input: [selection, line]
- inputPath: null
- keyBindingMap:
- !!com.aptana.scripting.model.Platform 'ALL': [CTRL+R]
- outputPath: null
- outputType: insert_as_text
- path: commands/execute_and_insert.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Smaller
- input: [none]
- inputPath: null
- keyBindingMap:
- !!com.aptana.scripting.model.Platform 'ALL': [M1+-]
- outputPath: null
- outputType: discard
- path: commands/font_decrease.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Bigger
- input: [none]
- inputPath: null
- keyBindingMap:
- !!com.aptana.scripting.model.Platform 'ALL': [M1+M2+=]
- outputPath: null
- outputType: discard
- path: commands/font_increase.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Join Lines
- input: [none]
- inputPath: null
- keyBindingMap:
- !!com.aptana.scripting.model.Platform 'ALL': [CONTROL+M2+J]
- outputPath: null
- outputType: discard
- path: commands/join_lines.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Move to EOL and Insert "."
- input: [line]
- inputPath: null
- keyBindingMap:
- !!com.aptana.scripting.model.Platform 'ALL': [OPTION+COMMAND+ENTER]
- outputPath: null
- outputType: replace_selection
- path: commands/move_to_eol_and_insert_period.rb
- runType: current_thread
- scope: text
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Move to EOL and Insert "." + LF
- input: [line]
- inputPath: null
- keyBindingMap:
- !!com.aptana.scripting.model.Platform 'ALL': [SHIFT+COMMAND+ENTER]
- outputPath: null
- outputType: replace_selection
- path: commands/move_to_eol_and_insert_period_and_lf.rb
- runType: current_thread
- scope: text
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Randomize Lines in Document / Selection
- input: [selection, document]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: replace_selection
- path: commands/randomize_lines_in_document_selection.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Sort Lines in Document / Selection
- input: [selection, document]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: replace_selection
- path: commands/sort.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Sort Lines & Remove Duplicates
- input: [selection, document]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: replace_selection
- path: commands/sort_uniq.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Speak Document / Selection
- input: [selection, document]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: discard
- path: commands/speak_document_selection.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Remove Unprintable Characters in Document / Selection
- input: [selection, document]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: replace_selection
- path: commands/strip_non-printables.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Remove Trailing Spaces in Document / Selection
- input: [selection, document]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: replace_selection
- path: commands/strip_trailing_spaces.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties: null
- displayName: Statistics for Document / Selection (Word Count)
- input: [selection, document]
- inputPath: null
- keyBindingMap:
- !!com.aptana.scripting.model.Platform 'ALL': [CONTROL+M2+N]
- outputPath: null
- outputType: show_as_tooltip
- path: commands/word_count.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties:
- prefix_values: [c)]
- displayName: Copyright Notice
- input: [none]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: insert_as_snippet
- path: snippets/snippets.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.CommandElement
- async: false
- customProperties:
- prefix_values: [isoD]
- displayName: Current Date - YYYY-MM-DD
- input: [none]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: insert_as_snippet
- path: snippets/snippets.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-- !!com.aptana.scripting.model.SnippetElement
- async: false
- customProperties:
- prefix_values: [lorem]
- displayName: Lorem ipsum
- expansion: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
- input: [none]
- inputPath: null
- keyBindingMap: null
- outputPath: null
- outputType: insert_as_snippet
- path: snippets/snippets.rb
- runType: current_thread
- scope: null
- workingDirectoryType: UNDEFINED
-copyright: Copyright 2010 Aptana Inc. Distributed under the MIT license.
-customProperties: null
-decreaseIndentMarkers: &id002 {}
-description: 'A port of the TextMate bundle.
-
-
- The text bundle has a lot of support for plain text and is a requisite for working
- with text.
-
- '
-displayName: Text
-fileTypeRegistry: *id002
-fileTypes: *id001
-foldingStartMarkers: *id002
-foldingStopMarkers: *id002
-increaseIndentMarkers: *id002
-license: null
-licenseUrl: null
-path: bundle.rb
-repository: git://github.com/aptana/text.ruble.git
-visible: true
View
2  commands/convert_to_ascii.rb
@@ -1,7 +1,7 @@
require 'ruble'
# FIXME This probably won't work on windows
-command 'Transliterate Word / Selection to ASCII' do |cmd|
+command t(:transliterate_to_ascii) do |cmd|
cmd.output = :replace_selection
cmd.input = :selection, :word
cmd.invoke =<<-EOF
View
2  commands/convert_to_hex.rb
@@ -1,6 +1,6 @@
require 'ruble'
-command 'Convert Character / Selection to Hex' do |cmd|
+command t(:convert_to_hex) do |cmd|
cmd.key_binding = 'CONTROL+M2+X'
cmd.output = :replace_selection
cmd.input = :selection, :right_character
View
2  commands/copy_matching_lines_into_new_document.rb
@@ -1,6 +1,6 @@
require 'ruble'
-command 'Copy Matching Lines into New Document' do |cmd|
+command t(:copy_matching_lines) do |cmd|
cmd.output = :create_new_document
cmd.input = :document
cmd.invoke do |context|
View
2  commands/copy_non-matching_lines_into_new_document.rb
@@ -1,6 +1,6 @@
require 'ruble'
-command 'Copy Non-Matching Lines into New Document' do |cmd|
+command t(:copy_non_matching_lines) do |cmd|
cmd.output = :create_new_document
cmd.input = :document
cmd.invoke do |context|
View
2  commands/decrypt_selection.rb
@@ -1,7 +1,7 @@
require 'ruble'
require 'ruble/ui'
-command 'AES Decrypt Document / Selection With Password...' do |cmd|
+command t(:aes_decrypt) do |cmd|
cmd.key_binding = 'CONTROL+SHIFT+COMMAND+E'
cmd.output = :replace_selection
cmd.input = :selection, :document
View
2  commands/delete_to_beginning_of_line.rb
@@ -1,6 +1,6 @@
require 'ruble'
# FIXME Something is interfering so keybinding doesn't actually work (though the command works fine when run from menu)!
-command 'Delete to Beginning of Line' do |cmd|
+command t(:delete_to_beginning_of_line) do |cmd|
cmd.key_binding = 'COMMAND+BACKSPACE'
cmd.output = :discard
cmd.input = :none
View
2  commands/distill_document_selection.rb
@@ -1,6 +1,6 @@
require 'ruble'
-command 'Distill Document / Selection' do |cmd|
+command t(:distill) do |cmd|
cmd.output = :replace_selection
cmd.input = :document
cmd.invoke do |context|
View
2  commands/duplicate_line.rb
@@ -1,7 +1,7 @@
require 'ruble'
require 'escape'
-command 'Duplicate Line / Selection' do |cmd|
+command t(:duplicate_line) do |cmd|
cmd.key_binding = 'CONTROL+M2+D'
cmd.output = :insert_as_text
cmd.input = :selection, :none
View
2  commands/encrypt_selection.rb
@@ -1,7 +1,7 @@
require 'ruble'
require 'ruble/ui'
-command 'AES Encrypt Document / Selection With Password...' do |cmd|
+command t(:aes_encrypt) do |cmd|
cmd.key_binding = 'CONTROL+SHIFT+COMMAND+E'
cmd.output = :replace_selection
cmd.input = :selection, :document
View
2  commands/enumerate_lines.rb
@@ -1,6 +1,6 @@
require 'ruble'
-command 'Add Line Numbers to Document / Selection' do |cmd|
+command t(:add_line_numbers) do |cmd|
cmd.output = :replace_selection
cmd.input = :selection, :document
cmd.invoke do
View
2  commands/execute_and_insert.rb
@@ -1,6 +1,6 @@
require 'ruble'
-command "Execute Selection/Line Inserting Results" do |cmd|
+command t(:execute_and_insert) do |cmd|
cmd.key_binding = "CTRL+R"
cmd.output = :insert_as_text
cmd.input = [ :selection, :line ]
View
2  commands/font_decrease.rb
@@ -1,6 +1,6 @@
require 'ruble'
-command 'Smaller' do |cmd|
+command t(:smaller) do |cmd|
cmd.key_binding = 'M1+-'
cmd.output = :discard
cmd.input = :none
View
2  commands/font_increase.rb
@@ -1,6 +1,6 @@
require 'ruble'
-command 'Bigger' do |cmd|
+command t(:bigger) do |cmd|
cmd.key_binding ='M1+M2+='
cmd.output = :discard
cmd.input = :none
View
3  commands/join_lines.rb
@@ -1,7 +1,6 @@
require 'ruble'
-require 'escape'
-command 'Join Lines' do |cmd|
+command t(:join_lines) do |cmd|
cmd.key_binding = 'CONTROL+M2+J'
cmd.output = :discard
cmd.input = :none
View
2  commands/move_to_eol_and_insert_period.rb
@@ -1,6 +1,6 @@
require 'ruble'
-command 'Move to EOL and Insert "."' do |cmd|
+command t(:insert_period_at_eol) do |cmd|
cmd.key_binding = 'OPTION+COMMAND+ENTER'
cmd.scope = 'text'
cmd.output = :replace_selection
View
2  commands/move_to_eol_and_insert_period_and_lf.rb
@@ -1,6 +1,6 @@
require 'ruble'
-command 'Move to EOL and Insert "." + LF' do |cmd|
+command t(:insert_period_and_newline_at_eol) do |cmd|
cmd.key_binding = 'SHIFT+COMMAND+ENTER'
cmd.scope = 'text'
cmd.output = :replace_selection
View
2  commands/randomize_lines_in_document_selection.rb
@@ -1,6 +1,6 @@
require 'ruble'
-command 'Randomize Lines in Document / Selection' do |cmd|
+command t(:randomize_lines) do |cmd|
cmd.output = :replace_selection
cmd.input = :selection, :document
cmd.invoke do
View
2  commands/sort.rb
@@ -1,6 +1,6 @@
require 'ruble'
# FIXME used to run "sort -f" which sorts things like [ after a-z, but ruby sorts before a-z
-command 'Sort Lines in Document / Selection' do |cmd|
+command t(:sort_lines) do |cmd|
# cmd.key_binding = 'F6' # Commented out to avoid clashes with debugger
cmd.output = :replace_selection
cmd.input = :selection, :document
View
2  commands/sort_uniq.rb
@@ -1,6 +1,6 @@
require 'ruble'
# FIXME used to run "sort -f" which sorts things like [ after a-z, but ruby sorts before a-z
-command 'Sort Lines & Remove Duplicates' do |cmd|
+command t(:sort_and_remove_duplicates) do |cmd|
# cmd.key_binding = 'F6' # Commented out to avoid clashes with debugger
cmd.output = :replace_selection
cmd.input = :selection, :document
View
2  commands/speak_document_selection.rb
@@ -1,6 +1,6 @@
require 'ruble'
# FIXME Won't work on Windows, or Ubuntu. Run 'espeak' on Ubuntu!
-command 'Speak Document / Selection' do |cmd|
+command t(:speak) do |cmd|
cmd.output = :discard
cmd.input = :selection, :document
cmd.invoke do
View
4 commands/strip_non-printables.rb
@@ -1,10 +1,10 @@
require 'ruble'
-command 'Remove Unprintable Characters in Document / Selection' do |cmd|
+command t(:remove_unprintable) do |cmd|
cmd.output = :replace_selection
cmd.input = :selection, :document
cmd.invoke do
- $stdin.readlines.each {|l| print l.gsub(/[^\t\n\x20-\xFF]|\x7F|\xC2[\x80-\x9F]/, '') }
+ $stdin.readlines.each {|l| print l.gsub(/[^\t\n\x20-\xFF]|\x7F|\xC2[\x80-\x9F]/n, '') }
nil
end
end
View
2  commands/strip_trailing_spaces.rb
@@ -1,6 +1,6 @@
require 'ruble'
-command 'Remove Trailing Spaces in Document / Selection' do |cmd|
+command t(:remove_trailing_spaces) do |cmd|
cmd.output = :replace_selection
cmd.input = :selection, :document
cmd.invoke do
View
2  commands/word_count.rb
@@ -4,7 +4,7 @@ def pretty(number)
number.to_s.gsub(/\d{1,3}(?=\d{3}+(?!\d))/, '\0,')
end
# FIXME Tooltip isn't showing properly when input is selection...
-command 'Statistics for Document / Selection (Word Count)' do |cmd|
+command t(:word_count) do |cmd|
cmd.key_binding = 'CONTROL+M2+N'
cmd.output = :show_as_tooltip
cmd.input = :selection, :document
View
33 config/locales/en.yml
@@ -0,0 +1,33 @@
+en:
+ bundle_name: 'Text'
+ font: 'Font'
+ bigger: 'Bigger'
+ smaller: 'Smaller'
+ convert_strip: 'Converting / Stripping'
+ convert_to_hex: 'Convert Character / Selection to Hex'
+ remove_trailing_spaces: 'Remove Trailing Spaces in Document / Selection'
+ remove_unprintable: 'Remove Unprintable Characters in Document / Selection'
+ transliterate_to_ascii: 'Transliterate Word / Selection to ASCII'
+ encryption: 'Encryption'
+ aes_encrypt: 'AES Encrypt Document / Selection With Password...'
+ aes_decrypt: 'AES Decrypt Document / Selection With Password...'
+ filtering: 'Filtering'
+ distill: 'Distill Document / Selection'
+ copy_matching_lines: 'Copy Matching Lines into New Document'
+ copy_non_matching_lines: 'Copy Non-Matching Lines into New Document'
+ sorting: 'Sorting'
+ sort_lines: 'Sort Lines in Document / Selection'
+ sort_and_remove_duplicates: 'Sort Lines & Remove Duplicates'
+ randomize_lines: 'Randomize Lines in Document / Selection'
+ delete_to_beginning_of_line: 'Delete to Beginning of Line'
+ duplicate_line: 'Duplicate Line / Selection'
+ join_lines: 'Join Lines'
+ execute_and_insert: "Execute Selection/Line Inserting Results"
+ add_line_numbers: 'Add Line Numbers to Document / Selection'
+ word_count: 'Statistics for Document / Selection (Word Count)'
+ copyright: 'Copyright Notice'
+ current_date: 'Current Date - YYYY-MM-DD'
+ lorem_ipsum: 'Lorem ipsum'
+ speak: 'Speak Document / Selection'
+ insert_period_at_eol: 'Move to EOL and Insert "."'
+ insert_period_and_newline_at_eol: 'Move to EOL and Insert "." + LF'
View
6 snippets/snippets.rb
@@ -1,20 +1,20 @@
require 'ruble'
-command 'Copyright Notice' do |s|
+command t(:copyright) do |s|
s.trigger = 'c)'
s.input = :none
s.output = :insert_as_snippet
s.invoke { "(c) Copyright #{Time.now.year} #{ENV['TM_FULLNAME']}. All Rights Reserved. " }
end
-command 'Current Date - YYYY-MM-DD' do |s|
+command t(:current_date) do |s|
s.trigger = 'isoD'
s.input = :none
s.output = :insert_as_snippet
s.invoke { Time.now.strftime('%Y-%m-%d') }
end
-snippet 'Lorem ipsum' do |s|
+snippet t(:lorem_ipsum) do |s|
s.trigger = 'lorem'
s.expansion = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
end

No commit comments for this range

Something went wrong with that request. Please try again.