Skip to content

Commit

Permalink
More work on APSTUD-4221 Externalize UI strings in HTML ruble
Browse files Browse the repository at this point in the history
sgtcoolguy committed Mar 15, 2012

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 75f0a10 commit 208d1e0
Showing 5 changed files with 27 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bundle.rb
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
bundle.author = 'Christopher Williams'
bundle.copyright = "Copyright 2011 Aptana. Distributed under the MIT license."
bundle.display_name = t(:bundle_name)
bundle.description = 'Support for HTML, converted from TextMate.'
bundle.description = t(:bundle_description)
bundle.repository = "git://github.com/aptana/html.ruble.git"

# Folding
10 changes: 10 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
en:
bundle_name: 'HTML'
bundle_description: 'Support for HTML, converted from TextMate.'
docs_for_tag: 'Documentation for Tag'
validate_syntax: 'Validate Syntax (W3C)'
open_doc_in_internal_browser: 'Open Document in Internal Browser'
@@ -63,3 +64,12 @@ en:
wrap_lines_in_tag_pairs: 'Wrap Each Selected Line in Open/Close Tag'
wrap_in_jsp_tag: 'Wrap in <?= ... ?>'
strip_html_tags: 'Strip HTML Tags from Document / Selection'
embed_qt_movie: 'Embed QT Movie'
html_file_template_name: "%{name} Template (%{filetype})"
basic_web_template_name: "Basic Web Template"
basic_web_template_desc: "A basic template which includes only a default index.html file"
html5_file_template_name: "HTML 5 Template"
html5_template_name: "HTML5 Boilerplate"
html5_template_desc: "Paul Irish's HTML5 Boilerplate (http://html5boilerplate.com/). Requires network access."
cached_html5_template_name: "HTML5 Boilerplate (Cached)"
cached_html5_template_desc: "Cached version of Paul Irish's HTML5 Boilerplate project for those without network access, current as of 2011-08-01."
2 changes: 1 addition & 1 deletion snippets/snippets.rb
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@
s.expansion = '&#x2193;'
end

snippet 'Embed QT Movie' do |s|
snippet t(:embed_qt_movie) do |s|
s.trigger = 'movie'
s.expansion = '<object width="${2:320}" height="${3:240}" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="${1:movie.mov}"/>
12 changes: 6 additions & 6 deletions templates/project_templates.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
require 'ruble'

project_template "Basic Web Template" do |t|
project_template t(:basic_web_template_name) do |t|
t.type = :web
t.location = "templates/basic_web_template.zip"
t.description = "A basic template which includes only a default index.html file"
t.description = t(:basic_web_template_desc)
t.replace_parameters = false
end

project_template "HTML5 Boilerplate" do |t|
project_template t(:html5_template_name) do |t|
t.type = :web
t.location = "git://github.com/h5bp/html5-boilerplate.git"
t.description = "Paul Irish's HTML5 Boilerplate (http://html5boilerplate.com/). Requires network access."
t.description = t(:html5_template_desc)
t.replace_parameters = false
end

project_template "HTML5 Boilerplate (Cached)" do |t|
project_template t(:cached_html5_template_name) do |t|
t.type = :web
t.location = "templates/html5_template.zip"
t.description = "Cached version of Paul Irish's HTML5 Boilerplate project for those without network access, current as of 2011-08-01."
t.description = t(:cached_html5_template_desc)
t.replace_parameters = false
end
18 changes: 9 additions & 9 deletions templates/templates.rb
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
require 'ruble'

HTML_TEMPLATES = {
'strict.html' => 'HTML - 4.01 Strict',
'transitional.html' => 'HTML - 4.01 Transitional',
'strict_1_0.xhtml' => 'XHTML - 1.0 Strict',
'transitional_1_0.xhtml' => 'XHTML - 1.0 Transitional',
'frameset_1_0.xhtml' => 'XHTML - 1.0 Frameset',
'1_1.xhtml' => 'XHTML - 1.1'
HTML_TEMPLATES = {
'strict.html' => t(:html_4_strict),
'transitional.html' => t(:html_4_transitional),
'strict_1_0.xhtml' => t(:xhtml_1_strict),
'transitional_1_0.xhtml' => t(:xhtml_1_transitional),
'frameset_1_0.xhtml' => t(:xhtml_1_frameset),
'1_1.xhtml' => t(:xhtml_11)
} unless defined?(HTML_TEMPLATES)

HTML_TEMPLATES.each do |filename, name|
filetypes = ["*.html"]
filetypes << "*.xhtml" if filename.end_with? ".xhtml"
filetypes.each do |filetype|
template(name + " Template (#{filetype})") do |t|
template t(:html_file_template_name, :name => name, :filetype => filetype) do |t|
t.filetype = filetype
t.location = "templates/#{filename}"
end
end
end

template("HTML 5 Template") do |t|
template t(:html5_file_template_name) do |t|
t.filetype = "*.html"
t.location = "templates/html5.html"
end

0 comments on commit 208d1e0

Please sign in to comment.