Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Change Output Text on page_entries_info
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Eric Gonzalez  
View profile  
 More options Nov 7 2012, 9:36 pm
From: Eric Gonzalez <mp.neos...@gmail.com>
Date: Wed, 7 Nov 2012 18:36:47 -0800 (PST)
Local: Wed, Nov 7 2012 9:36 pm
Subject: Change Output Text on page_entries_info

Hi there!! I have a question
is there a option to change the output of <% page_entries_info @muebles %>

default
Displaying Muebles *1 - 5* of *6* in total

What I need is to change into Spanish

Mostrando Muebles 1 - 5 de 6 en total

thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TuxmAL  
View profile  
 More options Dec 7 2012, 9:02 am
From: TuxmAL <tux...@gmail.com>
Date: Fri, 7 Dec 2012 06:02:59 -0800 (PST)
Local: Fri, Dec 7 2012 9:02 am
Subject: Re: Change Output Text on page_entries_info

Hi Eric,
yes, you can change the output not using *page_entries_info*, building
yourself an output similar to it in your own language.
To do that, in your view add this block instead of <% page_entries_info
@muebles %>
<div class="page_info">
    <%= custom_page_info(@muebles) %>
 </div>
 <%= will_paginate(@muebles, :container => false, :previous_label => "«
anterior", :next_label => "siguiente »")%>

Then define into your view helper file the custom_page_info method:

def custom_page_info(collection, options = {})
    entry_name = options[:entry_name] ||
      (collection.empty?? 'elemento' :
collection.first.class.name.underscore.sub('_', ' '))

    if collection.total_pages < 2
      case collection.size
      when 0; "Sin #{entry_name} encontrados."
      when 1; "Encontrado <b>1 solo</b> #{entry_name}"
      else;   "Encuentra <b> todas las #{collection.size}</b>
#{entry_name.pluralize}"
      end
    else
      %{#{entry_name.pluralize.capitalize} <b>%d&nbsp;-&nbsp;%d</b> de
<b>%d</b> en total.} % [
        collection.offset + 1,
        collection.offset + collection.length,
        collection.total_entries
      ]
    end
  end
Sorry for my poor spanish, hope it helps!
Antonio Liccardo

Il giorno giovedě 8 novembre 2012 03:36:47 UTC+1, Eric Gonzalez ha scritto:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »