Permalink
Browse files

rename to translator

  • Loading branch information...
1 parent 323380f commit 6905df0334d9f91980a053184bd70ac8068b3cc0 @hubertlepicki hubertlepicki committed Mar 12, 2011
View
@@ -1,6 +1,6 @@
source "http://rubygems.org"
-gem "rails", "3.0.1"
+gem "rails", "3.0.5"
gem "mongo", "1.1"
gem "bson_ext", ">=1.0.5"
View
@@ -1,44 +1,43 @@
GIT
remote: git://github.com/cavalle/steak.git
- revision: 86331782937ee379e14e02a0d313774a0391dab4
+ revision: 36a26d1f87a537a8e504aad72d3f628badcfce46
specs:
- steak (1.0.0.beta.2)
- rspec
+ steak (1.1.0)
+ rspec (>= 1.3)
GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
- actionmailer (3.0.1)
- actionpack (= 3.0.1)
- mail (~> 2.2.5)
- actionpack (3.0.1)
- activemodel (= 3.0.1)
- activesupport (= 3.0.1)
+ actionmailer (3.0.5)
+ actionpack (= 3.0.5)
+ mail (~> 2.2.15)
+ actionpack (3.0.5)
+ activemodel (= 3.0.5)
+ activesupport (= 3.0.5)
builder (~> 2.1.2)
erubis (~> 2.6.6)
- i18n (~> 0.4.1)
+ i18n (~> 0.4)
rack (~> 1.2.1)
- rack-mount (~> 0.6.12)
- rack-test (~> 0.5.4)
+ rack-mount (~> 0.6.13)
+ rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
- activemodel (3.0.1)
- activesupport (= 3.0.1)
+ activemodel (3.0.5)
+ activesupport (= 3.0.5)
builder (~> 2.1.2)
- i18n (~> 0.4.1)
- activerecord (3.0.1)
- activemodel (= 3.0.1)
- activesupport (= 3.0.1)
- arel (~> 1.0.0)
+ i18n (~> 0.4)
+ activerecord (3.0.5)
+ activemodel (= 3.0.5)
+ activesupport (= 3.0.5)
+ arel (~> 2.0.2)
tzinfo (~> 0.3.23)
- activeresource (3.0.1)
- activemodel (= 3.0.1)
- activesupport (= 3.0.1)
- activesupport (3.0.1)
- arel (1.0.1)
- activesupport (~> 3.0.0)
- bson (1.1)
- bson_ext (1.1)
+ activeresource (3.0.5)
+ activemodel (= 3.0.5)
+ activesupport (= 3.0.5)
+ activesupport (3.0.5)
+ arel (2.0.9)
+ bson (1.2.4)
+ bson_ext (1.2.4)
builder (2.1.2)
capybara (0.3.9)
culerity (>= 0.2.4)
@@ -48,7 +47,9 @@ GEM
rack-test (>= 0.5.4)
selenium-webdriver (>= 0.0.3)
cgi_multipart_eof_fix (2.5.0)
- culerity (0.2.12)
+ childprocess (0.1.7)
+ ffi (~> 0.6.3)
+ culerity (0.2.15)
daemons (1.0.10)
diff-lcs (1.1.2)
erubis (2.6.6)
@@ -57,38 +58,39 @@ GEM
ffi (0.6.3)
rake (>= 0.8.7)
gem_plugin (0.2.3)
- i18n (0.4.2)
- json_pure (1.4.6)
- mail (2.2.7)
+ i18n (0.5.0)
+ json_pure (1.5.1)
+ mail (2.2.15)
activesupport (>= 2.3.6)
- mime-types
- treetop (>= 1.4.5)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
mime-types (1.16)
mongo (1.1)
bson (>= 1.0.5)
mongrel (1.2.0.pre2)
daemons (~> 1.0.10)
gem_plugin (~> 0.2.3)
- nokogiri (1.4.3.1)
+ nokogiri (1.4.4)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
- rails (3.0.1)
- actionmailer (= 3.0.1)
- actionpack (= 3.0.1)
- activerecord (= 3.0.1)
- activeresource (= 3.0.1)
- activesupport (= 3.0.1)
- bundler (~> 1.0.0)
- railties (= 3.0.1)
- railties (3.0.1)
- actionpack (= 3.0.1)
- activesupport (= 3.0.1)
- rake (>= 0.8.4)
- thor (~> 0.14.0)
+ rails (3.0.5)
+ actionmailer (= 3.0.5)
+ actionpack (= 3.0.5)
+ activerecord (= 3.0.5)
+ activeresource (= 3.0.5)
+ activesupport (= 3.0.5)
+ bundler (~> 1.0)
+ railties (= 3.0.5)
+ railties (3.0.5)
+ actionpack (= 3.0.5)
+ activesupport (= 3.0.5)
+ rake (>= 0.8.7)
+ thor (~> 0.14.4)
rake (0.8.7)
rspec (2.5.0)
rspec-core (~> 2.5.0)
@@ -104,13 +106,14 @@ GEM
railties (~> 3.0)
rspec (~> 2.5.0)
rubyzip (0.9.4)
- selenium-webdriver (0.0.28)
- ffi (>= 0.6.1)
+ selenium-webdriver (0.1.3)
+ childprocess (~> 0.1.5)
+ ffi (~> 0.6.3)
json_pure
rubyzip
thor (0.14.6)
timecop (0.3.5)
- treetop (1.4.8)
+ treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.24)
@@ -125,7 +128,7 @@ DEPENDENCIES
fastthread
mongo (= 1.1)
mongrel (= 1.2.0.pre2)
- rails (= 3.0.1)
+ rails (= 3.0.5)
rspec-rails
steak!
timecop (= 0.3.5)
View
@@ -12,13 +12,13 @@ task :default => :spec
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'GoTranslateYourself'
+ rdoc.title = 'Translator'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end
-spec = eval(File.read("go_translate_yourself.gemspec"))
+spec = eval(File.read("translator.gemspec"))
Rake::GemPackageTask.new(spec) do |pkg|
end
@@ -1,21 +1,21 @@
-module GoTranslateYourself
+module Translator
class SiteTranslationsController < ApplicationController
before_filter :auth
def edit
@translations = hash_class[
- *GoTranslateYourself.current_store.keys_without_prefix.collect do |key|
- [key, GoTranslateYourself.current_store.default_translation("dev.#{key}")]
+ *Translator.current_store.keys_without_prefix.collect do |key|
+ [key, Translator.current_store.default_translation("dev.#{key}")]
end.flatten
]
- @locales = GoTranslateYourself.locales
- render :layout => GoTranslateYourself.layout_name
+ @locales = Translator.locales
+ render :layout => Translator.layout_name
end
def update
if params[:translations] && !params[:translations].empty?
params[:translations].each do |key, value|
- GoTranslateYourself.current_store[key] = value
+ Translator.current_store[key] = value
end
end
redirect_to site_translations_path
@@ -24,7 +24,7 @@ def update
private
def auth
- GoTranslateYourself.auth_handler.bind(self).call if GoTranslateYourself.auth_handler.is_a? Proc
+ Translator.auth_handler.bind(self).call if Translator.auth_handler.is_a? Proc
end
def hash_class
@@ -1,12 +1,12 @@
-module GoTranslateYourself
+module Translator
module SiteTranslationsHelper
def translation_text_field(locale, key, default_translation)
options = { :size => (default_translation.size + 20),
:id => "translations_#{locale}_#{key}".gsub(/\./, '_') }
- options[:disabled] = "disabled" if GoTranslateYourself.current_store.default_translation?("#{locale}.#{key}")
+ options[:disabled] = "disabled" if Translator.current_store.default_translation?("#{locale}.#{key}")
text_field_tag("translations[#{locale}.#{key}]",
- ActiveSupport::JSON.decode(GoTranslateYourself.current_store["#{locale}.#{key}"] || ""),
+ ActiveSupport::JSON.decode(Translator.current_store["#{locale}.#{key}"] || ""),
options)
end
end
@@ -1,13 +1,13 @@
require 'yaml'
-module GoTranslateYourself
+module Translator
class BaseStore
def keys
if @keys.nil? || (Rails.env.development? && dev_translations_mtime != @mtime)
load_default_translations
- @keys = GoTranslateYourself.locales.collect {|lang| keys_without_prefix.collect {|key| "#{lang}.#{key}"} }.flatten
+ @keys = Translator.locales.collect {|lang| keys_without_prefix.collect {|key| "#{lang}.#{key}"} }.flatten
end
@keys
@@ -1,4 +1,4 @@
-module GoTranslateYourself
+module Translator
class MongoStore < BaseStore
def initialize(collection)
@collection = collection
View
@@ -1,4 +1,4 @@
Rails.application.routes.draw do
- match 'site_translations' => 'GoTranslateYourself::SiteTranslations#edit', :as => :site_translations, :method => :get
- match 'site_translations/save' => 'GoTranslateYourself::SiteTranslations#update', :as => :update_site_translations, :method => :post
+ match 'site_translations' => 'Translator::SiteTranslations#edit', :as => :site_translations, :method => :get
+ match 'site_translations/save' => 'Translator::SiteTranslations#update', :as => :update_site_translations, :method => :post
end
@@ -1,8 +0,0 @@
-require 'go_translate_yourself/engine' if defined?(Rails) && Rails::VERSION::MAJOR == 3
-
-module GoTranslateYourself
- class << self
- attr_accessor :layout_name, :locales, :auth_handler, :current_store
- end
-end
-
View
@@ -0,0 +1,8 @@
+require 'translator/engine' if defined?(Rails) && Rails::VERSION::MAJOR == 3
+
+module Translator
+ class << self
+ attr_accessor :layout_name, :locales, :auth_handler, :current_store
+ end
+end
+
@@ -1,4 +1,4 @@
-module GoTranslateYourself
+module Translator
class Engine < Rails::Engine
end
end
@@ -1,6 +1,6 @@
<html>
<head>
- <title>Testing site for GoTranslateYourself!</title>
+ <title>Testing site for Translator!</title>
</head>
<body>
<%= yield %>
@@ -5,7 +5,7 @@
require "action_mailer/railtie"
Bundler.require
-require "go_translate_yourself"
+require "translator"
module Dummy
class Application < Rails::Application
@@ -1,13 +0,0 @@
-conn = Mongo::Connection.new.db("go_translate_yourself_test").collection("translations")
-GoTranslateYourself.current_store = GoTranslateYourself::MongoStore.new(conn)
-GoTranslateYourself.locales = [:pl, :de]
-
-I18n.backend = I18n::Backend::KeyValue.new GoTranslateYourself.current_store
-
-#GoTranslateYourself.auth_handler = proc {
-# authenticate_or_request_with_http_basic do |user_name, password|
-# user_name == 'some' && password == 'user'
-# end
-#}
-
-GoTranslateYourself.layout_name = "dummy_admin"
@@ -0,0 +1,13 @@
+conn = Mongo::Connection.new.db("go_translate_yourself_test").collection("translations")
+Translator.current_store = Translator::MongoStore.new(conn)
+Translator.locales = [:pl, :de]
+
+I18n.backend = I18n::Backend::KeyValue.new Translator.current_store
+
+#Translator.auth_handler = proc {
+# authenticate_or_request_with_http_basic do |user_name, password|
+# user_name == 'some' && password == 'user'
+# end
+#}
+
+Translator.layout_name = "dummy_admin"
@@ -1,9 +1,9 @@
# encoding: UTF-8
require 'spec_helper'
-describe GoTranslateYourself::MongoStore do
+describe Translator::MongoStore do
before :each do
- @store = GoTranslateYourself.current_store
+ @store = Translator.current_store
@store.clear_database
end
@@ -1,14 +1,14 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = "go_translate_yourself"
- s.version = "0.0.6"
+ s.name = "translator"
+ s.version = "0.0.1"
s.platform = Gem::Platform::RUBY
s.authors = ["Hubert Łępicki"]
s.email = ["hubert.lepicki@amberbit.com"]
- s.homepage = "http://github.com/hubertlepicki/GoTranslateYourself"
+ s.homepage = "http://github.com/amberbit/translator"
s.summary = "Rails engine to manage translations"
- s.description = "GoTranslateYourself is engine, that you can easily integrate with your administration panel, and let your clients do the dirty work translating the site"
+ s.description = "translator is engine, that you can easily integrate with your administration panel, and let your clients do the dirty work translating the site"
s.required_rubygems_version = ">= 1.3.6"

0 comments on commit 6905df0

Please sign in to comment.