translation_center 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  ## Translation Center Status
2
2
  [![Code Climate](https://codeclimate.com/github/BadrIT/translation_center.png)](https://codeclimate.com/github/BadrIT/translation_center)
3
3
  [![Gem Version](https://badge.fury.io/rb/translation_center.png)](http://badge.fury.io/rb/translation_center)
4
+ [![Dependency Status](https://gemnasium.com/BadrIT/translation_center.png)](https://gemnasium.com/BadrIT/translation_center)
4
5
 
5
6
  ## Introduction
6
7
 
@@ -39,23 +39,6 @@ module TranslationCenter
39
39
  def show
40
40
  end
41
41
 
42
- # POST /translation_keys
43
- # POST /translation_keys.json
44
- def create
45
- @translation_key = TranslationKey.new(params[:translation_key])
46
- @translation_key.last_accessed = Time.now
47
- category = Category.find(params[:translation_key][:category_id])
48
- respond_to do |format|
49
- if @translation_key.save
50
- format.html { redirect_to @translation_key.category, notice: 'Translation key was successfully created.' }
51
- format.json { render json: @translation_key, status: :created, location: @translation_key }
52
- else
53
- format.html { redirect_to category, notice: 'Translation key must have a name.' }
54
- format.json { render json: @translation_key.errors, status: :unprocessable_entity }
55
- end
56
- end
57
- end
58
-
59
42
  # PUT /translation_keys/1
60
43
  # PUT /translation_keys/1.json
61
44
  def update
data/config/routes.rb CHANGED
@@ -7,7 +7,7 @@ TranslationCenter::Engine.routes.draw do
7
7
  post :unaccept
8
8
  end
9
9
 
10
- resources :translation_keys do
10
+ resources :translation_keys, except: :create do
11
11
  post :update_translation
12
12
  get :translations
13
13
  collection do
@@ -112,7 +112,11 @@ module TranslationCenter
112
112
  I18n.locale = locale
113
113
  puts "Started exporting translations in #{locale}"
114
114
  TranslationCenter::TranslationKey.translated(locale).each do |key|
115
- key.add_to_hash(result, locale)
115
+ begin
116
+ key.add_to_hash(result, locale)
117
+ rescue
118
+ puts "Error writing key: #{key.name} to yaml for #{locale}"
119
+ end
116
120
  end
117
121
  File.open("config/locales/#{locale.to_s}.yml", 'w') do |file|
118
122
  file.write({locale.to_s => result}.ya2yaml)
@@ -1,3 +1,3 @@
1
1
  module TranslationCenter
2
- VERSION = "1.4.0"
2
+ VERSION = "1.4.1"
3
3
  end