code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
module ActiveScaffold::Actions
module ConfigList
def self.included(base)
#base.verify :method => :post,
# :only => :config_list,
# :redirect_to => { :action => :index }
base.before_filter :exclude_columns
base.before_filter :exclude_config_... | Ruby |
# Include hook code here
ActiveScaffold rescue throw "should have included ActiveScaffold plug in first. Please make sure that this plug-in comes alphabetically after the ActiveScaffold plug-in"
$:.unshift(File.dirname(__FILE__))
Kernel::load 'lib/pluginfactory.rb'
Kernel::load 'lib/actions/list_filter.rb'
Kernel:... | Ruby |
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the active_scaffold_filters plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentation for the active... | Ruby |
# desc "Explaining what the task does"
# task :active_scaffold_filters do
# # Task goes here
# end | Ruby |
# Uninstall hook code here
| Ruby |
# Workaround a problem with script/plugin and http-based repos.
# See http://dev.rubyonrails.org/ticket/8189
Dir.chdir(Dir.getwd.sub(/vendor.*/, '')) do
##
## Copy over asset files (javascript/css/images) from the plugin directory to public/
##
def copy_files(source_path, destination_path, directory)
source, de... | Ruby |
module ActiveScaffold::Config
class Core
# configures where the active_scaffold_list_filter plugin itself is located. there is no instance version of this.
cattr_accessor :list_filter_plugin_directory
@@list_filter_plugin_directory = File.expand_path(__FILE__).match(/vendor\/plugins\/([^\/]*)/)[1]
# ... | Ruby |
module ActiveScaffold::Config
class ListFilter < Base
self.crud_type = :read
def initialize(core_config)
@core = core_config
#puts @core.columns.inspect
# originates here
@list_filters = ActiveScaffold::DataStructures::ListFilters.new()
end
# global level configuration
... | Ruby |
module ActiveScaffold
module Helpers
module ViewHelpers
# Add the export plugin includes
def active_scaffold_includes_with_list_filter(frontend = :default)
css = stylesheet_link_tag(ActiveScaffold::Config::Core.asset_path('list_filter-stylesheet.css', frontend))
ie_css = stylesheet_lin... | Ruby |
module ActiveScaffold
module Helpers
# A bunch of helper methods to produce the common view ids
module Ids
def list_filter_form_id
"#{controller_id}-list_filter-form"
end
def list_filter_input_id(filter)
"#{controller_id}-list_filter-input[#{filter.filter_type}][#{filter.name}]"
... | Ruby |
module ActiveScaffold::Actions
module ListFilter
def self.included(base)
base.before_filter :list_filter_authorized?, :only => [:list_filter]
base.before_filter :init_filter_session_var
base.before_filter :do_list_filter
end
def init_filter_session_var
if !params["list_filter"].nil?... | Ruby |
#!/usr/bin/env ruby -w
#
# This module contains the PluginFactory mixin. Including PluginFactory in your
# class turns it into a factory for its derivatives, capable of searching for
# and loading them by name. This is useful when you have an abstract base class
# which defines an interface and basic functionality for ... | Ruby |
class Association < ActiveScaffold::DataStructures::ListFilter
# Return a list of conditions based on the params
def conditions(params)
association = association_tree[association_tree.size - 1]
column = [association.active_record.table_name, association.primary_key_name].join('.')
return ["#{column} IN (?)", ... | Ruby |
#!/usr/bin/env ruby -w
#
# This module contains the PluginFactory mixin. Including PluginFactory in your
# class turns it into a factory for its derivatives, capable of searching for
# and loading them by name. This is useful when you have an abstract base class
# which defines an interface and basic functionality for ... | Ruby |
require "pluginfactory"
module ActiveScaffold::DataStructures
class ListFilter
include PluginFactory
include ActiveScaffold::Configurable
def self::derivativeDirs
[File.dirname(__FILE__) + "/../list_filters"]
end
# provides a quick way to set any property of the object from a hash
de... | Ruby |
module ActiveScaffold::DataStructures
class ListFilters < Set
def initialize
@set = []
@columns = {}
end
# adds an ListFilter, creating one from the arguments if need be
def add(filter_type, filter_name, columns, options = {})
filter = ActiveScaffold::DataStructures::ListFilter::create(... | Ruby |
require 'rake'
require 'rake/packagetask'
ACTIVE_SUPPORT_ROOT = File.expand_path(File.dirname(__FILE__))
ACTIVE_SUPPORT_SRC_DIR = File.join(ACTIVE_SUPPORT_ROOT, 'src')
ACTIVE_SUPPORT_DIST_DIR = File.join(ACTIVE_SUPPORT_ROOT, 'dist')
ACTIVE_SUPPORT_VERSION = '0.1'
task :default => [:dist, :package, :clean_packag... | Ruby |
require 'erb'
class String
def lines
split $/
end
def strip_whitespace_at_line_ends
lines.map {|line| line.gsub(/\s+$/, '')} * $/
end
end
module Protodoc
module Environment
def include(*filenames)
filenames.map {|filename| Preprocessor.new(filename).to_s}.join("\n")
end
end
c... | Ruby |
require 'rake'
require 'rake/packagetask'
ACTIVE_SUPPORT_ROOT = File.expand_path(File.dirname(__FILE__))
ACTIVE_SUPPORT_SRC_DIR = File.join(ACTIVE_SUPPORT_ROOT, 'src')
ACTIVE_SUPPORT_DIST_DIR = File.join(ACTIVE_SUPPORT_ROOT, 'dist')
ACTIVE_SUPPORT_VERSION = '0.1'
task :default => [:dist, :package, :clean_packag... | Ruby |
require 'erb'
class String
def lines
split $/
end
def strip_whitespace_at_line_ends
lines.map {|line| line.gsub(/\s+$/, '')} * $/
end
end
module Protodoc
module Environment
def include(*filenames)
filenames.map {|filename| Preprocessor.new(filename).to_s}.join("\n")
end
end
c... | Ruby |
# Nothing to do here yet
| Ruby |
##
## Initialize the environment
##
require File.dirname(__FILE__) + '/environment'
##
## Run the install script, too, just to make sure
##
require File.dirname(__FILE__) + '/install'
| Ruby |
# desc "Explaining what the task does"
# task :active_scaffold_localize do
# # Task goes here
# end | Ruby |
ActiveScaffold::Localization.define('fr-fr') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Ajouter des données existantes'
lang['Are you sure?'] ||= 'Est-ce vraiment ce que vous voulez?'
lang['Cancel'] ||= 'Annuler'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Fermer'
lang['Cre... | Ruby |
ActiveScaffold::Localization.define('ru-ru') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Вы уверены?'
lang['Cancel'] ||= 'Отмена'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Создать'
lang['Create %s'] ... | Ruby |
ActiveScaffold::Localization.define('nb-no') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Er du sikker?'
lang['Cancel'] ||= 'Avbryt'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Opprett'
lang['Create %s'] ||... | Ruby |
ActiveScaffold::Localization.define('it-it') do |lang|
lang['Add'] ||= 'Aggiungi'
lang['Add Existing'] ||= 'Aggiungi esistente'
lang['Are you sure?'] ||= 'Sei sicuro?'
lang['Cancel'] ||= 'Annulla'
lang['Click to edit'] ||= 'Click per modificare'
lang['Close'] ||= 'Chiudi'
lang['Create'] ||= 'Crea'
lang[... | Ruby |
ActiveScaffold::Localization.define('es-ar') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= '¿Está seguro?'
lang['Cancel'] ||= 'Cancelar'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Crear'
lang['Create %s'] ... | Ruby |
ActiveScaffold::Localization.define('nl-nl') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Weet u het zeker?'
lang['Cancel'] ||= 'Annuleren'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Toevoegen'
lang['C... | Ruby |
ActiveScaffold::Localization.define('es-gt') do |lang|
lang['Add'] ||= 'Agregar'
lang['Add Existing'] ||= 'Agregar existente'
lang['Are you sure?'] ||= '¿Está seguro?'
lang['Cancel'] ||= 'Cancelar'
lang['Click to edit'] ||= 'Clic para editar'
lang['Close'] ||= 'Cerrar'
lang['Create'] ||= 'Crear'
lang['C... | Ruby |
ActiveScaffold::Localization.define('sl-sl') do |lang|
lang['Add'] ||= 'Dodaj'
lang['Add Existing'] ||= 'Dodaj obstoječe'
lang['Are you sure?'] ||= 'Ali ste prepričani?'
lang['Cancel'] ||= 'Prekliči'
lang['Click to edit'] ||= 'Kliknite za urejanje'
lang['Close'] ||= 'Zapri'
lang['Create'] ||= 'Ustvari'
... | Ruby |
ActiveScaffold::Localization.define('ro-ro') do |lang|
lang['Add'] ||= 'Adauga'
lang['Add Existing'] ||= 'Adauga din lista'
lang['Are you sure?'] ||= 'Sunteti sigur?'
lang['Cancel'] ||= 'Anulare'
lang['Click to edit'] ||= 'Click pentru editare'
lang['Close'] ||= 'Inchide'
lang['Create'] ||= 'Creare'
lan... | Ruby |
ActiveScaffold::Localization.define('de-de') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Neu'
lang['Are you sure?'] ||= 'Sind Sie sicher?'
lang['Cancel'] ||= 'Abbrechen'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Speichern'
lang['Create %s'] ||=... | Ruby |
ActiveScaffold::Localization.define('es-pa') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Agregar existente'
lang['Are you sure?'] ||= '¿Esta seguro(a)?'
lang['Cancel'] ||= 'Cancelar'
lang['Click to edit'] ||= 'Haga clic para editar'
lang['Close'] ||= 'Cerrar'
lang['Create'] ||= 'Crear'
lan... | Ruby |
ActiveScaffold::Localization.define('he-he') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= '? האם אתה בטוח'
lang['Cancel'] ||= 'בטל'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'צור'
lang['Create %s'] ||= 'Cre... | Ruby |
ActiveScaffold::Localization.define('fr-ca') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Ajouter des données existantes'
lang['Are you sure?'] ||= 'Est-ce vraiment ce que vous voulez?'
lang['Cancel'] ||= 'Annuler'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Fermer'
lang['Cre... | Ruby |
ActiveScaffold::Localization.define('bg-bg') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Сигурни ли сте?'
lang['Cancel'] ||= 'Откажи'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Създай'
lang['Create %s... | Ruby |
ActiveScaffold::Localization.define('tr-tr') do |lang|
lang['Add'] ||= 'Ekle'
lang['Add Existing'] ||= 'Var olanı ekle'
lang['Are you sure?'] ||= 'Emin misin?'
lang['Cancel'] ||= 'İptal'
lang['Click to edit'] ||= 'Düzenlemek için tıkla'
lang['Close'] ||= 'Kapat'
lang['Create'] ||= 'Oluştur'
lang['Create... | Ruby |
ActiveScaffold::Localization.define('pt-br') do |lang|
lang['Add'] ||= 'Adicionar'
lang['Add Existing'] ||= 'Adicionar existente'
lang['Are you sure?'] ||= 'Tem certeza?'
lang['Cancel'] ||= 'Cancelar'
lang['Click to edit'] ||= 'Clique para editar'
lang['Close'] ||= 'Fechar'
lang['Create'] ||= 'Criar'
... | Ruby |
ActiveScaffold::Localization.define('en-us') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Are you sure?'
lang['Cancel'] ||= 'Cancel'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Create'
lang['Create %s'] ||=... | Ruby |
ActiveScaffold::Localization.define('es-es') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Esta seguro?'
lang['Cancel'] ||= 'Cancelar'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Crear'
lang['Create %s'] ||=... | Ruby |
ActiveScaffold::Localization.define('da-dk') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Tilføj fra eksisterende'
lang['Are you sure?'] ||= 'Er du sikker?'
lang['Cancel'] ||= 'Annuller'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Ny'
lang[... | Ruby |
ActiveScaffold::Localization.define('en-us') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Are you sure?'
lang['Cancel'] ||= 'Cancel'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Create'
lang['Create %s'] ||=... | Ruby |
ActiveScaffold::Localization.define('sv-sv') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Lägg till från befintlig'
lang['Are you sure?'] ||= 'Är du säker?'
lang['Cancel'] ||= 'Avbryt'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= ... | Ruby |
require "#{File.dirname __FILE__}/lib/localization"
require "#{File.dirname __FILE__}/lib/extensions/active_record"
require "#{File.dirname __FILE__}/lib/extensions/form_options_helper"
require "#{File.dirname __FILE__}/lib/helpers/list_column_helpers"
##
## Preload lang files
##
ACTIVE_SCAFFOLD_LANG_OPTIONS = []
Dir[... | Ruby |
# Uninstall hook code here
| Ruby |
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the active_scaffold_localize plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentation for the activ... | Ruby |
module ActiveScaffold
module Helpers
# Helpers that assist with the rendering of a List Column
module ListColumns
def format_time(time)
time.localize
end
def format_date(date)
date.localize
end
end
end
end
| Ruby |
module ActiveRecord # :nodoc:
# Handle errors with pluralization correctly. This is similar to the Globalize plugin method.
# Validation happens to early to do anything short of this - it occurs before before_filter grrr.
# Messages are translated after the column names have been substituted.
class Errors
... | Ruby |
module ActionView
module Helpers
module FormOptionsHelper
def country_options_for_select(selected = nil, priority_countries = nil)
country_options = ""
if priority_countries
country_options += options_for_select(priority_countries, selected)
country_options += "<o... | Ruby |
module ActiveScaffold
module Localization
def self.lang
Thread.current[:active_scaffold_lang] ||= @@lang
end
def self.lang=(value)
Thread.current[:active_scaffold_lang] = value
end
@@l10s = { 'en-us' => {} }
@@lang = 'en-us'
def self._(string_to_localize, *args)
unless... | Ruby |
# Nothing to do here yet
| Ruby |
##
## Initialize the environment
##
require File.dirname(__FILE__) + '/environment'
##
## Run the install script, too, just to make sure
##
require File.dirname(__FILE__) + '/install'
| Ruby |
# desc "Explaining what the task does"
# task :active_scaffold_localize do
# # Task goes here
# end | Ruby |
ActiveScaffold::Localization.define('fr-fr') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Ajouter des données existantes'
lang['Are you sure?'] ||= 'Est-ce vraiment ce que vous voulez?'
lang['Cancel'] ||= 'Annuler'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Fermer'
lang['Cre... | Ruby |
ActiveScaffold::Localization.define('ru-ru') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Вы уверены?'
lang['Cancel'] ||= 'Отмена'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Создать'
lang['Create %s'] ... | Ruby |
ActiveScaffold::Localization.define('nb-no') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Er du sikker?'
lang['Cancel'] ||= 'Avbryt'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Opprett'
lang['Create %s'] ||... | Ruby |
ActiveScaffold::Localization.define('it-it') do |lang|
lang['Add'] ||= 'Aggiungi'
lang['Add Existing'] ||= 'Aggiungi esistente'
lang['Are you sure?'] ||= 'Sei sicuro?'
lang['Cancel'] ||= 'Annulla'
lang['Click to edit'] ||= 'Click per modificare'
lang['Close'] ||= 'Chiudi'
lang['Create'] ||= 'Crea'
lang[... | Ruby |
ActiveScaffold::Localization.define('es-ar') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= '¿Está seguro?'
lang['Cancel'] ||= 'Cancelar'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Crear'
lang['Create %s'] ... | Ruby |
ActiveScaffold::Localization.define('nl-nl') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Weet u het zeker?'
lang['Cancel'] ||= 'Annuleren'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Toevoegen'
lang['C... | Ruby |
ActiveScaffold::Localization.define('sl-sl') do |lang|
lang['Add'] ||= 'Dodaj'
lang['Add Existing'] ||= 'Dodaj obstoječe'
lang['Add From Existing'] ||= 'Dodaj obstoječe'
lang['Are you sure?'] ||= 'Ali ste prepričani?'
lang['Cancel'] ||= 'Prekliči'
lang['Click to edit'] ||= 'Kliknite za urejanje'
lang['Clo... | Ruby |
ActiveScaffold::Localization.define('de-de') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Neu'
lang['Are you sure?'] ||= 'Sind Sie sicher?'
lang['Cancel'] ||= 'Abbrechen'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Speichern'
lang['Create %s'] ||=... | Ruby |
ActiveScaffold::Localization.define('es-pa') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Agregar existente'
lang['Are you sure?'] ||= '¿Esta seguro(a)?'
lang['Cancel'] ||= 'Cancelar'
lang['Click to edit'] ||= 'Haga clic para editar'
lang['Close'] ||= 'Cerrar'
lang['Create'] ||= 'Crear'
lan... | Ruby |
ActiveScaffold::Localization.define('he-he') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= '? האם אתה בטוח'
lang['Cancel'] ||= 'בטל'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'צור'
lang['Create %s'] ||= 'Cre... | Ruby |
ActiveScaffold::Localization.define('fr-ca') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Ajouter des données existantes'
lang['Are you sure?'] ||= 'Est-ce vraiment ce que vous voulez?'
lang['Cancel'] ||= 'Annuler'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Fermer'
lang['Cre... | Ruby |
ActiveScaffold::Localization.define('bg-bg') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Сигурни ли сте?'
lang['Cancel'] ||= 'Откажи'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Създай'
lang['Create %s... | Ruby |
ActiveScaffold::Localization.define('tr-tr') do |lang|
lang['Add'] ||= 'Ekle'
lang['Add Existing'] ||= 'Var olanı ekle'
lang['Are you sure?'] ||= 'Emin misin?'
lang['Cancel'] ||= 'İptal'
lang['Click to edit'] ||= 'Düzenlemek için tıkla'
lang['Close'] ||= 'Kapat'
lang['Create'] ||= 'Oluştur'
lang['Create... | Ruby |
ActiveScaffold::Localization.define('pt-br') do |lang|
lang['Add'] ||= 'Adicionar'
lang['Add Existing'] ||= 'Adicionar existente'
lang['Are you sure?'] ||= 'Tem certeza?'
lang['Cancel'] ||= 'Cancelar'
lang['Click to edit'] ||= 'Clique para editar'
lang['Close'] ||= 'Fechar'
lang['Create'] ||= 'Criar'
... | Ruby |
ActiveScaffold::Localization.define('en-us') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Are you sure?'
lang['Cancel'] ||= 'Cancel'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Create'
lang['Create %s'] ||=... | Ruby |
ActiveScaffold::Localization.define('es-es') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Add Existing'
lang['Are you sure?'] ||= 'Esta seguro?'
lang['Cancel'] ||= 'Cancelar'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Crear'
lang['Create %s'] ||=... | Ruby |
ActiveScaffold::Localization.define('da-dk') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Tilføj fra eksisterende'
lang['Are you sure?'] ||= 'Er du sikker?'
lang['Cancel'] ||= 'Annuller'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= 'Ny'
lang[... | Ruby |
ActiveScaffold::Localization.define('sv-sv') do |lang|
lang['Add'] ||= 'Add'
lang['Add Existing'] ||= 'Lägg till från befintlig'
lang['Are you sure?'] ||= 'Är du säker?'
lang['Cancel'] ||= 'Avbryt'
lang['Click to edit'] ||= 'Click to edit'
lang['Close'] ||= 'Close'
lang['Create'] ||= ... | Ruby |
require 'localization'
require "#{File.dirname __FILE__}/lib/extensions/active_record"
require "#{File.dirname __FILE__}/lib/extensions/form_options_helper"
require "#{File.dirname __FILE__}/lib/helpers/list_column_helpers"
##
## Preload lang files
##
ACTIVE_SCAFFOLD_LANG_OPTIONS = []
Dir["#{File.dirname __FILE__}/la... | Ruby |
# Uninstall hook code here
| Ruby |
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the active_scaffold_localize plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentation for the activ... | Ruby |
module ActiveScaffold
module Helpers
# Helpers that assist with the rendering of a List Column
module ListColumns
def format_time(time)
time.localize
end
def format_date(date)
date.localize
end
end
end
end
| Ruby |
module ActiveRecord # :nodoc:
# Handle errors with pluralization correctly. This is similar to the Globalize plugin method.
# Validation happens to early to do anything short of this - it occurs before before_filter grrr.
# Messages are translated after the column names have been substituted.
class Errors
... | Ruby |
module ActionView
module Helpers
module FormOptionsHelper
def country_options_for_select(selected = nil, priority_countries = nil)
country_options = ""
if priority_countries
country_options += options_for_select(priority_countries, selected)
country_options += "<o... | Ruby |
module ActiveScaffold
module Localization
def self.lang
Thread.current[:active_scaffold_lang] ||= @@lang
end
def self.lang=(value)
Thread.current[:active_scaffold_lang] = value
end
@@l10s = { 'en-us' => {} }
@@lang = 'en-us'
def self._(string_to_localize, *args)
unless... | Ruby |
# Nothing to do here yet
| Ruby |
##
## Initialize the environment
##
require File.dirname(__FILE__) + '/environment'
##
## Run the install script, too, just to make sure
##
require File.dirname(__FILE__) + '/install'
| Ruby |
# desc "Explaining what the task does"
# task :active_scaffold_localize do
# # Task goes here
# end | Ruby |
ActiveScaffold::Localization.define('fr-ca') do |lang|
lang['Add From Existing'] ||= 'Add From Existing'
lang['Are you sure?'] ||= 'Êtes-vous sûr?'
lang['Cancel'] ||= 'Annuler'
lang['Create'] ||= 'Créer'
lang['Create %s'] ||= 'Create %s'
lang['Create Another'] ||= 'Create Another'
lang['Created %s'] ||= ... | Ruby |
ActiveScaffold::Localization.define('ru-ru') do |lang|
lang['Are you sure?'] ||= 'Вы уверены?'
lang['Cancel'] ||= 'Отмена'
lang['Create'] ||= 'Создать'
lang['Create New'] ||= 'Новая запись'
lang['Delete'] ||= 'Удалить'
lang['Edit'] ||= 'Изменить'
lang['Next'] ||= 'Следующая'
lang['No Entries'] |... | Ruby |
ActiveScaffold::Localization.define('it-it') do |lang|
lang['Are you sure?'] ||= 'Sei sicuro?'
lang['CANCEL'] ||= 'Annulla'
lang['CREATE'] ||= 'Crea'
lang['Created %s'] ||= 'Creato %s'
lang['Create New'] ||= 'Nuovo'
lang['DELETE'] ||= 'Elimina'
lang['Deleted %s'] ||= 'Eliminato %s'
lang['EDIT'] ||= 'Mo... | Ruby |
ActiveScaffold::Localization.define('es-ar') do |lang|
lang['Are you sure?'] ||= '¿Está seguro?'
lang['Cancel'] ||= 'Cancelar'
lang['Create'] ||= 'Crear'
lang['Create New'] ||= 'Crear Nuevo'
lang['Delete'] ||= 'Eliminar'
lang['Edit'] ||= 'Editar'
lang['Next'] ||= 'Siguiente'
lang['No Entries'] |... | Ruby |
ActiveScaffold::Localization.define('nl-nl') do |lang|
lang['Are you sure?'] ||= 'Weet u het zeker?'
lang['Cancel'] ||= 'Annuleren'
lang['Create'] ||= 'Toevoegen'
lang['Create %s'] ||= 'Toevoegen'
lang['Create New'] ||= 'Nieuw'
lang['Delete'] ||= 'Verwijderen'
lang['Edit'] ||= 'Bewerken'
lang['N... | Ruby |
ActiveScaffold::Localization.define('nb-no') do |lang|
lang['Are you sure?'] ||= 'Er du sikker?'
lang['Cancel'] ||= 'Avbryt'
lang['Create'] ||= 'Opprett'
lang['Create New'] ||= 'Opprett ny'
lang['Delete'] ||= 'Slett'
lang['Edit'] ||= 'Redigèr'
lang['Next'] ||= 'Neste'
lang['No Entries'] ||= 'Ingen oppfø... | Ruby |
ActiveScaffold::Localization.define('de-de') do |lang|
# Used to confirm an action. Presently used for Delete.
lang['Are you sure?'] ||= 'Sind Sie sicher?'
# For a cancel button
lang['Cancel'] ||= 'Abbrechen'
# For the submit button on Create forms
lang['Create'] ||= 'Speichern'
# For the header label ... | Ruby |
ActiveScaffold::Localization.define('he-he') do |lang|
lang['Are you sure?'] ||= '? האם אתה בטוח'
lang['Cancel'] ||= 'בטל'
lang['Create'] ||= 'צור'
lang['Create New'] ||= 'חדש'
lang['Delete'] ||= 'מחק'
lang['Edit'] ||= 'ערוך'
lang['Next'] ||= 'הבא'
lang['No Entries'] ||= 'לא נמצא'
lang['Previous'] ||=... | Ruby |
ActiveScaffold::Localization.define('fr-ca') do |lang|
lang['Add From Existing'] ||= 'Ajouter des données existantes'
lang['Are you sure?'] ||= 'Est-ce vraiment ce que vous voulez?'
lang['Cancel'] ||= 'Annuler'
lang['Close'] ||= 'Fermer'
lang['Create'] ||= 'Créer'
lang['Created %s'] ||= '%s créé'
la... | Ruby |
ActiveScaffold::Localization.define('bg-bg') do |lang|
lang['Are you sure?'] ||= 'Сигурни ли сте?'
lang['Cancel'] ||= 'Откажи'
lang['Create'] ||= 'Създай'
lang['Create New'] ||= 'Нов Запис'
lang['Delete'] ||= 'Изтрий'
lang['Edit'] ||= 'Промени'
lang['Next'] ||= 'Следващ'
lang['No Entries'] ||= '... | Ruby |
ActiveScaffold::Localization.define('en-us') do |lang|
# The link for
lang['Add From Existing'] ||= 'Add From Existing'
# Used to confirm an action. Presently used for Delete. - ARE_YOU_SURE
lang['Are you sure?'] ||= 'Are you sure?'
# For a cancel button - CANCEL_BUTTON
lang['Cancel'] ||= 'Cancel'
lang... | Ruby |
ActiveScaffold::Localization.define('es-es') do |lang|
lang['Are you sure?'] ||= 'Esta seguro?'
lang['CANCEL'] ||= 'Cancelar'
lang['Create'] ||= 'Crear'
lang['Created %s'] ||= 'Creado %s'
lang['Create New'] ||= 'Nuevo'
lang['DELETE'] ||= 'Borrar'
lang['Deleted %s'] ||= 'Borrado %s'
lang['EDIT'] ||= 'Mo... | Ruby |
ActiveScaffold::Localization.define('da-dk') do |lang|
# Used to confirm an action. Presently used for Delete.
lang['Are you sure?'] ||= 'Er du sikker?'
# For a cancel button
lang['Cancel'] ||= 'Annuller'
# For the submit button on Create forms
lang['Create'] ||= 'Ny'
# For the header label on Create f... | Ruby |
ActiveScaffold::Localization.define('sv-sv') do |lang|
# Used to confirm an action. Presently used for Delete.
lang['Are you sure?'] ||= 'Är du säker?'
# For a cancel button
lang['Cancel'] ||= 'Avbryt'
# For the submit button on Create forms
lang['Create'] ||= 'Skapa'
# For the header label o... | Ruby |
require 'localization'
require "#{File.dirname __FILE__}/lib/extensions/active_record"
require "#{File.dirname __FILE__}/lib/extensions/action_view"
##
## Preload lang files
##
ACTIVE_SCAFFOLD_LANG_OPTIONS = []
Dir["#{File.dirname __FILE__}/lang/*.rb"].each {|file|
ACTIVE_SCAFFOLD_LANG_OPTIONS << File.split(file)[... | Ruby |
# Uninstall hook code here
| Ruby |
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the active_scaffold_localize plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentation for the activ... | Ruby |
module ActiveRecord
class Errors
#TODO 2007-04-25 (EJM) Level=0 - Translate Rails error_messages the get_text way
def as_full_messages(config)
@as_config = config
full_messages = []
@errors.each_key do |attr|
@errors[attr].each do |msg|
next if msg.nil?
if ... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.