From 28948c22d433e16438737d1287fd89227de29f15 Mon Sep 17 00:00:00 2001 From: Robert Stewart Date: Sun, 4 Nov 2012 18:58:45 -0800 Subject: [PATCH 1/2] First pass at updating localized strings for Oakland and storm drains. --- config/locales/de.yml | 24 ++++++++++++------------ config/locales/en.yml | 22 +++++++++++----------- config/locales/es.yml | 24 ++++++++++++------------ config/locales/fr.yml | 25 ++++++++++++------------- config/locales/pt.yml | 20 ++++++++++---------- 5 files changed, 57 insertions(+), 58 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 8029d53..829b907 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -22,19 +22,19 @@ de: required: "(erforderlich)" defaults: address: "Adresse" - address_1: "1 City Hall Plaza" - address_2: "Suite 500" - city: "Boston" - city_state: "Boston, Massachusetts" + address_1: "1 Frank H. Ogawa Plaza, Oakland, CA" + address_2: "" + city: "Oakland" + city_state: "Oakland, California" neighborhood: "Downtown" - sms_number: "857-555-1212" - state: "MA" - thing: "Hydranten" + sms_number: "510-555-1212" + state: "CA" + thing: "Gully" this_thing: "Dieser %{thing}" - tagline: "Claim Verantwortung für schaufeln ein Feuer Hydrant, nachdem es schneit." + tagline: "Claim Verantwortung für die Führung der %{thing} Eingang klar." tos: "Mit der Anmeldung erklären Sie sich mit den %{tos}." - voice_number: "617-555-1212" - zip: "02201-2013" + voice_number: "510-555-1212" + zip: "94612" errors: password: "Sie müssen sich einloggen oder registrieren, bevor Sie fortfahren." not_found: "Konnte nicht gefunden werden %{thing}." @@ -85,7 +85,7 @@ de: sponsors: built: "Erbaut in Boston" cfa: "Code für Amerika" - city: "City of Boston" + city: "City of Oakland" mayor: - name: "Thomas M. Menino" + name: "Jean Quan" title: "Mayor" diff --git a/config/locales/en.yml b/config/locales/en.yml index 4d293af..24c8465 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -22,19 +22,19 @@ en: required: "(required)" defaults: address: "address" - address_1: "530 South King St. Honolulu, HI" + address_1: "1 Frank H. Ogawa Plaza, Oakland, CA" address_2: "" - city: "Honolulu" - city_state: "Honolulu, Hawaii" + city: "Oakland" + city_state: "Oakland, California" neighborhood: "Downtown" - sms_number: "808-555-1212" - state: "HI" - thing: "siren" + sms_number: "510-555-1212" + state: "CA" + thing: "storm drain" this_thing: "This %{thing}" - tagline: "You agree to listen for the siren test and report any problems." + tagline: "Claim responsibility for clearing a storm drain entrance and reporting any problems." tos: "By signing up, you agree to the %{tos}." - voice_number: "808-555-1212" - zip: "96813" + voice_number: "510-555-1212" + zip: "94612" errors: password: "You need to sign in or sign up before continuing." not_found: "Could not find %{thing}." @@ -85,7 +85,7 @@ en: thanks_for_feedback: "Thanks for the feedback" sponsors: cfa: "Code for America" - city: "City and County of Honolulu" + city: "City of Oakland" mayor: - name: "Peter Carlisle" + name: "Jean Quan" title: "Mayor" diff --git a/config/locales/es.yml b/config/locales/es.yml index e0e0975..060a391 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -22,19 +22,19 @@ es: required: "(necesario)" defaults: address: "dirección" - address_1: "1 City Hall Plaza" - address_2: "Suite 500" - city: "Honolulu" - city_state: "Honolulu, Hawaii" + address_1: "1 Frank H. Ogawa Plaza, Oakland, CA" + address_2: "" + city: "Oakland" + city_state: "Oakland, California" neighborhood: "Downtown" - sms_number: "857-555-1212" - state: "HI" - thing: "boca de incendio" + sms_number: "510-555-1212" + state: "CA" + thing: "drenaje pluvial" this_thing: "Esta %{thing}" - tagline: "Reclamar la responsabilidad para palear un hidrante de incendios después de que las nieves." + tagline: "Reclamar la responsabilidad para limpiar la entrada drenaje pluvial." tos: "Al registrarse, usted está de acuerdo con los %{tos}." - voice_number: "617-555-1212" - zip: "96817" + voice_number: "510-555-1212" + zip: "94612" errors: password: "Es necesario iniciar sesión o registrarse antes de continuar." not_found: "No se pudo encontrar %{thing}." @@ -85,7 +85,7 @@ es: sponsors: built: "Construido en Boston" cfa: "Código de los Estados Unidos" - city: "Ciudad de Boston" + city: "Ciudad de Oakland" mayor: - name: "Thomas M. Menino" + name: "Jean Quan" title: "Mayor" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 3eb8a20..541fc7e 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -22,19 +22,19 @@ fr: required: "(nécessaire)" defaults: address: "Adresse" - address_1: "1 City Hall Plaza" - address_2: "Suite 500" - city: "Boston" - city_state: "Boston, Massachusetts" + address_1: "1 Frank H. Ogawa Plaza, Oakland, CA" + address_2: "" + city: "Oakland" + city_state: "Oakland, California" neighborhood: "Downtown" - sms_number: "857-555-1212" - state: "MA" - thing: "bouche d'incendie" + sms_number: "510-555-1212" + state: "CA" + thing: "collecteur d'eaux pluviales" this_thing: "Cette %{thing}" - tagline: "La responsabilité Réclamation pour pelleter une %{thing} le feu après qu'il neige." + tagline: "La responsabilité Réclamation de dégager une entrée d'eaux pluviales." tos: "En vous inscrivant, vous acceptez les %{tos}." - voice_number: "617-555-1212" - zip: "02201-2013" + voice_number: "510-555-1212" + zip: "94612" errors: password: "Vous devez vous identifier ou vous inscrire avant de continuer." not_found: "Impossible de trouver %{thing}." @@ -83,9 +83,8 @@ fr: thank_you: "Merci pour l'adoption de cette %{thing}!" tos: "Conditions d'utilisation" sponsors: - built: "Construit à Boston" cfa: "Code pour l'Amérique" - city: "Ville de Boston" + city: "Ville de Oakland" mayor: - name: "Thomas M. Menino" + name: "Jean Quan" title: "Mayor" diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 4720dbf..1e0dd62 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -22,19 +22,19 @@ pt: required: "(exigido)" defaults: address: "endereço" - address_1: "1 City Hall Plaza" - address_2: "Suite 500" - city: "Boston" - city_state: "Boston, Massachusetts" + address_1: "1 Frank H. Ogawa Plaza, Oakland, CA" + address_2: "" + city: "Oakland" + city_state: "Oakland, California" neighborhood: "Downtown" - sms_number: "857-555-1212" - state: "MA" + sms_number: "510-555-1212" + state: "CA" thing: "hidrante" this_thing: "Este %{thing}" tagline: "Responsabilidade pedido de pá para fora um %{thing} de incêndio depois que neva." tos: "Ao inscrever-se, você concorda com os %{tos}." - voice_number: "617-555-1212" - zip: "02201-2013" + voice_number: "510-555-1212" + zip: "94612" errors: password: "Você precisa fazer login ou inscreva-se antes de continuar." not_found: "Não foi possível encontrar %{thing}." @@ -85,7 +85,7 @@ pt: sponsors: built: "Construído em Boston" cfa: "Código para a América" - city: "Cidade de Boston" + city: "Cidade de Oakland" mayor: - name: "Thomas M. Menino" + name: "Jean Quan" title: "Mayor" From 91d4c14cb8ffb71e0edb1d9c4ce3f0d59af25b01 Mon Sep 17 00:00:00 2001 From: Robert Stewart Date: Sun, 4 Nov 2012 20:36:22 -0800 Subject: [PATCH 2/2] Parameterized the DB limit on retrieving "things". --- app/controllers/things_controller.rb | 2 +- config/application.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/things_controller.rb b/app/controllers/things_controller.rb index a01b282..514f309 100644 --- a/app/controllers/things_controller.rb +++ b/app/controllers/things_controller.rb @@ -2,7 +2,7 @@ class ThingsController < ApplicationController respond_to :json def show - @things = Thing.limit(1000) + @things = Thing.limit(Rails.application.config.things_limit) unless @things.blank? for t in @things diff --git a/config/application.rb b/config/application.rb index 64289ac..743678d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -56,5 +56,8 @@ class Application < Rails::Application # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' + + # Limit on number of things to be returned from the database + config.things_limit = 10 end end