Permalink
Browse files

Initial addition of code to include translation feature

  • Loading branch information...
marvinbarretto committed Jul 7, 2011
1 parent a03b94a commit 599e24eda4378a2724d63c98d50c68851983cb23
Showing with 39 additions and 9 deletions.
  1. +19 −6 app/views/plaques/show.html.erb
  2. +20 −3 public/stylesheets/v1.css
@@ -3,12 +3,25 @@
<% @page_title = title(@plaque) %>
<div class="panel clearfix">
-
-<%=
- plaque_class = @plaque.inscription.length > 250 ? "large_inscription" : "inscription"
- content_tag("h1", new_linked_inscription(@plaque), {:class => plaque_class, :property => "op:inscription"})
-%>
-
+ <% foreign = true if @plaque.language_id != 1 %>
+ <% if foreign = true %><div class="goog-trans-section" lang="es"><% end %>
+ <%=
+ plaque_class = @plaque.inscription.length > 250 ? "large_inscription" : "inscription"
+ content_tag("h1", new_linked_inscription(@plaque), {:class => plaque_class, :property => "op:inscription"})
+ %>
+ <% if foreign = true %><div class="goog-trans-control"></div>
+ </div>
+ <script>
+ function googleSectionalElementInit() {
+ new google.translate.SectionalElement({
+ sectionalNodeClassName: 'goog-trans-section',
+ controlNodeClassName: 'goog-trans-control',
+ background: '#f4fa58'
+ }, 'google_sectional_element');
+ }
+ </script>
+ <script src="http://translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=en"></script>
+ <% end %>
</div>
<div class="panel clearfix">
View
@@ -299,13 +299,14 @@ a.secondary_button:hover, div.secondary_button:hover input {
margin-bottom: 16px;
}
-
-
-
/**
3. PLAQUE PAGE
*/
+/*
+ 3.1 Inscriptions
+*/
+
h1.inscription,
h1.large_inscription {
text-align: center;
@@ -322,6 +323,22 @@ h1.large_inscription a {
border-bottom: dotted 1px;
}
+.goog-te-gadget-link {
+ display: block;
+ margin: 0 auto;
+}
+
+.goog-te-sectional-gadget-checkbox-text,
+.goog-te-sectional-gadget-link-text {
+ display: block;
+ font-weight: normal !important; /* Overriding Google's CSS */
+ margin: 0 auto;
+ text-align: center;
+}
+
+/***/
+
+
#plaque_number {
display: block;
margin: 0 auto;

0 comments on commit 599e24e

Please sign in to comment.