phrase 0.4.31 → 0.4.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf0b86279fd6eb155d420c6f6e1eb484721f89f5
4
- data.tar.gz: 4ab2fdd122f8a275df89fb76f020a48772cb631c
3
+ metadata.gz: f3c29d841e3576113329401e0d8d5dcd53ec48be
4
+ data.tar.gz: f5e08aad1c332ca72036066e7b1d61fefb56653b
5
5
  SHA512:
6
- metadata.gz: 169aeda0534c724f894cbbd03f6e08292da3e96fa3f9f1aee4bfa7c900e1098330a577b9383606b632f9988d5992189bda3b28d5035cfc2de5c95eacfc2c7b0f
7
- data.tar.gz: 457868e5efae4cf27f2e3e240776b5b5e224f3f1e834447c4200926deee552cecb1c3334b4f20a3f85b7f17c14c292dc4b9e247f3f1d649731d9e49e61c92459
6
+ metadata.gz: 1978b651d3db74749be389c8357c83fa239382fff0ebe15019855ee8194f9c5a5fa8dcb1bad31635e6022f7ccefb23c899c6ad91fd657d9f4b28f38699f57ce2
7
+ data.tar.gz: a95c37634d85cd2650076fa7892100926c615d1647d471568fafc2f8ae12516fb1a5d4e0b3b9614021137c5350ac2885d0e67d6274e5580d92a812efd3e12131
data/README.md CHANGED
@@ -2,13 +2,16 @@
2
2
  [![Code Climate](https://codeclimate.com/github/phrase/phrase.png)](https://codeclimate.com/github/phrase/phrase)
3
3
  [![Build Status](https://secure.travis-ci.org/phrase/phrase.png)](http://travis-ci.org/phrase/phrase)
4
4
 
5
- PhraseApp lets you set up a professional translation process to boost the quality of your translations with the powerful In-Context Editor.
5
+ PhraseApp is a translation management software. Set up a professional translation process to boost the quality of your translations with our powerful In-Context Editor or simply share and edit locale files with your team.
6
6
 
7
- You can order professional translations from within PhraseApp, or just work with your own team. Our platform support various programming languages and frameworks. Such as [Ruby on Rails, Symfony, Zend Framework, iOS, Android and many more](https://phraseapp.com/docs/general/supported-platforms).
7
+ You can order professional translations through PhraseApp or work with your own translators. Our platform supports various programming languages and frameworks. Such as [Ruby on Rails, Symfony, Zend Framework, iOS, Android and many more](https://phraseapp.com/docs/general/supported-platforms).
8
8
 
9
- This client lets you integrate PhraseApp into your project and access your locale files through the PhraseApp [API](https://phraseapp.com/docs/api/overview).
9
+ This ruby gem allows you to integrate PhraseApp into your project and access your locale files through the PhraseApp [API](https://phraseapp.com/docs/api/overview).
10
10
 
11
- [Get your free PhraseApp trial](https://phraseapp.com/signup) and start right away.
11
+ [Try out PhraseApp for free](https://phraseapp.com/features) and start translating your app!
12
+
13
+ ### In-Context Editor ###
14
+ PhraseApp comes with an In-Context editor that allows you to translate directly on your website. See our documentation on how to set it up: [In-Context Editor Setup](http://docs.phraseapp.com/guides/in-context-editor/).
12
15
 
13
16
  ### Supported Formats ###
14
17
  You can manage your locale files with PhraseApp if you use one of the following formats:
@@ -24,6 +27,7 @@ You can manage your locale files with PhraseApp if you use one of the following
24
27
  * Chrome JSON i18n
25
28
  * Simple JSON
26
29
  * Nested JSON
30
+ * GoI18n JSON
27
31
  * i18n-node-2 JSON
28
32
  * .NET ResX
29
33
  * Windows Phone ResX
@@ -39,7 +43,7 @@ You can manage your locale files with PhraseApp if you use one of the following
39
43
  * CSV
40
44
  * PHP Array
41
45
  * Zendesk CSV
42
- * Laravel PHP
46
+ * Laravel/Flask PHP
43
47
  * Angular Translate
44
48
  * Mozilla Properties
45
49
  * Play Properties
@@ -284,15 +288,16 @@ For example you can specify a different file name for files you retrieve via the
284
288
  phrase init --secret=<YOUR_TOKEN> --locale-filename="<locale.name>.yml"
285
289
 
286
290
  ## Further Information
287
- * [Read the PhraseApp documentation](https://phraseapp.com/docs)
288
- * [Get your free PhraseApp trial](https://phraseapp.com/signup)
289
- * [Get in touch with the engineers](https://phraseapp.com/contact)
291
+ * [Read the PhraseApp Documentation](http://docs.phraseapp.com/)
292
+ * [Software Translation Managemeny with PhraseApp](https://phraseapp.com/features)
293
+ * [Get in touch with PhraseApp Team](https://phraseapp.com/contact)
290
294
 
291
295
  ## References
292
- * [PhraseApp In-Context Editor](http://demo.phraseapp.com)
293
- * [PhraseApp API](https://phraseapp.com/docs/api/overview)
296
+ * [PhraseApp API Documentation](http://docs.phraseapp.com/api/v1/)
297
+ * [Demo of the In-Context Editor](http://demo.phraseapp.com)
298
+ * [Localization Guides and Software Translation Best Practices](http://localize-software.phraseapp.com/)
294
299
 
295
300
  ## Partner-Integrations
296
- * [PhraseApp and Ruby Motion](https://github.com/phrase/motion-phrase)
297
- * [Heroku Add-on](https://addons.heroku.com/phrase)
298
- * [Cloudcontrol Add-on](https://phraseapp.com/docs/cloudcontrol/introduction)
301
+ * [Integrate PhraseApp with Ruby Motion](https://github.com/phrase/motion-phrase)
302
+ * [Integrate PhraseApp as a Heroku Add-on](https://addons.heroku.com/phrase)
303
+ * [Integrate PhraseApp as a Cloudcontrol Add-on](https://phraseapp.com/docs/cloudcontrol/introduction)
@@ -9,7 +9,7 @@ Phrase.configure do |config|
9
9
  # Configure an array of key names that should not be handled
10
10
  # with PhraseApp. This is useful when a key causes problems
11
11
  # (Such as keys that are used by Rails internally)
12
- config.ignored_keys = []
12
+ config.ignored_keys = ["number.*", "breadcrumb.*"]
13
13
 
14
14
  # PhraseApp uses decorators to generate a unique identification key
15
15
  # in context of your document. However, this might result in conflicts
@@ -1,7 +1,7 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  require 'ext/all'
4
- require 'colorize'
4
+ require 'rainbow'
5
5
 
6
6
  module Phrase
7
7
  autoload :Config, 'phrase/config'
@@ -6,8 +6,11 @@ require 'i18n'
6
6
  if defined? Rails
7
7
  class Phrase::Engine < Rails::Engine
8
8
  initializer 'phrase', :after => :disable_dependency_loading do |app|
9
- require 'phrase/adapters/i18n'
10
- require 'phrase/adapters/fast_gettext'
9
+ if Phrase.enabled?
10
+ require 'phrase/adapters/i18n'
11
+ require 'phrase/adapters/fast_gettext'
12
+ end
13
+
11
14
  ActionView::Base.send :include, Phrase::ViewHelpers
12
15
  end
13
16
  end
@@ -31,6 +31,7 @@ module Phrase
31
31
  autoload :AngularTranslate, 'phrase/formats/angular_translate'
32
32
  autoload :MozillaProperties, 'phrase/formats/mozilla_properties'
33
33
  autoload :PlayProperties, 'phrase/formats/play_properties'
34
+ autoload :GoI18n, 'phrase/formats/go_i18n'
34
35
 
35
36
  class Base
36
37
  def self.supports_extension?(extension)
@@ -105,6 +106,7 @@ module Phrase
105
106
  angular_translate: Phrase::Formats::AngularTranslate,
106
107
  mozilla_properties: Phrase::Formats::MozillaProperties,
107
108
  play_properties: Phrase::Formats::PlayProperties,
109
+ go_i18n: Phrase::Formats::GoI18n,
108
110
  }
109
111
 
110
112
  def self.config
@@ -0,0 +1,23 @@
1
+ # -*- encoding : utf-8 -*-
2
+
3
+ module Phrase
4
+ module Formats
5
+ class GoI18n < Phrase::Formats::Base
6
+ def self.filename_for_locale(locale)
7
+ "#{locale.name}.all.json"
8
+ end
9
+
10
+ def self.locale_aware?
11
+ false
12
+ end
13
+
14
+ def self.extensions
15
+ [:json]
16
+ end
17
+
18
+ def self.target_directory
19
+ 'locales/'
20
+ end
21
+ end
22
+ end
23
+ end
@@ -20,7 +20,7 @@ module Phrase::Tool::Commands
20
20
  end
21
21
 
22
22
  def self.print_error(msg)
23
- $stderr.puts msg.red
23
+ $stderr.puts Rainbow(msg).red
24
24
  end
25
25
 
26
26
  def self.print_server_error(msg, location=nil)
@@ -28,18 +28,18 @@ private
28
28
  def create_locale(name)
29
29
  begin
30
30
  api_client.create_locale(name)
31
- print_message "Created locale \"#{name}\"".green
31
+ print_message Rainbow("Created locale \"#{name}\"").green
32
32
  rescue Exception => e
33
- print_message "Notice: Locale \"#{name}\" could not be created (maybe it already exists)".light_red
33
+ print_message Rainbow("Notice: Locale \"#{name}\" could not be created (maybe it already exists)").bright.red
34
34
  end
35
35
  end
36
36
 
37
37
  def make_locale_default(name)
38
38
  begin
39
39
  api_client.make_locale_default(name)
40
- print_message "Locale \"#{name}\" is now the default locale".green
40
+ print_message Rainbow("Locale \"#{name}\" is now the default locale").green
41
41
  rescue Exception => e
42
- print_message "Notice: Locale \"#{name}\" could not be made the default locale".light_red
42
+ print_message Rainbow("Notice: Locale \"#{name}\" could not be made the default locale").bright.red
43
43
  print_server_error(e.message)
44
44
  end
45
45
  end
@@ -52,7 +52,7 @@ private
52
52
  File.open(target, "w") do |file|
53
53
  file.write(content)
54
54
  end
55
- print_message "Saved to #{clean_path target}".green
55
+ print_message Rainbow("Saved to #{clean_path target}").green
56
56
  rescue
57
57
  print_error("Cannot write file to target folder (#{path})")
58
58
  exit_command
@@ -27,7 +27,7 @@ class Phrase::Tool::Commands::Push < Phrase::Tool::Commands::Base
27
27
  files = choose_files_to_upload(@file_names, @recursive)
28
28
 
29
29
  if files.empty?
30
- print_message "Could not find any files to upload".light_red
30
+ print_message Rainbow("Could not find any files to upload").bright.red
31
31
  exit_command
32
32
  else
33
33
  interruptable_upload_files(files)
@@ -91,7 +91,7 @@ private
91
91
  locale = guess_locale_for_upload(file, @format)
92
92
  end
93
93
  api_client.upload(file, file_content(file), @tags, locale, @format, @update_translations, @skip_unverification, @skip_upload_tags, @convert_emoji)
94
- print_message "OK".green
94
+ print_message Rainbow("OK").green
95
95
  rescue Exception => e
96
96
  print_error "Failed"
97
97
  print_server_error(e.message)
@@ -1,6 +1,7 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  require 'json'
4
+ require 'erb'
4
5
 
5
6
  class Phrase::Tool::Config
6
7
  def load
@@ -8,7 +9,8 @@ class Phrase::Tool::Config
8
9
  if File.exist?(".phrase")
9
10
  begin
10
11
  contents = File.read(".phrase")
11
- @config = JSON.parse(contents)
12
+ parsed_content = ERB.new(contents).result
13
+ @config = JSON.parse(parsed_content)
12
14
  rescue JSON::ParserError => err
13
15
  $stderr.puts "Could not parse config file: #{err}"
14
16
  end
@@ -1,3 +1,3 @@
1
1
  module Phrase
2
- VERSION = "0.4.31"
2
+ VERSION = "0.4.32"
3
3
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.test_files = s.files.grep(%r{^(spec)/})
21
21
  s.executables = %w(phrase)
22
22
  s.require_paths = ["lib"]
23
- s.add_dependency('colorize')
23
+ s.add_dependency('rainbow')
24
24
  s.add_dependency('json')
25
25
  s.add_dependency('i18n')
26
26
  s.add_development_dependency('rake')
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phrase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.31
4
+ version: 0.4.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dynport GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-14 00:00:00.000000000 Z
11
+ date: 2015-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: colorize
14
+ name: rainbow
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -200,6 +200,7 @@ files:
200
200
  - lib/phrase/formats/custom.rb
201
201
  - lib/phrase/formats/gettext.rb
202
202
  - lib/phrase/formats/gettext_template.rb
203
+ - lib/phrase/formats/go_i18n.rb
203
204
  - lib/phrase/formats/ini.rb
204
205
  - lib/phrase/formats/json.rb
205
206
  - lib/phrase/formats/laravel.rb